summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-12-12 01:03:56 +0000
committerCarl Hetherington <carl@carlh.net>2010-12-12 01:03:56 +0000
commitb0c23c0646d9771ca171197a42094100ed9e6ee4 (patch)
tree719eca3322eb9ff684b4fe9ff6d393a75a1fd18c
parentdd6935e2ade782241cf3d0db8fd4595525125e5e (diff)
Make adjust region gain work in 1dB steps with no upper limit. Should fix or help with #2843.
git-svn-id: svn://localhost/ardour2/branches/3.0@8254 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/editor_ops.cc22
1 files changed, 5 insertions, 17 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 77b2f40bcc..fa096dc42b 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -4517,28 +4517,16 @@ Editor::adjust_region_gain (bool up)
}
arv->region()->clear_changes ();
-
- double fraction = gain_to_slider_position (arv->audio_region()->scale_amplitude ());
+
+ double dB = accurate_coefficient_to_dB (arv->audio_region()->scale_amplitude ());
if (up) {
- fraction += 0.05;
- fraction = min (fraction, 1.0);
+ dB += 1;
} else {
- fraction -= 0.05;
- fraction = max (fraction, 0.0);
- }
-
- if (!up && fraction <= 0) {
- continue;
- }
-
- fraction = slider_position_to_gain (fraction);
-
- if (up && fraction >= 2.0) {
- continue;
+ dB -= 1;
}
- arv->audio_region()->set_scale_amplitude (fraction);
+ arv->audio_region()->set_scale_amplitude (dB_to_coefficient (dB));
_session->add_command (new StatefulDiffCommand (arv->region()));
}