From 21d86b264a2a6fc4cb3aaef64790fad7851955fa Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 11 Feb 2023 13:36:23 +0100 Subject: [PATCH] VST3: synchronize AC when plugin's internal state changes e.g. loading a u-he zebra preset using the plugin's GUI internally changes the controller state without using the `performEdit` API, but instead calls `restartComponent` wit the `kParamValuesChanged` flag to perform a a batch update. This now also updates Ardour's AutomationControl to match. --- libs/ardour/ardour/vst3_plugin.h | 4 +++- libs/ardour/vst3_plugin.cc | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/ardour/ardour/vst3_plugin.h b/libs/ardour/ardour/vst3_plugin.h index 6482ff04e3..fcfa602d4a 100644 --- a/libs/ardour/ardour/vst3_plugin.h +++ b/libs/ardour/ardour/vst3_plugin.h @@ -173,7 +173,9 @@ public: EndGesture, ValueChange, InternalChange, - PresetChange }; + PresetChange, + ParamValueChanged + }; PBD::Signal3 OnParameterChange; diff --git a/libs/ardour/vst3_plugin.cc b/libs/ardour/vst3_plugin.cc index 04027db66f..7226d27166 100644 --- a/libs/ardour/vst3_plugin.cc +++ b/libs/ardour/vst3_plugin.cc @@ -124,6 +124,8 @@ VST3Plugin::parameter_change_handler (VST3PI::ParameterChange t, uint32_t param, break; case VST3PI::ValueChange: _parameter_queue.write_one (PV (param, value)); + /* fallthrough */ + case VST3PI::ParamValueChanged: /* emit ParameterChangedExternally, mark preset dirty */ Plugin::parameter_changed_externally (param, value); break; @@ -1943,6 +1945,7 @@ VST3PI::update_shadow_data () _input_param_changes.addParameterData (i->second, index)->addPoint (0, v, index); #endif _shadow_data[i->first] = v; + OnParameterChange (ParamValueChanged, i->first, v); /* EMIT SIGNAL */ } } }