From 439e112d325e43c05759d91260f46b955f2f5b89 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 9 Feb 2022 17:25:36 -0700 Subject: [PATCH] triggerbox: pay attention to the fact that a trigger may have Stopped while fast-forwarding --- libs/ardour/triggerbox.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index a79b6f78e1..bff1f972b8 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -1074,6 +1074,16 @@ AudioTrigger::start_and_roll_to (samplepos_t start_pos, samplepos_t end_position pframes_t n = audio_run (bufs, pos, pos+nframes, start_beats, end_beats, nframes, 0, bpm); + /* We could have reached the end. Check and restart, because + * TriggerBox::fast_forward() already determined that we are + * the active trigger at @param end_position + */ + + if (_state == Stopped) { + retrigger (); + _state = WaitingToStart; + } + pos += n; } }