From: Len Ovens Date: Sat, 2 Jul 2016 01:12:31 +0000 (-0700) Subject: OSC: Don't look for which stripable is selected until we actually need it, It may... X-Git-Tag: 5.0-pre1~392 X-Git-Url: https://main.carlh.net/gitweb/?p=ardour.git;a=commitdiff_plain;h=3491f22c0448d78d0d0134e482642a0740c56d82 OSC: Don't look for which stripable is selected until we actually need it, It may be wrong at application start. --- 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(); - for (StripableList::iterator it = stripables.begin(); it != stripables.end(); ++it) { - boost::shared_ptr 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 s = *it; + if (s->is_selected()) { + _select = s; + break; + } + } + } + // No surface create one with default values OSCSurface s; s.remote_url = r_url;