-
- /* put the loop event into the event list */
-
- SessionEvent* event = new SessionEvent (SessionEvent::AutoLoop, SessionEvent::Replace, loc->end(), loc->start(), 0.0f);
- merge_event (event);
-
- /* locate to start of loop and roll. If doing seamless loop, force a
- locate+buffer refill even if we are positioned there already.
+
+ /* Put the delick and loop events in into the event list. The declick event will
+ cause a de-clicking fade-out just before the end of the loop, and it will also result
+ in a fade-in when the loop restarts. The AutoLoop event will peform the actual loop.
+ */
+
+ framepos_t dcp;
+ framecnt_t dcl;
+ auto_loop_declick_range (loc, dcp, dcl);
+ merge_event (new SessionEvent (SessionEvent::AutoLoopDeclick, SessionEvent::Replace, dcp, dcl, 0.0f));
+ merge_event (new SessionEvent (SessionEvent::AutoLoop, SessionEvent::Replace, loc->end(), loc->start(), 0.0f));
+
+ /* locate to start of loop and roll.
+
+ args: positition, roll=true, flush=true, with_loop=false, force buffer refill if seamless looping