Public Member Functions | Public Attributes

MidiSequence Class Reference
[MIDI]

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

List of all members.

Public Member Functions

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

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:
trackIndex index of the track (start at 1 and less or equal to numTracks)
MidiEvent& MidiSequence::getEvent ( int  trackIndex,
int  eventIndex 
)

get a MidiEvent

Parameters:
trackIndex index of the track (start at 1 and less or equal to numTracks)
eventIndex index 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:
trackIndex index of the track (start at 1 and less or equal to numTracks)
songPosition song position in ticks
int MidiSequence::findNextAt ( int  trackIndex,
int  songPosition 
)

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

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

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

Parameters:
trackIndex index of the track (start at 1 and less or equal to numTracks)
songPosition song position in ticks