diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-11-03 18:55:03 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-11-03 18:55:03 +0100 |
commit | 618ccf981bf16e848912cf8c4d72f58c7134642a (patch) | |
tree | 540fad9cbaa9dbf8d0f1b91adddd5300319cacd7 /src/drumgizmo.cc | |
parent | 3176ea311ab6ad13546f8410f4f2ebc9ef229df3 (diff) |
Use Drumgizmo::setSamplerate to control resampler target samplerate.
Diffstat (limited to 'src/drumgizmo.cc')
-rw-r--r-- | src/drumgizmo.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc index 9252afc..60ced09 100644 --- a/src/drumgizmo.cc +++ b/src/drumgizmo.cc @@ -74,14 +74,11 @@ bool DrumGizmo::loadkit(std::string file) loader.loadKit(&kit); #ifdef WITH_RESAMPLER - unsigned int output_fs = kit.samplerate(); - if(oe->samplerate() != UNKNOWN_SAMPLERATE) output_fs = oe->samplerate(); for(int i = 0; i < MAX_NUM_CHANNELS; i++) { - resampler[i].setup(kit.samplerate(), output_fs); + resampler[i].setup(kit.samplerate(), Conf::samplerate); } #endif/*WITH_RESAMPLER*/ - DEBUG(loadkit, "loadkit: Success\n"); return true; @@ -443,6 +440,12 @@ int DrumGizmo::samplerate() void DrumGizmo::setSamplerate(int samplerate) { Conf::samplerate = samplerate; +#ifdef WITH_RESAMPLER + for(int i = 0; i < MAX_NUM_CHANNELS; i++) { + resampler[i].setup(kit.samplerate(), Conf::samplerate); + } +#endif/*WITH_RESAMPLER*/ + } std::string float2str(float a) |