13
0

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.
This commit is contained in:
Robin Gareus 2023-02-11 13:36:23 +01:00
parent 83d6b87249
commit 21d86b264a
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 6 additions and 1 deletions

View File

@ -173,7 +173,9 @@ public:
EndGesture,
ValueChange,
InternalChange,
PresetChange };
PresetChange,
ParamValueChanged
};
PBD::Signal3<void, ParameterChange, uint32_t, float> OnParameterChange;

View File

@ -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 */
}
}
}