From 2b27f5b36e93f7da9cbff93b2849160e5df11fbc Mon Sep 17 00:00:00 2001 From: hogliux Date: Mon, 11 May 2015 12:21:15 +0100 Subject: [PATCH] Fix automation issue when automation points are edited before opening editor. See: http://www.juce.com/forum/topic/automation-issue-cubase/nuendo#new --- .../VST3/juce_VST3_Wrapper.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 e4f433f55e..df852481b7 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp @@ -231,6 +231,18 @@ public: }; //============================================================================== + tresult PLUGIN_API setComponentState (IBStream*) override + { + // Cubase and Nuendo need to inform the host of the current parameter values + if (AudioProcessor* const pluginInstance = getPluginInstance()) + { + for (int i = 0; i < pluginInstance->getNumParameters(); ++i) + setParamNormalized ((Vst::ParamID) i, (double) pluginInstance->getParameter (i)); + } + + return kResultFalse; + } + void setAudioProcessor (JuceAudioProcessor* audioProc) { if (audioProcessor != audioProc)