diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-05-14 20:27:56 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-05-14 20:27:56 +0200 |
commit | 36a62ae3403f7cfb02bd8dde43b6b2fa96fe867b (patch) | |
tree | c4ea5f2f97e94688bd0ac96dbb198a8f1eb67491 /src/drumgizmo.cc | |
parent | 7bbc7520ecb2ff4fc020189c1fdfebd7d3bb8e42 (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.cc | 9 |
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(); |