From 00b5b61a433b9439a448b2c9bc5ec546d8493fb8 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 30 Sep 2020 17:09:32 +0200 Subject: [PATCH] VST3: implement some restart component flags Re-order handling of the flags, do not return early, and log warnings for unhandled flags. --- libs/ardour/vst3_plugin.cc | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/libs/ardour/vst3_plugin.cc b/libs/ardour/vst3_plugin.cc index 2067a50abe..6fbeb340ae 100644 --- a/libs/ardour/vst3_plugin.cc +++ b/libs/ardour/vst3_plugin.cc @@ -1261,10 +1261,16 @@ VST3PI::restartComponent (int32 flags) printf ("VST3PI::restartComponent %x\n", flags); #endif if (flags & Vst::kReloadComponent) { - return kNotImplemented; - } - if (flags & Vst::kIoChanged) { - return kNotImplemented; + /* according to the spec, "The host has to unload completely + * the plug-in (controller/processor) and reload it." + * + * However other implementations, in particular JUCE, only + * re-activates the plugin. So let's follow their lead for + * the time being. + */ + warning << "VST3: Vst::kReloadComponent (ignored)" << endmsg; + deactivate (); + activate (); } if (flags & Vst::kParamValuesChanged) { update_shadow_data (); @@ -1275,6 +1281,14 @@ VST3PI::restartComponent (int32 flags) activate (); _plugin_latency.reset (); } + if (flags & Vst::kIoChanged) { + warning << "VST3: Vst::kIoChanged (not implemented)" << endmsg; +#if 0 + update_processor (); + // TODO getBusArrangement(); enable_io() +#endif + return kNotImplemented; + } return kResultOk; }