mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-30 08:53:08 +01:00
push2: volume pots now work like non-linear faders, as desired
This commit is contained in:
parent
6f2ac5d6ad
commit
87ab1625ff
2 changed files with 11 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue