Maintain correct tracker state on MIDI overwrite.

This is a little hard-edged in that edits while rolling will prematurely chop
off any playing notes, but at least the state of things actually reflects
reality.  More sophisticated solution hopefully to come...
This commit is contained in:
David Robillard 2014-12-19 18:09:36 -05:00
parent db92d62c95
commit 5d8021bf44
7 changed files with 44 additions and 14 deletions

View file

@ -282,13 +282,8 @@ SMFSource::read_unlocked (const Lock& lock,
if (ev_frame_time < start + duration) {
destination.write (ev_frame_time, ev_type, ev_size, ev_buffer);
if (tracker) {
if (ev_buffer[0] & MIDI_CMD_NOTE_ON) {
tracker->add (ev_buffer[1], ev_buffer[0] & 0xf);
} else if (ev_buffer[0] & MIDI_CMD_NOTE_OFF) {
tracker->remove (ev_buffer[1], ev_buffer[0] & 0xf);
}
tracker->track(ev_buffer);
}
} else {
break;