13
0

OSC: Constrain master pan position as width requires.

This commit is contained in:
Len Ovens 2016-06-10 13:45:07 -07:00
parent b588308bed
commit 1695de335d
2 changed files with 16 additions and 3 deletions

View File

@ -1455,17 +1455,28 @@ OSC::master_set_trim (float dB)
} }
int int
OSC::master_set_pan_stereo_position (float position) OSC::master_set_pan_stereo_position (float position, lo_message msg)
{ {
if (!session) return -1; if (!session) return -1;
float endposition = .5;
boost::shared_ptr<Stripable> s = session->master_out(); boost::shared_ptr<Stripable> s = session->master_out();
if (s) { if (s) {
if (s->pan_azimuth_control()) { if (s->pan_azimuth_control()) {
s->pan_azimuth_control()->set_value (position, PBD::Controllable::NoGroup); 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; return 0;
} }

View File

@ -306,7 +306,6 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
PATH_CALLBACK1(master_set_gain,f,); PATH_CALLBACK1(master_set_gain,f,);
PATH_CALLBACK1(master_set_fader,i,); PATH_CALLBACK1(master_set_fader,i,);
PATH_CALLBACK1(master_set_trim,f,); PATH_CALLBACK1(master_set_trim,f,);
PATH_CALLBACK1(master_set_pan_stereo_position,f,);
PATH_CALLBACK1(master_set_mute,i,); PATH_CALLBACK1(master_set_mute,i,);
PATH_CALLBACK1(monitor_set_gain,f,); PATH_CALLBACK1(monitor_set_gain,f,);
PATH_CALLBACK1(monitor_set_fader,i,); PATH_CALLBACK1(monitor_set_fader,i,);
@ -323,6 +322,9 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
return 0; \ 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_bank_size,i);
PATH_CALLBACK1_MSG(set_surface_strip_types,i); PATH_CALLBACK1_MSG(set_surface_strip_types,i);
PATH_CALLBACK1_MSG(set_surface_feedback,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_gain (float dB);
int master_set_fader (uint32_t position); int master_set_fader (uint32_t position);
int master_set_trim (float dB); 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 master_set_mute (uint32_t state);
int monitor_set_gain (float dB); int monitor_set_gain (float dB);
int monitor_set_fader (uint32_t position); int monitor_set_fader (uint32_t position);