diff options
author | Robin Gareus <robin@gareus.org> | 2019-04-07 19:18:28 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-04-07 19:54:24 +0200 |
commit | 8f9c1df1838847c85fc774e3a899bb00264954fe (patch) | |
tree | da0c4551599f662ec8ce40d834b906d31fae7f96 /libs/ardour/midi_track.cc | |
parent | 1ba391ab110dc1623171168e60016de8f21c2e30 (diff) |
Prepare midi-export for midi-to-audio bouncing.
* shift event time into process cycle before calling processors
* reset note-trackers when exporting, don't allow any pending
events into the queue
Diffstat (limited to 'libs/ardour/midi_track.cc')
-rw-r--r-- | libs/ardour/midi_track.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index 9f7291c6e7..c7547816a4 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -478,13 +478,22 @@ MidiTrack::export_stuff (BufferSet& buffers, if (!mpl) { return -2; } + mpl->reset_note_trackers (); // TODO once at start and end ? buffers.get_midi(0).clear(); if (mpl->read(buffers.get_midi(0), start, nframes, 0) != nframes) { return -1; } - //bounce_process (buffers, start, nframes, endpoint, include_endpoint, for_export, for_freeze); + if (endpoint && !for_export) { + MidiBuffer& buf = buffers.get_midi(0); + for (MidiBuffer::iterator i = buf.begin(); i != buf.end(); ++i) { + MidiBuffer::TimeType *t = i.timeptr (); + *t -= start; + } + bounce_process (buffers, start, nframes, endpoint, include_endpoint, for_export, for_freeze); + } + mpl->reset_note_trackers (); return 0; } |