triggerbox: fix up what happens at the end of a MIDI trigger
This commit is contained in:
parent
050b046e4d
commit
4a13a1fa62
@ -1281,7 +1281,7 @@ MIDITrigger::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sam
|
|||||||
const timepos_t region_start_time = _region->start();
|
const timepos_t region_start_time = _region->start();
|
||||||
const Temporal::Beats region_start = region_start_time.beats();
|
const Temporal::Beats region_start = region_start_time.beats();
|
||||||
Temporal::TempoMap::SharedPtr tmap (Temporal::TempoMap::use());
|
Temporal::TempoMap::SharedPtr tmap (Temporal::TempoMap::use());
|
||||||
samplepos_t last_event_samples = 0;
|
samplepos_t last_event_samples = max_samplepos;
|
||||||
|
|
||||||
/* see if we're going to start or stop or retrigger in this run() call */
|
/* see if we're going to start or stop or retrigger in this run() call */
|
||||||
dest_offset = maybe_compute_next_transition (start_sample, start_beats, end_beats, dest_offset, passthru);
|
dest_offset = maybe_compute_next_transition (start_sample, start_beats, end_beats, dest_offset, passthru);
|
||||||
@ -1361,7 +1361,6 @@ MIDITrigger::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sam
|
|||||||
|
|
||||||
DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 reached end\n", index()));
|
DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 reached end\n", index()));
|
||||||
|
|
||||||
if (!(_state == Stopping)) {
|
|
||||||
_loop_cnt++;
|
_loop_cnt++;
|
||||||
|
|
||||||
if (_loop_cnt == _follow_count) {
|
if (_loop_cnt == _follow_count) {
|
||||||
@ -1385,11 +1384,14 @@ MIDITrigger::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sam
|
|||||||
retrigger ();
|
retrigger ();
|
||||||
_state = WaitingToStart;
|
_state = WaitingToStart;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* the time we processed spans from start to the last event */
|
/* the time we processed spans from start to the last event */
|
||||||
|
|
||||||
nframes -= (last_event_samples - start_sample);
|
if (last_event_samples != max_samplepos) {
|
||||||
|
nframes = (last_event_samples - start_sample);
|
||||||
|
} else {
|
||||||
|
/* all frames covered */
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* we didn't reach the end of the MIDI data, ergo we covered
|
/* we didn't reach the end of the MIDI data, ergo we covered
|
||||||
|
Loading…
Reference in New Issue
Block a user