diff options
Diffstat (limited to 'dgedit/canvastoollisten.cc')
-rw-r--r-- | dgedit/canvastoollisten.cc | 18 |
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"); +} |