X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fmidi_port.cc;h=1377938f2e7363a734ab28169fd3b32933db0aed;hb=0c4869dc35a15757915ebbddcdd7077d788ca91e;hp=381441a8d6fdbc8941fba1867e1605619d63d350;hpb=bd97450ef8bfa7acf152e8f0ab7675d32db176c7;p=ardour.git diff --git a/libs/ardour/midi_port.cc b/libs/ardour/midi_port.cc index 381441a8d6..1377938f2e 100644 --- a/libs/ardour/midi_port.cc +++ b/libs/ardour/midi_port.cc @@ -19,12 +19,17 @@ #include #include +#include "pbd/compose.h" +#include "pbd/debug.h" + #include "ardour/midi_port.h" #include "ardour/data_type.h" #include "ardour/audioengine.h" +#include "ardour/debug.h" -using namespace ARDOUR; using namespace std; +using namespace ARDOUR; +using namespace PBD; #define port_engine AudioEngine::instance()->port_engine() @@ -197,6 +202,21 @@ MidiPort::flush_buffers (pframes_t nframes) // event times are in frames, relative to cycle start +#ifndef NDEBUG + if (DEBUG::MidiIO & PBD::debug_bits) { + DEBUG_STR_DECL(a); + DEBUG_STR_APPEND(a, string_compose ("MidiPort %1 pop event @ %2 sz %3 ", this, ev.time(), ev.size())); + for (size_t i=0; i < ev.size(); ++i) { + DEBUG_STR_APPEND(a,hex); + DEBUG_STR_APPEND(a,"0x"); + DEBUG_STR_APPEND(a,(int)(ev.buffer()[i])); + DEBUG_STR_APPEND(a,' '); + } + DEBUG_STR_APPEND(a,'\n'); + DEBUG_TRACE (DEBUG::MidiIO, DEBUG_STR(a).str()); + } +#endif + assert (ev.time() < (nframes + _global_port_buffer_offset + _port_buffer_offset)); if (ev.time() >= _global_port_buffer_offset + _port_buffer_offset) { @@ -208,7 +228,7 @@ MidiPort::flush_buffers (pframes_t nframes) cerr << "drop flushed event on the floor, time " << ev.time() << " too early for " << _global_port_buffer_offset << " + " << _port_buffer_offset; - for (int xx = 0; xx < ev.size(); ++xx) { + for (size_t xx = 0; xx < ev.size(); ++xx) { cerr << ' ' << hex << (int) ev.buffer()[xx]; } cerr << dec << endl;