MIDI rec-rect: apply offset, correctly position notes

This commit is contained in:
Robin Gareus 2021-07-11 07:14:38 +02:00
parent 08cd4b2083
commit 35394f427c
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -643,9 +643,12 @@ DiskWriter::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
for (MidiBuffer::iterator i = buf.begin(); i != buf.end(); ++i) {
/* This may fail if buf is larger than _gui_feed_buffer, but it's not really
the end of the world if it does.
*/
_gui_feed_buffer.push_back ((*i).time() + start_sample, Evoral::MIDI_EVENT, (*i).size(), (*i).buffer());
* the end of the world if it does.
*/
samplepos_t mpos = (*i).time() + start_sample - _accumulated_capture_offset;
if (mpos >= _first_recordable_sample) {
_gui_feed_buffer.push_back (mpos, Evoral::MIDI_EVENT, (*i).size(), (*i).buffer());
}
}
}