164 unsigned char nStatus,
165 unsigned char nData1,
166 unsigned char nData2);
Cursor over the chunks inside one RIFF list or Standard MIDI File.
Definition hxilistchunk.h:19
Seekable data source interface, unrelated to IBStream and OBStream.
Definition hxstream.h:35
static constexpr short kTargetDivision
Ticks per quarter note of every position delivered to the receiver.
Definition reader.h:39
void ReadTrackChunk(HxStream &stream)
Read one MTrk chunk when the file format has one track per chunk.
void Flush()
Sort mPending with mCompare, deliver every event at mPendingTick, and empty it.
void QueueEvent(Sch::Tick tick, unsigned char nStatus, unsigned char nData1, unsigned char nData2)
Deliver a channel event, or collect it in mPending when mCompare is set.
short mTrackCount
Definition reader.h:192
void ReadMeta(unsigned char nType, HxStream &stream)
Read one meta event and deliver end of track, tempo, and the seven text types.
int mTrackDone
Definition reader.h:199
EventCompare mCompare
Definition reader.h:203
void ReadHeader(HxStream &stream)
Read the format, track count, and division of an MThd chunk.
void SendChannelMsg(Sch::Tick tick, unsigned char nStatus, unsigned char nData1, unsigned char nData2)
Deliver one channel event to the receiver slot its status selects.
int mTrack
Definition reader.h:195
void AllTracksRead()
Report the end of the file to the receiver's AllDone().
void ReadSystemEvent(HxStream &stream)
Skip a system-exclusive event or read a meta event, depending on mRunningStatus.
short mFormat
Definition reader.h:191
bool ReadChunk()
Read the next chunk.
void ReadAllTracks()
Read every chunk of the file.
Reader(HxIListChunk *pReader, Receiver *pReceiver)
Build a reader over the chunks of a file.
short mDivision
Definition reader.h:193
short mTargetDivision
Definition reader.h:194
bool(* EventCompare)(const Midi &left, const Midi &right)
Ordering mPending is sorted by.
Definition reader.h:51
std::vector< Midi > mPending
Definition reader.h:201
void ReadEvent(HxStream &stream)
Read one delta time and event.
HxIListChunk * mReader
Definition reader.h:200
unsigned char mRunningStatus
Definition reader.h:198
int mTick
Definition reader.h:197
Sch::Tick mPendingTick
Definition reader.h:202
Receiver * mReceiver
Definition reader.h:196
void ReadTrack(HxStream &stream)
Begin a track at the receiver and read its events until the end-of-track meta event.
Sink a Standard MIDI File reader delivers one event at a time to.
Definition receiver.h:27
Song position in MIDI ticks, printed as measure, beat, and tick.
Definition tick.h:70
Reading of Standard MIDI Files and the receivers their events go to.
Definition reader.h:11
One channel event waiting in mPending.
Definition reader.h:44
unsigned char mData1
Definition reader.h:46
unsigned char mStatus
Definition reader.h:45
unsigned char mData2
Definition reader.h:47