diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-01-28 19:04:43 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-01-28 19:04:43 +0100 |
commit | 6f96e034906f06439b6e3e00517f03927264a8f4 (patch) | |
tree | 32b05585c366c32d8eb513eb5e581fc60c1d51d6 | |
parent | 180eacc2af8a69b8ee947750ae7708b78c499f7d (diff) |
Don't remove the old run() method just yet.
-rw-r--r-- | src/drumgizmo.cc | 24 | ||||
-rw-r--r-- | src/drumgizmo.h | 1 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc index 26b8e65..0edc599 100644 --- a/src/drumgizmo.cc +++ b/src/drumgizmo.cc @@ -217,6 +217,30 @@ void DrumGizmo::setFreeWheel(bool freewheel) } } +void DrumGizmo::run(int endpos) +{ + size_t pos = 0; + size_t nsamples = 1024;//oe->getBufferSize(); + sample_t *samples = (sample_t *)malloc(nsamples * sizeof(sample_t)); + + ie->start(); + oe->start(); + + while(run(pos, samples, nsamples) == true) + { + pos += nsamples; + if((endpos != -1) && (pos >= (size_t)endpos)) + { + break; + } + } + + ie->stop(); + oe->stop(); + + free(samples); +} + bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples) { setFrameSize(nsamples); diff --git a/src/drumgizmo.h b/src/drumgizmo.h index 98cd287..2778092 100644 --- a/src/drumgizmo.h +++ b/src/drumgizmo.h @@ -64,6 +64,7 @@ public: bool init(); + void run(int endpos); bool run(size_t pos, sample_t *samples, size_t nsamples); void stop(); |