NO-OP: return early, remove scope

This commit is contained in:
Robin Gareus 2023-10-17 05:40:31 +02:00
parent 3ce2cf937e
commit 576840c09e
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -267,7 +267,9 @@ MidiPort::resolve_notes (void* port_buffer, MidiBuffer::TimeType when)
void void
MidiPort::flush_buffers (pframes_t nframes) MidiPort::flush_buffers (pframes_t nframes)
{ {
if (sends_output ()) { if (!sends_output ()) {
return;
}
void* port_buffer = 0; void* port_buffer = 0;
@ -288,14 +290,16 @@ MidiPort::flush_buffers (pframes_t nframes)
double speed_ratio = (flags () & TransportGenerator) ? 1.0 : resample_ratio (); double speed_ratio = (flags () & TransportGenerator) ? 1.0 : resample_ratio ();
std::shared_ptr<MIDI::Parser> trace_parser = _trace_parser.lock ();
for (MidiBuffer::iterator i = _buffer->begin(); i != _buffer->end(); ++i) { for (MidiBuffer::iterator i = _buffer->begin(); i != _buffer->end(); ++i) {
const Evoral::Event<MidiBuffer::TimeType> ev (*i, false); const Evoral::Event<MidiBuffer::TimeType> ev (*i, false);
/* event times are in samples, relative to cycle start */
const samplepos_t adjusted_time = ev.time() + _global_port_buffer_offset; const samplepos_t adjusted_time = ev.time() + _global_port_buffer_offset;
if (sends_output()) { /* MIDI Tracer */
std::shared_ptr<MIDI::Parser> trace_parser = _trace_parser.lock ();
if (trace_parser) { if (trace_parser) {
uint8_t const * const buf = ev.buffer(); uint8_t const * const buf = ev.buffer();
const samplepos_t now = AudioEngine::instance()->sample_time_at_cycle_start(); const samplepos_t now = AudioEngine::instance()->sample_time_at_cycle_start();
@ -308,9 +312,6 @@ MidiPort::flush_buffers (pframes_t nframes)
trace_parser->scanner (buf[n]); trace_parser->scanner (buf[n]);
} }
} }
}
// event times are in samples, relative to cycle start
#ifndef NDEBUG #ifndef NDEBUG
if (DEBUG_ENABLED (DEBUG::MidiIO)) { if (DEBUG_ENABLED (DEBUG::MidiIO)) {
@ -360,7 +361,6 @@ MidiPort::flush_buffers (pframes_t nframes)
_buffer->clear (); _buffer->clear ();
} }
} }
}
void void
MidiPort::require_resolve () MidiPort::require_resolve ()