MidiTrack Class Reference
#include <track.h>
Public Member Functions | |
MidiTrack (FILE *file, int tpcn, int Id) | |
~MidiTrack () | |
int | ticksPassed (ulong ticks) |
int | msPassed (ulong ms) |
int | currentMs (double ms) |
ulong | waitTicks (void) |
double | absMsOfNextEvent (void) |
void | changeTempo (ulong t) |
void | readEvent (MidiEvent *ev) |
void | init (void) |
void | clear (void) |
Detailed Description
Stores a MIDI track.
This can be thought of as a list of MIDI events.
The data types used to store the track is similar to how events are stored on a MIDI file, but used in a way that allows for faster parses.
This class is used on MidiPlayer::loadSong() to load the song and later play it with MidiPlayer::play().
Stores a MIDI track with a simple API
- Version
- 0.9.5 17/01/2000
Constructor & Destructor Documentation
◆ MidiTrack()
MidiTrack::MidiTrack | ( | FILE * | file, |
int | tpcn, | ||
int | Id | ||
) |
Constructor.
- Parameters
-
file the file to read the track from. It should be ready at the start of a track. MidiTrack reads just that track and the file is left at the end of this track). tpcn the ticks per cuarter note used in this file. Id the ID for this track.
◆ ~MidiTrack()
Member Function Documentation
◆ absMsOfNextEvent()
|
inline |
◆ changeTempo()
void MidiTrack::changeTempo | ( | ulong | t | ) |
◆ clear()
void MidiTrack::clear | ( | void | ) |
◆ currentMs()
int MidiTrack::currentMs | ( | double | ms | ) |
◆ init()
◆ msPassed()
int MidiTrack::msPassed | ( | ulong | ms | ) |
Makes the iterator advance the given number of milliseconds.
- Returns
- 0 if OK, and 1 if you didn't handle this track well and you forgot to take an event (thing that will never happen if you use MidiPlayer::play() ).
◆ readEvent()
void MidiTrack::readEvent | ( | MidiEvent * | ev | ) |
◆ ticksPassed()
int MidiTrack::ticksPassed | ( | ulong | ticks | ) |
Makes the iterator advance the given number of ticks.
- Returns
- 0 if OK, and 1 if you didn't handle this track well and you forgot to take an event (thing that will never happen if you use MidiPlayer::play() ).
◆ waitTicks()
|
inline |
The documentation for this class was generated from the following files: