Skip to content

Commit

Permalink
Fix bufsize/srate callbacks not triggered in some conditions
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Jan 30, 2023
1 parent b4b0c7c commit 3a5d360
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions distrho/src/DistrhoPluginJACK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ class PluginProcessTestingThread : public Thread
protected:
void run() override
{
plugin.setBufferSize(256);
plugin.setBufferSize(256, true);
plugin.activate();

float buffer[256];
Expand Down Expand Up @@ -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] = {};
Expand Down
6 changes: 3 additions & 3 deletions distrho/src/DistrhoPluginLV2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
{
Expand All @@ -846,7 +846,7 @@ class PluginLv2
{
const float sampleRate(*(const float*)options[i].value);
fSampleRate = sampleRate;
fPlugin.setSampleRate(sampleRate);
fPlugin.setSampleRate(sampleRate, true);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion distrho/src/DistrhoPluginVST2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion distrho/src/DistrhoUILV2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a5d360

Please sign in to comment.