From 43203a407be76aaf6c8295337fda8a14348e9b4c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 22 Dec 2021 17:27:19 -0700 Subject: [PATCH] triggerbox: steps toward sane trigger stopping API and design (GUI edition) --- gtk2_ardour/trigger_master.cc | 19 +++++++++++++++++-- gtk2_ardour/triggerbox_ui.cc | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/trigger_master.cc b/gtk2_ardour/trigger_master.cc index 66ac61288f..a310f12684 100644 --- a/gtk2_ardour/trigger_master.cc +++ b/gtk2_ardour/trigger_master.cc @@ -35,6 +35,7 @@ #include "ardour_ui.h" #include "gui_thread.h" +#include "keyboard.h" #include "public_editor.h" #include "region_view.h" #include "selection.h" @@ -302,7 +303,14 @@ TriggerMaster::event_handler (GdkEvent* ev) switch (ev->type) { case GDK_BUTTON_PRESS: if (ev->button.button == 1) { - _triggerbox->request_stop_all (); + if (Keyboard::modifier_state_equals (ev->button.state, Keyboard::PrimaryModifier)) { + _triggerbox->stop_all_immediately (); + } else { + _triggerbox->stop_all_quantized (); + } + + + return true; } break; @@ -615,7 +623,14 @@ CueMaster::event_handler (GdkEvent* ev) switch (ev->type) { case GDK_BUTTON_PRESS: if (ev->button.button == 1) { - _session->stop_all_triggers (); + /* stop all running triggers, but let them run + to their natural end + */ + if (Keyboard::modifier_state_equals (ev->button.state, Keyboard::PrimaryModifier)) { + _session->stop_all_triggers (true); + } else { + _session->stop_all_triggers (false); + } return true; } break; diff --git a/gtk2_ardour/triggerbox_ui.cc b/gtk2_ardour/triggerbox_ui.cc index 0ecd3fed91..388dfb90a1 100644 --- a/gtk2_ardour/triggerbox_ui.cc +++ b/gtk2_ardour/triggerbox_ui.cc @@ -652,7 +652,7 @@ TriggerBoxUI::play_button_event (GdkEvent* ev, uint64_t n) switch (ev->type) { case GDK_BUTTON_PRESS: if (ev->button.button == 1) { - _triggerbox.request_stop_all (); + _triggerbox.stop_all_immediately (); return true; } break;