OSC: added automation name feedback
authorLen Ovens <len@ovenwerks.net>
Mon, 15 May 2017 03:55:24 +0000 (20:55 -0700)
committerLen Ovens <len@ovenwerks.net>
Mon, 15 May 2017 14:43:59 +0000 (07:43 -0700)
libs/surfaces/osc/osc.cc
libs/surfaces/osc/osc_route_observer.cc
libs/surfaces/osc/osc_select_observer.cc

index 0a412ee7de9d88b5c1f9847f52f6df50a96fbfb4..052e9502c051f9bdbc367733ecc0c893dd1b7b77 100644 (file)
@@ -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<AutomationControl> control = boost::shared_ptr<AutomationControl>();
+               // 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)
index 8690a47a7f6e507d3d844d4c8a7556275c13cbb2..c33ad7cc2bf0f831c10cc8f9517e5d6fbc0ab6df 100644 (file)
@@ -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<GainControl> 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
index 151b00b6e05a8aef81bcdcb7da7b4498996ff061..ff9020585a9f3c208767a9578695d11913fd04a3 100644 (file)
@@ -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());