From 12dbcd90bf624632bc52cd4df6d56833f14b7b1d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 27 Dec 2021 16:24:35 -0700 Subject: [PATCH] triggerbox: fix quantized stop via ::unbang() --- libs/ardour/triggerbox.cc | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index bfabb3a8c8..25f6777ae6 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -464,17 +464,23 @@ Trigger::process_state_requests () DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 unbanged\n", index())); - if (_launch_style == Gate || _launch_style == Repeat) { - switch (_state) { - case Running: - begin_stop (true); - DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 unbanged, now in WaitingToStop\n", index())); - break; - default: - /* didn't even get started */ - shutdown (); - DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 unbanged, never started, now stopped\n", index())); - } + switch (_state) { + case Running: + begin_stop (true); + DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 unbanged, now in WaitingToStop\n", index())); + break; + + case Stopped: + case Stopping: /* theoretically not possible */ + case WaitingToStop: + case WaitingForRetrigger: + /* do nothing */ + break; + + case WaitingToStart: + /* didn't even get started */ + shutdown (); + DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 unbanged, never started, now stopped\n", index())); } } }