mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
NOOP, whitespace
This commit is contained in:
parent
410cf8e79d
commit
9f842f3247
1 changed files with 202 additions and 203 deletions
|
|
@ -352,7 +352,7 @@ OSC::register_callbacks()
|
|||
REGISTER_CALLBACK (serv, "/ardour/transport_play", "", transport_play);
|
||||
REGISTER_CALLBACK (serv, "/ardour/transport_frame", "", transport_frame);
|
||||
REGISTER_CALLBACK (serv, "/ardour/set_transport_speed", "f", set_transport_speed);
|
||||
REGISTER_CALLBACK (serv, "/ardour/locate", "ii", locate);
|
||||
REGISTER_CALLBACK (serv, "/ardour/locate", "ii", locate);
|
||||
REGISTER_CALLBACK (serv, "/ardour/save_state", "", save_state);
|
||||
REGISTER_CALLBACK (serv, "/ardour/prev_marker", "", prev_marker);
|
||||
REGISTER_CALLBACK (serv, "/ardour/next_marker", "", next_marker);
|
||||
|
|
@ -762,7 +762,7 @@ OSC::routes_list (lo_message msg)
|
|||
lo_message_add_int32 (reply, r->remote_control_id());
|
||||
|
||||
if (boost::dynamic_pointer_cast<AudioTrack>(r)
|
||||
|| boost::dynamic_pointer_cast<MidiTrack>(r)) {
|
||||
|| boost::dynamic_pointer_cast<MidiTrack>(r)) {
|
||||
|
||||
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(r);
|
||||
lo_message_add_int32 (reply, t->record_enabled());
|
||||
|
|
@ -791,14 +791,14 @@ OSC::routes_list (lo_message msg)
|
|||
void
|
||||
OSC::transport_frame (lo_message msg)
|
||||
{
|
||||
framepos_t pos = session->transport_frame ();
|
||||
framepos_t pos = session->transport_frame ();
|
||||
|
||||
lo_message reply = lo_message_new ();
|
||||
lo_message_add_int64 (reply, pos);
|
||||
lo_message reply = lo_message_new ();
|
||||
lo_message_add_int64 (reply, pos);
|
||||
|
||||
lo_send_message (lo_message_get_source (msg), "/ardour/transport_frame", reply);
|
||||
lo_send_message (lo_message_get_source (msg), "/ardour/transport_frame", reply);
|
||||
|
||||
lo_message_free (reply);
|
||||
lo_message_free (reply);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -879,10 +879,10 @@ OSC::route_set_pan_stereo_position (int rid, float pos)
|
|||
boost::shared_ptr<Route> r = session->route_by_remote_id (rid);
|
||||
|
||||
if (r) {
|
||||
boost::shared_ptr<Panner> panner = r->panner();
|
||||
if (panner) {
|
||||
panner->set_position (pos);
|
||||
}
|
||||
boost::shared_ptr<Panner> panner = r->panner();
|
||||
if (panner) {
|
||||
panner->set_position (pos);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -897,10 +897,10 @@ OSC::route_set_pan_stereo_width (int rid, float pos)
|
|||
boost::shared_ptr<Route> r = session->route_by_remote_id (rid);
|
||||
|
||||
if (r) {
|
||||
boost::shared_ptr<Panner> panner = r->panner();
|
||||
if (panner) {
|
||||
panner->set_width (pos);
|
||||
}
|
||||
boost::shared_ptr<Panner> panner = r->panner();
|
||||
if (panner) {
|
||||
panner->set_width (pos);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -910,15 +910,15 @@ OSC::route_set_pan_stereo_width (int rid, float pos)
|
|||
int
|
||||
OSC::route_set_send_gain_abs (int rid, int sid, float val)
|
||||
{
|
||||
if (!session) {
|
||||
return -1;
|
||||
}
|
||||
if (!session) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Route> r = session->route_by_remote_id (rid);
|
||||
boost::shared_ptr<Route> r = session->route_by_remote_id (rid);
|
||||
|
||||
if (!r) {
|
||||
return -1;
|
||||
}
|
||||
if (!r) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* revert to zero-based counting */
|
||||
|
||||
|
|
@ -942,15 +942,15 @@ OSC::route_set_send_gain_abs (int rid, int sid, float val)
|
|||
int
|
||||
OSC::route_set_send_gain_dB (int rid, int sid, float val)
|
||||
{
|
||||
if (!session) {
|
||||
return -1;
|
||||
}
|
||||
if (!session) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Route> r = session->route_by_remote_id (rid);
|
||||
boost::shared_ptr<Route> r = session->route_by_remote_id (rid);
|
||||
|
||||
if (!r) {
|
||||
return -1;
|
||||
}
|
||||
if (!r) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* revert to zero-based counting */
|
||||
|
||||
|
|
@ -974,108 +974,107 @@ OSC::route_set_send_gain_dB (int rid, int sid, float val)
|
|||
int
|
||||
OSC::route_plugin_parameter (int rid, int piid, int par, float val)
|
||||
{
|
||||
if (!session) {
|
||||
return -1;
|
||||
}
|
||||
if (!session)
|
||||
return -1;
|
||||
|
||||
boost::shared_ptr<Route> r = session->route_by_remote_id (rid);
|
||||
boost::shared_ptr<Route> r = session->route_by_remote_id (rid)
|
||||
|
||||
if (!r) {
|
||||
PBD::error << "OSC: Invalid Remote Control ID '" << rid << "'" << endmsg;
|
||||
return -1;
|
||||
}
|
||||
if (!r) {
|
||||
PBD::error << "OSC: Invalid Remote Control ID '" << rid << "'" << endmsg;
|
||||
return -1;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Processor> redi=r->nth_plugin (piid);
|
||||
boost::shared_ptr<Processor> redi=r->nth_plugin (piid);
|
||||
|
||||
if (!redi) {
|
||||
if (!redi) {
|
||||
PBD::error << "OSC: cannot find plugin # " << piid << " for RID '" << rid << "'" << endmsg;
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
boost::shared_ptr<PluginInsert> pi;
|
||||
boost::shared_ptr<PluginInsert> pi;
|
||||
|
||||
if (!(pi = boost::dynamic_pointer_cast<PluginInsert>(redi))) {
|
||||
if (!(pi = boost::dynamic_pointer_cast<PluginInsert>(redi))) {
|
||||
PBD::error << "OSC: given processor # " << piid << " on RID '" << rid << "' is not a Plugin." << endmsg;
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
boost::shared_ptr<ARDOUR::Plugin> pip = pi->plugin();
|
||||
bool ok=false;
|
||||
boost::shared_ptr<ARDOUR::Plugin> pip = pi->plugin();
|
||||
bool ok=false;
|
||||
|
||||
uint32_t controlid = pip->nth_parameter (par,ok);
|
||||
uint32_t controlid = pip->nth_parameter (par,ok);
|
||||
|
||||
if (!ok) {
|
||||
if (!ok) {
|
||||
PBD::error << "OSC: Cannot find parameter # " << par << " for plugin # " << piid << " on RID '" << rid << "'" << endmsg;
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!pip->parameter_is_input(par)) {
|
||||
PBD::error << "OSC: Parameter # " << par << " for plugin # " << piid << " on RID '" << rid << "' is not a control input" << endmsg;
|
||||
return -1;
|
||||
}
|
||||
|
||||
ParameterDescriptor pd;
|
||||
pi->plugin()->get_parameter_descriptor (controlid,pd);
|
||||
ParameterDescriptor pd;
|
||||
pi->plugin()->get_parameter_descriptor (controlid,pd);
|
||||
|
||||
if (val >= pd.lower && val < pd.upper) {
|
||||
if (val >= pd.lower && val < pd.upper) {
|
||||
|
||||
boost::shared_ptr<AutomationControl> c = pi->automation_control (Evoral::Parameter(PluginAutomation, 0, controlid));
|
||||
// cerr << "parameter:" << redi->describe_parameter(controlid) << " val:" << val << "\n";
|
||||
c->set_value (val);
|
||||
} else {
|
||||
boost::shared_ptr<AutomationControl> c = pi->automation_control (Evoral::Parameter(PluginAutomation, 0, controlid));
|
||||
// cerr << "parameter:" << redi->describe_parameter(controlid) << " val:" << val << "\n";
|
||||
c->set_value (val);
|
||||
} else {
|
||||
PBD::warning << "OSC: Parameter # " << par << " for plugin # " << piid << " on RID '" << rid << "' is out of range" << endmsg;
|
||||
PBD::info << "OSC: Valid range min=" << pd.lower << " max=" << pd.upper << endmsg;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
OSC::route_plugin_parameter_print (int rid, int piid, int par)
|
||||
{
|
||||
if (!session) {
|
||||
return -1;
|
||||
}
|
||||
if (!session) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Route> r = session->route_by_remote_id (rid);
|
||||
boost::shared_ptr<Route> r = session->route_by_remote_id (rid);
|
||||
|
||||
if (!r) {
|
||||
return -1;
|
||||
}
|
||||
if (!r) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Processor> redi=r->nth_processor (piid);
|
||||
boost::shared_ptr<Processor> redi=r->nth_processor (piid);
|
||||
|
||||
if (!redi) {
|
||||
return -1;
|
||||
}
|
||||
if (!redi) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
boost::shared_ptr<PluginInsert> pi;
|
||||
boost::shared_ptr<PluginInsert> pi;
|
||||
|
||||
if (!(pi = boost::dynamic_pointer_cast<PluginInsert>(redi))) {
|
||||
return -1;
|
||||
}
|
||||
if (!(pi = boost::dynamic_pointer_cast<PluginInsert>(redi))) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
boost::shared_ptr<ARDOUR::Plugin> pip = pi->plugin();
|
||||
bool ok=false;
|
||||
boost::shared_ptr<ARDOUR::Plugin> pip = pi->plugin();
|
||||
bool ok=false;
|
||||
|
||||
uint32_t controlid = pip->nth_parameter (par,ok);
|
||||
uint32_t controlid = pip->nth_parameter (par,ok);
|
||||
|
||||
if (!ok) {
|
||||
return -1;
|
||||
}
|
||||
if (!ok) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
ParameterDescriptor pd;
|
||||
ParameterDescriptor pd;
|
||||
|
||||
if (pi->plugin()->get_parameter_descriptor (controlid, pd) == 0) {
|
||||
boost::shared_ptr<AutomationControl> c = pi->automation_control (Evoral::Parameter(PluginAutomation, 0, controlid));
|
||||
if (pi->plugin()->get_parameter_descriptor (controlid, pd) == 0) {
|
||||
boost::shared_ptr<AutomationControl> c = pi->automation_control (Evoral::Parameter(PluginAutomation, 0, controlid));
|
||||
|
||||
cerr << "parameter: " << redi->describe_parameter(controlid) << "\n";
|
||||
cerr << "current value: " << c->get_value ();
|
||||
cerr << "lower value: " << pd.lower << "\n";
|
||||
cerr << "upper value: " << pd.upper << "\n";
|
||||
}
|
||||
cerr << "parameter: " << redi->describe_parameter(controlid) << "\n";
|
||||
cerr << "current value: " << c->get_value ();
|
||||
cerr << "lower value: " << pd.lower << "\n";
|
||||
cerr << "upper value: " << pd.upper << "\n";
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
XMLNode&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue