summaryrefslogtreecommitdiff
path: root/libs/surfaces/osc/osc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/surfaces/osc/osc.cc')
-rw-r--r--libs/surfaces/osc/osc.cc66
1 files changed, 64 insertions, 2 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index 357b82d4d2..ef07ca17fb 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -356,8 +356,8 @@ OSC::register_callbacks()
REGISTER_CALLBACK (serv, "/ardour/routes/pan_stereo_width", "if", route_set_pan_stereo_width);
REGISTER_CALLBACK (serv, "/ardour/routes/plugin/parameter", "iiif", route_plugin_parameter);
REGISTER_CALLBACK (serv, "/ardour/routes/plugin/parameter/print", "iii", route_plugin_parameter_print);
-
-
+ REGISTER_CALLBACK (serv, "/ardour/routes/send/gainabs", "iif", route_set_send_gain_abs);
+ REGISTER_CALLBACK (serv, "/ardour/routes/send/gaindB", "iif", route_set_send_gain_dB);
/* still not-really-standardized query interface */
//REGISTER_CALLBACK (serv, "/ardour/*/#current_value", "", current_value);
@@ -892,6 +892,68 @@ 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;
+ }
+
+ boost::shared_ptr<Route> r = session->route_by_remote_id (rid);
+
+ if (!r) {
+ return -1;
+ }
+
+ /* revert to zero-based counting */
+
+ if (sid > 0) {
+ --sid;
+ }
+
+ boost::shared_ptr<Processor> p = r->nth_send (send);
+
+ if (p) {
+ boost::shared_ptr<Send> s = boost::dynamic_pointer_cast<Send>(p);
+ boost::shared_ptr<Amp> a = s->amp();
+
+ if (a) {
+ a->set_gain (val, this);
+ }
+ }
+}
+
+int
+OSC::route_set_send_gain_dB (int rid, int sid, float val)
+{
+ if (!session) {
+ return -1;
+ }
+
+ boost::shared_ptr<Route> r = session->route_by_remote_id (rid);
+
+ if (!r) {
+ return -1;
+ }
+
+ /* revert to zero-based counting */
+
+ if (sid > 0) {
+ --sid;
+ }
+
+ boost::shared_ptr<Processor> p = r->nth_send (send);
+
+ if (p) {
+ boost::shared_ptr<Send> s = boost::dynamic_pointer_cast<Send>(p);
+ boost::shared_ptr<Amp> a = s->amp();
+
+ if (a) {
+ a->set_gain (dB_to_coefficient (val), this);
+ }
+ }
+}
+
+int
OSC::route_plugin_parameter (int rid, int piid, int par, float val)
{
if (!session) {