summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorMark Knoop <mark@markknoop.com>2020-05-17 16:08:49 +0100
committerPaul Davis <paul@linuxaudiosystems.com>2020-05-17 10:44:33 -0600
commit414ea28e78d3daf360db94697eb4a26f92ed2912 (patch)
tree43f968d1587fdc34e045616ee263a7ad80117ccc /libs/ardour
parent2e7992dd584c4df686525ce4b1760a87f5fba0a2 (diff)
Fix repeated toggling of loop mode
Calling Session::set_play_loop repeatedly (e.g. LLL) should toggle in and out of loop play. Previously transport needed to be stopped before loop play could be started for a second or subsequent time. This uses the loop_changing boolean to flag that Session::non_realtime_stop should not unset the loop. Also, Session::non_realtime_stop must reset loop_changing to false after use so it does not affect the next transport action.
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/session_transport.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index a5e8f3ea7f..92ab447179 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -1483,6 +1483,9 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
}
}
+ /* reset loop_changing so it does not affect next transport action */
+ loop_changing = false;
+
if (!_transport_fsm->declicking_for_locate()) {
DEBUG_TRACE (DEBUG::Transport, X_("Butler PTW: locate\n"));
@@ -1593,7 +1596,11 @@ Session::set_play_loop (bool yn, bool change_transport_state)
merge_event (new SessionEvent (SessionEvent::AutoLoop, SessionEvent::Replace, loc->end(), loc->start(), 0.0f));
if (!Config->get_loop_is_mode()) {
- /* args: positition, disposition, flush=true, for_loop_end=false, force=true */
+ if (transport_rolling()) {
+ /* set loop_changing to ensure that non_realtime_stop does not unset_play_loop */
+ loop_changing = true;
+ }
+ /* args: position, disposition, flush=true, for_loop_end=false, force=true */
TFSM_LOCATE (loc->start(), MustRoll, true, false, true);
} else {
if (!transport_rolling()) {