From 659382ecd809ce736298dc1c8721e32870f9b107 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 10 Jan 2024 11:44:23 -0700 Subject: [PATCH] convert debug output from printf to type-safe iostreams --- libs/ardour/midi_model.cc | 3 +++ libs/ardour/smf_source.cc | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc index 06f7df72ad..3d126888cb 100644 --- a/libs/ardour/midi_model.cc +++ b/libs/ardour/midi_model.cc @@ -243,6 +243,7 @@ MidiModel::NoteDiffCommand::operator() () MidiModel::WriteLock lock(_model->edit_lock()); for (NoteList::iterator i = _added_notes.begin(); i != _added_notes.end(); ++i) { + std::cerr << "====== ADDDED a note " << *i << std::endl; if (!_model->add_note_unlocked(*i)) { /* failed to add it, so don't leave it in the removed list, to avoid apparent errors on undo. @@ -1262,6 +1263,8 @@ MidiModel::sync_to_source (const Source::WriterLock& source_lock) { ReadLock lock(read_lock()); + std::cerr << "SYNC " << _midi_source.name() << " from model\n"; + /* Invalidate and store active notes, which will be picked up by the iterator on the next roll if time progresses linearly. */ _midi_source.invalidate(source_lock); diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index 71051b20e4..e5eeea6b88 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -475,9 +475,9 @@ SMFSource::append_event_beats (const WriterLock& lock, } #if 0 - printf("SMFSource: %s - append_event_beats ID = %d time = %lf, size = %u, data = ", - name().c_str(), ev.id(), ev.time(), ev.size()); - for (size_t i = 0; i < ev.size(); ++i) printf("%X ", ev.buffer()[i]); printf("\n"); + std::cerr << "SMFSource " << name() << " - append_event_beats ID = " << ev.id() << " time = " << ev.time() << " size " << ev.size() << " data: "; + for (size_t i = 0; i < ev.size(); ++i) std::cerr << "0x" << std::hex << (int) ev.buffer()[i]; + std::cerr << std::dec << std::endl; #endif Temporal::Beats time = ev.time();