summaryrefslogtreecommitdiff
path: root/libs/ardour/smf_source.cc
diff options
context:
space:
mode:
authorHans Baier <hansfbaier@googlemail.com>2008-05-09 11:28:14 +0000
committerHans Baier <hansfbaier@googlemail.com>2008-05-09 11:28:14 +0000
commit8d44391f4ba571c4dbcec0a87033c83414f515e8 (patch)
tree8875e32f275f027fbbd790f90fdd09fe01d235de /libs/ardour/smf_source.cc
parentf65119016207d9c413437227bd5117fef7dc31b1 (diff)
* adjusted formatting a bit to style guide
* fixed: velocity value left on canvas * fixed: end-of-track problem still showed up sometimes * enabled heaps of debugging output in order to debug MidiModel corruption git-svn-id: svn://localhost/ardour2/branches/3.0@3329 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/smf_source.cc')
-rw-r--r--libs/ardour/smf_source.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc
index 8c2ee6031f..4ab7a9b973 100644
--- a/libs/ardour/smf_source.cc
+++ b/libs/ardour/smf_source.cc
@@ -194,8 +194,15 @@ SMFSource::seek_to_footer_position()
// lets check if there is a track end marker at the end of the data
fseek(_fd, -4, SEEK_END);
+ //cerr << "SMFSource::seek_to_footer_position: At position: " << ftell(_fd);
size_t read_bytes = fread(buffer, sizeof(uint8_t), 4, _fd);
- //cerr << "SMFSource::seek_to_footer_position: read size: " << read_bytes << endl;
+ /*cerr << " read size: " << read_bytes << " buffer: ";
+ for (size_t i=0; i < read_bytes; ++i) {
+ printf("%x ", buffer[i]);
+ }
+ printf("\n");
+ */
+
if( (read_bytes == 4) &&
buffer[0] == 0x00 &&
buffer[1] == 0xFF &&
@@ -244,6 +251,7 @@ SMFSource::flush_footer()
//cerr << path() << " SMF Flushing footer\n";
seek_to_footer_position();
write_footer();
+ seek_to_footer_position();
return 0;
}
@@ -491,8 +499,8 @@ SMFSource::write_unlocked (MidiRingBuffer& src, nframes_t cnt)
void
SMFSource::append_event_unlocked(EventTimeUnit unit, const MIDI::Event& ev)
{
- /*printf("SMFSource: %s - append_event_unlocked chan = %u, time = %lf, size = %u, data = ",
- name().c_str(), (unsigned)ev.channel(), ev.time(), ev.size()); */
+ printf("SMFSource: %s - append_event_unlocked chan = %u, time = %lf, size = %u, data = ",
+ name().c_str(), (unsigned)ev.channel(), ev.time(), ev.size());
for (size_t i=0; i < ev.size(); ++i) {
printf("%X ", ev.buffer()[i]);
}