diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-01-17 14:48:17 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-01-17 14:48:17 +0000 |
commit | 5adcb61f6059bb5554ee6da7a7dba6c65b6100f0 (patch) | |
tree | 6cf248d039a0bd6639238ceb046fe6e869ef1c36 /gtk2_ardour/shuttle_control.cc | |
parent | 4ecb07aaee57e72aedb744f0cce885f418320e70 (diff) |
a few small fixes that help pitchbend control of things, notably the shuttle controller. but note that basically, teh shuttle controller is completely and hopelessly broken through excess complexity and incorrect design
git-svn-id: svn://localhost/ardour2/branches/3.0@13870 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/shuttle_control.cc')
-rw-r--r-- | gtk2_ardour/shuttle_control.cc | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/gtk2_ardour/shuttle_control.cc b/gtk2_ardour/shuttle_control.cc index b4095f7c0c..7096cd31bb 100644 --- a/gtk2_ardour/shuttle_control.cc +++ b/gtk2_ardour/shuttle_control.cc @@ -427,10 +427,10 @@ ShuttleControl::mouse_shuttle (double x, bool force) } void -ShuttleControl::set_shuttle_fract (double f) +ShuttleControl::set_shuttle_fract (double f, bool zero_ok) { shuttle_fract = f; - use_shuttle_fract (false); + use_shuttle_fract (false, zero_ok); } int @@ -472,7 +472,7 @@ ShuttleControl::fract_as_semitones (float fract, bool& reverse) } void -ShuttleControl::use_shuttle_fract (bool force) +ShuttleControl::use_shuttle_fract (bool force, bool zero_ok) { microseconds_t now = get_microseconds(); @@ -503,7 +503,11 @@ ShuttleControl::use_shuttle_fract (bool force) speed = shuttle_max_speed * shuttle_fract; } - _session->request_transport_speed_nonzero (speed, Config->get_shuttle_behaviour() == Wheel); + if (zero_ok) { + _session->request_transport_speed (speed, Config->get_shuttle_behaviour() == Wheel); + } else { + _session->request_transport_speed_nonzero (speed, Config->get_shuttle_behaviour() == Wheel); + } } void @@ -657,25 +661,13 @@ ShuttleControl::ShuttleControllable::ShuttleControllable (ShuttleControl& s) void ShuttleControl::ShuttleControllable::set_value (double val) { - double fract; - - if (val == 0.5) { - fract = 0.0; - } else { - if (val < 0.5) { - fract = -((0.5 - val)/0.5); - } else { - fract = ((val - 0.5)/0.5); - } - } - - sc.set_shuttle_fract (fract); + sc.set_shuttle_fract ((val - lower()) / (upper() - lower()), true); } double ShuttleControl::ShuttleControllable::get_value () const { - return sc.get_shuttle_fract (); + return lower() + (sc.get_shuttle_fract () * (upper() - lower())); } void |