13
0

Fix tracing internally connected MIDI ports

MIDI track A -> MIDI track B
The data on Track B's input is not available at cycle-start.
This commit is contained in:
Robin Gareus 2023-10-07 22:40:50 +02:00
parent a5712d1f85
commit c5b2c4432e
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -74,13 +74,6 @@ MidiPort::cycle_start (pframes_t nframes)
port_engine.midi_clear (port_engine.get_buffer (_port_handle, nframes));
}
if (receives_input()) {
std::shared_ptr<MIDI::Parser> trace_parser = _trace_parser.lock ();
if (trace_parser) {
read_and_parse_entire_midi_buffer_with_no_speed_adjustment (nframes, *trace_parser.get(), AudioEngine::instance()->sample_time_at_cycle_start());
}
}
if (_inbound_midi_filter) {
MidiBuffer& mb (get_midi_buffer (nframes));
_inbound_midi_filter (mb, mb);
@ -229,6 +222,12 @@ MidiPort::read_and_parse_entire_midi_buffer_with_no_speed_adjustment (pframes_t
void
MidiPort::cycle_end (pframes_t nframes)
{
if (receives_input()) {
std::shared_ptr<MIDI::Parser> trace_parser = _trace_parser.lock ();
if (trace_parser) {
read_and_parse_entire_midi_buffer_with_no_speed_adjustment (nframes, *trace_parser.get(), AudioEngine::instance()->sample_time_at_cycle_start());
}
}
Port::cycle_end (nframes);
_data_fetched_for_cycle = false;
}