summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-11-03 18:55:03 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2014-11-03 18:55:03 +0100
commit618ccf981bf16e848912cf8c4d72f58c7134642a (patch)
tree540fad9cbaa9dbf8d0f1b91adddd5300319cacd7 /src
parent3176ea311ab6ad13546f8410f4f2ebc9ef229df3 (diff)
Use Drumgizmo::setSamplerate to control resampler target samplerate.
Diffstat (limited to 'src')
-rw-r--r--src/audiooutputengine.h5
-rw-r--r--src/drumgizmo.cc11
2 files changed, 7 insertions, 9 deletions
diff --git a/src/audiooutputengine.h b/src/audiooutputengine.h
index 25b6ea0..eafafe9 100644
--- a/src/audiooutputengine.h
+++ b/src/audiooutputengine.h
@@ -57,11 +57,6 @@ public:
* Overload this method to force engine to use different buffer size.
*/
virtual size_t getBufferSize() { return 1024; }
-
- /**
- * Overload this method to report output engine samplerate.
- */
- virtual size_t samplerate() { return UNKNOWN_SAMPLERATE; }
};
#endif/*__DRUMGIZMO_AUDIOOUTPUTENGINE_H__*/
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)