diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/audioinputengine.h | 3 | ||||
-rw-r--r-- | src/drumgizmo.cc | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/audioinputengine.h b/src/audioinputengine.h index bb7131c..72fa57d 100644 --- a/src/audioinputengine.h +++ b/src/audioinputengine.h @@ -48,4 +48,7 @@ public: virtual void pre() = 0; virtual void run(size_t pos, size_t len, std::vector<event_t>& events) = 0; virtual void post() = 0; + + //! Reimplement to receive sample rate changes. + virtual void setSampleRate(double sample_rate) {} }; diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc index e07b7a1..d6dc028 100644 --- a/src/drumgizmo.cc +++ b/src/drumgizmo.cc @@ -426,6 +426,10 @@ void DrumGizmo::setSamplerate(int samplerate) { DEBUG(dgeditor, "%s samplerate: %d\n", __PRETTY_FUNCTION__, samplerate); settings.samplerate.store(samplerate); + + // Notify input engine of the samplerate change. + ie.setSampleRate(samplerate); + #ifdef WITH_RESAMPLER resamplers.setup(kit.getSamplerate(), settings.samplerate.load()); |