From: Len Ovens Date: Mon, 28 Nov 2016 02:32:50 +0000 (-0800) Subject: OSC: Squelch select feedback when no feedback is configured. X-Git-Tag: 5.5~29 X-Git-Url: https://main.carlh.net/gitweb/?p=ardour.git;a=commitdiff_plain;h=8ddeca133bb6decbb1f2f46ec7b50c1bb622f731 OSC: Squelch select feedback when no feedback is configured. --- diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 63d18dd388..a9168c29e0 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -2277,21 +2277,25 @@ OSC::_strip_select (boost::shared_ptr s, lo_address addr) delete sur->sel_obs; sur->sel_obs = 0; } - if (s) { + bool feedback_on = sur->feedback.to_ulong(); + if (s && feedback_on) { OSCSelectObserver* sel_fb = new OSCSelectObserver (s, addr, sur->gainmode, sur->feedback); s->DropReferences.connect (*this, MISSING_INVALIDATOR, boost::bind (&OSC::recalcbanks, this), this); sur->sel_obs = sel_fb; } else if (sur->expand_enable) { sur->expand = 0; sur->expand_enable = false; - if (_select) { + if (_select && feedback_on) { OSCSelectObserver* sel_fb = new OSCSelectObserver (_select, addr, sur->gainmode, sur->feedback); _select->DropReferences.connect (*this, MISSING_INVALIDATOR, boost::bind (&OSC::recalcbanks, this), this); sur->sel_obs = sel_fb; } - } else { + } else if (feedback_on) { route_send_fail ("select", sur->expand, 0 , addr); } + if (!feedback_on) { + return 0; + } //update buttons on surface int b_s = sur->bank_size; if (!b_s) { // bank size 0 means we need to know how many strips there are. @@ -2346,7 +2350,6 @@ OSC::strip_gui_select (int ssid, int yn, lo_message msg) if (!yn) return 0; if (!session) { - route_send_fail ("select", ssid, 0, get_address (msg)); return -1; } OSCSurface *sur = get_surface(get_address (msg)); @@ -2355,7 +2358,9 @@ OSC::strip_gui_select (int ssid, int yn, lo_message msg) if (s) { SetStripableSelection (s); } else { - route_send_fail ("select", ssid, 0, get_address (msg)); + if ((int) (sur->feedback.to_ulong())) { + route_send_fail ("select", ssid, 0, get_address (msg)); + } } return 0; diff --git a/libs/surfaces/osc/osc_select_observer.cc b/libs/surfaces/osc/osc_select_observer.cc index b115d4a8c3..ab768bc814 100644 --- a/libs/surfaces/osc/osc_select_observer.cc +++ b/libs/surfaces/osc/osc_select_observer.cc @@ -179,11 +179,10 @@ OSCSelectObserver::OSCSelectObserver (boost::shared_ptr s, lo_address OSCSelectObserver::~OSCSelectObserver () { - strip_connections.drop_connections (); // all strip buttons should be off and faders 0 and etc. - clear_strip ("/select/expand", 0); if (feedback[0]) { // buttons are separate feedback + clear_strip ("/select/expand", 0); text_message ("/select/name", " "); text_message ("/select/comment", " "); clear_strip ("/select/mute", 0); @@ -634,8 +633,12 @@ OSCSelectObserver::eq_end () { //need to check feedback for [13] eq_connections.drop_connections (); - clear_strip ("/select/eq_hpf", 0); - clear_strip ("/select/eq_enable", 0); + if (_strip->eq_hpf_controllable ()) { + clear_strip ("/select/eq_hpf", 0); + } + if (_strip->eq_enable_controllable ()) { + clear_strip ("/select/eq_enable", 0); + } for (uint32_t i = 1; i <= _strip->eq_band_cnt (); i++) { text_with_id ("/select/eq_band_name", i, " ");