diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/drumgizmo.cc | 11 | ||||
-rw-r--r-- | src/drumgizmo.h | 2 |
2 files changed, 7 insertions, 6 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(); diff --git a/src/drumgizmo.h b/src/drumgizmo.h index 1bdb5b5..2f85d51 100644 --- a/src/drumgizmo.h +++ b/src/drumgizmo.h @@ -50,7 +50,7 @@ public: bool init(bool preload = true); void run(); - void run(size_t pos, sample_t *samples, size_t nsamples); + bool run(size_t pos, sample_t *samples, size_t nsamples); void stop(); void getSamples(int ch, int pos, sample_t *s, size_t sz); |