summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorLen Ovens <len@ovenwerks.net>2016-06-11 12:09:15 -0700
committerLen Ovens <len@ovenwerks.net>2016-06-11 12:09:15 -0700
commit63e6378713b1cb130efeb2347e42e796931b1415 (patch)
treec1bdb79a326c635b7aee800464120891e2a9867e /libs
parentbcf683df0042e5f87013d5a726b8b96c349f24aa (diff)
OSC: added solo isolate and solo safe/lock.
Diffstat (limited to 'libs')
-rw-r--r--libs/surfaces/osc/osc.cc64
-rw-r--r--libs/surfaces/osc/osc.h8
-rw-r--r--libs/surfaces/osc/osc_select_observer.cc8
3 files changed, 80 insertions, 0 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index 8507869235..d68e52b59b 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -47,6 +47,8 @@
#include "ardour/presentation_info.h"
#include "ardour/send.h"
#include "ardour/phase_control.h"
+#include "ardour/solo_isolate_control.h"
+#include "ardour/solo_safe_control.h"
#include "osc_select_observer.h"
#include "osc.h"
@@ -519,6 +521,8 @@ OSC::register_callbacks()
REGISTER_CALLBACK (serv, "/select/record_safe", "i", sel_recsafe);
REGISTER_CALLBACK (serv, "/select/mute", "i", sel_mute);
REGISTER_CALLBACK (serv, "/select/solo", "i", sel_solo);
+ REGISTER_CALLBACK (serv, "/select/solo_iso", "i", sel_solo_iso);
+ REGISTER_CALLBACK (serv, "/select/solo_safe", "i", sel_solo_safe);
REGISTER_CALLBACK (serv, "/select/monitor_input", "i", sel_monitor_input);
REGISTER_CALLBACK (serv, "/select/monitor_disk", "i", sel_monitor_disk);
REGISTER_CALLBACK (serv, "/select/polarity", "i", sel_phase);
@@ -533,6 +537,8 @@ OSC::register_callbacks()
/* These commands require the route index in addition to the arg; TouchOSC (et al) can't use these */
REGISTER_CALLBACK (serv, "/strip/mute", "ii", route_mute);
REGISTER_CALLBACK (serv, "/strip/solo", "ii", route_solo);
+ REGISTER_CALLBACK (serv, "/strip/solo_iso", "ii", route_solo_iso);
+ REGISTER_CALLBACK (serv, "/strip/solo_safe", "ii", route_solo_safe);
REGISTER_CALLBACK (serv, "/strip/recenable", "ii", route_recenable);
REGISTER_CALLBACK (serv, "/strip/record_safe", "ii", route_recsafe);
REGISTER_CALLBACK (serv, "/strip/monitor_input", "ii", route_monitor_input);
@@ -1575,6 +1581,42 @@ OSC::route_solo (int ssid, int yn, lo_message msg)
}
int
+OSC::route_solo_iso (int ssid, int yn, lo_message msg)
+{
+ if (!session) return -1;
+ int rid = get_rid (ssid, lo_message_get_source (msg));
+
+ boost::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::Route);
+
+ if (s) {
+ if (s->solo_isolate_control()) {
+ s->solo_isolate_control()->set_value (yn ? 1.0 : 0.0, PBD::Controllable::NoGroup);
+ return 0;
+ }
+ }
+
+ return route_send_fail ("solo_iso", ssid, 0, lo_message_get_source (msg));
+}
+
+int
+OSC::route_solo_safe (int ssid, int yn, lo_message msg)
+{
+ if (!session) return -1;
+ int rid = get_rid (ssid, lo_message_get_source (msg));
+
+ boost::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::Route);
+
+ if (s) {
+ if (s->solo_safe_control()) {
+ s->solo_safe_control()->set_value (yn ? 1.0 : 0.0, PBD::Controllable::NoGroup);
+ return 0;
+ }
+ }
+
+ return route_send_fail ("solo_safe", ssid, 0, lo_message_get_source (msg));
+}
+
+int
OSC::sel_solo (uint32_t yn, lo_message msg)
{
OSCSurface *sur = get_surface(lo_message_get_source (msg));
@@ -1586,6 +1628,28 @@ OSC::sel_solo (uint32_t yn, lo_message msg)
}
int
+OSC::sel_solo_iso (uint32_t yn, lo_message msg)
+{
+ OSCSurface *sur = get_surface(lo_message_get_source (msg));
+ if (sur->surface_sel) {
+ return route_solo_iso(sur->surface_sel, yn, msg);
+ } else {
+ return route_send_fail ("solo_iso", 0, 0, lo_message_get_source (msg));
+ }
+}
+
+int
+OSC::sel_solo_safe (uint32_t yn, lo_message msg)
+{
+ OSCSurface *sur = get_surface(lo_message_get_source (msg));
+ if (sur->surface_sel) {
+ return route_solo_safe(sur->surface_sel, yn, msg);
+ } else {
+ return route_send_fail ("solo_safe", 0, 0, lo_message_get_source (msg));
+ }
+}
+
+int
OSC::sel_recenable (uint32_t yn, lo_message msg)
{
OSCSurface *sur = get_surface(lo_message_get_source (msg));
diff --git a/libs/surfaces/osc/osc.h b/libs/surfaces/osc/osc.h
index 4d277fb822..0ff427ecf0 100644
--- a/libs/surfaces/osc/osc.h
+++ b/libs/surfaces/osc/osc.h
@@ -333,6 +333,8 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
PATH_CALLBACK1_MSG(sel_recsafe,i);
PATH_CALLBACK1_MSG(sel_mute,i);
PATH_CALLBACK1_MSG(sel_solo,i);
+ PATH_CALLBACK1_MSG(sel_solo_iso,i);
+ PATH_CALLBACK1_MSG(sel_solo_safe,i);
PATH_CALLBACK1_MSG(sel_monitor_input,i);
PATH_CALLBACK1_MSG(sel_monitor_disk,i);
PATH_CALLBACK1_MSG(sel_phase,i);
@@ -398,6 +400,8 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
PATH_CALLBACK2(loop_location,i,i);
PATH_CALLBACK2_MSG(route_mute,i,i);
PATH_CALLBACK2_MSG(route_solo,i,i);
+ PATH_CALLBACK2_MSG(route_solo_iso,i,i);
+ PATH_CALLBACK2_MSG(route_solo_safe,i,i);
PATH_CALLBACK2_MSG(route_recenable,i,i);
PATH_CALLBACK2_MSG(route_recsafe,i,i);
PATH_CALLBACK2_MSG(route_monitor_input,i,i);
@@ -419,6 +423,8 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
int route_mute (int rid, int yn, lo_message msg);
int route_solo (int rid, int yn, lo_message msg);
+ int route_solo_iso (int rid, int yn, lo_message msg);
+ int route_solo_safe (int rid, int yn, lo_message msg);
int route_recenable (int rid, int yn, lo_message msg);
int route_recsafe (int ssid, int yn, lo_message msg);
int route_monitor_input (int rid, int yn, lo_message msg);
@@ -461,6 +467,8 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
int sel_recsafe (uint32_t state, lo_message msg);
int sel_mute (uint32_t state, lo_message msg);
int sel_solo (uint32_t state, lo_message msg);
+ int sel_solo_iso (uint32_t state, lo_message msg);
+ int sel_solo_safe (uint32_t state, lo_message msg);
int sel_monitor_input (uint32_t state, lo_message msg);
int sel_monitor_disk (uint32_t state, lo_message msg);
int sel_phase (uint32_t state, lo_message msg);
diff --git a/libs/surfaces/osc/osc_select_observer.cc b/libs/surfaces/osc/osc_select_observer.cc
index 3e675fb97b..a51f9e702a 100644
--- a/libs/surfaces/osc/osc_select_observer.cc
+++ b/libs/surfaces/osc/osc_select_observer.cc
@@ -25,6 +25,8 @@
#include "ardour/dB.h"
#include "ardour/meter.h"
#include "ardour/phase_control.h"
+#include "ardour/solo_isolate_control.h"
+#include "ardour/solo_safe_control.h"
#include "osc.h"
#include "osc_select_observer.h"
@@ -55,6 +57,12 @@ OSCSelectObserver::OSCSelectObserver (boost::shared_ptr<Stripable> s, lo_address
_strip->solo_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/solo"), _strip->solo_control()), OSC::instance());
change_message ("/select/solo", _strip->solo_control());
+ _strip->solo_isolate_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/solo_iso"), _strip->solo_isolate_control()), OSC::instance());
+ change_message ("/select/solo_iso", _strip->solo_isolate_control());
+
+ _strip->solo_safe_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/solo_safe"), _strip->solo_safe_control()), OSC::instance());
+ change_message ("/select/solo_safe", _strip->solo_safe_control());
+
boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track> (_strip);
if (track) {
track->monitoring_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::monitor_status, this, track->monitoring_control()), OSC::instance());