push2: volume pots now work like non-linear faders, as desired
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "ardour/automation_control.h"
|
||||
#include "ardour/dB.h"
|
||||
#include "ardour/utils.h"
|
||||
|
||||
#include "gtkmm2ext/gui_thread.h"
|
||||
#include "gtkmm2ext/rgb_macros.h"
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "ardour/midi_port.h"
|
||||
#include "ardour/session.h"
|
||||
#include "ardour/tempo.h"
|
||||
#include "ardour/utils.h"
|
||||
#include "ardour/vca_manager.h"
|
||||
|
||||
#include "canvas/colors.h"
|
||||
@@ -399,7 +400,15 @@ MixLayout::strip_vpot (int n, int delta)
|
||||
boost::shared_ptr<Controllable> ac = knobs[n]->controllable();
|
||||
|
||||
if (ac) {
|
||||
ac->set_value (ac->get_value() + ((2.0/64.0) * delta), PBD::Controllable::UseGroup);
|
||||
if (ac->is_gain_like()) {
|
||||
/* 128 steps from fader position 0 to 1.0 ..
|
||||
*/
|
||||
const double new_fader_position = min (1.0, max (0.0, ac->internal_to_interface (ac->get_value()) + ((1.0 / 128.0) * delta)));
|
||||
ac->set_value (ac->interface_to_internal (new_fader_position), PBD::Controllable::UseGroup);
|
||||
} else {
|
||||
/* 128 steps from min to max */
|
||||
ac->set_value (ac->get_value() + (((ac->upper() - ac->lower()) / 128.0) * delta) , PBD::Controllable::UseGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user