From 2ea211420cdca010aabf91d0fd23e46418210769 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 3 Jul 2013 05:19:54 +0100 Subject: [PATCH] Send callbacks to native plugins --- source/backend/plugin/NativePlugin.cpp | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/source/backend/plugin/NativePlugin.cpp b/source/backend/plugin/NativePlugin.cpp index 591a25a1a..06c54601b 100644 --- a/source/backend/plugin/NativePlugin.cpp +++ b/source/backend/plugin/NativePlugin.cpp @@ -1880,6 +1880,39 @@ public: delete[] fAudioOutBuffers[i]; fAudioOutBuffers[i] = new float[newBufferSize]; } + + if (fDescriptor != nullptr && fDescriptor->dispatcher != nullptr) + { + fDescriptor->dispatcher(fHandle, PLUGIN_OPCODE_BUFFER_SIZE_CHANGED, 0, 0, nullptr); + + if (fHandle2 != nullptr) + fDescriptor->dispatcher(fHandle2, PLUGIN_OPCODE_BUFFER_SIZE_CHANGED, 0, 0, nullptr); + } + } + + void sampleRateChanged(const double newSampleRate) override + { + CARLA_ASSERT_INT(newSampleRate > 0.0, newSampleRate); + carla_debug("NativePlugin::sampleRateChanged(%g)", newSampleRate); + + if (fDescriptor != nullptr && fDescriptor->dispatcher != nullptr) + { + fDescriptor->dispatcher(fHandle, PLUGIN_OPCODE_SAMPLE_RATE_CHANGED, 0, 0, nullptr); + + if (fHandle2 != nullptr) + fDescriptor->dispatcher(fHandle2, PLUGIN_OPCODE_SAMPLE_RATE_CHANGED, 0, 0, nullptr); + } + } + + void offlineModeChanged(const bool) override + { + if (fDescriptor != nullptr && fDescriptor->dispatcher != nullptr) + { + fDescriptor->dispatcher(fHandle, PLUGIN_OPCODE_OFFLINE_CHANGED, 0, 0, nullptr); + + if (fHandle2 != nullptr) + fDescriptor->dispatcher(fHandle2, PLUGIN_OPCODE_OFFLINE_CHANGED, 0, 0, nullptr); + } } // -------------------------------------------------------------------