From d1558dcab5bcf0a9f81ab743a17409782e913dc7 Mon Sep 17 00:00:00 2001 From: Len Ovens Date: Wed, 2 Aug 2017 10:43:13 -0700 Subject: OSC: Add command to select Master --- libs/surfaces/osc/osc.cc | 17 +++++++++++++++++ libs/surfaces/osc/osc.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 46446f357e..4aa27018fb 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -543,6 +543,7 @@ OSC::register_callbacks() REGISTER_CALLBACK (serv, "/master/mute", "i", master_set_mute); REGISTER_CALLBACK (serv, "/master/trimdB", "f", master_set_trim); REGISTER_CALLBACK (serv, "/master/pan_stereo_position", "f", master_set_pan_stereo_position); + REGISTER_CALLBACK (serv, "/master/select", "f", master_select); REGISTER_CALLBACK (serv, "/monitor/gain", "f", monitor_set_gain); REGISTER_CALLBACK (serv, "/monitor/fader", "f", monitor_set_fader); REGISTER_CALLBACK (serv, "/monitor/db_delta", "f", monitor_delta_gain); @@ -2484,6 +2485,22 @@ OSC::master_set_mute (uint32_t state) return 0; } +int +OSC::master_select (lo_message msg) +{ + if (!session) { + return -1; + } + OSCSurface *sur = get_surface(get_address (msg)); + sur->expand_enable = false; + boost::shared_ptr s = session->master_out(); + if (s) { + SetStripableSelection (s); + } + + return 0; +} + int OSC::monitor_set_gain (float dB) { diff --git a/libs/surfaces/osc/osc.h b/libs/surfaces/osc/osc.h index 20a7b96632..79392a0008 100644 --- a/libs/surfaces/osc/osc.h +++ b/libs/surfaces/osc/osc.h @@ -306,6 +306,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI PATH_CALLBACK_MSG(refresh_surface); PATH_CALLBACK_MSG(bank_up); PATH_CALLBACK_MSG(bank_down); + PATH_CALLBACK_MSG(master_select); #define PATH_CALLBACK(name) \ static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \ @@ -622,6 +623,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI int master_set_trim (float dB); int master_set_pan_stereo_position (float position, lo_message msg); int master_set_mute (uint32_t state); + int master_select (lo_message msg); int monitor_set_gain (float dB); int monitor_set_fader (float position); int monitor_delta_gain (float delta); -- cgit v1.2.3