mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
fix range on SiP cut control; simplify a couple of other things
git-svn-id: svn://localhost/ardour2/branches/3.0@9751 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
b272332933
commit
4a81c71e97
1 changed files with 5 additions and 7 deletions
|
|
@ -49,13 +49,7 @@ VolumeController::VolumeController (Glib::RefPtr<Gdk::Pixbuf> p,
|
||||||
, _linear (linear)
|
, _linear (linear)
|
||||||
{
|
{
|
||||||
set_print_func (VolumeController::_dB_printer, this);
|
set_print_func (VolumeController::_dB_printer, this);
|
||||||
|
value->set_width_chars (8);
|
||||||
if (step < 1.0) {
|
|
||||||
value->set_width_chars (6 + abs ((int) ceil (log10 (step))));
|
|
||||||
} else {
|
|
||||||
value->set_width_chars (5); // -NNdB
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -152,8 +146,12 @@ VolumeController::adjust (double control_delta)
|
||||||
v = gain_to_slider_position_with_max (v, ARDOUR::Config->get_max_gain());
|
v = gain_to_slider_position_with_max (v, ARDOUR::Config->get_max_gain());
|
||||||
/* adjust in this domain */
|
/* adjust in this domain */
|
||||||
v += control_delta;
|
v += control_delta;
|
||||||
|
/* clamp in this domain */
|
||||||
|
v = std::max (0.0, std::min (1.0, v));
|
||||||
/* convert back to gain coefficient domain */
|
/* convert back to gain coefficient domain */
|
||||||
v = slider_position_to_gain_with_max (v, ARDOUR::Config->get_max_gain());
|
v = slider_position_to_gain_with_max (v, ARDOUR::Config->get_max_gain());
|
||||||
|
/* clamp in this domain */
|
||||||
|
v = std::max (_controllable->lower(), std::min (_controllable->upper(), v));
|
||||||
|
|
||||||
/* now round to some precision in the dB domain */
|
/* now round to some precision in the dB domain */
|
||||||
v = accurate_coefficient_to_dB (v);
|
v = accurate_coefficient_to_dB (v);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue