|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream java.io.FilterInputStream java.io.BufferedInputStream com.softsynth.midifile.MIDIFileInputStream
public class MIDIFileInputStream
MIDI File Parser.
Parse tracks and events from an InputStream and pass the information to a MIDIFileListener.
MIDIFileListener
Constructor Summary | |
---|---|
MIDIFileInputStream(java.io.InputStream stream)
|
Method Summary | |
---|---|
void |
addMIDIFileListener(MIDIFileListener listener)
Request that information from the parser be passed to this listener. |
void |
handleBeginTrack(int index)
Called at the beginning of each track |
void |
handleEndTrack(int index)
Called at the end of each track |
void |
handleHeader(int format,
int numTracks,
short division)
Called when the header is parsed. |
void |
handleMetaEvent(int ticks,
int type,
byte[] b)
Called when a MetaEvent is encountered. |
void |
handleSysExF0(int ticks,
byte[] b)
Called when an F0 SysEx event is encountered. |
void |
handleSysExF7(int ticks,
byte[] b)
Called when an F7 SysEx event is encountered. |
static java.lang.String |
IDToString(int ID)
Convert a 4 character IFF ID to a String |
void |
parse()
|
int |
read()
Override read method with one that counts bytes. |
int |
read(byte[] b)
|
int |
readIntBig()
Read 32 bit signed integer assuming Big Endian byte order. |
short |
readShortBig()
Read 16 bit signed short assuming Big Endian byte order. |
void |
removeMIDIFileListener(MIDIFileListener listener)
|
Methods inherited from class java.io.BufferedInputStream |
---|
available, close, mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MIDIFileInputStream(java.io.InputStream stream)
Method Detail |
---|
public void addMIDIFileListener(MIDIFileListener listener)
public void removeMIDIFileListener(MIDIFileListener listener)
public int read() throws java.io.IOException
read
in class java.io.BufferedInputStream
java.io.IOException
public int read(byte[] b) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int readIntBig() throws java.io.IOException
java.io.IOException
public short readShortBig() throws java.io.IOException
java.io.IOException
public static java.lang.String IDToString(int ID)
public void handleHeader(int format, int numTracks, short division)
format
- Format of file. 0, 1 or 2.numTracks
- division
- public void handleBeginTrack(int index)
index
- Track index starting at zeropublic void handleEndTrack(int index)
index
- Track index starting at zeropublic void handleSysExF0(int ticks, byte[] b)
ticks
- MIDIFile time-stampb
- bytes read from file for SysEx. May be null.public void handleSysExF7(int ticks, byte[] b)
ticks
- MIDIFile time-stampb
- bytes read from file for SysEx. May be null.public void handleMetaEvent(int ticks, int type, byte[] b)
ticks
- MIDIFile time-stamptype
- MetaEvent type, from 0 to 127.b
- bytes read from file for SysEx. May be null.public void parse() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |