summaryrefslogtreecommitdiff
path: root/dgedit/canvastoollisten.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-04-02 21:12:41 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-04-02 21:12:41 +0200
commit644c3996fe91f35bcdc84e0c3bb4f906be740bae (patch)
treeff707039cd582a2855cf70579264671c8590c937 /dgedit/canvastoollisten.cc
parent6b0f9242beca3df3c5e98a215b9fe0059436770a (diff)
Warning: Ugly hack ahead... Initial attempt at a 'play sample selections ordered by sorting' feature.
Diffstat (limited to 'dgedit/canvastoollisten.cc')
-rw-r--r--dgedit/canvastoollisten.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/dgedit/canvastoollisten.cc b/dgedit/canvastoollisten.cc
index f638f93..35b619b 100644
--- a/dgedit/canvastoollisten.cc
+++ b/dgedit/canvastoollisten.cc
@@ -26,6 +26,8 @@
*/
#include "canvastoollisten.h"
+#include <QApplication>
+
#define BUFSZ 1024 * 2
Player::Player(Canvas *c)
@@ -140,3 +142,19 @@ void CanvasToolListen::setVolume(int v)
{
player.setVolume(v);
}
+
+#include <unistd.h>
+void CanvasToolListen::playRange(unsigned int from, unsigned int to)
+{
+ player.pos = from;
+ player.playing = true;
+ canvas->update();
+ timer.start(50);
+ printf("start\n");
+ while(player.pos < to) {
+ qApp->processEvents();
+ usleep(10000);
+ }
+ player.playing = false;
+ printf("stop\n");
+}