Debug async MIDI port (M1 builds)
This commit is contained in:
parent
9ce91e2952
commit
f8a0de5928
@ -105,6 +105,11 @@ AsyncMIDIPort::flush_output_fifo (MIDI::pframes_t nframes)
|
|||||||
/* do this "atomically" after we're done pushing events into the
|
/* do this "atomically" after we're done pushing events into the
|
||||||
* MidiBuffer
|
* MidiBuffer
|
||||||
*/
|
*/
|
||||||
|
#ifndef NDEBUG
|
||||||
|
if (written > 0) {
|
||||||
|
cout << "AsyncMIDIPort::flush_output_fifo '" << MIDI::Port::name () << "' written " << written << " events\n";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
output_fifo.increment_read_idx (written);
|
output_fifo.increment_read_idx (written);
|
||||||
}
|
}
|
||||||
@ -156,7 +161,10 @@ AsyncMIDIPort::cycle_start (MIDI::pframes_t nframes)
|
|||||||
when = AudioEngine::instance()->sample_time_at_cycle_start() + timestamp;
|
when = AudioEngine::instance()->sample_time_at_cycle_start() + timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
input_fifo.write (when, Evoral::NO_EVENT, size, buf);
|
uint32_t rv = input_fifo.write (when, Evoral::NO_EVENT, size, buf);
|
||||||
|
#ifndef NDEBUG
|
||||||
|
cout << "AsyncMIDIPort::cycle_start '" << MIDI::Port::name () << "' add event, written " << rv << " / " << size << " bytes\n";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event_count) {
|
if (event_count) {
|
||||||
@ -332,6 +340,9 @@ AsyncMIDIPort::read (MIDI::byte *, size_t)
|
|||||||
|
|
||||||
while (input_fifo.read (&time, &type, &size, &buffer[0])) {
|
while (input_fifo.read (&time, &type, &size, &buffer[0])) {
|
||||||
_parser->set_timestamp (time);
|
_parser->set_timestamp (time);
|
||||||
|
#ifndef NDEBUG
|
||||||
|
cout << "AsyncMIDIPort::read '" << MIDI::Port::name () << "' bytes = " << size << "\n";
|
||||||
|
#endif
|
||||||
for (uint32_t i = 0; i < size; ++i) {
|
for (uint32_t i = 0; i < size; ++i) {
|
||||||
_parser->scanner (buffer[i]);
|
_parser->scanner (buffer[i]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user