diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-09-13 14:10:04 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-09-13 14:11:29 -0500 |
commit | f41bc70ee900257d2d9008f3a749981b10de16bc (patch) | |
tree | 37f3f5950af81cd5f958da0a37a381dbf256c74d /libs/ardour/smf_source.cc | |
parent | 182e35235c41abb6ec7ab92897be0a1a228dd004 (diff) |
change all MIDI read-from-source to map all events into the loop-range for seamless looping (if using)
Diffstat (limited to 'libs/ardour/smf_source.cc')
-rw-r--r-- | libs/ardour/smf_source.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index dac78cd020..22245abe52 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -215,6 +215,7 @@ SMFSource::read_unlocked (const Lock& lock, framepos_t const source_start, framepos_t start, framecnt_t duration, + Evoral::Range<framepos_t>* loop_range, MidiStateTracker* tracker, MidiChannelFilter* filter) const { @@ -288,6 +289,10 @@ SMFSource::read_unlocked (const Lock& lock, */ const framepos_t ev_frame_time = converter.to(Evoral::Beats::ticks_at_rate(time, ppqn())) + source_start; + if (loop_range) { + loop_range->squish (ev_frame_time); + } + if (ev_frame_time < start + duration) { if (!filter || !filter->filter(ev_buffer, ev_size)) { destination.write (ev_frame_time, ev_type, ev_size, ev_buffer); @@ -793,5 +798,3 @@ SMFSource::prevent_deletion () _flags = Flag (_flags & ~(Removable|RemovableIfEmpty|RemoveAtDestroy)); } - - |