summaryrefslogtreecommitdiff
path: root/dgedit/canvastoollisten.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-04-15 12:18:12 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-04-15 12:18:12 +0200
commit12b62ca84abab622889363b9b9f3215d52eb5167 (patch)
tree3b649cec0efd1566355cf9628d3ef13b19bbc675 /dgedit/canvastoollisten.h
parent0fcacc1c3329e905228ceb80903f69561a7db732 (diff)
Player interface changes. Player moved to MainWindow for easier component sharing.
Diffstat (limited to 'dgedit/canvastoollisten.h')
-rw-r--r--dgedit/canvastoollisten.h33
1 files changed, 7 insertions, 26 deletions
diff --git a/dgedit/canvastoollisten.h b/dgedit/canvastoollisten.h
index dccc3f9..810e7cb 100644
--- a/dgedit/canvastoollisten.h
+++ b/dgedit/canvastoollisten.h
@@ -29,35 +29,15 @@
#include "canvastool.h"
-#include <QThread>
-#include <QTimer>
-
-#include <ao/ao.h>
+//#include <QTimer>
#include "canvas.h"
-
-class Player : public QThread {
-public:
- Player(Canvas *canvas);
- ~Player();
-
- void run();
-
- volatile bool playing;
- volatile size_t pos;
-
- void setVolume(double v);
-
-private:
- ao_device *dev;
- Canvas *canvas;
- double volume;
-};
+#include "player.h"
class CanvasToolListen : public CanvasTool {
Q_OBJECT
public:
- CanvasToolListen(Canvas *canvas);
+ CanvasToolListen(Canvas *canvas, Player &player);
QString name() { return "Listen"; }
bool mousePressEvent(QMouseEvent *event);
@@ -67,15 +47,16 @@ public:
void playRange(unsigned int from, unsigned int to);
public slots:
- void update();
+ void update(size_t position);
void setVolume(int v);
private:
Canvas *canvas;
- Player player;
- QTimer timer;
+ Player &player;
+
size_t lastpos;
+ size_t pos;
};
#endif/*__DRUMGIZMO_CANVASTOOLLISTEN_H__*/