summaryrefslogtreecommitdiff
path: root/src/drumgizmo.cc
diff options
context:
space:
mode:
authordeva <deva>2011-07-17 12:27:10 +0000
committerdeva <deva>2011-07-17 12:27:10 +0000
commitdc26c53fc4d1b92cc6fdda5e73825c6e093c73a9 (patch)
tree32436d0a721b66482b29bb9fec0b0bb857ebcc42 /src/drumgizmo.cc
parent7d35e31ea61cb7fa088aa33a90f3207919fcd0b1 (diff)
Fix bug, where pos was not increased as it should on each run.
Diffstat (limited to 'src/drumgizmo.cc')
-rw-r--r--src/drumgizmo.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc
index de8e610..b0d59ef 100644
--- a/src/drumgizmo.cc
+++ b/src/drumgizmo.cc
@@ -88,7 +88,7 @@ bool DrumGizmo::init(bool preload)
return true;
}
-void DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)
+bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)
{
ie->pre();
oe->pre(nsamples);
@@ -153,8 +153,7 @@ void DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)
}
if(evs[e].type == TYPE_STOP) {
- printf("Stoooooop!\n");
- // running = false;
+ return false;
}
}
@@ -176,6 +175,8 @@ void DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)
oe->post(nsamples);
pos += nsamples;
+
+ return true;
}
void DrumGizmo::run()
@@ -189,8 +190,8 @@ void DrumGizmo::run()
bool running = true;
- while(running) {
- run(pos, samples, nsamples);
+ while(run(pos, samples, nsamples) == true) {
+ pos += nsamples;
}
ie->stop();