summaryrefslogtreecommitdiff
path: root/dgedit/player.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-04-15 14:14:52 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-04-15 14:14:52 +0200
commit1cabb60b318fd831458f937b240b207c21a28ceb (patch)
treecf915e291f2301049ef912bf2ef0863a0cc4730c /dgedit/player.h
parent4aa5b796ba7186892d14e20226d6cef942d0c60d (diff)
Make CanvasToolListen work again with offsets using the mouse. Clean up Player code some more.
Diffstat (limited to 'dgedit/player.h')
-rw-r--r--dgedit/player.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/dgedit/player.h b/dgedit/player.h
index 0289cd5..1aa4426 100644
--- a/dgedit/player.h
+++ b/dgedit/player.h
@@ -37,7 +37,7 @@
class Player : public QThread {
Q_OBJECT
public:
- Player(Canvas *canvas); // TODO: Don't use canvas pointer here. Instead introduce setData slot or similar.
+ Player();
~Player();
void run();
@@ -50,6 +50,11 @@ public:
public slots:
/**
+ * Assign PCM data to the player.
+ */
+ void setPcmData(float *data, size_t num_samples);
+
+ /**
* Set gain scalar.
* This value is multiplied with each sample before it is played.
*/
@@ -62,6 +67,11 @@ public slots:
*/
void setGainDB(double gain_db);
+ /**
+ * Set player position as sample offset.
+ */
+ void setPosition(size_t position);
+
signals:
/**
* The absolute maximum of samples seen since last update.
@@ -83,7 +93,9 @@ private slots:
private:
ao_device *dev;
- Canvas *canvas;
+
+ float *pcm_data;
+ size_t pcm_size;
QTimer report_timer;