From 641b8a1139030da900f8c72d0a47dec26c2df4a6 Mon Sep 17 00:00:00 2001 From: Len Ovens Date: Wed, 11 Apr 2018 10:48:24 -0700 Subject: [PATCH] OSC: select should not show expand if invalid --- libs/surfaces/osc/osc.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 94a1123f28..d0e7e3e28b 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -2176,6 +2176,7 @@ OSC::get_surface (lo_address addr , bool quiet) s.sel_obs = 0; s.expand = 0; s.expand_enable = false; + s.expand_strip = boost::shared_ptr (); s.cue = false; s.aux = 0; s.cue_obs = 0; @@ -4409,7 +4410,7 @@ OSC::strip_expand (int ssid, int yn, lo_message msg) if (yn) { sel = get_strip (ssid, get_address (msg)); } else { - sel = _select; + sel = boost::shared_ptr (); } return _strip_select (sel, get_address (msg)); @@ -4458,6 +4459,8 @@ OSC::_strip_select (boost::shared_ptr s, lo_address addr) if (!s) { sur->expand = 0; sur->expand_enable = false; + // XXXX fix this to be more like editor mixer selection + // may have to be it's own call if (ControlProtocol::first_selected_stripable()) { s = ControlProtocol::first_selected_stripable(); } else { @@ -4495,6 +4498,7 @@ OSC::_strip_select (boost::shared_ptr s, lo_address addr) sur->sel_obs->set_expand (sur->expand_enable); uint32_t obs_expand = 0; if (sur->expand_enable) { + sur->expand = get_sid (s, addr); obs_expand = sur->expand; } else { obs_expand = 0; @@ -4562,9 +4566,13 @@ OSC::sel_expand (uint32_t state, lo_message msg) { OSCSurface *sur = get_surface(get_address (msg)); boost::shared_ptr s; + if (!sur->expand_strip) { + state = 0; + float_message (X_("/select/expand"), 0.0, get_address (msg)); + } if (state) { sur->expand_enable = (bool) state; - s = sur->expand_strip; + s = boost::shared_ptr (); } else { sur->expand_enable = false; s = boost::shared_ptr ();