Mercurial > hg > svcore
diff data/fileio/MIDIFileReader.cpp @ 690:1424aa29ae95
Seems to be a bad idea to use plain DEBUG symbol on OS/X (system wants it)
author | Chris Cannam |
---|---|
date | Tue, 14 Jun 2011 15:26:52 +0100 |
parents | 06f13a3b9e9e |
children | e802e550a1f2 |
line wrap: on
line diff
--- a/data/fileio/MIDIFileReader.cpp Tue Jun 14 14:47:59 2011 +0100 +++ b/data/fileio/MIDIFileReader.cpp Tue Jun 14 15:26:52 2011 +0100 @@ -52,7 +52,7 @@ using namespace MIDIConstants; -//#define MIDI_DEBUG 1 +//#define MIDI_SVDEBUG 1 MIDIFileReader::MIDIFileReader(QString path, @@ -278,7 +278,7 @@ m_error = ""; #ifdef MIDI_DEBUG - DEBUG << "MIDIFileReader::open() : fileName = " << m_fileName.c_str() << endl; + SVDEBUG << "MIDIFileReader::open() : fileName = " << m_fileName.c_str() << endl; #endif // Open the file @@ -315,7 +315,7 @@ for (unsigned int j = 0; j < m_numberOfTracks; ++j) { #ifdef MIDI_DEBUG - DEBUG << "Parsing Track " << j << endl; + SVDEBUG << "Parsing Track " << j << endl; #endif if (!skipToNextTrack()) { @@ -350,7 +350,7 @@ } catch (MIDIException e) { - DEBUG << "MIDIFileReader::open() - caught exception - " << e.what() << endl; + SVDEBUG << "MIDIFileReader::open() - caught exception - " << e.what() << endl; m_error = e.what(); } @@ -392,14 +392,14 @@ { if (midiHeader.size() < 14) { #ifdef MIDI_DEBUG - DEBUG << "MIDIFileReader::parseHeader() - file header undersized" << endl; + SVDEBUG << "MIDIFileReader::parseHeader() - file header undersized" << endl; #endif return false; } if (midiHeader.compare(0, 4, MIDI_FILE_HEADER) != 0) { #ifdef MIDI_DEBUG - DEBUG << "MIDIFileReader::parseHeader()" + SVDEBUG << "MIDIFileReader::parseHeader()" << "- file header not found or malformed" << endl; #endif @@ -408,7 +408,7 @@ if (midiBytesToLong(midiHeader.substr(4,4)) != 6L) { #ifdef MIDI_DEBUG - DEBUG << "MIDIFileReader::parseHeader()" + SVDEBUG << "MIDIFileReader::parseHeader()" << " - header length incorrect" << endl; #endif @@ -498,7 +498,7 @@ data1 = midiByte; #ifdef MIDI_DEBUG - DEBUG << "using running status (byte " << int(midiByte) << " found)" << endl; + SVDEBUG << "using running status (byte " << int(midiByte) << " found)" << endl; #endif } else { #ifdef MIDI_DEBUG @@ -611,7 +611,7 @@ MIDI_END_OF_EXCLUSIVE) { #ifdef MIDI_DEBUG - DEBUG << "MIDIFileReader::parseTrack() - " + SVDEBUG << "MIDIFileReader::parseTrack() - " << "malformed or unsupported SysEx type" << endl; #endif @@ -631,14 +631,14 @@ case MIDI_END_OF_EXCLUSIVE: #ifdef MIDI_DEBUG - DEBUG << "MIDIFileReader::parseTrack() - " + SVDEBUG << "MIDIFileReader::parseTrack() - " << "Found a stray MIDI_END_OF_EXCLUSIVE" << endl; #endif break; default: #ifdef MIDI_DEBUG - DEBUG << "MIDIFileReader::parseTrack()" + SVDEBUG << "MIDIFileReader::parseTrack()" << " - Unsupported MIDI Event Code: " << (int)eventCode << endl; #endif @@ -787,15 +787,15 @@ double seconds = (60.0 * quarters) / tempo; /* - DEBUG << "MIDIFileReader::getTimeForMIDITime(" << midiTime << ")" + SVDEBUG << "MIDIFileReader::getTimeForMIDITime(" << midiTime << ")" << endl; - DEBUG << "timing division = " << td << endl; + SVDEBUG << "timing division = " << td << endl; std::cerr << "nearest tempo event (of " << m_tempoMap.size() << ") is at " << tempoMIDITime << " (" << tempoRealTime << ")" << std::endl; std::cerr << "quarters since then = " << quarters << std::endl; std::cerr << "tempo = " << tempo << " quarters per minute" << std::endl; std::cerr << "seconds since then = " << seconds << std::endl; - DEBUG << "resulting time = " << (tempoRealTime + RealTime::fromSeconds(seconds)) << endl; + SVDEBUG << "resulting time = " << (tempoRealTime + RealTime::fromSeconds(seconds)) << endl; */ return tempoRealTime + RealTime::fromSeconds(seconds); @@ -1033,7 +1033,7 @@ Note note(startFrame, (*i)->getPitch(), endFrame - startFrame, level, noteLabel); -// DEBUG << "Adding note " << startFrame << "," << (endFrame-startFrame) << " : " << int((*i)->getPitch()) << endl; +// SVDEBUG << "Adding note " << startFrame << "," << (endFrame-startFrame) << " : " << int((*i)->getPitch()) << endl; model->addPoint(note); break;