summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorLen Ovens <len@ovenwerks.net>2016-07-01 18:12:31 -0700
committerLen Ovens <len@ovenwerks.net>2016-07-01 18:12:31 -0700
commit3491f22c0448d78d0d0134e482642a0740c56d82 (patch)
tree7ee0a6225643bb63911b27bc1b4e29d1218444e4 /libs
parent55722a74fb8fae1814def23ff676251240d4723e (diff)
OSC: Don't look for which stripable is selected until we actually need it, It may be wrong at application start.
Diffstat (limited to 'libs')
-rw-r--r--libs/surfaces/osc/osc.cc34
1 files changed, 19 insertions, 15 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index 51746d1ce4..68b51a96d0 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -260,23 +260,8 @@ OSC::start ()
// order changed
PresentationInfo::Change.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&OSC::recalcbanks, this), this);
- // guess at which stripable is the current editor mixerstrip
- // right now just choose the first one we find, may be the wrong one
- // hopefully we will have access to session->current_strip at some point
- StripableList stripables;
-
- session->get_stripables (stripables);
_select = boost::shared_ptr<Stripable>();
- for (StripableList::iterator it = stripables.begin(); it != stripables.end(); ++it) {
- boost::shared_ptr<Stripable> s = *it;
- if (s->is_selected()) {
- _select = s;
- break;
- }
- }
-
-
return 0;
}
@@ -1238,6 +1223,25 @@ OSC::get_surface (lo_address addr)
return &_surface[it];
}
}
+ // if we do this when OSC is started we get the wrong stripable
+ // we don't need this until we actually have a surface to deal with
+ if (!_select) {
+ // guess at which stripable is the current editor mixerstrip
+ // right now just choose the first one we find, may be the wrong one
+ // hopefully we will have access to session->current_strip at some point
+ StripableList stripables;
+
+ session->get_stripables (stripables);
+
+ for (StripableList::iterator it = stripables.begin(); it != stripables.end(); ++it) {
+ boost::shared_ptr<Stripable> s = *it;
+ if (s->is_selected()) {
+ _select = s;
+ break;
+ }
+ }
+ }
+
// No surface create one with default values
OSCSurface s;
s.remote_url = r_url;