OSC: take care of track order changes too. Deal with mixer topology changes one time.
authorLen Ovens <len@ovenwerks.net>
Fri, 17 Jun 2016 02:41:39 +0000 (19:41 -0700)
committerLen Ovens <len@ovenwerks.net>
Fri, 17 Jun 2016 02:41:39 +0000 (19:41 -0700)
libs/surfaces/osc/osc.cc
libs/surfaces/osc/osc.h

index 948e73652dcb53746c933cab4ff66e98f0c15dec..19c8a3396530856b7a90d9e61f36ab436c38eeca 100644 (file)
@@ -257,6 +257,9 @@ OSC::start ()
        session->RouteAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&OSC::notify_routes_added, this, _1), this);
        // receive VCAs added
        session->vca_manager().VCAAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&OSC::notify_vca_added, this, _1), this);
+       // order changed
+       PresentationInfo::Change.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&OSC::recalcbanks, this), this);
+
 
        return 0;
 }
@@ -1283,6 +1286,13 @@ OSC::notify_vca_added (ARDOUR::VCAList &)
 
 void
 OSC::recalcbanks ()
+{
+       tick = false;
+       bank_dirty = true;
+}
+
+void
+OSC::_recalcbanks ()
 {
        for (uint32_t it = 0; it < _surface.size(); ++it) {
                OSCSurface* sur = &_surface[it];
@@ -2389,8 +2399,11 @@ bool
 OSC::periodic (void)
 {
        if (!tick) {
+               usleep(100); // let flurry of signals subside
                if (bank_dirty) {
-                       recalcbanks ();
+                       _recalcbanks ();
+                       bank_dirty = false;
+                       tick = true;
                }
        }
 
index a2ebc80510b6e9696c39f456260e7b5c9710b58a..7cb256e725531fee6f846b30b226801ab08717d5 100644 (file)
@@ -495,6 +495,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
 
        void route_name_changed (const PBD::PropertyChange&, boost::weak_ptr<ARDOUR::Route> r, lo_address addr);
        void recalcbanks ();
+       void _recalcbanks ();
        void notify_routes_added (ARDOUR::RouteList &);
        void notify_vca_added (ARDOUR::VCAList &);