OSC: Squelch select feedback when no feedback is configured.
authorLen Ovens <len@ovenwerks.net>
Mon, 28 Nov 2016 02:32:50 +0000 (18:32 -0800)
committerLen Ovens <len@ovenwerks.net>
Mon, 28 Nov 2016 02:32:50 +0000 (18:32 -0800)
libs/surfaces/osc/osc.cc
libs/surfaces/osc/osc_select_observer.cc

index 63d18dd38836ec61c36a4621f9be1a0d3a5f3215..a9168c29e0efd4055491d1d1f109070ea363d2b9 100644 (file)
@@ -2277,21 +2277,25 @@ OSC::_strip_select (boost::shared_ptr<Stripable> s, lo_address addr)
                delete sur->sel_obs;
                sur->sel_obs = 0;
        }
                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;
                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;
                }
                        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);
        }
                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.
        //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) {
        if (!yn) return 0;
 
        if (!session) {
-               route_send_fail ("select", ssid, 0, get_address (msg));
                return -1;
        }
        OSCSurface *sur = get_surface(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 {
        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;
        }
 
        return 0;
index b115d4a8c35a2271d7a2616229bfc80e2f0a6504..ab768bc8143da2a470f6e929be39d8e2a54ee710 100644 (file)
@@ -179,11 +179,10 @@ OSCSelectObserver::OSCSelectObserver (boost::shared_ptr<Stripable> s, lo_address
 
 OSCSelectObserver::~OSCSelectObserver ()
 {
 
 OSCSelectObserver::~OSCSelectObserver ()
 {
-
        strip_connections.drop_connections ();
        // all strip buttons should be off and faders 0 and etc.
        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
        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);
                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 ();
 {
        //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, " ");
 
        for (uint32_t i = 1; i <= _strip->eq_band_cnt (); i++) {
                text_with_id ("/select/eq_band_name", i, " ");