summaryrefslogtreecommitdiff
path: root/src/drumgizmo.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-05-14 20:27:56 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2016-05-14 20:27:56 +0200
commit36a62ae3403f7cfb02bd8dde43b6b2fa96fe867b (patch)
treec4ea5f2f97e94688bd0ac96dbb198a8f1eb67491 /src/drumgizmo.cc
parent7bbc7520ecb2ff4fc020189c1fdfebd7d3bb8e42 (diff)
Make all components use the same Random instance and add seed method on DrumGizmo class. Added dgreftest application for doing reference midifile rendering tests.
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();