mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-09 23:25:43 +01:00
reorder input & output stages of beatbox, to deal with different semantics compared to JACK ports.
Still needs some kind of intermediate buffer so that we can sort output events in among the input ones
This commit is contained in:
parent
7900fe6503
commit
6908eb748b
1 changed files with 16 additions and 17 deletions
|
|
@ -151,10 +151,6 @@ BeatBox::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_fram
|
|||
/* do this on the first pass only */
|
||||
MidiBuffer& buf = bufs.get_midi (0);
|
||||
|
||||
second_pass:
|
||||
|
||||
/* Output */
|
||||
|
||||
if (clear_pending) {
|
||||
|
||||
for (Events::iterator ee = _current_events.begin(); ee != _current_events.end(); ++ee) {
|
||||
|
|
@ -165,19 +161,7 @@ BeatBox::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_fram
|
|||
clear_pending = false;
|
||||
}
|
||||
|
||||
for (Events::iterator ee = _current_events.begin(); ee != _current_events.end(); ++ee) {
|
||||
Event* e = (*ee);
|
||||
|
||||
if (e->size && (e->time >= process_start && e->time < process_end)) {
|
||||
framepos_t sample_offset_in_buffer = superclock_to_samples (offset + e->time - process_start, _session.frame_rate());
|
||||
|
||||
buf.push_back (sample_offset_in_buffer, e->size, e->buf);
|
||||
}
|
||||
|
||||
if (e->time >= process_end) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
second_pass:
|
||||
|
||||
/* input */
|
||||
|
||||
|
|
@ -252,6 +236,21 @@ BeatBox::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_fram
|
|||
}
|
||||
}
|
||||
|
||||
/* Output */
|
||||
|
||||
for (Events::iterator ee = _current_events.begin(); ee != _current_events.end(); ++ee) {
|
||||
Event* e = (*ee);
|
||||
|
||||
if (e->size && (e->time >= process_start && e->time < process_end)) {
|
||||
const framepos_t sample_offset_in_buffer = superclock_to_samples (offset + e->time - process_start, _session.frame_rate());
|
||||
buf.push_back (sample_offset_in_buffer, e->size, e->buf);
|
||||
}
|
||||
|
||||
if (e->time >= process_end) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
superclock_cnt += superclocks;
|
||||
|
||||
if (two_pass_required) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue