13
0

OSC: Allow expand to be global

This commit is contained in:
Len Ovens 2018-04-11 09:24:21 -07:00
parent 293326cd94
commit fee23d8778
2 changed files with 39 additions and 15 deletions

View File

@ -2938,7 +2938,7 @@ OSC::get_sid (boost::shared_ptr<ARDOUR::Stripable> strip, lo_address addr)
}
}
}
// failsafe... should never get here.
// strip not in current bank
return 0;
}
@ -4399,6 +4399,8 @@ OSC::strip_expand (int ssid, int yn, lo_message msg)
val = 1;
}
return float_message_with_id (X_("/strip/expand"), ssid, val, sur->feedback[2], get_address (msg));
} else {
sur->expand_strip = s;
}
}
sur->expand_enable = (bool) yn;
@ -4439,12 +4441,21 @@ OSC::_strip_select (boost::shared_ptr<Stripable> s, lo_address addr)
OSCSurface *sur = get_surface(addr, true);
boost::weak_ptr<Stripable> o_sel = sur->select;
boost::shared_ptr<Stripable> old_sel= o_sel.lock ();
boost::weak_ptr<Stripable> o_expand = sur->expand_strip;
boost::shared_ptr<Stripable> old_expand= o_expand.lock ();
if (!s) {
// we got a null strip check that old strip is valid
if (old_sel && sur->expand_enable) {
s = old_sel;
// we got a null strip check that old strips are valid
if (old_expand && sur->expand_enable) {
sur->expand = get_sid (old_expand, addr);
if (sur->strip_types[11] || sur->expand) {
s = old_expand;
} else {
sur->expand_strip = boost::shared_ptr<Stripable> ();
}
}
}
if (!s) {
sur->expand = 0;
sur->expand_enable = false;
if (ControlProtocol::first_selected_stripable()) {
@ -4454,7 +4465,6 @@ OSC::_strip_select (boost::shared_ptr<Stripable> s, lo_address addr)
}
_select = s;
}
}
if (s != old_sel) {
sur->select = s;
if (sur->custom_mode >= GroupOnly) {
@ -4552,9 +4562,9 @@ OSC::sel_expand (uint32_t state, lo_message msg)
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
if (state && sur->expand) {
if (state) {
sur->expand_enable = (bool) state;
s = get_strip (sur->expand, get_address (msg));
s = sur->expand_strip;
} else {
sur->expand_enable = false;
s = _select;

View File

@ -150,7 +150,8 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
OSCSelectObserver* sel_obs; // So we can sync select feedback with selected channel
uint32_t expand; // Used by /select/select
bool expand_enable; // use expand instead of select
boost::shared_ptr<ARDOUR::Stripable> select; // stripable this surface uses (maybe expand strip)
boost::shared_ptr<ARDOUR::Stripable> expand_strip; // stripable this surface uses for expand
boost::shared_ptr<ARDOUR::Stripable> select; // stripable this surface uses as selected
int plug_page; // current plugin page
uint32_t plug_page_size; // plugin page size (number of controls)
int plugin_id; // id of current plugin
@ -185,9 +186,22 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
* [12] - Send Playhead position like primary/secondary GUI clocks
* [13] - Send well known feedback (for /select/command
* [14] - use OSC 1.0 only (#reply -> /reply)
*
* Strip_type bits:
* [0] - Audio Tracks
* [1] - Midi Tracks
* [2] - Audio Bus
* [3] - Midi Bus
* [4] - VCAs
* [5] - master
* [6] - Monitor
* [7] - Aux Bus
* [8] - Selected
* [9] - Hidden
* [10] - Use Groups
* [11] - Global Expand
*/
// storage for each surface's settings
mutable Glib::Threads::Mutex surfaces_lock;
typedef std::vector<OSCSurface> Surface;