summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/drumgizmo.cc24
-rw-r--r--src/drumgizmo.h1
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();