List of all members | Public Member Functions | Public Attributes
MidiSequence Class Reference

A Midi sequence that represent a midi file. More...

Public Member Functions

int findAt (int trackIndex, int songPosition)
 return the index of the first event not less than songPosition, nil otherwise. More...
 
int findNextAt (int trackIndex, int songPosition)
 return the index of the first event greater than songPosition, nil otherwise. More...
 
int findPreviousAt (int trackIndex, int songPosition)
 return the index of the whose position is just before songPosition, nil otherwise. More...
 
MidiEventgetEvent (int trackIndex, int eventIndex)
 get a MidiEvent More...
 
int getNumEventsForTrack (int trackIndex)
 return the number of events in the track. More...
 

Public Attributes

int division
 time division: number of ticks per beat
 
int format
 midi format type (0|1|2)
 
int numTracks
 number of midi Tracks
 

Detailed Description

A Midi sequence that represent a midi file.

a Midi Sequence is a collection of tracks containing MidiEvents.

Member Function Documentation

int MidiSequence::getNumEventsForTrack ( int  trackIndex)

return the number of events in the track.

Parameters
trackIndexindex of the track (start at 1 and less or equal to numTracks)
MidiEvent& MidiSequence::getEvent ( int  trackIndex,
int  eventIndex 
)

get a MidiEvent

Parameters
trackIndexindex of the track (start at 1 and less or equal to numTracks)
eventIndexindex of the track (start at 1 and less or equal to getNumEventsForTrack(trackIndex))
int MidiSequence::findAt ( int  trackIndex,
int  songPosition 
)

return the index of the first event not less than songPosition, nil otherwise.

Parameters
trackIndexindex of the track (start at 1 and less or equal to numTracks)
songPositionsong position in ticks
int MidiSequence::findNextAt ( int  trackIndex,
int  songPosition 
)

return the index of the first event greater than songPosition, nil otherwise.

Parameters
trackIndexindex of the track (start at 1 and less or equal to numTracks)
songPositionsong position in ticks
int MidiSequence::findPreviousAt ( int  trackIndex,
int  songPosition 
)

return the index of the whose position is just before songPosition, nil otherwise.

Parameters
trackIndexindex of the track (start at 1 and less or equal to numTracks)
songPositionsong position in ticks