From 8b8f47430adfefc624af19f8f27585039560cc81 Mon Sep 17 00:00:00 2001 From: Len Ovens Date: Sat, 10 Jun 2017 07:28:15 -0700 Subject: OSC: add option to send /reply instead of #reply (OSC1.0 compat) --- libs/surfaces/osc/osc.cc | 26 ++++++++++++++++++++++---- libs/surfaces/osc/osc.h | 1 + libs/surfaces/osc/osc_gui.cc | 11 +++++++++++ libs/surfaces/osc/osc_gui.h | 1 + 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 72d8010c3f..4b554e6f2b 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -846,8 +846,13 @@ OSC::send_current_value (const char* path, lo_arg** argv, int argc, lo_message m } } } + OSCSurface *sur = get_surface(get_address (msg)); - lo_send_message (get_address (msg), "#reply", reply); + if (sur->feedback[14]) { + lo_send_message (get_address (msg), "/reply", reply); + } else { + lo_send_message (get_address (msg), "#reply", reply); + } lo_message_free (reply); } @@ -869,6 +874,7 @@ OSC::catchall (const char *path, const char* types, lo_arg **argv, int argc, lo_ /* 15 for /#current_value plus 2 for / */ len = strlen (path); + OSCSurface *sur = get_surface(get_address (msg)); if (strstr (path, "/automation")) { ret = set_automation (path, types, argv, argc, msg); @@ -924,7 +930,11 @@ OSC::catchall (const char *path, const char* types, lo_arg **argv, int argc, lo_ } } - lo_send_message (get_address (msg), "#reply", reply); + if (sur->feedback[14]) { + lo_send_message (get_address (msg), "/reply", reply); + } else { + lo_send_message (get_address (msg), "#reply", reply); + } lo_message_free (reply); ret = 0; @@ -1239,7 +1249,11 @@ OSC::routes_list (lo_message msg) //Automatically listen to stripables listed listen_to_route(s, get_address (msg)); - lo_send_message (get_address (msg), "#reply", reply); + if (sur->feedback[14]) { + lo_send_message (get_address (msg), "/reply", reply); + } else { + lo_send_message (get_address (msg), "#reply", reply); + } lo_message_free (reply); } } @@ -1257,7 +1271,11 @@ OSC::routes_list (lo_message msg) lo_message_add_int32 (reply, 0); } - lo_send_message (get_address (msg), "#reply", reply); + if (sur->feedback[14]) { + lo_send_message (get_address (msg), "/reply", reply); + } else { + lo_send_message (get_address (msg), "#reply", reply); + } lo_message_free (reply); } diff --git a/libs/surfaces/osc/osc.h b/libs/surfaces/osc/osc.h index 5bb55113c0..0f9cbeba7b 100644 --- a/libs/surfaces/osc/osc.h +++ b/libs/surfaces/osc/osc.h @@ -154,6 +154,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI * [11] - Send Playhead position as minutes seconds * [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) */ diff --git a/libs/surfaces/osc/osc_gui.cc b/libs/surfaces/osc/osc_gui.cc index a898cf74be..b61dd35e99 100644 --- a/libs/surfaces/osc/osc_gui.cc +++ b/libs/surfaces/osc/osc_gui.cc @@ -363,6 +363,12 @@ OSC_GUI::OSC_GUI (OSC& p) fbtable->attach (select_fb, 1, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0); ++fn; + label = manage (new Gtk::Label(_("Use /reply instead of #reply:"))); + label->set_alignment(1, .5); + fbtable->attach (*label, 0, 1, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0)); + fbtable->attach (use_osc10, 1, 2, fn, fn+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0); + ++fn; + fbtable->show_all (); append_page (*fbtable, _("Default Feedback")); // set strips and feedback from loaded default values @@ -392,6 +398,7 @@ OSC_GUI::OSC_GUI (OSC& p) hp_min_sec.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::set_bitsets)); hp_gui.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::set_bitsets)); select_fb.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::set_bitsets)); + use_osc10.signal_clicked().connect (sigc::mem_fun (*this, &OSC_GUI::set_bitsets)); preset_busy = false; } @@ -599,6 +606,7 @@ OSC_GUI::reshow_values () hp_min_sec.set_active (def_feedback & 2048); //hp_gui.set_active (false); // we don't have this yet (Mixbus wants) select_fb.set_active(def_feedback & 8192); + use_osc10.set_active(def_feedback & 16384); calculate_strip_types (); calculate_feedback (); @@ -650,6 +658,9 @@ OSC_GUI::calculate_feedback () if (select_fb.get_active()) { fbvalue += 8192; } + if (use_osc10.get_active()) { + fbvalue += 16384; + } current_feedback.set_text(string_compose("%1", fbvalue)); } diff --git a/libs/surfaces/osc/osc_gui.h b/libs/surfaces/osc/osc_gui.h index ae3640c1ee..3e651b70fc 100644 --- a/libs/surfaces/osc/osc_gui.h +++ b/libs/surfaces/osc/osc_gui.h @@ -106,6 +106,7 @@ private: Gtk::CheckButton hp_min_sec; Gtk::CheckButton hp_gui; Gtk::CheckButton select_fb; + Gtk::CheckButton use_osc10; int fbvalue; void set_bitsets (); -- cgit v1.2.3