12 #ifndef MUSIC_MIDIFILE_HPP 13 #define MUSIC_MIDIFILE_HPP 15 #include "../stdafx.h" 16 #include "../core/smallvec_type.hpp" 28 DataBlock(uint32 _ticktime = 0) : ticktime(_ticktime) { }
33 TempoChange(uint32 _ticktime, uint32 _tempo) : ticktime(_ticktime), tempo(_tempo) { }
Metadata about a music track.
bool LoadMpsData(const byte *data, size_t length)
Create MIDI data from song data for the original Microprose music drivers.
bool LoadFile(const char *filename)
Load a standard MIDI file.
SmallVector< byte, 8 > data
raw midi data contained in block
uint16 tickdiv
ticks per quarter note
void MoveFrom(MidiFile &other)
Move data from other to this, and clears other.
std::vector< DataBlock > blocks
sequential time-annotated data of file, merged to a single track
uint32 tempo
new tempo in microseconds per tick
std::vector< TempoChange > tempos
list of tempo changes in file
uint32 realtime
real-time (microseconds) since start of file this block should be triggered at
uint32 ticktime
tick number since start of file this tempo change occurs at
static std::string GetSMFFile(const MusicSongInfo &song)
Get the name of a Standard MIDI File for a given song.
static bool ReadSMFHeader(const char *filename, SMFHeader &header)
Read the header of a standard MIDI file.
uint32 ticktime
tick number since start of file this block should be triggered at
bool WriteSMF(const char *filename)
Write a Standard MIDI File containing the decoded music.