diff options
author | Len Ovens <len@ovenwerks.net> | 2018-01-14 08:42:13 -0800 |
---|---|---|
committer | Len Ovens <len@ovenwerks.net> | 2018-01-14 13:07:40 -0800 |
commit | c7a052a45f687f33d88cc56f3eee8daa959cb452 (patch) | |
tree | 9b759fa74e17bc2628e987756e44cddc094a5c5d /libs/surfaces/osc/osc.cc | |
parent | 324938f017cd13b7334c6c026e858c4e22cb4a8a (diff) |
OSC: add /strip/hide
Diffstat (limited to 'libs/surfaces/osc/osc.cc')
-rw-r--r-- | libs/surfaces/osc/osc.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 41d1210281..a026e0283a 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -618,6 +618,7 @@ OSC::register_callbacks() REGISTER_CALLBACK (serv, "/strip/monitor_input", "ii", route_monitor_input); REGISTER_CALLBACK (serv, "/strip/monitor_disk", "ii", route_monitor_disk); REGISTER_CALLBACK (serv, "/strip/expand", "ii", strip_expand); + REGISTER_CALLBACK (serv, "/strip/hide", "ii", strip_hide); REGISTER_CALLBACK (serv, "/strip/select", "ii", strip_gui_select); REGISTER_CALLBACK (serv, "/strip/polarity", "ii", strip_phase); REGISTER_CALLBACK (serv, "/strip/gain", "if", route_set_gain_dB); @@ -963,6 +964,10 @@ OSC::catchall (const char *path, const char* types, lo_arg **argv, int argc, lo_ int ssid = atoi (&path[14]); ret = strip_expand (ssid, argv[0]->i, msg); } + else if (!strncmp (path, "/strip/hide/", 12) && strlen (path) > 12) { + int ssid = atoi (&path[12]); + ret = strip_hide (ssid, argv[0]->i, msg); + } else if (!strncmp (path, "/strip/select/", 14) && strlen (path) > 14) { int ssid = atoi (&path[14]); ret = strip_gui_select (ssid, argv[0]->i, msg); @@ -3790,6 +3795,19 @@ OSC::strip_expand (int ssid, int yn, lo_message msg) } int +OSC::strip_hide (int ssid, int state, lo_message msg) +{ + boost::shared_ptr<Stripable> s = get_strip (ssid, get_address (msg)); + + if (s) { + if (state != s->is_hidden ()) { + s->presentation_info().set_hidden ((bool) state); + } + } + return 0; +} + +int OSC::_strip_select (boost::shared_ptr<Stripable> s, lo_address addr) { if (!session) { |