summaryrefslogtreecommitdiff
path: root/src/drumgizmo.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/drumgizmo.cc')
-rw-r--r--src/drumgizmo.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc
index 1ccefc5..7d9d88c 100644
--- a/src/drumgizmo.cc
+++ b/src/drumgizmo.cc
@@ -50,7 +50,7 @@
DrumGizmo::DrumGizmo(Settings& settings,
AudioOutputEngine *o, AudioInputEngine *i)
- : loader(settings, kit, *i, resamplers)
+ : loader(settings, kit, *i, resamplers, rand)
, oe(o)
, ie(i)
, kit()
@@ -115,6 +115,11 @@ void DrumGizmo::setFreeWheel(bool freewheel)
}
}
+void DrumGizmo::setRandomSeed(unsigned int seed)
+{
+ rand.setSeed(seed);
+}
+
void DrumGizmo::run(int endpos)
{
size_t pos = 0;
@@ -143,6 +148,8 @@ void DrumGizmo::run(int endpos)
bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)
{
+ std::lock_guard<std::mutex> guard(resamplers.mutex);
+
setFrameSize(nsamples);
ie->pre();