summaryrefslogtreecommitdiff
path: root/libs/surfaces/osc
diff options
context:
space:
mode:
authorLen Ovens <len@ovenwerks.net>2016-06-10 13:45:07 -0700
committerLen Ovens <len@ovenwerks.net>2016-06-10 13:45:07 -0700
commit1695de335db34e7d35de25454e3a33e560d81ae0 (patch)
tree86239322c6dbc63b38915602857f7c89c0ac9249 /libs/surfaces/osc
parentb588308bede25c226ef6c3b3eefff41ac6fc6fcc (diff)
OSC: Constrain master pan position as width requires.
Diffstat (limited to 'libs/surfaces/osc')
-rw-r--r--libs/surfaces/osc/osc.cc13
-rw-r--r--libs/surfaces/osc/osc.h6
2 files changed, 16 insertions, 3 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index d6dc4277e8..8507869235 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -1455,17 +1455,28 @@ OSC::master_set_trim (float dB)
}
int
-OSC::master_set_pan_stereo_position (float position)
+OSC::master_set_pan_stereo_position (float position, lo_message msg)
{
if (!session) return -1;
+ float endposition = .5;
boost::shared_ptr<Stripable> s = session->master_out();
if (s) {
if (s->pan_azimuth_control()) {
s->pan_azimuth_control()->set_value (position, PBD::Controllable::NoGroup);
+ endposition = s->pan_azimuth_control()->get_value ();
}
}
+ OSCSurface *sur = get_surface(lo_message_get_source (msg));
+
+ if (sur->feedback[4]) {
+ lo_message reply = lo_message_new ();
+ lo_message_add_float (reply, endposition);
+
+ lo_send_message (lo_message_get_source (msg), "/master/pan_stereo_position", reply);
+ lo_message_free (reply);
+ }
return 0;
}
diff --git a/libs/surfaces/osc/osc.h b/libs/surfaces/osc/osc.h
index e337fbb669..4d277fb822 100644
--- a/libs/surfaces/osc/osc.h
+++ b/libs/surfaces/osc/osc.h
@@ -306,7 +306,6 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
PATH_CALLBACK1(master_set_gain,f,);
PATH_CALLBACK1(master_set_fader,i,);
PATH_CALLBACK1(master_set_trim,f,);
- PATH_CALLBACK1(master_set_pan_stereo_position,f,);
PATH_CALLBACK1(master_set_mute,i,);
PATH_CALLBACK1(monitor_set_gain,f,);
PATH_CALLBACK1(monitor_set_fader,i,);
@@ -323,6 +322,9 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
return 0; \
}
+ // pan position needs message info to send feedback
+ PATH_CALLBACK1_MSG(master_set_pan_stereo_position,f);
+
PATH_CALLBACK1_MSG(set_surface_bank_size,i);
PATH_CALLBACK1_MSG(set_surface_strip_types,i);
PATH_CALLBACK1_MSG(set_surface_feedback,i);
@@ -451,7 +453,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
int master_set_gain (float dB);
int master_set_fader (uint32_t position);
int master_set_trim (float dB);
- int master_set_pan_stereo_position (float position);
+ int master_set_pan_stereo_position (float position, lo_message msg);
int master_set_mute (uint32_t state);
int monitor_set_gain (float dB);
int monitor_set_fader (uint32_t position);