summaryrefslogtreecommitdiff
path: root/libs/ardour/smf_source.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-07-14 12:59:51 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-07-14 12:59:51 +0000
commit78eafdced6deb74a4edb78054780b75c5148701f (patch)
treee672d1d9059c8012f76deddf88da43437f1db4ef /libs/ardour/smf_source.cc
parent160f1493faa489b79a7cb0cbbc0b3f3758cb1939 (diff)
more midi I/O debugging
git-svn-id: svn://localhost/ardour2/branches/3.0@9873 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/smf_source.cc')
-rw-r--r--libs/ardour/smf_source.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc
index cf46099a3e..158c9c144d 100644
--- a/libs/ardour/smf_source.cc
+++ b/libs/ardour/smf_source.cc
@@ -240,9 +240,13 @@ SMFSource::write_unlocked (MidiRingBuffer<framepos_t>& source, framepos_t positi
Evoral::MIDIEvent<framepos_t> ev;
+ cerr << "SMFSource::write unlocked, begins writing from src buffer\n";
+
while (true) {
bool ret = source.peek ((uint8_t*)&time, sizeof (time));
if (!ret || time > _last_write_end + duration) {
+ DEBUG_TRACE (DEBUG::MidiIO, string_compose ("SMFSource::write_unlocked: dropping event @ %1 because ret %4 or it is later than %2 + %3\n",
+ time, _last_write_end, duration, ret));
break;
}
@@ -277,11 +281,12 @@ SMFSource::write_unlocked (MidiRingBuffer<framepos_t>& source, framepos_t positi
continue;
}
+ cerr << "SMFSource:: calling append_event_unlocked_frames()\n";
append_event_unlocked_frames(ev, position);
}
Evoral::SMF::flush();
- free(buf);
+ free (buf);
return duration;
}
@@ -336,6 +341,7 @@ SMFSource::append_event_unlocked_frames (const Evoral::Event<framepos_t>& ev, fr
{
assert(_writing);
if (ev.size() == 0) {
+ cerr << "SMFSource: asked to append zero-size event\n";
return;
}
@@ -545,8 +551,9 @@ SMFSource::load_model (bool lock, bool force_reload)
have_event_id = false;
}
- _model->end_write(false);
- _model->set_edited(false);
+ //_model->end_write (_length_beats, false, true);
+ _model->end_write (false);
+ _model->set_edited (false);
_model_iter = _model->begin();
@@ -567,7 +574,7 @@ SMFSource::flush_midi ()
return;
}
- Evoral::SMF::end_write();
+ Evoral::SMF::end_write ();
/* data in the file means its no longer removable */
mark_nonremovable ();
}