triggerbox: fix repeat launch style

This commit is contained in:
Paul Davis 2021-08-12 12:42:29 -06:00
parent 0b2c03b0e9
commit 75f8b9a083

View file

@ -203,7 +203,7 @@ Trigger::process_state_requests ()
_unbang.fetch_sub (1); _unbang.fetch_sub (1);
if (launch_style() == Trigger::Gate) { if (_launch_style == Gate || _launch_style == Repeat) {
switch (_state) { switch (_state) {
case Running: case Running:
_state = WaitingToStop; _state = WaitingToStop;
@ -569,10 +569,10 @@ AudioTrigger::run (BufferSet& bufs, pframes_t nframes, pframes_t dest_offset, bo
/* We reached the end */ /* We reached the end */
if (_next_trigger > 0 && (size_t) _next_trigger == _index) { /* self repeat */ if ((_launch_style == Repeat) || ((_next_trigger > 0) && (size_t) _next_trigger == _index)) { /* self repeat */
nframes -= this_read; nframes -= this_read;
dest_offset += this_read; dest_offset += this_read;
DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 was reached end, but set to loop, so retrigger\n", index())); DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 reached end, but set to loop, so retrigger\n", index()));
retrigger (); retrigger ();
/* and go around again */ /* and go around again */
continue; continue;
@ -589,7 +589,7 @@ AudioTrigger::run (BufferSet& bufs, pframes_t nframes, pframes_t dest_offset, bo
} }
} }
_state = Stopped; _state = Stopped;
DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 was reached end, now stopped\n", index())); DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 reached end, now stopped\n", index()));
break; break;
} }
} }