From 050b046e4d43f5397b5be353ef5863e2aa4aebc0 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 4 Dec 2021 11:48:42 -0700 Subject: [PATCH] triggerbox: stop immediately when stop_all() is used --- libs/ardour/triggerbox.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index 638e6bae00..5225c5a770 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -317,12 +317,20 @@ Trigger::process_state_requests () bool stop = _requests.stop.exchange (false); if (stop) { - if (_state == Running) { - DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 noticed stop request\n", name())); - begin_stop (); - } else if (_state == WaitingToStart || _state == WaitingForRetrigger) { + + /* This is for an immediate stop, not a quantized one */ + + if (_state != Stopped) { shutdown (); + DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 immediate stop implemented\n", name())); } + + /* Don't process bang/unbang requests since we're stopping */ + + _bang = 0; + _unbang = 0; + + return; } /* now check bangs/unbangs */