Fix reverse MIDI playback
upper_bound() returns the first element that is **greater** than the given value. So during reverse playback we need the value before that. Likewise for forward playback, lower_bound() returns an iterator pointing to the element before the one that need to be played.
This commit is contained in:
parent
59c914e2db
commit
0d4ea1e61f
|
@ -302,8 +302,16 @@ RTMidiBuffer::read (MidiBuffer& dst, samplepos_t start, samplepos_t end, MidiSta
|
|||
*/
|
||||
|
||||
if (reverse) {
|
||||
if (evtime > start) {
|
||||
--item;
|
||||
continue;
|
||||
}
|
||||
evtime = start - evtime;
|
||||
} else {
|
||||
if (evtime < start) {
|
||||
++item;
|
||||
continue;
|
||||
}
|
||||
evtime -= start;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user