OSC: added a linear VCA style gain control for faders that are 0 to 1 linear.
authorLen Ovens <len@ovenwerks.net>
Sat, 26 Mar 2016 18:38:19 +0000 (11:38 -0700)
committerLen Ovens <len@ovenwerks.net>
Sat, 26 Mar 2016 18:38:19 +0000 (11:38 -0700)
path = /ardour/routes/gainVCA if RID position

libs/surfaces/osc/osc.cc
libs/surfaces/osc/osc.h

index 3e880979edf5038d9c317b59db96a176835f0d00..37c0cd77271b746f8b1da4b064a8d11be77f705c 100644 (file)
@@ -477,6 +477,7 @@ OSC::register_callbacks()
                REGISTER_CALLBACK (serv, "/ardour/routes/recenable", "ii", route_recenable);
                REGISTER_CALLBACK (serv, "/ardour/routes/gainabs", "if", route_set_gain_abs);
                REGISTER_CALLBACK (serv, "/ardour/routes/gaindB", "if", route_set_gain_dB);
+               REGISTER_CALLBACK (serv, "/ardour/routes/gainVCA", "if", route_set_gain_VCA);
                REGISTER_CALLBACK (serv, "/ardour/routes/trimabs", "if", route_set_trim_abs);
                REGISTER_CALLBACK (serv, "/ardour/routes/trimdB", "if", route_set_trim_dB);
                REGISTER_CALLBACK (serv, "/ardour/routes/pan_stereo_position", "if", route_set_pan_stereo_position);
@@ -1110,6 +1111,12 @@ OSC::route_set_gain_dB (int rid, float dB)
        return route_set_gain_abs (rid, dB_to_coefficient (dB));
 }
 
+int
+OSC::route_set_gain_VCA (int rid, float pos)
+{
+       return route_set_gain_abs (rid, slider_position_to_gain_with_max (pos, 2.0));
+}
+
 
 int
 OSC::route_set_trim_abs (int rid, float level)
index a3b83e03658c8aae5be79c66d33f1ba7b1f1a5e1..efad21ba7cd13c763bf1fb533f373653a78fc915 100644 (file)
@@ -290,6 +290,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
        PATH_CALLBACK2(route_recenable,i,i);
        PATH_CALLBACK2(route_set_gain_abs,i,f);
        PATH_CALLBACK2(route_set_gain_dB,i,f);
+       PATH_CALLBACK2(route_set_gain_VCA,i,f);
        PATH_CALLBACK2(route_set_trim_abs,i,f);
        PATH_CALLBACK2(route_set_trim_dB,i,f);
        PATH_CALLBACK2(route_set_pan_stereo_position,i,f);
@@ -304,6 +305,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
        int route_recenable (int rid, int yn);
        int route_set_gain_abs (int rid, float level);
        int route_set_gain_dB (int rid, float dB);
+       int route_set_gain_VCA (int rid, float pos);
        int route_set_trim_abs (int rid, float level);
        int route_set_trim_dB (int rid, float dB);
        int route_set_pan_stereo_position (int rid, float left_right_fraction);