triggerbox: avoid double-accounting for buffer offset in MIDI triggers

Because MIDI triggers compute buffer-relative timestamps using
timeline_samples - start_sample, this already takes into account
any offset to the start of the trigger. We still need to use dest_offset
if a non-zero value was passed into ::midi_run(), but we do NOT
want to have it contain the "offset to start of trigger in process
cycle" as well. Instead of trying to special case
::maybe_compute_next_transition(), we just pass a dummy pframes_t
to that method, leaving dest_offset as it was passed into ::midi_run()
This commit is contained in:
Paul Davis 2022-02-14 12:56:18 -07:00
parent 374fa48fad
commit 511b09b3d6

View File

@ -2412,7 +2412,8 @@ MIDITrigger::midi_run (BufferSet& bufs, samplepos_t start_sample, samplepos_t en
samplepos_t last_event_samples = max_samplepos;
/* see if we're going to start or stop or retrigger in this run() call */
maybe_compute_next_transition (start_sample, start_beats, end_beats, nframes, dest_offset);
pframes_t ignore_computed_dest_offset = 0;
maybe_compute_next_transition (start_sample, start_beats, end_beats, nframes, ignore_computed_dest_offset);
const pframes_t orig_nframes = nframes;
DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 after checking for transition, state = %2\n", name(), enum_2_string (_state)));