summaryrefslogtreecommitdiff
path: root/src/drumgizmo.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2015-07-27 19:36:28 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2016-01-20 13:31:09 +0100
commit41a6b0ebb6f71032c5a8e69e6aa8c813657224d7 (patch)
tree92c1fcd62d3b910fced00b51dd79ce302e1c33d7 /src/drumgizmo.cc
parent116b8dbef22bf3245bcf6c8195bf8bb8c0ea91d3 (diff)
Add free-wheel mode to LV2 and DrumGizmo class.
Diffstat (limited to 'src/drumgizmo.cc')
-rw-r--r--src/drumgizmo.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc
index 528b542..5348324 100644
--- a/src/drumgizmo.cc
+++ b/src/drumgizmo.cc
@@ -51,6 +51,7 @@ DrumGizmo::DrumGizmo(AudioOutputEngine *o, AudioInputEngine *i)
, oe(o)
, ie(i)
, framesize(0)
+ , freewheel(false)
{
is_stopping = false;
cacheManager.init(1000, true); // start thread
@@ -189,6 +190,16 @@ void DrumGizmo::setFrameSize(size_t framesize)
}
}
+void DrumGizmo::setFreeWheel(bool freewheel)
+{
+ // Freewheel = true means that we are bouncing and therefore running faster
+ // than realtime.
+ if(freewheel != this->freewheel) {
+ this->freewheel = freewheel;
+ cacheManager.setAsyncMode(!freewheel);
+ }
+}
+
bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)
{
setFrameSize(nsamples);