13
0

further API changes to MIDIRegion::render() to allow for use by triggers

This commit is contained in:
Paul Davis 2021-10-26 17:32:36 -06:00
parent 787e5a2ea8
commit 948500bbc7
2 changed files with 5 additions and 3 deletions

View File

@ -114,6 +114,7 @@ class LIBARDOUR_API MidiRegion : public Region
NoteMode mode,
timepos_t const & read_start,
timecnt_t const & read_length,
timepos_t const & source_position,
MidiChannelFilter* filter) const;
protected:

View File

@ -283,7 +283,7 @@ MidiRegion::render (Evoral::EventSink<samplepos_t>& dst,
NoteMode mode,
MidiChannelFilter* filter) const
{
return render_range (dst, chan_n, mode, this->start(), _length, filter);
return render_range (dst, chan_n, mode, this->start(), _length, source_position(), filter);
}
int
@ -292,6 +292,7 @@ MidiRegion::render_range (Evoral::EventSink<samplepos_t>& dst,
NoteMode mode,
timepos_t const & read_start,
timecnt_t const & read_length,
timepos_t const & source_position,
MidiChannelFilter* filter) const
{
/* precondition: caller has verified that we cover the desired section */
@ -327,7 +328,7 @@ MidiRegion::render_range (Evoral::EventSink<samplepos_t>& dst,
src->midi_read (
lm, // source lock
dst, // destination buffer
this->source_position(), // start position of the source in session samples
source_position, // start position of the source in session samples
read_start,
read_length,
0,
@ -340,7 +341,7 @@ MidiRegion::render_range (Evoral::EventSink<samplepos_t>& dst,
* Note-Off's get inserted at the end of the region
*/
const timepos_t end = source_position() + read_start + read_length;
const timepos_t end = source_position + read_start + read_length;
tracker.resolve_notes (dst, end.samples());
return 0;