summaryrefslogtreecommitdiff
path: root/dgedit/player.h
diff options
context:
space:
mode:
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;