From 3a40d9ef6b921d2fe2f6f3928d4e849a900cda6d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 4 Apr 2011 21:48:17 +0000 Subject: [PATCH] minor tweaks to debug output and comments and header order git-svn-id: svn://localhost/ardour2/branches/3.0@9285 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/audio_diskstream.cc | 4 +++- libs/ardour/midi_playlist.cc | 4 ++-- libs/ardour/midi_source.cc | 9 ++++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index 326efb21c3..2f72dbee5e 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -745,7 +745,9 @@ AudioDiskstream::overwrite_existing_buffers () mixdown_buffer = new Sample[size]; gain_buffer = new float[size]; - /* reduce size so that we can fill the buffer correctly. */ + /* reduce size so that we can fill the buffer correctly (ringbuffers + * can only handle size-1, otherwise they appear to be empty) + */ size--; uint32_t n=0; diff --git a/libs/ardour/midi_playlist.cc b/libs/ardour/midi_playlist.cc index ec90b2e913..31918aa2b6 100644 --- a/libs/ardour/midi_playlist.cc +++ b/libs/ardour/midi_playlist.cc @@ -24,6 +24,8 @@ #include +#include "pbd/error.h" + #include "evoral/EventList.hpp" #include "ardour/debug.h" @@ -34,8 +36,6 @@ #include "ardour/session.h" #include "ardour/midi_ring_buffer.h" -#include "pbd/error.h" - #include "i18n.h" using namespace ARDOUR; diff --git a/libs/ardour/midi_source.cc b/libs/ardour/midi_source.cc index 5e57651775..dcf89e6b84 100644 --- a/libs/ardour/midi_source.cc +++ b/libs/ardour/midi_source.cc @@ -219,7 +219,7 @@ MidiSource::midi_read (Evoral::EventSink& dst, framepos_t source_sta } _model_iter_valid = true; } else { - DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("*** %1 use cached iterator for %1 / %2\n", _name, source_start, start)); + DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("*** %1 use cachediterator for %1 / %2\n", _name, source_start, start)); } _last_read_end = start + cnt; @@ -231,13 +231,16 @@ MidiSource::midi_read (Evoral::EventSink& dst, framepos_t source_sta /* convert event times to session frames by adding on the source start position in session frames */ dst.write (time_frames + source_start, i->event_type(), i->size(), i->buffer()); + DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("%1: add event @ %2 type %3 size = %4\n", + _name, time_frames + source_start, i->event_type(), i->size())); + if (tracker) { Evoral::MIDIEvent& ev (*(Evoral::MIDIEvent*) (&(*i))); if (ev.is_note_on()) { - DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("\t%1 add note on %2 @ %3 velocity %4\n", _name, (int) ev.note(), time_frames, (int) ev.velocity())); + DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("\t%1 track note on %2 @ %3 velocity %4\n", _name, (int) ev.note(), time_frames, (int) ev.velocity())); tracker->add (ev.note(), ev.channel()); } else if (ev.is_note_off()) { - DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("\t%1 add note off %2 @ %3\n", _name, (int) ev.note(), time_frames)); + DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("\t%1 track note off %2 @ %3\n", _name, (int) ev.note(), time_frames)); tracker->remove (ev.note(), ev.channel()); } }