2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2003-05-18 23:36:38 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2003-05-18 23:36:38 +00:00
|
|
|
*
|
2006-02-11 10:05:31 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2003-05-18 23:36:38 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2005-06-24 16:16:46 +00:00
|
|
|
#include "sound/midiparser.h"
|
|
|
|
#include "sound/mididrv.h"
|
2003-05-18 23:36:38 +00:00
|
|
|
#include "common/util.h"
|
|
|
|
|
2003-10-03 23:34:06 +00:00
|
|
|
/**
|
|
|
|
* The Standard MIDI File version of MidiParser.
|
|
|
|
*/
|
2003-05-18 23:36:38 +00:00
|
|
|
class MidiParser_SMF : public MidiParser {
|
|
|
|
protected:
|
|
|
|
byte *_buffer;
|
2003-05-19 05:00:13 +00:00
|
|
|
bool _malformedPitchBends;
|
2003-05-18 23:36:38 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void compressToType0();
|
2005-05-27 12:43:19 +00:00
|
|
|
void parseNextEvent(EventInfo &info);
|
2003-05-18 23:36:38 +00:00
|
|
|
|
|
|
|
public:
|
2003-05-25 15:47:06 +00:00
|
|
|
MidiParser_SMF() : _buffer(0), _malformedPitchBends(false) {}
|
2003-05-19 00:12:16 +00:00
|
|
|
~MidiParser_SMF();
|
|
|
|
|
2005-05-27 12:43:19 +00:00
|
|
|
bool loadMusic(byte *data, uint32 size);
|
|
|
|
void property(int property, int value);
|
2003-05-18 23:36:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-10-03 23:34:06 +00:00
|
|
|
static const byte command_lengths[8] = { 3, 3, 3, 3, 2, 2, 3, 0 };
|
2004-05-01 13:16:45 +00:00
|
|
|
static const byte special_lengths[16] = { 0, 2, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 };
|
2003-05-19 05:00:13 +00:00
|
|
|
|
2003-05-19 00:12:16 +00:00
|
|
|
MidiParser_SMF::~MidiParser_SMF() {
|
2010-01-03 19:37:43 +00:00
|
|
|
free(_buffer);
|
2003-05-19 00:12:16 +00:00
|
|
|
}
|
|
|
|
|
2005-05-27 12:43:19 +00:00
|
|
|
void MidiParser_SMF::property(int prop, int value) {
|
2003-05-19 09:04:50 +00:00
|
|
|
switch (prop) {
|
2003-05-19 05:00:13 +00:00
|
|
|
case mpMalformedPitchBends:
|
|
|
|
_malformedPitchBends = (value > 0);
|
2003-05-19 18:48:18 +00:00
|
|
|
default:
|
2005-05-27 12:43:19 +00:00
|
|
|
MidiParser::property(prop, value);
|
2003-05-19 05:00:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-05-27 12:43:19 +00:00
|
|
|
void MidiParser_SMF::parseNextEvent(EventInfo &info) {
|
2003-05-23 04:19:47 +00:00
|
|
|
info.start = _position._play_pos;
|
2005-05-27 12:43:19 +00:00
|
|
|
info.delta = readVLQ(_position._play_pos);
|
2003-05-19 18:48:18 +00:00
|
|
|
|
|
|
|
// Process the next info. If mpMalformedPitchBends
|
|
|
|
// was set, we must skip over any pitch bend events
|
|
|
|
// because they are from Simon games and are not
|
|
|
|
// real pitch bend events, they're just two-byte
|
|
|
|
// prefixes before the real info.
|
|
|
|
do {
|
2003-05-23 04:19:47 +00:00
|
|
|
if ((_position._play_pos[0] & 0xF0) >= 0x80)
|
|
|
|
info.event = *(_position._play_pos++);
|
2003-05-19 18:48:18 +00:00
|
|
|
else
|
2003-05-23 04:19:47 +00:00
|
|
|
info.event = _position._running_status;
|
|
|
|
} while (_malformedPitchBends && (info.event & 0xF0) == 0xE0 && _position._play_pos++);
|
2003-05-19 18:48:18 +00:00
|
|
|
if (info.event < 0x80)
|
2003-05-18 23:36:38 +00:00
|
|
|
return;
|
|
|
|
|
2003-05-23 04:19:47 +00:00
|
|
|
_position._running_status = info.event;
|
2003-05-22 15:34:30 +00:00
|
|
|
switch (info.command()) {
|
2008-07-09 10:42:47 +00:00
|
|
|
case 0x9: // Note On
|
|
|
|
info.basic.param1 = *(_position._play_pos++);
|
|
|
|
info.basic.param2 = *(_position._play_pos++);
|
|
|
|
if (info.basic.param2 == 0)
|
|
|
|
info.event = info.channel() | 0x80;
|
|
|
|
info.length = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0xC:
|
|
|
|
case 0xD:
|
2003-05-23 04:19:47 +00:00
|
|
|
info.basic.param1 = *(_position._play_pos++);
|
2003-05-19 19:24:22 +00:00
|
|
|
info.basic.param2 = 0;
|
2003-05-19 18:48:18 +00:00
|
|
|
break;
|
|
|
|
|
2008-07-09 10:42:47 +00:00
|
|
|
case 0x8:
|
|
|
|
case 0xA:
|
|
|
|
case 0xB:
|
|
|
|
case 0xE:
|
2003-05-23 04:19:47 +00:00
|
|
|
info.basic.param1 = *(_position._play_pos++);
|
|
|
|
info.basic.param2 = *(_position._play_pos++);
|
2003-05-22 15:34:30 +00:00
|
|
|
info.length = 0;
|
2003-05-19 18:48:18 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0xF: // System Common, Meta or SysEx event
|
|
|
|
switch (info.event & 0x0F) {
|
|
|
|
case 0x2: // Song Position Pointer
|
2003-05-23 04:19:47 +00:00
|
|
|
info.basic.param1 = *(_position._play_pos++);
|
|
|
|
info.basic.param2 = *(_position._play_pos++);
|
2003-05-18 23:36:38 +00:00
|
|
|
break;
|
|
|
|
|
2003-05-19 18:48:18 +00:00
|
|
|
case 0x3: // Song Select
|
2003-05-23 04:19:47 +00:00
|
|
|
info.basic.param1 = *(_position._play_pos++);
|
2003-05-19 19:24:22 +00:00
|
|
|
info.basic.param2 = 0;
|
2003-05-18 23:36:38 +00:00
|
|
|
break;
|
|
|
|
|
2008-07-09 10:42:47 +00:00
|
|
|
case 0x6:
|
|
|
|
case 0x8:
|
|
|
|
case 0xA:
|
|
|
|
case 0xB:
|
|
|
|
case 0xC:
|
|
|
|
case 0xE:
|
2003-05-19 19:24:22 +00:00
|
|
|
info.basic.param1 = info.basic.param2 = 0;
|
2003-05-18 23:36:38 +00:00
|
|
|
break;
|
|
|
|
|
2003-05-19 18:48:18 +00:00
|
|
|
case 0x0: // SysEx
|
2005-05-27 12:43:19 +00:00
|
|
|
info.length = readVLQ(_position._play_pos);
|
2003-05-23 04:19:47 +00:00
|
|
|
info.ext.data = _position._play_pos;
|
|
|
|
_position._play_pos += info.length;
|
2003-05-19 18:48:18 +00:00
|
|
|
break;
|
2003-05-18 23:36:38 +00:00
|
|
|
|
2003-05-19 18:48:18 +00:00
|
|
|
case 0xF: // META event
|
2003-05-23 04:19:47 +00:00
|
|
|
info.ext.type = *(_position._play_pos++);
|
2005-05-27 12:43:19 +00:00
|
|
|
info.length = readVLQ(_position._play_pos);
|
2003-05-23 04:19:47 +00:00
|
|
|
info.ext.data = _position._play_pos;
|
|
|
|
_position._play_pos += info.length;
|
2003-05-19 18:48:18 +00:00
|
|
|
break;
|
2007-09-19 08:40:12 +00:00
|
|
|
|
2007-02-16 13:30:41 +00:00
|
|
|
default:
|
2007-02-18 18:03:57 +00:00
|
|
|
warning("MidiParser_SMF::parseNextEvent: Unsupported event code %x", info.event);
|
2003-05-18 23:36:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-05-27 12:43:19 +00:00
|
|
|
bool MidiParser_SMF::loadMusic(byte *data, uint32 size) {
|
2003-05-18 23:36:38 +00:00
|
|
|
uint32 len;
|
|
|
|
byte midi_type;
|
|
|
|
uint32 total_size;
|
2003-05-19 05:00:13 +00:00
|
|
|
bool isGMF;
|
2003-05-18 23:36:38 +00:00
|
|
|
|
|
|
|
unloadMusic();
|
|
|
|
byte *pos = data;
|
2003-05-19 05:00:13 +00:00
|
|
|
isGMF = false;
|
2003-05-18 23:36:38 +00:00
|
|
|
|
2005-05-27 12:43:19 +00:00
|
|
|
if (!memcmp(pos, "RIFF", 4)) {
|
2003-05-18 23:36:38 +00:00
|
|
|
// Skip the outer RIFF header.
|
|
|
|
pos += 8;
|
|
|
|
}
|
|
|
|
|
2005-05-27 12:43:19 +00:00
|
|
|
if (!memcmp(pos, "MThd", 4)) {
|
2003-05-18 23:36:38 +00:00
|
|
|
// SMF with MTHd information.
|
|
|
|
pos += 4;
|
2005-05-27 12:43:19 +00:00
|
|
|
len = read4high(pos);
|
2003-05-18 23:36:38 +00:00
|
|
|
if (len != 6) {
|
2005-05-27 12:43:19 +00:00
|
|
|
warning("MThd length 6 expected but found %d", (int)len);
|
2003-05-18 23:36:38 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Verify that this MIDI either is a Type 2
|
|
|
|
// or has only 1 track. We do not support
|
|
|
|
// multitrack Type 1 files.
|
|
|
|
_num_tracks = pos[2] << 8 | pos[3];
|
|
|
|
midi_type = pos[1];
|
|
|
|
if (midi_type > 2 /*|| (midi_type < 2 && _num_tracks > 1)*/) {
|
2005-05-27 12:43:19 +00:00
|
|
|
warning("No support for a Type %d MIDI with %d tracks", (int)midi_type, (int)_num_tracks);
|
2003-05-18 23:36:38 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
_ppqn = pos[4] << 8 | pos[5];
|
|
|
|
pos += len;
|
2005-05-27 12:43:19 +00:00
|
|
|
} else if (!memcmp(pos, "GMF\x1", 4)) {
|
2003-05-18 23:36:38 +00:00
|
|
|
// Older GMD/MUS file with no header info.
|
|
|
|
// Assume 1 track, 192 PPQN, and no MTrk headers.
|
2003-05-19 05:00:13 +00:00
|
|
|
isGMF = true;
|
2003-05-18 23:36:38 +00:00
|
|
|
midi_type = 0;
|
|
|
|
_num_tracks = 1;
|
|
|
|
_ppqn = 192;
|
|
|
|
pos += 7; // 'GMD\x1' + 3 bytes of useless (translate: unknown) information
|
|
|
|
} else {
|
2004-04-30 17:48:20 +00:00
|
|
|
warning("Expected MThd or GMD header but found '%c%c%c%c' instead", pos[0], pos[1], pos[2], pos[3]);
|
2003-05-18 23:36:38 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Now we identify and store the location for each track.
|
2003-05-23 04:19:47 +00:00
|
|
|
if (_num_tracks > ARRAYSIZE(_tracks)) {
|
2005-05-27 12:43:19 +00:00
|
|
|
warning("Can only handle %d tracks but was handed %d", (int)ARRAYSIZE(_tracks), (int)_num_tracks);
|
2003-05-18 23:36:38 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
total_size = 0;
|
|
|
|
int tracks_read = 0;
|
|
|
|
while (tracks_read < _num_tracks) {
|
2005-05-27 12:43:19 +00:00
|
|
|
if (memcmp(pos, "MTrk", 4) && !isGMF) {
|
2004-04-30 17:48:20 +00:00
|
|
|
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]);
|
2003-05-18 23:36:38 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// If needed, skip the MTrk and length bytes
|
2003-05-19 05:00:13 +00:00
|
|
|
_tracks[tracks_read] = pos + (isGMF ? 0 : 8);
|
|
|
|
if (!isGMF) {
|
2003-05-18 23:36:38 +00:00
|
|
|
pos += 4;
|
2005-05-27 12:43:19 +00:00
|
|
|
len = read4high(pos);
|
2003-05-18 23:36:38 +00:00
|
|
|
total_size += len;
|
|
|
|
pos += len;
|
|
|
|
} else {
|
|
|
|
// An SMF End of Track meta event must be placed
|
|
|
|
// at the end of the stream.
|
2003-05-19 05:00:13 +00:00
|
|
|
data[size++] = 0xFF;
|
|
|
|
data[size++] = 0x2F;
|
|
|
|
data[size++] = 0x00;
|
|
|
|
data[size++] = 0x00;
|
2003-05-18 23:36:38 +00:00
|
|
|
}
|
|
|
|
++tracks_read;
|
|
|
|
}
|
|
|
|
|
|
|
|
// If this is a Type 1 MIDI, we need to now compress
|
|
|
|
// our tracks down into a single Type 0 track.
|
2010-07-16 03:31:45 +00:00
|
|
|
free(_buffer);
|
|
|
|
_buffer = 0;
|
2003-05-18 23:36:38 +00:00
|
|
|
|
|
|
|
if (midi_type == 1) {
|
2004-05-01 16:42:58 +00:00
|
|
|
// FIXME: Doubled the buffer size to prevent crashes with the
|
|
|
|
// Inherit the Earth MIDIs. Jamieson630 said something about a
|
|
|
|
// better fix, but this will have to do in the meantime.
|
2005-05-27 12:43:19 +00:00
|
|
|
_buffer = (byte *)malloc(size * 2);
|
2003-05-18 23:36:38 +00:00
|
|
|
compressToType0();
|
|
|
|
_num_tracks = 1;
|
|
|
|
_tracks[0] = _buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Note that we assume the original data passed in
|
|
|
|
// will persist beyond this call, i.e. we do NOT
|
|
|
|
// copy the data to our own buffer. Take warning....
|
2003-05-19 18:48:18 +00:00
|
|
|
resetTracking();
|
2005-05-27 12:43:19 +00:00
|
|
|
setTempo(500000);
|
|
|
|
setTrack(0);
|
2003-05-18 23:36:38 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MidiParser_SMF::compressToType0() {
|
|
|
|
// We assume that _buffer has been allocated
|
|
|
|
// to sufficient size for this operation.
|
2006-04-13 23:13:56 +00:00
|
|
|
|
|
|
|
// using 0xFF since it could write track_pos[0 to _num_tracks] here
|
|
|
|
// this would cause some illegal writes and could lead to segfaults
|
|
|
|
// (it crashed for some midis for me, they're not used in any game
|
|
|
|
// scummvm supports though). *Maybe* handle this in another way,
|
|
|
|
// it's at the moment only to be sure, that nothing goes wrong.
|
|
|
|
byte *track_pos[0xFF];
|
|
|
|
byte running_status[0xFF];
|
|
|
|
uint32 track_timer[0xFF];
|
2003-05-18 23:36:38 +00:00
|
|
|
uint32 delta;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < _num_tracks; ++i) {
|
|
|
|
running_status[i] = 0;
|
|
|
|
track_pos[i] = _tracks[i];
|
2005-05-27 12:43:19 +00:00
|
|
|
track_timer[i] = readVLQ(track_pos[i]);
|
2003-05-20 20:58:59 +00:00
|
|
|
running_status[i] = 0;
|
2003-05-18 23:36:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int best_i;
|
|
|
|
uint32 length;
|
|
|
|
byte *output = _buffer;
|
|
|
|
byte *pos, *pos2;
|
|
|
|
byte event;
|
|
|
|
uint32 copy_bytes;
|
|
|
|
bool write;
|
2005-05-27 12:43:19 +00:00
|
|
|
byte active_tracks = (byte)_num_tracks;
|
2003-05-18 23:36:38 +00:00
|
|
|
|
|
|
|
while (active_tracks) {
|
|
|
|
write = true;
|
|
|
|
best_i = 255;
|
|
|
|
for (i = 0; i < _num_tracks; ++i) {
|
|
|
|
if (track_pos[i] && (best_i == 255 || track_timer[i] < track_timer[best_i]))
|
|
|
|
best_i = i;
|
|
|
|
}
|
|
|
|
if (best_i == 255) {
|
2004-04-30 17:48:20 +00:00
|
|
|
warning("Premature end of tracks");
|
2003-05-18 23:36:38 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Initial VLQ delta computation
|
|
|
|
delta = 0;
|
|
|
|
length = track_timer[best_i];
|
|
|
|
for (i = 0; length; ++i) {
|
2003-05-20 20:58:59 +00:00
|
|
|
delta = (delta << 8) | (length & 0x7F) | (i ? 0x80 : 0);
|
2003-05-18 23:36:38 +00:00
|
|
|
length >>= 7;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Process MIDI event.
|
2004-05-01 13:16:45 +00:00
|
|
|
bool implicitEvent = false;
|
2003-05-18 23:36:38 +00:00
|
|
|
copy_bytes = 0;
|
|
|
|
pos = track_pos[best_i];
|
2003-05-19 05:00:13 +00:00
|
|
|
do {
|
|
|
|
event = *(pos++);
|
2004-05-01 13:16:45 +00:00
|
|
|
if (event < 0x80) {
|
2003-05-19 05:00:13 +00:00
|
|
|
event = running_status[best_i];
|
2004-05-01 13:16:45 +00:00
|
|
|
implicitEvent = true;
|
|
|
|
}
|
2003-05-19 05:00:13 +00:00
|
|
|
} while (_malformedPitchBends && (event & 0xF0) == 0xE0 && pos++);
|
2003-05-18 23:36:38 +00:00
|
|
|
running_status[best_i] = event;
|
|
|
|
|
2005-05-27 12:43:19 +00:00
|
|
|
if (command_lengths[(event >> 4) - 8] > 0) {
|
|
|
|
copy_bytes = command_lengths[(event >> 4) - 8];
|
|
|
|
} else if (special_lengths[(event & 0x0F)] > 0) {
|
|
|
|
copy_bytes = special_lengths[(event & 0x0F)];
|
2003-05-18 23:36:38 +00:00
|
|
|
} else if (event == 0xF0) {
|
|
|
|
// SysEx
|
|
|
|
pos2 = pos;
|
2005-05-27 12:43:19 +00:00
|
|
|
length = readVLQ(pos);
|
2003-05-18 23:36:38 +00:00
|
|
|
copy_bytes = 1 + (pos - pos2) + length;
|
|
|
|
} else if (event == 0xFF) {
|
|
|
|
// META
|
|
|
|
event = *(pos++);
|
|
|
|
if (event == 0x2F && active_tracks > 1) {
|
|
|
|
track_pos[best_i] = 0;
|
|
|
|
write = false;
|
|
|
|
} else {
|
|
|
|
pos2 = pos;
|
2005-05-27 12:43:19 +00:00
|
|
|
length = readVLQ(pos);
|
2003-05-18 23:36:38 +00:00
|
|
|
copy_bytes = 2 + (pos - pos2) + length;
|
|
|
|
}
|
|
|
|
if (event == 0x2F)
|
|
|
|
--active_tracks;
|
|
|
|
} else {
|
2005-05-27 12:43:19 +00:00
|
|
|
warning("Bad MIDI command %02X", (int)event);
|
2003-05-18 23:36:38 +00:00
|
|
|
track_pos[best_i] = 0;
|
|
|
|
}
|
|
|
|
|
2003-05-20 20:58:59 +00:00
|
|
|
// Update all tracks' deltas
|
|
|
|
if (write) {
|
2003-05-18 23:36:38 +00:00
|
|
|
for (i = 0; i < _num_tracks; ++i) {
|
|
|
|
if (track_pos[i] && i != best_i)
|
|
|
|
track_timer[i] -= track_timer[best_i];
|
|
|
|
}
|
2003-05-20 20:58:59 +00:00
|
|
|
}
|
2003-05-18 23:36:38 +00:00
|
|
|
|
2003-05-20 20:58:59 +00:00
|
|
|
if (track_pos[best_i]) {
|
2003-05-18 23:36:38 +00:00
|
|
|
if (write) {
|
2003-05-20 20:58:59 +00:00
|
|
|
track_timer[best_i] = 0;
|
|
|
|
|
2003-05-18 23:36:38 +00:00
|
|
|
// Write VLQ delta
|
2003-05-20 20:58:59 +00:00
|
|
|
while (delta & 0x80) {
|
2005-05-27 12:43:19 +00:00
|
|
|
*output++ = (byte)(delta & 0xFF);
|
2003-05-18 23:36:38 +00:00
|
|
|
delta >>= 8;
|
2003-05-20 20:58:59 +00:00
|
|
|
}
|
2005-05-27 12:43:19 +00:00
|
|
|
*output++ = (byte)(delta & 0xFF);
|
2003-05-18 23:36:38 +00:00
|
|
|
|
|
|
|
// Write MIDI data
|
2004-05-01 13:16:45 +00:00
|
|
|
if (!implicitEvent)
|
|
|
|
++track_pos[best_i];
|
|
|
|
--copy_bytes;
|
|
|
|
*output++ = running_status[best_i];
|
2005-05-27 12:43:19 +00:00
|
|
|
memcpy(output, track_pos[best_i], copy_bytes);
|
2003-05-18 23:36:38 +00:00
|
|
|
output += copy_bytes;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Fetch new VLQ delta for winning track
|
|
|
|
track_pos[best_i] += copy_bytes;
|
2003-05-20 20:58:59 +00:00
|
|
|
if (active_tracks)
|
2005-05-27 12:43:19 +00:00
|
|
|
track_timer[best_i] += readVLQ(track_pos[best_i]);
|
2003-05-18 23:36:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
*output++ = 0x00;
|
|
|
|
}
|
|
|
|
|
|
|
|
MidiParser *MidiParser::createParser_SMF() { return new MidiParser_SMF; }
|