From e72cff4ab1a0087773159a72aa16870288e7c0f1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 17 Mar 2022 12:20:20 -0600 Subject: [PATCH] triggerbox: reset all trigger states when locating/stopping We also exclude anything from happening during TriggerBox::run() while locating/stopping is taking place. --- libs/ardour/triggerbox.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index 9e387c9648..f4cf1d0226 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -3600,6 +3600,13 @@ TriggerBox::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp return; } + if (_session.transport_locating()) { + /* nothing to do here at all. We do not run triggers while + locate is still taking place. + */ + return; + } + #ifndef NDEBUG { Temporal::TempoMap::SharedPtr __tmap (Temporal::TempoMap::use()); @@ -4307,12 +4314,24 @@ TriggerBox::realtime_handle_transport_stopped () void TriggerBox::non_realtime_transport_stop (samplepos_t now, bool /*flush*/) { + DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 (%3): non-realtime stop at %2\n", order(), now, this)); + + for (auto & t : all_triggers) { + t->shutdown_from_fwd (); + } + fast_forward (_session.cue_events(), now); } void TriggerBox::non_realtime_locate (samplepos_t now) { + DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 (%3): non-realtime locate at %2\n", order(), now, this)); + + for (auto & t : all_triggers) { + t->shutdown_from_fwd (); + } + fast_forward (_session.cue_events(), now); }