OSC: fix VCAs try to connect to controls it does not have.
authorLen Ovens <len@ovenwerks.net>
Mon, 31 Jul 2017 01:34:56 +0000 (18:34 -0700)
committerLen Ovens <len@ovenwerks.net>
Mon, 31 Jul 2017 01:35:38 +0000 (18:35 -0700)
libs/surfaces/osc/osc_route_observer.cc

index 550fd396a08ee584adcc61c2eceeb1e172aa0470..656c6f086e62e884a3d663ad2fcc97032ec0dc06 100644 (file)
@@ -61,11 +61,15 @@ OSCRouteObserver::OSCRouteObserver (boost::shared_ptr<Stripable> s, uint32_t ss,
                _strip->solo_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCRouteObserver::send_change_message, this, X_("/strip/solo"), _strip->solo_control()), OSC::instance());
                send_change_message ("/strip/solo", _strip->solo_control());
 
-               _strip->solo_isolate_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_change_message, this, X_("/strip/solo_iso"), _strip->solo_isolate_control()), OSC::instance());
-               send_change_message ("/strip/solo_iso", _strip->solo_isolate_control());
+               if (_strip->solo_isolate_control()) {
+                       _strip->solo_isolate_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_change_message, this, X_("/strip/solo_iso"), _strip->solo_isolate_control()), OSC::instance());
+                       send_change_message ("/strip/solo_iso", _strip->solo_isolate_control());
+               }
 
-               _strip->solo_safe_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_change_message, this, X_("/strip/solo_safe"), _strip->solo_safe_control()), OSC::instance());
-               send_change_message ("/strip/solo_safe", _strip->solo_safe_control());
+               if (_strip->solo_safe_control()) {
+                       _strip->solo_safe_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_change_message, this, X_("/strip/solo_safe"), _strip->solo_safe_control()), OSC::instance());
+                       send_change_message ("/strip/solo_safe", _strip->solo_safe_control());
+               }
 
                boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track> (_strip);
                if (track) {