From 3a5d360ecea7dd0897e31049eeeb850a312b50fb Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 30 Jan 2023 12:55:17 +0100 Subject: [PATCH] Fix bufsize/srate callbacks not triggered in some conditions Signed-off-by: falkTX --- distrho/src/DistrhoPluginJACK.cpp | 6 +++--- distrho/src/DistrhoPluginLV2.cpp | 6 +++--- distrho/src/DistrhoPluginVST2.cpp | 2 +- distrho/src/DistrhoUILV2.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/distrho/src/DistrhoPluginJACK.cpp b/distrho/src/DistrhoPluginJACK.cpp index f932f10db..2e8692d62 100644 --- a/distrho/src/DistrhoPluginJACK.cpp +++ b/distrho/src/DistrhoPluginJACK.cpp @@ -807,7 +807,7 @@ class PluginProcessTestingThread : public Thread protected: void run() override { - plugin.setBufferSize(256); + plugin.setBufferSize(256, true); plugin.activate(); float buffer[256]; @@ -862,8 +862,8 @@ bool runSelfTests() plugin.activate(); plugin.deactivate(); - plugin.setBufferSize(128); - plugin.setSampleRate(48000); + plugin.setBufferSize(128, true); + plugin.setSampleRate(48000, true); plugin.activate(); float buffer[128] = {}; diff --git a/distrho/src/DistrhoPluginLV2.cpp b/distrho/src/DistrhoPluginLV2.cpp index 401a02681..95bf18e1d 100644 --- a/distrho/src/DistrhoPluginLV2.cpp +++ b/distrho/src/DistrhoPluginLV2.cpp @@ -821,7 +821,7 @@ class PluginLv2 if (options[i].type == fURIDs.atomInt) { const int32_t bufferSize(*(const int32_t*)options[i].value); - fPlugin.setBufferSize(bufferSize); + fPlugin.setBufferSize(bufferSize, true); } else { @@ -833,7 +833,7 @@ class PluginLv2 if (options[i].type == fURIDs.atomInt) { const int32_t bufferSize(*(const int32_t*)options[i].value); - fPlugin.setBufferSize(bufferSize); + fPlugin.setBufferSize(bufferSize, true); } else { @@ -846,7 +846,7 @@ class PluginLv2 { const float sampleRate(*(const float*)options[i].value); fSampleRate = sampleRate; - fPlugin.setSampleRate(sampleRate); + fPlugin.setSampleRate(sampleRate, true); } else { diff --git a/distrho/src/DistrhoPluginVST2.cpp b/distrho/src/DistrhoPluginVST2.cpp index b57366b8e..73fda954c 100644 --- a/distrho/src/DistrhoPluginVST2.cpp +++ b/distrho/src/DistrhoPluginVST2.cpp @@ -548,7 +548,7 @@ class PluginVst : public ParameterAndNotesHelper #if DISTRHO_PLUGIN_HAS_UI if (fVstUI != nullptr) - fVstUI->setSampleRate(opt); + fVstUI->setSampleRate(opt, true); #endif break; diff --git a/distrho/src/DistrhoUILV2.cpp b/distrho/src/DistrhoUILV2.cpp index cdd065e79..ba9b17a74 100644 --- a/distrho/src/DistrhoUILV2.cpp +++ b/distrho/src/DistrhoUILV2.cpp @@ -259,7 +259,7 @@ class UiLv2 if (options[i].type == fURIDs.atomFloat) { const float sampleRate = *(const float*)options[i].value; - fUI.setSampleRate(sampleRate); + fUI.setSampleRate(sampleRate, true); continue; } else