summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorLen Ovens <len@ovenwerks.net>2016-06-16 19:41:39 -0700
committerLen Ovens <len@ovenwerks.net>2016-06-16 19:41:39 -0700
commitf4047b9a2656cbdc3e5cb3e943c6bdb421dccbfa (patch)
tree16248806e4d3d752b533efc0363a2f9a7b73a01a /libs/surfaces
parent3754859f2f2614131d6c7051be6793623e695412 (diff)
OSC: take care of track order changes too. Deal with mixer topology changes one time.
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/osc/osc.cc15
-rw-r--r--libs/surfaces/osc/osc.h1
2 files changed, 15 insertions, 1 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index 948e73652d..19c8a33965 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -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;
}
@@ -1284,6 +1287,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];
// find lo_address
@@ -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;
}
}
diff --git a/libs/surfaces/osc/osc.h b/libs/surfaces/osc/osc.h
index a2ebc80510..7cb256e725 100644
--- a/libs/surfaces/osc/osc.h
+++ b/libs/surfaces/osc/osc.h
@@ -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 &);