mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 00:34:59 +01:00
OSC: add phase control
This commit is contained in:
parent
4905422a47
commit
37aed5715b
3 changed files with 46 additions and 1 deletions
|
|
@ -46,6 +46,7 @@
|
|||
#include "ardour/plugin_insert.h"
|
||||
#include "ardour/presentation_info.h"
|
||||
#include "ardour/send.h"
|
||||
#include "ardour/phase_control.h"
|
||||
|
||||
#include "osc_select_observer.h"
|
||||
#include "osc.h"
|
||||
|
|
@ -526,6 +527,8 @@ OSC::register_callbacks()
|
|||
REGISTER_CALLBACK (serv, "/select/pan_stereo_position", "f", sel_pan_position);
|
||||
REGISTER_CALLBACK (serv, "/select/pan_stereo_width", "f", sel_pan_width);
|
||||
|
||||
REGISTER_CALLBACK (serv, "/select/phase", "i", sel_phase);
|
||||
|
||||
/* 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);
|
||||
|
|
@ -535,6 +538,7 @@ OSC::register_callbacks()
|
|||
REGISTER_CALLBACK (serv, "/strip/monitor_disk", "ii", route_monitor_disk);
|
||||
REGISTER_CALLBACK (serv, "/strip/select", "ii", strip_select);
|
||||
REGISTER_CALLBACK (serv, "/strip/gui_select", "ii", strip_gui_select);
|
||||
REGISTER_CALLBACK (serv, "/strip/phase", "ii", strip_phase);
|
||||
REGISTER_CALLBACK (serv, "/strip/gain", "if", route_set_gain_dB);
|
||||
REGISTER_CALLBACK (serv, "/strip/fader", "if", route_set_gain_fader);
|
||||
REGISTER_CALLBACK (serv, "/strip/trimabs", "if", route_set_trim_abs);
|
||||
|
|
@ -1677,6 +1681,33 @@ OSC::sel_monitor_disk (uint32_t yn, lo_message msg)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
OSC::strip_phase (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) {
|
||||
s->phase_control()->set_value (yn ? 1.0 : 0.0, PBD::Controllable::NoGroup);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
OSC::sel_phase (uint32_t yn, lo_message msg)
|
||||
{
|
||||
OSCSurface *sur = get_surface(lo_message_get_source (msg));
|
||||
if (sur->surface_sel) {
|
||||
return strip_phase(sur->surface_sel, yn, msg);
|
||||
} else {
|
||||
return route_send_fail ("phase", 0, 0, lo_message_get_source (msg));
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
OSC::strip_select (int ssid, int yn, lo_message msg)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -333,6 +333,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
|
|||
PATH_CALLBACK1_MSG(sel_solo,i);
|
||||
PATH_CALLBACK1_MSG(sel_monitor_input,i);
|
||||
PATH_CALLBACK1_MSG(sel_monitor_disk,i);
|
||||
PATH_CALLBACK1_MSG(sel_phase,i);
|
||||
PATH_CALLBACK1_MSG(sel_gain,f);
|
||||
PATH_CALLBACK1_MSG(sel_fader,f);
|
||||
PATH_CALLBACK1_MSG(sel_trim,f);
|
||||
|
|
@ -396,6 +397,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
|
|||
PATH_CALLBACK2_MSG(route_recsafe,i,i);
|
||||
PATH_CALLBACK2_MSG(route_monitor_input,i,i);
|
||||
PATH_CALLBACK2_MSG(route_monitor_disk,i,i);
|
||||
PATH_CALLBACK2_MSG(strip_phase,i,i);
|
||||
PATH_CALLBACK2_MSG(strip_select,i,i);
|
||||
PATH_CALLBACK2_MSG(strip_gui_select,i,i);
|
||||
PATH_CALLBACK2_MSG(route_set_gain_abs,i,f);
|
||||
|
|
@ -417,6 +419,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
|
|||
int route_recsafe (int ssid, int yn, lo_message msg);
|
||||
int route_monitor_input (int rid, int yn, lo_message msg);
|
||||
int route_monitor_disk (int rid, int yn, lo_message msg);
|
||||
int strip_phase (int rid, int yn, lo_message msg);
|
||||
int strip_select (int rid, int yn, lo_message msg);
|
||||
int _strip_select (int rid, lo_address addr);
|
||||
int strip_gui_select (int rid, int yn, lo_message msg);
|
||||
|
|
@ -456,6 +459,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
|
|||
int sel_solo (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);
|
||||
int sel_gain (float state, lo_message msg);
|
||||
int sel_fader (float state, lo_message msg);
|
||||
int sel_trim (float val, lo_message msg);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#include "ardour/monitor_control.h"
|
||||
#include "ardour/dB.h"
|
||||
#include "ardour/meter.h"
|
||||
#include "ardour/phase_control.h"
|
||||
|
||||
#include "osc.h"
|
||||
#include "osc_select_observer.h"
|
||||
|
|
@ -65,11 +66,19 @@ OSCSelectObserver::OSCSelectObserver (boost::shared_ptr<Stripable> s, lo_address
|
|||
rec_controllable->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::send_change_message, this, X_("/select/recenable"), _strip->rec_enable_control()), OSC::instance());
|
||||
send_change_message ("/select/recenable", _strip->rec_enable_control());
|
||||
}
|
||||
|
||||
boost::shared_ptr<AutomationControl> recsafe_controllable = _strip->rec_safe_control ();
|
||||
if (rec_controllable) {
|
||||
if (recsafe_controllable) {
|
||||
recsafe_controllable->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::send_change_message, this, X_("/select/record_safe"), _strip->rec_safe_control()), OSC::instance());
|
||||
send_change_message ("/select/record_safe", _strip->rec_safe_control());
|
||||
}
|
||||
|
||||
boost::shared_ptr<AutomationControl> phase_controllable = _strip->phase_control ();
|
||||
if (phase_controllable) {
|
||||
phase_controllable->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::send_change_message, this, X_("/select/phase"), _strip->phase_control()), OSC::instance());
|
||||
send_change_message ("/select/phase", _strip->phase_control());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (feedback[1]) { // level controls
|
||||
|
|
@ -125,6 +134,7 @@ OSCSelectObserver::~OSCSelectObserver ()
|
|||
clear_strip ("/select/record_safe", 0);
|
||||
clear_strip ("/select/monitor_input", 0);
|
||||
clear_strip ("/select/monitor_disk", 0);
|
||||
clear_strip ("/select/phase", 0);
|
||||
}
|
||||
if (feedback[1]) { // level controls
|
||||
if (gainmode) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue