summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLen Ovens <len@ovenwerks.net>2017-11-10 08:38:08 -0800
committerLen Ovens <len@ovenwerks.net>2017-11-10 08:38:08 -0800
commit69603bb76e897706d60647c121d8aeb5313f2858 (patch)
tree005a5166b539054116c8bd9b3833c88752d76a05
parent634c620b075ee5006d845e75d807797f8fbd8365 (diff)
OSC link: make whole link set follow strip_types
strip should not run periodic when blank - crash fix
-rw-r--r--libs/surfaces/osc/osc.cc40
-rw-r--r--libs/surfaces/osc/osc.h1
-rw-r--r--libs/surfaces/osc/osc_route_observer.cc1
3 files changed, 41 insertions, 1 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index 74f4cec155..a7af9c1b10 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -1470,6 +1470,42 @@ OSC::set_link (uint32_t set, uint32_t id, lo_address addr)
}
void
+OSC::link_strip_types (uint32_t linkset, uint32_t striptypes)
+{
+ LinkSet *ls = 0;
+
+ if (!linkset) {
+ return;
+ }
+ std::map<uint32_t, LinkSet>::iterator it;
+ it = link_sets.find(linkset);
+ if (it == link_sets.end()) {
+ // this should never happen... but
+ return;
+ }
+ ls = &link_sets[linkset];
+ ls->strip_types = striptypes;
+ for (uint32_t dv = 1; dv < ls->urls.size(); dv++) {
+ OSCSurface *su;
+
+ if (ls->urls[dv] != "") {
+ string url = ls->urls[dv];
+ su = get_surface (lo_address_new_from_url (url.c_str()), true);
+ if (su->linkset == linkset) {
+ su->strip_types = striptypes;
+ if (su->strip_types[10]) {
+ su->usegroup = PBD::Controllable::UseGroup;
+ } else {
+ su->usegroup = PBD::Controllable::NoGroup;
+ }
+ } else {
+ ls->urls[dv] = "";
+ }
+ }
+ }
+}
+
+void
OSC::surface_link_state (LinkSet * set)
{
for (uint32_t dv = 1; dv < set->urls.size(); dv++) {
@@ -1763,6 +1799,7 @@ OSC::set_surface (uint32_t b_size, uint32_t strips, uint32_t fb, uint32_t gm, ui
s->plug_page_size = pi_size;
if (s->linkset) {
set_link (s->linkset, s->linkid, get_address (msg));
+ link_strip_types (s->linkset, s->strip_types.to_ulong());
} else {
// set bank and strip feedback
strip_feedback(s, true);
@@ -1805,6 +1842,9 @@ OSC::set_surface_strip_types (uint32_t st, lo_message msg)
} else {
s->usegroup = PBD::Controllable::NoGroup;
}
+ if (s->linkset) {
+ link_strip_types (s->linkset, st);
+ }
// set bank and strip feedback
_set_bank (1, get_address (msg));
diff --git a/libs/surfaces/osc/osc.h b/libs/surfaces/osc/osc.h
index 00e15074b7..c1ba89cca7 100644
--- a/libs/surfaces/osc/osc.h
+++ b/libs/surfaces/osc/osc.h
@@ -322,6 +322,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
int link_check (uint32_t linkset);
int set_link (uint32_t set, uint32_t id, lo_address addr);
void surface_link_state (LinkSet * set);
+ void link_strip_types (uint32_t linkset, uint32_t striptypes);
#define OSC_DEBUG \
if (_debugmode == All) { \
diff --git a/libs/surfaces/osc/osc_route_observer.cc b/libs/surfaces/osc/osc_route_observer.cc
index 48c5a24ec3..8438cb0c58 100644
--- a/libs/surfaces/osc/osc_route_observer.cc
+++ b/libs/surfaces/osc/osc_route_observer.cc
@@ -120,7 +120,6 @@ OSCRouteObserver::refresh_strip (boost::shared_ptr<ARDOUR::Stripable> new_strip,
if (!_strip) {
// this strip is blank and should be cleared
clear_strip ();
- _init = false;
return;
}
_strip->DropReferences.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCRouteObserver::no_strip, this), OSC::instance());