vpot above metronome button controls click gain; master gain knob now works correctly
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 23 Sep 2016 19:35:31 +0000 (14:35 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 27 Sep 2016 19:59:32 +0000 (14:59 -0500)
libs/surfaces/push2/push2.cc

index ec234be7128b4c7cf92fb756c36804a5a3e41e9d..fb33a916cb03178d61b564ce6bc3561e28082349 100644 (file)
@@ -30,6 +30,7 @@
 #include "timecode/time.h"
 #include "timecode/bbt_time.h"
 
+#include "ardour/amp.h"
 #include "ardour/async_midi_port.h"
 #include "ardour/audioengine.h"
 #include "ardour/debug.h"
@@ -1083,17 +1084,25 @@ Push2::set_state (const XMLNode & node, int version)
 void
 Push2::other_vpot (int n, int delta)
 {
+       boost::shared_ptr<Amp> click_gain;
        switch (n) {
        case 0:
+               /* tempo control */
                break;
        case 1:
+               /* metronome gain control */
+               click_gain = session->click_gain();
+               if (click_gain) {
+                       boost::shared_ptr<AutomationControl> ac = click_gain->gain_control();
+                       ac->set_value (ac->interface_to_internal (ac->internal_to_interface (ac->get_value()) + (delta/128.0)), PBD::Controllable::UseGroup);
+               }
                break;
        case 2:
                /* master gain control */
                if (master) {
                        boost::shared_ptr<AutomationControl> ac = master->gain_control();
                        if (ac) {
-                               ac->set_value (ac->get_value() + ((2.0/64.0) * delta), PBD::Controllable::UseGroup);
+                               ac->set_value (ac->interface_to_internal (ac->internal_to_interface (ac->get_value()) + (delta/128.0)), PBD::Controllable::UseGroup);
                        }
                }
                break;