summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorLen Ovens <len@ovenwerks.net>2016-06-09 11:11:48 -0700
committerLen Ovens <len@ovenwerks.net>2016-06-09 11:11:48 -0700
commit4905422a47c8068951bacb53b55884cf0dec5602 (patch)
tree765947885e125d7c6692f3d4c71173ab9eecb694 /libs
parent199f20ff2c6f1437acca412b2eda994aa31f663c (diff)
OSC: Added pan width to selected
Diffstat (limited to 'libs')
-rw-r--r--libs/surfaces/osc/osc.cc14
-rw-r--r--libs/surfaces/osc/osc.h2
-rw-r--r--libs/surfaces/osc/osc_select_observer.cc8
3 files changed, 23 insertions, 1 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index ff5c093758..12ba1f552a 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -524,6 +524,7 @@ OSC::register_callbacks()
REGISTER_CALLBACK (serv, "/select/fader", "f", sel_fader);
REGISTER_CALLBACK (serv, "/select/trimdB", "f", sel_trim);
REGISTER_CALLBACK (serv, "/select/pan_stereo_position", "f", sel_pan_position);
+ REGISTER_CALLBACK (serv, "/select/pan_stereo_width", "f", sel_pan_width);
/* 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);
@@ -1881,7 +1882,18 @@ OSC::sel_pan_position (float val, lo_message msg)
if (sur->surface_sel) {
return route_set_pan_stereo_position (sur->surface_sel, val, msg);
} else {
- return route_send_fail ("pan_stereo_position", 0, 0, lo_message_get_source (msg));
+ return route_send_fail ("pan_stereo_position", 0, 0.5, lo_message_get_source (msg));
+ }
+}
+
+int
+OSC::sel_pan_width (float val, lo_message msg)
+{
+ OSCSurface *sur = get_surface(lo_message_get_source (msg));
+ if (sur->surface_sel) {
+ return route_set_pan_stereo_width (sur->surface_sel, val, msg);
+ } else {
+ return route_send_fail ("pan_stereo_width", 0, 1, lo_message_get_source (msg));
}
}
diff --git a/libs/surfaces/osc/osc.h b/libs/surfaces/osc/osc.h
index 55a0a09aed..2818226143 100644
--- a/libs/surfaces/osc/osc.h
+++ b/libs/surfaces/osc/osc.h
@@ -337,6 +337,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
PATH_CALLBACK1_MSG(sel_fader,f);
PATH_CALLBACK1_MSG(sel_trim,f);
PATH_CALLBACK1_MSG(sel_pan_position,f);
+ PATH_CALLBACK1_MSG(sel_pan_width,f);
#define PATH_CALLBACK2(name,arg1type,arg2type) \
static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
@@ -459,6 +460,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
int sel_fader (float state, lo_message msg);
int sel_trim (float val, lo_message msg);
int sel_pan_position (float val, lo_message msg);
+ int sel_pan_width (float val, lo_message msg);
void listen_to_route (boost::shared_ptr<ARDOUR::Stripable>, lo_address);
void end_listen (boost::shared_ptr<ARDOUR::Stripable>, lo_address);
diff --git a/libs/surfaces/osc/osc_select_observer.cc b/libs/surfaces/osc/osc_select_observer.cc
index c6cbaaecbd..0b57bda728 100644
--- a/libs/surfaces/osc/osc_select_observer.cc
+++ b/libs/surfaces/osc/osc_select_observer.cc
@@ -92,6 +92,13 @@ OSCSelectObserver::OSCSelectObserver (boost::shared_ptr<Stripable> s, lo_address
pan_controllable->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::send_change_message, this, X_("/select/pan_stereo_position"), _strip->pan_azimuth_control()), OSC::instance());
send_change_message ("/select/pan_stereo_position", _strip->pan_azimuth_control());
}
+
+ boost::shared_ptr<Controllable> width_controllable = boost::dynamic_pointer_cast<Controllable>(_strip->pan_width_control());
+ if (width_controllable) {
+ width_controllable->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::send_change_message, this, X_("/select/pan_stereo_width"), _strip->pan_width_control()), OSC::instance());
+ send_change_message ("/select/pan_stereo_width", _strip->pan_width_control());
+ }
+
// detecting processor changes requires cast to route
boost::shared_ptr<Route> r = boost::dynamic_pointer_cast<Route>(_strip);
r->processors_changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::send_restart, this, -1), OSC::instance());
@@ -127,6 +134,7 @@ OSCSelectObserver::~OSCSelectObserver ()
}
clear_strip ("/select/trimdB", 0);
clear_strip ("/select/pan_stereo_position", 0.5);
+ clear_strip ("/select/pan_stereo_width", 1);
}
if (feedback[9]) {
clear_strip ("/select/signal", 0);