13
0

triggerbox: add ReTrigger launch style; do not stop running slots when cue launching

This commit is contained in:
Paul Davis 2022-01-03 17:45:00 -07:00
parent b72268f6e1
commit 58d4c1e317
3 changed files with 7 additions and 4 deletions

View File

@ -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 */

View File

@ -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);

View File

@ -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);