From 7e791981f0db6ce6448833fac0b5d41dff61a319 Mon Sep 17 00:00:00 2001 From: Len Ovens Date: Sun, 14 May 2017 20:55:24 -0700 Subject: [PATCH] OSC: added automation name feedback --- libs/surfaces/osc/osc.cc | 2 ++ libs/surfaces/osc/osc_route_observer.cc | 9 ++++++++- libs/surfaces/osc/osc_select_observer.cc | 8 ++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 0a412ee7de..052e9502c0 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -2244,6 +2244,7 @@ OSC::set_automation (const char *path, size_t len, lo_arg **argv, int argc, lo_m } if (strp) { boost::shared_ptr control = boost::shared_ptr(); + // other automatable controls can be added by repeating the next 6.5 lines if ((!strncmp (&path[ctr], "fader", 5)) || (!strncmp (&path[ctr], "gain", 4))) { if (strp->gain_control ()) { control = strp->gain_control (); @@ -3713,6 +3714,7 @@ OSC::sel_eq_hpf (float val, lo_message msg) } return sel_fail ("eq_hpf", 0, get_address (msg)); } +// need to add two more filter controls int OSC::sel_eq_gain (int id, float val, lo_message msg) diff --git a/libs/surfaces/osc/osc_route_observer.cc b/libs/surfaces/osc/osc_route_observer.cc index 8690a47a7f..c33ad7cc2b 100644 --- a/libs/surfaces/osc/osc_route_observer.cc +++ b/libs/surfaces/osc/osc_route_observer.cc @@ -378,6 +378,7 @@ OSCRouteObserver::gain_automation (string path) { lo_message msg = lo_message_new (); string apath = string_compose ("%1/automation", path); + string npath = string_compose ("%1/automation_name", path); if (feedback[2]) { apath = set_path (apath); @@ -387,28 +388,34 @@ OSCRouteObserver::gain_automation (string path) boost::shared_ptr control = _strip->gain_control(); as = control->alist()->automation_state(); + string auto_name; float output; switch (as) { case ARDOUR::Off: output = 0; + auto_name = "Manual"; break; case ARDOUR::Play: output = 1; + auto_name = "Play"; break; case ARDOUR::Write: output = 2; + auto_name = "Write"; break; case ARDOUR::Touch: output = 3; + auto_name = "Touch"; break; default: break; } - lo_message_add_float (msg, output); send_gain_message (path, control); + lo_message_add_float (msg, output); lo_send_message (addr, apath.c_str(), msg); lo_message_free (msg); + text_with_id (npath, ssid, auto_name); } string diff --git a/libs/surfaces/osc/osc_select_observer.cc b/libs/surfaces/osc/osc_select_observer.cc index 151b00b6e0..ff9020585a 100644 --- a/libs/surfaces/osc/osc_select_observer.cc +++ b/libs/surfaces/osc/osc_select_observer.cc @@ -517,18 +517,23 @@ OSCSelectObserver::gain_automation () { float output; as = _strip->gain_control()->alist()->automation_state(); + string auto_name; switch (as) { case ARDOUR::Off: output = 0; + auto_name = "Manual"; break; case ARDOUR::Play: output = 1; + auto_name = "Play"; break; case ARDOUR::Write: output = 2; + auto_name = "Write"; break; case ARDOUR::Touch: output = 3; + auto_name = "Touch"; break; default: break; @@ -536,8 +541,10 @@ OSCSelectObserver::gain_automation () if (gainmode) { send_float ("/select/fader/automation", output); + text_message ("/select/fader/automation_name", auto_name); } else { send_float ("/select/gain/automation", output); + text_message ("/select/gain/automation_name", auto_name); } gain_message (); @@ -629,6 +636,7 @@ OSCSelectObserver::eq_init() change_message ("/select/eq_hpf", _strip->filter_freq_controllable(true)); } // TODO LPF and LPF/HPF enable ctrls. + if (_strip->eq_enable_controllable ()) { _strip->eq_enable_controllable ()->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::enable_message, this, X_("/select/eq_enable"), _strip->eq_enable_controllable()), OSC::instance()); enable_message ("/select/eq_enable", _strip->eq_enable_controllable()); -- 2.30.2