Feature: Decoder for DOS version music

This is based on reverse-engineering the TTD DOS driver for General MIDI music.
This commit is contained in:
Niels Martin Hansen
2018-03-14 15:55:40 +01:00
committed by Michael Lutz
parent f946b3da56
commit 2ae9df7248
5 changed files with 492 additions and 25 deletions

View File

@@ -17,6 +17,8 @@
#include "midi.h"
#include <vector>
struct MusicSongInfo;
struct MidiFile {
struct DataBlock {
uint32 ticktime; ///< tick number since start of file this block should be triggered at
@@ -35,6 +37,8 @@ struct MidiFile {
uint16 tickdiv; ///< ticks per quarter note
bool LoadFile(const char *filename);
bool LoadMpsData(const byte *data, size_t length);
bool LoadSong(const MusicSongInfo &song);
void MoveFrom(MidiFile &other);
static bool ReadSMFHeader(const char *filename, SMFHeader &header);