Keep shuttle ctrl in sync with actual speed
When using "VS" the numeric control shows the "default speed" when not rolling. Then when starting to roll default speed will be the actual speed. Previously the shuttle was not updated when `last_speed_displayed` was the current speed. This dated back to before "VS" showed default speed.
This commit is contained in:
parent
0f21d26f2c
commit
417f3647cc
@ -155,6 +155,7 @@ ShuttleControl::ShuttleControl ()
|
||||
shine_pattern = 0;
|
||||
last_shuttle_request = 0;
|
||||
last_speed_displayed = -99999999;
|
||||
last_shuttle_fract = -99999999;
|
||||
shuttle_grabbed = false;
|
||||
shuttle_speed_on_grab = 0;
|
||||
shuttle_fract = 0.0;
|
||||
@ -318,13 +319,6 @@ ShuttleControl::map_transport_state ()
|
||||
speed = _session->actual_speed ();
|
||||
}
|
||||
|
||||
if ((fabsf (speed - last_speed_displayed) < 0.005f) // dead-zone
|
||||
&& !(speed == 1.f && last_speed_displayed != 1.f)
|
||||
&& !(speed == 0.f && last_speed_displayed != 0.f)) {
|
||||
return; // nothing to see here, move along.
|
||||
}
|
||||
|
||||
// Q: is there a good reason why we re-calculate this every time?
|
||||
if (fabs (speed) <= (2 * DBL_EPSILON)) {
|
||||
shuttle_fract = 0;
|
||||
} else {
|
||||
@ -335,6 +329,11 @@ ShuttleControl::map_transport_state ()
|
||||
}
|
||||
}
|
||||
|
||||
if ((fabsf (shuttle_fract - last_shuttle_fract) < 0.005f)) {
|
||||
/* dead-zone */
|
||||
return;
|
||||
}
|
||||
|
||||
queue_draw ();
|
||||
}
|
||||
|
||||
@ -725,6 +724,7 @@ ShuttleControl::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangl
|
||||
}
|
||||
|
||||
last_speed_displayed = actual_speed;
|
||||
last_shuttle_fract = shuttle_fract;
|
||||
|
||||
_info_button.set_text (buf);
|
||||
|
||||
@ -765,6 +765,7 @@ ShuttleControl::parameter_changed (std::string p)
|
||||
} else if (p == "shuttle-max-speed") {
|
||||
shuttle_max_speed = Config->get_shuttle_max_speed ();
|
||||
last_speed_displayed = -99999999;
|
||||
last_shuttle_fract = -99999999;
|
||||
map_transport_state ();
|
||||
use_shuttle_fract (true);
|
||||
delete shuttle_context_menu;
|
||||
|
@ -111,6 +111,7 @@ protected:
|
||||
bool _hovering;
|
||||
float shuttle_max_speed;
|
||||
float last_speed_displayed;
|
||||
float last_shuttle_fract;
|
||||
bool shuttle_grabbed;
|
||||
double shuttle_speed_on_grab;
|
||||
double requested_speed;
|
||||
|
Loading…
Reference in New Issue
Block a user