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
This commit is contained in:
parent
1ba391ab11
commit
8f9c1df183
@ -478,13 +478,22 @@ MidiTrack::export_stuff (BufferSet& buffers,
|
|||||||
if (!mpl) {
|
if (!mpl) {
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
mpl->reset_note_trackers (); // TODO once at start and end ?
|
||||||
|
|
||||||
buffers.get_midi(0).clear();
|
buffers.get_midi(0).clear();
|
||||||
if (mpl->read(buffers.get_midi(0), start, nframes, 0) != nframes) {
|
if (mpl->read(buffers.get_midi(0), start, nframes, 0) != nframes) {
|
||||||
return -1;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -6238,7 +6238,9 @@ Session::write_one_track (Track& track, samplepos_t start, samplepos_t end,
|
|||||||
const MidiBuffer& buf = buffers.get_midi(0);
|
const MidiBuffer& buf = buffers.get_midi(0);
|
||||||
for (MidiBuffer::const_iterator i = buf.begin(); i != buf.end(); ++i) {
|
for (MidiBuffer::const_iterator i = buf.begin(); i != buf.end(); ++i) {
|
||||||
Evoral::Event<samplepos_t> ev = *i;
|
Evoral::Event<samplepos_t> ev = *i;
|
||||||
ev.set_time(ev.time() - position);
|
if (!endpoint || for_export) {
|
||||||
|
ev.set_time(ev.time() - position);
|
||||||
|
}
|
||||||
ms->append_event_samples(lock, ev, ms->timeline_position());
|
ms->append_event_samples(lock, ev, ms->timeline_position());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user