diff options
author | Len Ovens <len@ovenwerks.net> | 2016-11-27 18:32:50 -0800 |
---|---|---|
committer | Len Ovens <len@ovenwerks.net> | 2016-11-27 18:32:50 -0800 |
commit | 8ddeca133bb6decbb1f2f46ec7b50c1bb622f731 (patch) | |
tree | a6179688988308f21e6e6403cf2fd0b888a7f4ea /libs/surfaces | |
parent | 198b8f6b58e2b2125932b6f9f4ab0d90677de874 (diff) |
OSC: Squelch select feedback when no feedback is configured.
Diffstat (limited to 'libs/surfaces')
-rw-r--r-- | libs/surfaces/osc/osc.cc | 15 | ||||
-rw-r--r-- | libs/surfaces/osc/osc_select_observer.cc | 11 |
2 files changed, 17 insertions, 9 deletions
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<Stripable> 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<Stripable> 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, " "); |