diff options
author | Len Ovens <len@ovenwerks.net> | 2018-04-07 10:42:11 -0700 |
---|---|---|
committer | Len Ovens <len@ovenwerks.net> | 2018-06-19 09:46:28 -0700 |
commit | 293326cd94197158e35b08a039bdc7003ab5a807 (patch) | |
tree | 26f3aa7e52db434aa6cd95fd8cd5f126000447ce /libs/surfaces/osc | |
parent | 3a6d7ba321bec88e2b0bb6c8cc772d31b6613d58 (diff) |
OSC do not recalc select if still valid
Diffstat (limited to 'libs/surfaces/osc')
-rw-r--r-- | libs/surfaces/osc/osc.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index fdbdf206f6..3e1e8c4c0b 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -4437,17 +4437,23 @@ OSC::_strip_select (boost::shared_ptr<Stripable> s, lo_address addr) return -1; } OSCSurface *sur = get_surface(addr, true); - boost::shared_ptr<Stripable> old_sel = sur->select; + boost::weak_ptr<Stripable> o_sel = sur->select; + boost::shared_ptr<Stripable> old_sel= o_sel.lock (); + if (!s) { - // expand doesn't point to a stripable, turn it off and use select - sur->expand = 0; - sur->expand_enable = false; - if (ControlProtocol::first_selected_stripable()) { - s = ControlProtocol::first_selected_stripable(); + // we got a null strip check that old strip is valid + if (old_sel && sur->expand_enable) { + s = old_sel; } else { - s = session->master_out (); - } + sur->expand = 0; + sur->expand_enable = false; + if (ControlProtocol::first_selected_stripable()) { + s = ControlProtocol::first_selected_stripable(); + } else { + s = session->master_out (); + } _select = s; + } } if (s != old_sel) { sur->select = s; |