mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-23 15:16:25 +01:00
optimize midi delayline.
This commit is contained in:
parent
8cb24865d2
commit
f1533a03da
1 changed files with 21 additions and 13 deletions
|
|
@ -222,11 +222,13 @@ DelayLine::run (BufferSet& bufs, framepos_t /* start_frame */, framepos_t /* end
|
|||
}
|
||||
}
|
||||
|
||||
if (_delay != 0) {
|
||||
// delay events in current-buffer, in place.
|
||||
for (MidiBuffer::iterator m = mb.begin(); m != mb.end(); ++m) {
|
||||
MidiBuffer::TimeType *t = m.timeptr();
|
||||
*t += _delay;
|
||||
}
|
||||
}
|
||||
|
||||
// move events from dly-buffer into current-buffer until nsamples
|
||||
// and remove them from the dly-buffer
|
||||
|
|
@ -239,6 +241,11 @@ DelayLine::run (BufferSet& bufs, framepos_t /* start_frame */, framepos_t /* end
|
|||
m = dly->erase(m);
|
||||
}
|
||||
|
||||
/* For now, this is only relevant if there is there's a positive delay.
|
||||
* In the future this could also be used to delay 'too early' events
|
||||
* (ie '_global_port_buffer_offset + _port_buffer_offset' - midi_port.cc)
|
||||
*/
|
||||
if (_delay != 0) {
|
||||
// move events after nsamples from current-buffer into dly-buffer
|
||||
// and trim current-buffer after nsamples
|
||||
for (MidiBuffer::iterator m = mb.begin(); m != mb.end();) {
|
||||
|
|
@ -252,6 +259,7 @@ DelayLine::run (BufferSet& bufs, framepos_t /* start_frame */, framepos_t /* end
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_delay = pending_delay;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue