mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-12 17:46:34 +01:00
copy over (boo!) transport control changes to BasicUI (control surfaces)
This commit is contained in:
parent
6b98e56da2
commit
57b3df8b22
1 changed files with 13 additions and 4 deletions
|
|
@ -192,6 +192,7 @@ BasicUI::button_varispeed (bool fwd)
|
||||||
// (keypress auto-repeat is 100ms)
|
// (keypress auto-repeat is 100ms)
|
||||||
const float maxspeed = Config->get_shuttle_max_speed();
|
const float maxspeed = Config->get_shuttle_max_speed();
|
||||||
float semitone_ratio = exp2f (1.0f/12.0f);
|
float semitone_ratio = exp2f (1.0f/12.0f);
|
||||||
|
const float octave_down = pow (1.0/semitone_ratio, 12.0);
|
||||||
float transport_speed = get_transport_speed ();
|
float transport_speed = get_transport_speed ();
|
||||||
float speed;
|
float speed;
|
||||||
|
|
||||||
|
|
@ -214,7 +215,7 @@ BasicUI::button_varispeed (bool fwd)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (transport_speed == 0.0 || fabs (transport_speed) <= 1.0/semitone_ratio) {
|
if (fabs (transport_speed) <= 0.1) {
|
||||||
|
|
||||||
/* close to zero, maybe flip direction */
|
/* close to zero, maybe flip direction */
|
||||||
|
|
||||||
|
|
@ -240,15 +241,23 @@ BasicUI::button_varispeed (bool fwd)
|
||||||
if (fwd) {
|
if (fwd) {
|
||||||
if (transport_speed < 0.f) {
|
if (transport_speed < 0.f) {
|
||||||
/* we need to move the speed back towards zero */
|
/* we need to move the speed back towards zero */
|
||||||
|
if (fabs (transport_speed) < octave_down) {
|
||||||
|
semitone_ratio = pow (1.0/semitone_ratio, 4.0);
|
||||||
|
} else {
|
||||||
semitone_ratio = 1.0/semitone_ratio;
|
semitone_ratio = 1.0/semitone_ratio;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (transport_speed > 0.f) {
|
if (transport_speed > 0.f) {
|
||||||
/* we need to move the speed back towards zero */
|
/* we need to move the speed back towards zero */
|
||||||
|
|
||||||
|
if (transport_speed < octave_down) {
|
||||||
|
semitone_ratio = pow (1.0/semitone_ratio, 4.0);
|
||||||
|
} else {
|
||||||
semitone_ratio = 1.0/semitone_ratio;
|
semitone_ratio = 1.0/semitone_ratio;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
speed = semitone_ratio * transport_speed;
|
speed = semitone_ratio * transport_speed;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue