diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-09-23 14:35:31 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-09-27 14:59:32 -0500 |
commit | 7594e7644ab2c3f7b697d518c5747d542b9edbdf (patch) | |
tree | 0d0b4afce7e7850dfbf87ea20cfbdbe0a0854f2e /libs/surfaces/push2/push2.cc | |
parent | 0f39f27375f4be4d96af55320df141d6a04da669 (diff) |
vpot above metronome button controls click gain; master gain knob now works correctly
Diffstat (limited to 'libs/surfaces/push2/push2.cc')
-rw-r--r-- | libs/surfaces/push2/push2.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libs/surfaces/push2/push2.cc b/libs/surfaces/push2/push2.cc index ec234be712..fb33a916cb 100644 --- a/libs/surfaces/push2/push2.cc +++ b/libs/surfaces/push2/push2.cc @@ -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; |