From abb1407611612758b7e6a37f1588ddbd0467b054 Mon Sep 17 00:00:00 2001 From: bonsembiante Date: Fri, 6 Sep 2024 17:23:37 -0300 Subject: [PATCH 1/4] VST3: non optimal calls from host #9619 Use passed parameter value when changed externally --- libs/ardour/plugin.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc index 06e442d91a4..9208383071d 100644 --- a/libs/ardour/plugin.cc +++ b/libs/ardour/plugin.cc @@ -532,11 +532,11 @@ Plugin::set_parameter (uint32_t /* which */, float /* value */, sampleoffset_t / } void -Plugin::parameter_changed_externally (uint32_t which, float /* value */) +Plugin::parameter_changed_externally (uint32_t which, float value) { _parameter_changed_since_last_preset = true; _session.set_dirty (); - ParameterChangedExternally (which, get_parameter (which)); /* EMIT SIGNAL */ + ParameterChangedExternally (which, value); /* EMIT SIGNAL */ PresetDirty (); /* EMIT SIGNAL */ } From afbc775ffa654b5230d15de384fcbb96e3ff20be Mon Sep 17 00:00:00 2001 From: bonsembiante Date: Fri, 6 Sep 2024 17:24:31 -0300 Subject: [PATCH 2/4] VST3: non optimal calls from host #9619 Send parameter value on control Changed signal --- gtk2_ardour/processor_box.cc | 38 ++++++++++++------- gtk2_ardour/processor_box.h | 4 +- gtk2_ardour/virtual_keyboard_window.h | 2 +- libs/ardour/amp.cc | 2 +- libs/ardour/ardour/monitor_processor.h | 4 +- libs/ardour/ardour/proxy_controllable.h | 2 +- libs/ardour/audioregion.cc | 2 +- libs/ardour/automation_control.cc | 8 ++-- libs/ardour/control_group.cc | 4 +- libs/ardour/gain_control.cc | 2 +- libs/ardour/lv2_plugin.cc | 2 +- libs/ardour/midi_track.cc | 2 +- libs/ardour/monitor_processor.cc | 4 +- libs/ardour/mute_control.cc | 12 +++--- libs/ardour/plugin_insert.cc | 2 +- libs/ardour/region_fx_plugin.cc | 4 +- libs/ardour/session_state.cc | 2 +- libs/ardour/slavable_automation_control.cc | 4 +- libs/ardour/solo_control.cc | 10 ++--- libs/ardour/solo_isolate_control.cc | 4 +- libs/ardour/surround_send.cc | 2 +- libs/pbd/pbd/controllable.h | 2 +- .../surfaces/console1/c1_plugin_operations.cc | 4 +- 23 files changed, 66 insertions(+), 56 deletions(-) diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 133bc728839..119adf0b5d1 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -1019,7 +1019,7 @@ ProcessorEntry::Control::Control (ProcessorEntry& e,std::shared_ptrChanged.connect (_connections, invalidator (*this), boost::bind (&Control::control_changed, this), gui_context ()); + c->Changed.connect (_connections, invalidator (*this), boost::bind (&Control::control_changed, this, _3), gui_context ()); if (c->alist ()) { c->alist()->automation_state_changed.connect (_connections, invalidator (*this), boost::bind (&Control::control_automation_state_changed, this), gui_context()); control_automation_state_changed (); @@ -1056,15 +1056,16 @@ ProcessorEntry::Control::Control (ProcessorEntry& e,std::shared_ptrChanged.connect (_connections, invalidator (*this), boost::bind (&Control::control_changed, this), gui_context ()); + c->Changed.connect (_connections, invalidator (*this), boost::bind (&Control::control_changed, this, _3), gui_context ()); if (c->alist ()) { c->alist()->automation_state_changed.connect (_connections, invalidator (*this), boost::bind (&Control::control_automation_state_changed, this), gui_context()); control_automation_state_changed (); } } - control_changed (); - set_tooltip (); + double control_value = c->get_value(); + control_changed (control_value); + set_tooltip (control_value); /* We're providing our own PersistentTooltip */ set_no_tooltip_whatsoever (_slider); @@ -1075,14 +1076,15 @@ ProcessorEntry::Control::~Control () } void -ProcessorEntry::Control::set_tooltip () +ProcessorEntry::Control::set_tooltip (double control_value) { std::shared_ptr c = _control.lock (); if (!c) { return; } - std::string tt = _name + ": " + ARDOUR::value_as_string (c->desc(), c->get_value ()); + + std::string tt = _name + ": " + ARDOUR::value_as_string (c->desc(), control_value); string sm = Gtkmm2ext::markup_escape_text (tt); _slider_persistant_tooltip.set_tip (sm); ArdourWidgets::set_tooltip (_button, Gtkmm2ext::markup_escape_text (sm)); @@ -1101,8 +1103,10 @@ ProcessorEntry::Control::slider_adjusted () return; } - c->set_value ( c->interface_to_internal(_adjustment.get_value (), true) , Controllable::NoGroup); - set_tooltip (); + double control_value = c->interface_to_internal(_adjustment.get_value (), true); + + c->set_value (control_value , Controllable::NoGroup); + set_tooltip (control_value); } void @@ -1146,9 +1150,11 @@ ProcessorEntry::Control::button_clicked () bool const n = _button.get_active (); - c->set_value (n ? 0 : 1, Controllable::NoGroup); + double control_value = n ? 0 : 1; + + c->set_value (control_value, Controllable::NoGroup); _button.set_active (!n); - set_tooltip (); + set_tooltip (control_value); } void @@ -1175,23 +1181,27 @@ ProcessorEntry::Control::control_automation_state_changed () } void -ProcessorEntry::Control::control_changed () +ProcessorEntry::Control::control_changed (boost::optional control_value) { std::shared_ptr c = _control.lock (); if (!c) { return; } + if (control_value == boost::none) { + control_value = boost::optional (c->get_value()); + } + _ignore_ui_adjustment = true; if (c->toggled ()) { - _button.set_active (c->get_value() > 0.5); + _button.set_active (control_value.value() > 0.5); } else { // Note: the _slider watches the controllable by itself - const double nval = c->internal_to_interface (c->get_value (), true); + const double nval = c->internal_to_interface (control_value.value(), true); if (_adjustment.get_value() != nval) { _adjustment.set_value (nval); - set_tooltip (); + set_tooltip (nval); } } diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h index 68928492192..5009e0d749f 100644 --- a/gtk2_ardour/processor_box.h +++ b/gtk2_ardour/processor_box.h @@ -232,10 +232,10 @@ class ProcessorEntry : public Gtkmm2ext::DnDVBoxChild, public sigc::trackable void slider_adjusted (); void button_clicked (); void button_clicked_event (GdkEventButton *); - void control_changed (); + void control_changed (boost::optional control_value); void control_automation_state_changed (); std::string state_id () const; - void set_tooltip (); + void set_tooltip (double control_value); void start_touch (int); void end_touch (int); diff --git a/gtk2_ardour/virtual_keyboard_window.h b/gtk2_ardour/virtual_keyboard_window.h index c41fcd2565f..94fa2d6dca0 100644 --- a/gtk2_ardour/virtual_keyboard_window.h +++ b/gtk2_ardour/virtual_keyboard_window.h @@ -58,7 +58,7 @@ class VKBDControl : public PBD::Controllable { if (v != _value) { _value = std::max (_lower, std::min (_upper, v)); - Changed (true, gcd); /* EMIT SIGNAL */ + Changed (true, gcd, v); /* EMIT SIGNAL */ ValueChanged ((int)_value); /* EMIT SIGNAL */ } } diff --git a/libs/ardour/amp.cc b/libs/ardour/amp.cc index 6c4917537ec..52ab7e5d912 100644 --- a/libs/ardour/amp.cc +++ b/libs/ardour/amp.cc @@ -140,7 +140,7 @@ Amp::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t /*end_sample*/, /* see note in PluginInsert::connect_and_run () * set_value_unchecked() won't emit a signal since the value is effectively unchanged */ - _gain_control->Changed (false, PBD::Controllable::NoGroup); + _gain_control->Changed (false, PBD::Controllable::NoGroup, boost::none); } else if (target_gain != GAIN_COEFF_UNITY) { diff --git a/libs/ardour/ardour/monitor_processor.h b/libs/ardour/ardour/monitor_processor.h index e58e8f0a5da..897bcc658a8 100644 --- a/libs/ardour/ardour/monitor_processor.h +++ b/libs/ardour/ardour/monitor_processor.h @@ -61,7 +61,7 @@ class /*LIBARDOUR_API*/ MPControl : public PBD::Controllable { T newval = (T) v; if (newval != _value) { _value = std::max (_lower, std::min (_upper, newval)); - Changed (true, gcd); /* EMIT SIGNAL */ + Changed (true, gcd, v); /* EMIT SIGNAL */ } } @@ -84,7 +84,7 @@ class /*LIBARDOUR_API*/ MPControl : public PBD::Controllable { MPControl& operator=(const T& v) { if (v != _value) { _value = std::max (_lower, std::min (_upper, v)); - Changed (true, PBD::Controllable::UseGroup); /* EMIT SIGNAL */ + Changed (true, PBD::Controllable::UseGroup, boost::none); /* EMIT SIGNAL */ // FIXME(bonsembiante): I don't know if here I should use _value or boost:none } return *this; } diff --git a/libs/ardour/ardour/proxy_controllable.h b/libs/ardour/ardour/proxy_controllable.h index 6ed7ab91c72..e690b83d858 100644 --- a/libs/ardour/ardour/proxy_controllable.h +++ b/libs/ardour/ardour/proxy_controllable.h @@ -40,7 +40,7 @@ class LIBARDOUR_API ProxyControllable : public PBD::Controllable { , _getter (getter) {} - void set_value (double v, PBD::Controllable::GroupControlDisposition gcd) { if (_setter (v)) { Changed (true, gcd); /* EMIT SIGNAL */ } } + void set_value (double v, PBD::Controllable::GroupControlDisposition gcd) { if (_setter (v)) { Changed (true, gcd, v); /* EMIT SIGNAL */ } } double get_value () const { return _getter (); } std::string get_user_string () const { diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 90a68f0e0f0..03a12b15f4f 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -2473,7 +2473,7 @@ AudioRegion::_add_plugin (std::shared_ptr rfx, std::shared_ptr ac (std::dynamic_pointer_cast(ec)); std::weak_ptr wc (ac); - ec->Changed.connect_same_thread (*this, [this, wc] (bool, PBD::Controllable::GroupControlDisposition) + ec->Changed.connect_same_thread (*this, [this, wc] (bool, PBD::Controllable::GroupControlDisposition, boost::optional) { std::shared_ptr ac = wc.lock (); if (ac && ac->automation_playback ()) { diff --git a/libs/ardour/automation_control.cc b/libs/ardour/automation_control.cc index 3fc0492946e..6770ab0044e 100644 --- a/libs/ardour/automation_control.cc +++ b/libs/ardour/automation_control.cc @@ -227,7 +227,7 @@ AutomationControl::actually_set_value (double value, PBD::Controllable::GroupCon << " (was " << old_value << ") @ " << this << std::endl; #endif - Changed (true, gcd); + Changed (true, gcd, value); if (!al || !al->automation_playback ()) { _session.set_dirty (); } @@ -238,7 +238,7 @@ void AutomationControl::set_list (std::shared_ptr list) { Control::set_list (list); - Changed (true, Controllable::NoGroup); + Changed (true, Controllable::NoGroup, boost::none); } void @@ -264,7 +264,7 @@ AutomationControl::set_automation_state (AutoState as) Control::set_double (val, timepos_t (_session.current_start ().beats()), true); Control::set_double (val, timepos_t (_session.current_end ().beats()), true); } - Changed (true, Controllable::NoGroup); + Changed (true, Controllable::NoGroup, val); } if (!touching()) { AutomationWatch::instance().remove_automation_watch (std::dynamic_pointer_cast(shared_from_this())); @@ -278,7 +278,7 @@ AutomationControl::set_automation_state (AutoState as) } } else { AutomationWatch::instance().remove_automation_watch (std::dynamic_pointer_cast(shared_from_this())); - Changed (false, Controllable::NoGroup); + Changed (false, Controllable::NoGroup, val); } } } diff --git a/libs/ardour/control_group.cc b/libs/ardour/control_group.cc index b7fc39114a0..3b3c39c19b6 100644 --- a/libs/ardour/control_group.cc +++ b/libs/ardour/control_group.cc @@ -345,13 +345,13 @@ GainControlGroup::set_group_value (std::shared_ptr control, d if (factor > 0.0f) { factor = get_max_factor (factor); if (factor == 0.0f) { - control->Changed (true, Controllable::ForGroup); /* EMIT SIGNAL */ + control->Changed (true, Controllable::ForGroup, val); /* EMIT SIGNAL */ return; } } else { factor = get_min_factor (factor); if (factor == 0.0f) { - control->Changed (true, Controllable::ForGroup); /* EMIT SIGNAL */ + control->Changed (true, Controllable::ForGroup, val); /* EMIT SIGNAL */ return; } } diff --git a/libs/ardour/gain_control.cc b/libs/ardour/gain_control.cc index dc41145faac..a524c1e8e8a 100644 --- a/libs/ardour/gain_control.cc +++ b/libs/ardour/gain_control.cc @@ -123,7 +123,7 @@ GainControl::post_add_master (std::shared_ptr m) { if (m->get_value() == 0) { /* master is at -inf, which forces this ctrl to -inf on assignment */ - Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ + Changed (false, Controllable::NoGroup, boost::none); /* EMIT SIGNAL */ } } diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index ce753c9d7f4..577f981fb91 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -2809,7 +2809,7 @@ LV2Plugin::connect_and_run(BufferSet& bufs, AutomationCtrlPtr c = get_automation_control (_bpm_control_port_index); if (c && c->ac) { /* may be NULL for replicated instances - only one custom UI/ctrl */ - c->ac->Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ + c->ac->Changed (false, Controllable::NoGroup, boost::none); /* EMIT SIGNAL */ } } diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index 0756e66ae3d..15ca7af4ee5 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -386,7 +386,7 @@ MidiTrack::update_controls (BufferSet const& bufs) double old = control->get_double (); control->set_double (ev.value(), timepos_t::zero (false), false); if (old != ev.value()) { - control->Changed (false, Controllable::NoGroup); + control->Changed (false, Controllable::NoGroup, ev.value()); } } } diff --git a/libs/ardour/monitor_processor.cc b/libs/ardour/monitor_processor.cc index 6e3cc2aa589..bcaff04f85e 100644 --- a/libs/ardour/monitor_processor.cc +++ b/libs/ardour/monitor_processor.cc @@ -42,7 +42,7 @@ namespace ARDOUR { bool newval = fabs (v) >= 0.5; if (newval != _value) { _value = newval; - Changed (true, gcd); /* EMIT SIGNAL */ + Changed (true, gcd, v); /* EMIT SIGNAL */ } } } @@ -112,7 +112,7 @@ MonitorProcessor::allocate_channels (uint32_t size) /* update solo_cnt when Solo changes */ std::shared_ptr sc = _channels.back()->soloed_control; std::weak_ptr wc (sc); - sc->Changed.connect_same_thread (*this, [this, wc](bool, PBD::Controllable::GroupControlDisposition) + sc->Changed.connect_same_thread (*this, [this, wc](bool, PBD::Controllable::GroupControlDisposition, boost::optional) { std::shared_ptr ac = wc.lock (); if (ac && ac->get_value () > 0) { diff --git a/libs/ardour/mute_control.cc b/libs/ardour/mute_control.cc index 15dfdfc1b52..753613bd162 100644 --- a/libs/ardour/mute_control.cc +++ b/libs/ardour/mute_control.cc @@ -53,7 +53,7 @@ MuteControl::post_add_master (std::shared_ptr m) if (!muted_by_self() && !get_boolean_masters()) { _muteable.mute_master()->set_muted_by_masters (true); - Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ + Changed (false, Controllable::NoGroup, boost::none); /* EMIT SIGNAL */ } } } @@ -71,7 +71,7 @@ MuteControl::pre_remove_master (std::shared_ptr m) if (m->get_value() && get_boolean_masters() == 1) { _muteable.mute_master()->set_muted_by_masters (false); if (!muted_by_self()) { - Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ + Changed (false, Controllable::NoGroup, boost::none); /* EMIT SIGNAL */ } } } @@ -142,7 +142,7 @@ MuteControl::set_mute_points (MuteMaster::MutePoint mp) _muteable.mute_points_changed (); /* EMIT SIGNAL */ if (_muteable.mute_master()->muted_by_self()) { - Changed (true, Controllable::UseGroup); /* EMIT SIGNAL */ + Changed (true, Controllable::UseGroup, boost::none); /* EMIT SIGNAL */ } } @@ -202,16 +202,16 @@ MuteControl::automation_run (samplepos_t start, pframes_t len) */ if (muted_by_self () != mute) { set_value_unchecked (mute ? 1. : 0.); - Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ + Changed (false, Controllable::NoGroup, boost::none); /* EMIT SIGNAL */ } return; } if (mute && !muted()) { set_value_unchecked (1.0); // mute - Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ + Changed (false, Controllable::NoGroup, boost::none); /* EMIT SIGNAL */ } else if (!mute && muted()) { set_value_unchecked (0.0); // unmute - Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ + Changed (false, Controllable::NoGroup, boost::none); /* EMIT SIGNAL */ } } diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index e69f67ea064..b8a9525536c 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -2727,7 +2727,7 @@ PluginInsert::set_state(const XMLNode& node, int version) for (Controls::const_iterator li = controls().begin(); li != controls().end(); ++li) { std::shared_ptr c = std::dynamic_pointer_cast (li->second); if (c) { - c->Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ + c->Changed (false, Controllable::NoGroup, boost::none); /* EMIT SIGNAL */ } } diff --git a/libs/ardour/region_fx_plugin.cc b/libs/ardour/region_fx_plugin.cc index b0547e94d5d..6151b0da6e9 100644 --- a/libs/ardour/region_fx_plugin.cc +++ b/libs/ardour/region_fx_plugin.cc @@ -152,7 +152,7 @@ class TimedPluginControl : public PlugInsertBase::PluginControl */ actually_set_value (current, PBD::Controllable::NoGroup); } else { // generic UI, LV2 - Changed (true, Controllable::NoGroup); + Changed (true, Controllable::NoGroup, boost::none); } return true; } @@ -381,7 +381,7 @@ RegionFxPlugin::set_state (const XMLNode& node, int version) for (auto const& i : _controls) { std::shared_ptr ac = std::dynamic_pointer_cast (i.second); if (ac) { - ac->Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ + ac->Changed (false, Controllable::NoGroup, boost::none); /* EMIT SIGNAL */ } } diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index c09ff047f32..535662a2c97 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -4555,7 +4555,7 @@ Session::config_changed (std::string p, bool ours) } else if (p == "solo-control-is-listen-control") { solo_control_mode_changed (); } else if (p == "solo-mute-gain") { - _solo_cut_control->Changed (true, Controllable::NoGroup); + _solo_cut_control->Changed (true, Controllable::NoGroup, boost::none); } else if (p == "timecode-offset" || p == "timecode-offset-negative") { last_timecode_valid = false; } else if (p == "ltc-sink-port") { diff --git a/libs/ardour/slavable_automation_control.cc b/libs/ardour/slavable_automation_control.cc index c9b8714f6dd..31da64bb6c3 100644 --- a/libs/ardour/slavable_automation_control.cc +++ b/libs/ardour/slavable_automation_control.cc @@ -293,7 +293,7 @@ SlavableAutomationControl::master_changed (bool /*from_self*/, GroupControlDispo update_boolean_masters_records (m); if (send_signal) { - Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ + Changed (false, Controllable::NoGroup, boost::none); /* EMIT SIGNAL */ } } @@ -596,7 +596,7 @@ SlavableAutomationControl::boolean_automation_run (samplepos_t start, pframes_t change = boolean_automation_run_locked (start, len); } if (change) { - Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ + Changed (false, Controllable::NoGroup, boost::none); /* EMIT SIGNAL */ } return change; } diff --git a/libs/ardour/solo_control.cc b/libs/ardour/solo_control.cc index 78e3ffd5f26..a91d065e5f6 100644 --- a/libs/ardour/solo_control.cc +++ b/libs/ardour/solo_control.cc @@ -100,7 +100,7 @@ SoloControl::mod_solo_by_others_downstream (int32_t delta) set_mute_master_solo (); _transition_into_solo = 0; - Changed (false, Controllable::UseGroup); /* EMIT SIGNAL */ + Changed (false, Controllable::UseGroup, boost::none); /* EMIT SIGNAL */ } void @@ -155,7 +155,7 @@ SoloControl::mod_solo_by_others_upstream (int32_t delta) set_mute_master_solo (); _transition_into_solo = 0; - Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ + Changed (false, Controllable::NoGroup, boost::none); /* EMIT SIGNAL */ } void @@ -217,7 +217,7 @@ SoloControl::clear_all_solo_state () _transition_into_solo = 0; /* Session does not need to propagate */ if (change) { - Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ + Changed (false, Controllable::NoGroup, boost::none); /* EMIT SIGNAL */ } } @@ -293,7 +293,7 @@ SoloControl::master_changed (bool /*from self*/, GroupControlDisposition, std::w if (send_signal) { set_mute_master_solo (); - Changed (false, Controllable::UseGroup); + Changed (false, Controllable::UseGroup, boost::none); } } @@ -311,7 +311,7 @@ SoloControl::post_add_master (std::shared_ptr m) if (!self_soloed() && !get_boolean_masters()) { _transition_into_solo = 1; - Changed (false, Controllable::NoGroup); + Changed (false, Controllable::NoGroup, boost::none); } } } diff --git a/libs/ardour/solo_isolate_control.cc b/libs/ardour/solo_isolate_control.cc index 3e666c0f82c..d0acd925759 100644 --- a/libs/ardour/solo_isolate_control.cc +++ b/libs/ardour/solo_isolate_control.cc @@ -84,7 +84,7 @@ SoloIsolateControl::mod_solo_isolated_by_upstream (int32_t delta) } if (solo_isolated() != old) { - Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ + Changed (false, Controllable::NoGroup, boost::none); /* EMIT SIGNAL */ } } @@ -133,7 +133,7 @@ SoloIsolateControl::set_solo_isolated (bool yn, Controllable::GroupControlDispos /* XXX should we back-propagate as well? (April 2010: myself and chris goddard think not) */ - Changed (true, group_override); /* EMIT SIGNAL */ + Changed (true, group_override, boost::none); /* EMIT SIGNAL */ } diff --git a/libs/ardour/surround_send.cc b/libs/ardour/surround_send.cc index 675df6229f2..4097f2f6aaf 100644 --- a/libs/ardour/surround_send.cc +++ b/libs/ardour/surround_send.cc @@ -249,7 +249,7 @@ SurroundSend::add_pannable () _change_connections.drop_connections (); for (auto const& c: _controls) { std::shared_ptr ac = std::dynamic_pointer_cast(c.second); - ac->Changed.connect_same_thread (_change_connections, [this](bool, PBD::Controllable::GroupControlDisposition) { PanChanged (); /* EMIT SIGNAL*/}); + ac->Changed.connect_same_thread (_change_connections, [this](bool, PBD::Controllable::GroupControlDisposition, boost::optional) { PanChanged (); /* EMIT SIGNAL*/}); } } diff --git a/libs/pbd/pbd/controllable.h b/libs/pbd/pbd/controllable.h index fe95932c8bb..0ce94e17a02 100644 --- a/libs/pbd/pbd/controllable.h +++ b/libs/pbd/pbd/controllable.h @@ -147,7 +147,7 @@ class LIBPBD_API Controllable : public PBD::StatefulDestructible, public std::en static PBD::Signal1 > GUIFocusChanged; static PBD::Signal1 > ControlTouched; - PBD::Signal2 Changed; + PBD::Signal3> Changed; int set_state (const XMLNode&, int version); virtual XMLNode& get_state () const; diff --git a/libs/surfaces/console1/c1_plugin_operations.cc b/libs/surfaces/console1/c1_plugin_operations.cc index dfa89714641..3cca0f56faa 100644 --- a/libs/surfaces/console1/c1_plugin_operations.cc +++ b/libs/surfaces/console1/c1_plugin_operations.cc @@ -405,7 +405,7 @@ Console1::spill_plugins (const int32_t plugin_index) }); c->Changed.connect ( plugin_connections, MISSING_INVALIDATOR, boost::bind (plugin_mapping, _1, _2), this); - c->Changed (true, PBD::Controllable::GroupControlDisposition::UseGroup); + c->Changed (true, PBD::Controllable::GroupControlDisposition::UseGroup, boost::none); continue; } catch (ControlNotFoundException const&) { DEBUG_TRACE (DEBUG::Console1, string_compose ("No Encoder found %1\n", n_controls)); @@ -432,7 +432,7 @@ Console1::spill_plugins (const int32_t plugin_index) c->Changed.connect ( plugin_connections, MISSING_INVALIDATOR, boost::bind (plugin_mapping, _1, _2), this); - c->Changed (true, PBD::Controllable::GroupControlDisposition::UseGroup); + c->Changed (true, PBD::Controllable::GroupControlDisposition::UseGroup, boost::none); continue; } catch (ControlNotFoundException const&) { DEBUG_TRACE (DEBUG::Console1, string_compose ("No ControllerButton found %1\n", n_controls)); From 87904b2610dfa71a5b28bb3493075b3188ae4b88 Mon Sep 17 00:00:00 2001 From: bonsembiante Date: Fri, 6 Sep 2024 17:31:43 -0300 Subject: [PATCH 3/4] VST3: non optimal calls from host #9619 When performing an edit we don't need to add parameter to queue --- libs/ardour/vst3_plugin.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libs/ardour/vst3_plugin.cc b/libs/ardour/vst3_plugin.cc index 27c5f691a50..6a40fd80061 100644 --- a/libs/ardour/vst3_plugin.cc +++ b/libs/ardour/vst3_plugin.cc @@ -131,9 +131,6 @@ VST3Plugin::parameter_change_handler (VST3PI::ParameterChange t, uint32_t param, case VST3PI::EndGesture: Plugin::EndTouch (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); @@ -1676,7 +1673,7 @@ VST3PI::performEdit (Vst::ParamID id, Vst::ParamValue v) _update_ctrl[idx->second] = true; /* set_parameter_internal() is called via OnParameterChange */ value = _controller->normalizedParamToPlain (id, value); - OnParameterChange (ValueChange, idx->second, value); /* EMIT SIGNAL */ + OnParameterChange (ParamValueChanged, idx->second, value); /* EMIT SIGNAL */ } return kResultOk; } From 1ef925450dab4bbb2b1518e9c08103bd2940094c Mon Sep 17 00:00:00 2001 From: bonsembiante Date: Fri, 6 Sep 2024 17:53:46 -0300 Subject: [PATCH 4/4] VST3: non optimal calls from host #9619 We don't need to flag the control for update when we are performing an edit --- libs/ardour/vst3_plugin.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/ardour/vst3_plugin.cc b/libs/ardour/vst3_plugin.cc index 6a40fd80061..098deab8881 100644 --- a/libs/ardour/vst3_plugin.cc +++ b/libs/ardour/vst3_plugin.cc @@ -1670,7 +1670,6 @@ VST3PI::performEdit (Vst::ParamID id, Vst::ParamValue v) if (idx != _ctrl_id_index.end ()) { float value = v; _shadow_data[idx->second] = value; - _update_ctrl[idx->second] = true; /* set_parameter_internal() is called via OnParameterChange */ value = _controller->normalizedParamToPlain (id, value); OnParameterChange (ParamValueChanged, idx->second, value); /* EMIT SIGNAL */