diff --git a/libs/ardour/ardour/transport_fsm.h b/libs/ardour/ardour/transport_fsm.h index 869611a8ab..d6d49fa012 100644 --- a/libs/ardour/ardour/transport_fsm.h +++ b/libs/ardour/ardour/transport_fsm.h @@ -133,6 +133,7 @@ struct TransportFSM void start_playback (); void stop_playback (); void start_locate_after_declick () const; + void locate_for_loop (Event const &); void roll_after_locate () const; void start_locate_while_stopped (Event const &) const; void interrupt_locate (Event const &) const; diff --git a/libs/ardour/transport_fsm.cc b/libs/ardour/transport_fsm.cc index c8b5c65035..f80f6e7a90 100644 --- a/libs/ardour/transport_fsm.cc +++ b/libs/ardour/transport_fsm.cc @@ -260,8 +260,17 @@ TransportFSM::process_event (Event& ev, bool already_deferred, bool& deferred) start_locate_while_stopped (ev); break; case Rolling: - transition (DeclickToLocate); - start_declick_for_locate (ev); + if (ev.with_loop) { + /* 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; case WaitingForLocate: 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); } +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 TransportFSM::start_locate_after_declick () const {