13
0

transportFSM: when locating due to end-of-loop, skip declick and do not transition states

This commit is contained in:
Paul Davis 2019-11-01 13:24:05 -06:00
parent 0041e8b3ae
commit d30f2180bf
2 changed files with 21 additions and 2 deletions

View File

@ -133,6 +133,7 @@ struct TransportFSM
void start_playback (); void start_playback ();
void stop_playback (); void stop_playback ();
void start_locate_after_declick () const; void start_locate_after_declick () const;
void locate_for_loop (Event const &);
void roll_after_locate () const; void roll_after_locate () const;
void start_locate_while_stopped (Event const &) const; void start_locate_while_stopped (Event const &) const;
void interrupt_locate (Event const &) const; void interrupt_locate (Event const &) const;

View File

@ -260,8 +260,17 @@ TransportFSM::process_event (Event& ev, bool already_deferred, bool& deferred)
start_locate_while_stopped (ev); start_locate_while_stopped (ev);
break; break;
case Rolling: case Rolling:
transition (DeclickToLocate); if (ev.with_loop) {
start_declick_for_locate (ev); /* no state transitions. Just do a realtime
locate and continue rolling. Note that
ev.with_roll is ignored and assumed to be
true because we're looping.
*/
locate_for_loop (ev);
} else {
transition (DeclickToLocate);
start_declick_for_locate (ev);
}
break; break;
case WaitingForLocate: case WaitingForLocate:
case DeclickToLocate: case DeclickToLocate:
@ -395,6 +404,15 @@ TransportFSM::start_locate_while_stopped (Event const & l) const
api->locate (l.target, current_roll_after_locate_status.get(), l.with_flush, l.with_loop, l.force); api->locate (l.target, current_roll_after_locate_status.get(), l.with_flush, l.with_loop, l.force);
} }
void
TransportFSM::locate_for_loop (Event const & l)
{
assert (l.type == Locate);
DEBUG_TRACE (DEBUG::TFSMEvents, "locate_for_loop\n");
current_roll_after_locate_status = l.with_roll;
api->locate (l.target, l.with_roll, l.with_flush, l.with_loop, l.force);
}
void void
TransportFSM::start_locate_after_declick () const TransportFSM::start_locate_after_declick () const
{ {