mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-18 20:56:28 +01:00
change all MIDI read-from-source to map all events into the loop-range for seamless looping (if using)
This commit is contained in:
parent
182e35235c
commit
f41bc70ee9
12 changed files with 245 additions and 169 deletions
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue