summaryrefslogtreecommitdiff
path: root/src/drumgizmo.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-01-28 19:04:43 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2016-01-28 19:04:43 +0100
commit6f96e034906f06439b6e3e00517f03927264a8f4 (patch)
tree32b05585c366c32d8eb513eb5e581fc60c1d51d6 /src/drumgizmo.cc
parent180eacc2af8a69b8ee947750ae7708b78c499f7d (diff)
Don't remove the old run() method just yet.
Diffstat (limited to 'src/drumgizmo.cc')
-rw-r--r--src/drumgizmo.cc24
1 files changed, 24 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);