summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2019-07-10 23:32:14 -0600
committerPaul Davis <paul@linuxaudiosystems.com>2019-09-17 17:19:15 -0600
commitb84c99639f0dd28e210ed9c064429c17014093a7 (patch)
treea4b6c50dc9d4859b7e53e100533a67ed6c859a04
parentea30642ae3eac3706dbef1f70f8d13e8ebfec51d (diff)
parametize the maximum transport speed.
No GUI to adjust this at this, nor is any planned. This just makes it easier if we ever feel we can change this.
-rw-r--r--gtk2_ardour/shuttle_control.cc6
-rw-r--r--libs/ardour/ardour/rc_configuration_vars.h1
-rw-r--r--libs/ardour/session_transport.cc4
3 files changed, 7 insertions, 4 deletions
diff --git a/gtk2_ardour/shuttle_control.cc b/gtk2_ardour/shuttle_control.cc
index 38bbfad73a..caf0d8cf73 100644
--- a/gtk2_ardour/shuttle_control.cc
+++ b/gtk2_ardour/shuttle_control.cc
@@ -77,7 +77,7 @@ ShuttleControl::ShuttleControl ()
shuttle_grabbed = false;
shuttle_speed_on_grab = 0;
shuttle_fract = 0.0;
- shuttle_max_speed = 8.0f;
+ shuttle_max_speed = Config->get_max_transport_speed();
shuttle_context_menu = 0;
_hovering = false;
@@ -89,7 +89,7 @@ ShuttleControl::ShuttleControl ()
shuttle_max_speed = Config->get_shuttle_max_speed();
- if (shuttle_max_speed >= 8.f) { shuttle_max_speed = 8.0f; }
+ if (shuttle_max_speed >= Config->get_max_transport_speed()) { shuttle_max_speed = Config->get_max_transport_speed(); }
else if (shuttle_max_speed >= 6.f) { shuttle_max_speed = 6.0f; }
else if (shuttle_max_speed >= 4.f) { shuttle_max_speed = 4.0f; }
else if (shuttle_max_speed >= 3.f) { shuttle_max_speed = 3.0f; }
@@ -225,6 +225,8 @@ ShuttleControl::build_shuttle_context_menu ()
RadioMenuItem::Group speed_group;
+ /* XXX this code assumes that Config->get_max_transport_speed() returns 8 */
+
speed_items.push_back (RadioMenuElem (speed_group, "8", sigc::bind (sigc::mem_fun (*this, &ShuttleControl::set_shuttle_max_speed), 8.0f)));
if (shuttle_max_speed == 8.0) {
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h
index 32c0a748be..a7a48811c9 100644
--- a/libs/ardour/ardour/rc_configuration_vars.h
+++ b/libs/ardour/ardour/rc_configuration_vars.h
@@ -101,6 +101,7 @@ CONFIG_VARIABLE (float, midi_track_buffer_seconds, "midi-track-buffer-seconds",
CONFIG_VARIABLE (uint32_t, disk_choice_space_threshold, "disk-choice-space-threshold", 57600000)
CONFIG_VARIABLE (bool, auto_analyse_audio, "auto-analyse-audio", false)
CONFIG_VARIABLE (float, transient_sensitivity, "transient-sensitivity", 50)
+CONFIG_VARIABLE (float, max_transport_speed, "max-transport-speed", 8.0)
/* OSC */
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index de87fea4eb..40a0b7e358 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -412,9 +412,9 @@ Session::set_transport_speed (double speed, samplepos_t destination_sample, bool
*/
if (speed > 0) {
- speed = min (8.0, speed);
+ speed = min ((double) Config->get_max_transport_speed(), speed);
} else if (speed < 0) {
- speed = max (-8.0, speed);
+ speed = max ((double) -Config->get_max_transport_speed(), speed);
}
double new_engine_speed = 1.0;