From 58d4c1e31792dc6385a92a62341c2ad06ccbb06c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 3 Jan 2022 17:45:00 -0700 Subject: [PATCH] triggerbox: add ReTrigger launch style; do not stop running slots when cue launching --- libs/ardour/ardour/triggerbox.h | 1 + libs/ardour/enums.cc | 1 + libs/ardour/triggerbox.cc | 9 +++++---- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libs/ardour/ardour/triggerbox.h b/libs/ardour/ardour/triggerbox.h index 5070425dd0..3f434afd59 100644 --- a/libs/ardour/ardour/triggerbox.h +++ b/libs/ardour/ardour/triggerbox.h @@ -156,6 +156,7 @@ class LIBARDOUR_API Trigger : public PBD::Stateful { enum LaunchStyle { OneShot, /* mouse down/NoteOn starts; mouse up/NoteOff ignored */ + ReTrigger, /* mouse down/NoteOn starts or retriggers; mouse up/NoteOff */ Gate, /* runs till mouse up/note off then to next quantization */ Toggle, /* runs till next mouse down/NoteOn */ Repeat, /* plays only quantization extent until mouse up/note off */ diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc index a180e305ea..2d2325b6a1 100644 --- a/libs/ardour/enums.cc +++ b/libs/ardour/enums.cc @@ -868,6 +868,7 @@ setup_enum_writer () REGISTER (_TriggerFollowAction); REGISTER_CLASS_ENUM (Trigger, OneShot); + REGISTER_CLASS_ENUM (Trigger, ReTrigger); REGISTER_CLASS_ENUM (Trigger, Gate); REGISTER_CLASS_ENUM (Trigger, Toggle); REGISTER_CLASS_ENUM (Trigger, Repeat); diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index e53760ccc0..2dcbfc58c8 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -77,7 +77,7 @@ Trigger::Trigger (uint32_t n, TriggerBox& b) , _loop_cnt (0) , _ui (0) , _explicitly_stopped (false) - , _launch_style (Properties::launch_style, Toggle) + , _launch_style (Properties::launch_style, OneShot) , _use_follow (Properties::use_follow, true) , _follow_action0 (Properties::follow_action0, Again) , _follow_action1 (Properties::follow_action1, Stop) @@ -499,6 +499,9 @@ Trigger::process_state_requests () case Running: switch (launch_style()) { case OneShot: + /* do nothing, just let it keep playing */ + break; + case ReTrigger: DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 oneshot %2 => %3\n", index(), enum_2_string (Running), enum_2_string (WaitingForRetrigger))); _state = WaitingForRetrigger; PropertyChanged (ARDOUR::Properties::running); @@ -507,9 +510,7 @@ Trigger::process_state_requests () case Toggle: case Repeat: if (_box.active_scene() >= 0) { - _state = WaitingForRetrigger; - cue_launched = true; - DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 cue-launched %2, now wait for retrigger\n", index(), enum_2_string (_launch_style.val()))); + std::cerr << "should not happen, cue launching but launch_style() said " << enum_2_string (launch_style()) << std::endl; } else { DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 %2 gate/toggle/repeat => %3\n", index(), enum_2_string (Running), enum_2_string (WaitingToStop))); begin_stop (true);