diff --git a/libs/ardour/midi_buffer.cc b/libs/ardour/midi_buffer.cc index c65ba58288..29bec23851 100644 --- a/libs/ardour/midi_buffer.cc +++ b/libs/ardour/midi_buffer.cc @@ -158,6 +158,7 @@ MidiBuffer::push_back(TimeType time, size_t size, const uint8_t* data) const size_t stamp_size = sizeof(TimeType); #ifndef NDEBUG + if (DEBUG::MidiIO & PBD::debug_bits) { DEBUG_STR_DECL(a); DEBUG_STR_APPEND(a, string_compose ("midibuffer %1 push event @ %2 sz %3 ", this, time, size)); for (size_t i=0; i < size; ++i) { @@ -168,6 +169,7 @@ MidiBuffer::push_back(TimeType time, size_t size, const uint8_t* data) } DEBUG_STR_APPEND(a,'\n'); DEBUG_TRACE (DEBUG::MidiIO, DEBUG_STR(a).str()); + } #endif if (_size + stamp_size + size >= _capacity) { diff --git a/libs/ardour/midi_ring_buffer.cc b/libs/ardour/midi_ring_buffer.cc index b25154fefb..a10ad0b199 100644 --- a/libs/ardour/midi_ring_buffer.cc +++ b/libs/ardour/midi_ring_buffer.cc @@ -137,16 +137,18 @@ MidiRingBuffer::read(MidiBuffer& dst, framepos_t start, framepos_t end, frame success = read_contents (ev_size, write_loc); #ifndef NDEBUG - DEBUG_STR_DECL(a); - DEBUG_STR_APPEND(a, string_compose ("wrote MidiEvent to Buffer (time=%1, start=%2 offset=%3)", ev_time, start, offset)); - for (size_t i=0; i < ev_size; ++i) { - DEBUG_STR_APPEND(a,hex); - DEBUG_STR_APPEND(a,"0x"); - DEBUG_STR_APPEND(a,(int)write_loc[i]); - DEBUG_STR_APPEND(a,' '); + if (DEBUG::MidiDiskstreamIO && PBD::debug_bits) { + DEBUG_STR_DECL(a); + DEBUG_STR_APPEND(a, string_compose ("wrote MidiEvent to Buffer (time=%1, start=%2 offset=%3)", ev_time, start, offset)); + for (size_t i=0; i < ev_size; ++i) { + DEBUG_STR_APPEND(a,hex); + DEBUG_STR_APPEND(a,"0x"); + DEBUG_STR_APPEND(a,(int)write_loc[i]); + DEBUG_STR_APPEND(a,' '); + } + DEBUG_STR_APPEND(a,'\n'); + DEBUG_TRACE (DEBUG::MidiDiskstreamIO, DEBUG_STR(a).str()); } - DEBUG_STR_APPEND(a,'\n'); - DEBUG_TRACE (DEBUG::MidiDiskstreamIO, DEBUG_STR(a).str()); #endif if (success) {