diff --git a/libs/ardour/ardour/vst3_plugin.h b/libs/ardour/ardour/vst3_plugin.h index c54db2e853..584cd23ae4 100644 --- a/libs/ardour/ardour/vst3_plugin.h +++ b/libs/ardour/ardour/vst3_plugin.h @@ -205,10 +205,10 @@ private: bool midi_controller (int32_t, int16_t, Vst::CtrlNumber, Vst::ParamID &id); bool live_midi_cc (int32_t, int16_t, Vst::CtrlNumber); - void setup_info_listener (); + bool setup_info_listener (); void stripable_property_changed (PBD::PropertyChange const&); - void setup_psl_info_handler (); + bool setup_psl_info_handler (); void psl_subscribe_to (boost::shared_ptr, FIDString); void psl_stripable_property_changed (PBD::PropertyChange const&); diff --git a/libs/ardour/vst3_plugin.cc b/libs/ardour/vst3_plugin.cc index 23d439793d..c13b86966c 100644 --- a/libs/ardour/vst3_plugin.cc +++ b/libs/ardour/vst3_plugin.cc @@ -1498,8 +1498,10 @@ VST3PI::set_owner (SessionObject* o) _ac_subscriptions.clear(); return; } - setup_info_listener (); - setup_psl_info_handler (); + + if (!setup_psl_info_handler ()) { + setup_info_listener (); + } } int32 @@ -2346,12 +2348,12 @@ VST3PI::stripable_property_changed (PBD::PropertyChange const&) il->setChannelContextInfos (al); } -void +bool VST3PI::setup_info_listener () { FUnknownPtr il (_controller); if (!il) { - return; + return false; } DEBUG_TRACE (DEBUG::VST3Config, "VST3PI::setup_info_listener\n"); Stripable* s = dynamic_cast (_owner); @@ -2361,6 +2363,7 @@ VST3PI::setup_info_listener () /* send initial change */ stripable_property_changed (PropertyChange ()); + return true; } /* **************************************************************************** @@ -2741,28 +2744,29 @@ VST3PI::psl_stripable_property_changed (PBD::PropertyChange const& what_changed) } } -void +bool VST3PI::setup_psl_info_handler () { /* initial update */ FUnknownPtr nfo (_controller); FUnknownPtr nfo2 (_controller); + DEBUG_TRACE (DEBUG::VST3Config, string_compose ("VST3PI::setup_psl_info_handler: (%1) (%2)\n", nfo != 0, nfo2 !=0)); + if (nfo2) { nfo2->notifyContextInfoChange (""); } else if (nfo) { nfo->notifyContextInfoChange (); } - DEBUG_TRACE (DEBUG::VST3Config, string_compose ("VST3PI::setup_psl_info_handler: (%1) (%2)\n", nfo != 0, nfo2 !=0)); - if (!nfo && !nfo2) { - return; + return false; } Stripable* s = dynamic_cast (_owner); s->PropertyChanged.connect_same_thread (_strip_connections, boost::bind (&VST3PI::psl_stripable_property_changed, this, _1)); s->presentation_info().PropertyChanged.connect_same_thread (_strip_connections, boost::bind (&VST3PI::psl_stripable_property_changed, this, _1)); + return true; } /* ****************************************************************************