13
0

expose TransportFSM default_speed

This commit is contained in:
Paul Davis 2021-05-04 18:53:57 -06:00
parent 9905f6e0a9
commit 4f13ec69c1
2 changed files with 7 additions and 6 deletions

View File

@ -148,6 +148,7 @@ struct TransportFSM
std::string current_state () const;
double transport_speed() const { return _transport_speed; }
double default_speed() const { return _default_speed; }
private:
MotionState _motion_state;
@ -208,7 +209,7 @@ struct TransportFSM
int processing;
mutable boost::optional<bool> current_roll_after_locate_status;
mutable double most_recently_requested_speed;
mutable double default_speed;
mutable double _default_speed;
void defer (Event& ev);
void bad_transition (Event const &);

View File

@ -87,7 +87,7 @@ TransportFSM::TransportFSM (TransportAPI& tapi)
, api (&tapi)
, processing (0)
, most_recently_requested_speed (std::numeric_limits<double>::max())
, default_speed (1.0)
, _default_speed (1.0)
{
init ();
}
@ -507,8 +507,8 @@ TransportFSM::stop_playback (Event const & s)
*/
if (most_recently_requested_speed != default_speed) {
set_speed (Event (default_speed, false));
if (most_recently_requested_speed != _default_speed) {
set_speed (Event (_default_speed, false));
}
}
@ -599,7 +599,7 @@ TransportFSM::start_locate_after_declick ()
double post_locate_speed;
if (api->user_roll_after_locate()) {
post_locate_speed = default_speed;
post_locate_speed = _default_speed;
} else {
post_locate_speed = most_recently_requested_speed;
}
@ -788,7 +788,7 @@ TransportFSM::set_speed (Event const & ev)
most_recently_requested_speed = ev.speed;
if (ev.as_default) {
default_speed = ev.speed;
_default_speed = ev.speed;
}
if (must_reverse) {