[Scummvm-cvs-logs] CVS: scummvm/sound midiparser_smf.cpp,1.17,1.18
Torbj?rn Andersson
eriktorbjorn at users.sourceforge.net
Fri Apr 30 10:49:09 CEST 2004
Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32636
Modified Files:
midiparser_smf.cpp
Log Message:
Changed printf() to warning()
Index: midiparser_smf.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/midiparser_smf.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- midiparser_smf.cpp 6 Jan 2004 12:45:33 -0000 1.17
+++ midiparser_smf.cpp 30 Apr 2004 17:48:20 -0000 1.18
@@ -148,7 +148,7 @@
pos += 4;
len = read4high (pos);
if (len != 6) {
- printf ("Warning: MThd length 6 expected but found %d\n", (int) len);
+ warning("MThd length 6 expected but found %d", (int) len);
return false;
}
@@ -158,7 +158,7 @@
_num_tracks = pos[2] << 8 | pos[3];
midi_type = pos[1];
if (midi_type > 2 /*|| (midi_type < 2 && _num_tracks > 1)*/) {
- printf ("Warning: No support for a Type %d MIDI with %d tracks\n", (int) midi_type, (int) _num_tracks);
+ warning("No support for a Type %d MIDI with %d tracks", (int) midi_type, (int) _num_tracks);
return false;
}
_ppqn = pos[4] << 8 | pos[5];
@@ -172,13 +172,13 @@
_ppqn = 192;
pos += 7; // 'GMD\x1' + 3 bytes of useless (translate: unknown) information
} else {
- printf ("Expected MThd or GMD header but found '%c%c%c%c' instead.\n", pos[0], pos[1], pos[2], pos[3]);
+ warning("Expected MThd or GMD header but found '%c%c%c%c' instead", pos[0], pos[1], pos[2], pos[3]);
return false;
}
// Now we identify and store the location for each track.
if (_num_tracks > ARRAYSIZE(_tracks)) {
- printf ("Can only handle %d tracks but was handed %d\n", (int) ARRAYSIZE(_tracks), (int) _num_tracks);
+ warning("Can only handle %d tracks but was handed %d", (int) ARRAYSIZE(_tracks), (int) _num_tracks);
return false;
}
@@ -186,8 +186,8 @@
int tracks_read = 0;
while (tracks_read < _num_tracks) {
if (memcmp (pos, "MTrk", 4) && !isGMF) {
- printf ("Position: %p ('%c')\n", pos, *pos);
- printf ("Hit invalid block '%c%c%c%c' while scanning for track locations\n", pos[0], pos[1], pos[2], pos[3]);
+ warning("Position: %p ('%c')", pos, *pos);
+ warning("Hit invalid block '%c%c%c%c' while scanning for track locations", pos[0], pos[1], pos[2], pos[3]);
return false;
}
@@ -265,7 +265,7 @@
best_i = i;
}
if (best_i == 255) {
- printf ("Premature end of tracks!\n");
+ warning("Premature end of tracks");
break;
}
@@ -310,7 +310,7 @@
if (event == 0x2F)
--active_tracks;
} else {
- printf ("Bad MIDI command %02X!\n", (int) event);
+ warning("Bad MIDI command %02X", (int) event);
track_pos[best_i] = 0;
}
More information about the Scummvm-git-logs
mailing list