Package com.softsynth.midifile
Interface MIDIFileListener
- All Known Implementing Classes:
MIDIFileImage,MIDIFileListenerTest,MIDIFilePrinter,MIDIFileToMusicShape
public interface MIDIFileListener
MIDI File Listener
This class is called by the MIDI File Input Stream when it parses MIDI Files.
- Author:
- Phil Burk (C) 1999 SoftSynth.com
-
Method Summary
Modifier and Type Method Description voidhandleBeginTrack(int index)Called at the beginning of each trackvoidhandleEndTrack(int index)Called at the end of each trackvoidhandleEvent(int ticks, int command, int data1, int data2)Called when a MIDI Message event is encountered.voidhandleHeader(int format, int numTracks, short division)Called when the header is parsed.voidhandleMetaEvent(int ticks, int type, byte[] b)Called when a MetaEvent is encountered.voidhandleSysExF0(int ticks, byte[] b)Called when an F0 SysEx event is encountered.voidhandleSysExF7(int ticks, byte[] b)Called when an F7 SysEx event is encountered.
-
Method Details
-
handleHeader
void handleHeader(int format, int numTracks, short division)Called when the header is parsed.- Parameters:
format- Format of file. 0, 1 or 2.numTracks-division-
-
handleBeginTrack
void handleBeginTrack(int index)Called at the beginning of each track- Parameters:
index- Track index starting at zero
-
handleEndTrack
void handleEndTrack(int index)Called at the end of each track- Parameters:
index- Track index starting at zero
-
handleSysExF0
void handleSysExF0(int ticks, byte[] b)Called when an F0 SysEx event is encountered.- Parameters:
ticks- MIDIFile time-stampb- bytes read from file for SysEx. May be null.
-
handleSysExF7
void handleSysExF7(int ticks, byte[] b)Called when an F7 SysEx event is encountered.- Parameters:
ticks- MIDIFile time-stampb- bytes read from file for SysEx. May be null.
-
handleMetaEvent
void handleMetaEvent(int ticks, int type, byte[] b)Called when a MetaEvent is encountered.- Parameters:
ticks- MIDIFile time-stamptype- MetaEvent type, from 0 to 127.b- bytes read from file for SysEx. May be null.
-
handleEvent
void handleEvent(int ticks, int command, int data1, int data2)Called when a MIDI Message event is encountered.- Parameters:
ticks- MIDIFile time-stampcommand- MIDI Command, eg. NOTE_ON.data1- First data byte of message.data2- Second optional data byte of message.
-