From 97de6efe5d6705f5ca8fb7af0e595e0f9fa092c1 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 11 Jun 2015 15:05:46 +0200 Subject: [PATCH] fix transport loop sub-state events Loading a session with a loop-range, or setting a loop-range adds LoopDeclick events. Normal play back (no loop) never processes/clears the events. Ardour was constantly doing split cycles for nothing. This lead to stuck midi-notes: Split cycle calls increment_global_port_buffer_offset() but the midi_diskstream itself was not aware of any loop positions or offsets. Entering loop playback adds those events explicitly in Session::set_play_loop(). auto_loop_changed() only needs to add/replace session-events when actively looping. --- libs/ardour/session.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 30c1d2acdd..71ad0bd705 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -1346,10 +1346,10 @@ Session::auto_loop_changed (Location* location) framepos_t dcp; framecnt_t dcl; auto_loop_declick_range (location, dcp, dcl); - replace_event (SessionEvent::AutoLoopDeclick, dcp, dcl); if (transport_rolling() && play_loop) { + replace_event (SessionEvent::AutoLoopDeclick, dcp, dcl); // if (_transport_frame > location->end()) { @@ -1373,6 +1373,9 @@ Session::auto_loop_changed (Location* location) } } + } else { + clear_events (SessionEvent::AutoLoopDeclick); + clear_events (SessionEvent::AutoLoop); } last_loopend = location->end(); -- 2.30.2