summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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)