From c14eb040b979926d4e880174944aa407cf8bc994 Mon Sep 17 00:00:00 2001 From: hogliux Date: Tue, 20 Sep 2016 14:57:38 +0100 Subject: [PATCH] Fixed automation bug when switching between presets in VST and VST3 --- examples/audio plugin demo/Source/PluginProcessor.cpp | 2 +- modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/audio plugin demo/Source/PluginProcessor.cpp b/examples/audio plugin demo/Source/PluginProcessor.cpp index 426bc88d9e..fd3c82fd81 100644 --- a/examples/audio plugin demo/Source/PluginProcessor.cpp +++ b/examples/audio plugin demo/Source/PluginProcessor.cpp @@ -370,7 +370,7 @@ void JuceDemoPluginAudioProcessor::setStateInformation (const void* data, int si // Now reload our parameters.. for (int i = 0; i < getNumParameters(); ++i) if (AudioProcessorParameterWithID* p = dynamic_cast (getParameters().getUnchecked(i))) - p->setValueNotifyingHost ((float) xmlState->getDoubleAttribute (p->paramID, p->getValue())); + p->setValue ((float) xmlState->getDoubleAttribute (p->paramID, p->getValue())); } } } diff --git a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp index e0ce74fec7..993a52e0f8 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp @@ -444,6 +444,9 @@ public: setParamNormalized (paramPreset, static_cast (pluginInstance->getCurrentProgram()) / static_cast (numPrograms - 1)); } + if (Vst::IComponentHandler* handler = getComponentHandler()) + handler->restartComponent (Vst::kParamValuesChanged); + return Vst::EditController::setComponentState (stream); }