Class MIDIEvent
java.lang.Object
|
+----MIDIEvent
- public class MIDIEvent
- extends Object
A MIDIEvent-instance stores one MIDI-event, with time, status and dataBytes.
-
absTime
- Absolute time from starting in ticks.
-
dataVector
- Vector for storing the dataBytes.
-
deltaTime
- Timedifference between this and the MIDI-event before this event.
-
status
- StatusByte of MIDI-event.
-
valid
- Marks MIDI-event as valid or not.
-
MIDIEvent()
- Creates an empty invalid MIDIEvent with all variables set to -1.
-
MIDIEvent(int, int[], FileInputStream)
- Creates an valid MIDIEvent, reading its data from concerning file.
-
fromMIDI(int, int[], FileInputStream)
- Reads all neccessary data from a standard MIDI-file.
-
fromTXT(int[], FileInputStream)
- Reads all neccessary data from an ASCII MIDITXT-file.
-
size(int)
- Size in Bytes neede to represent this MIDI-event in a standard MIDI-file.
-
toMIDI(int, FileOutputStream)
- Writes itself to a standard MIDI-file.
-
toTXT(int, FileOutputStream)
- Writes itself to an ASCII MIDITXT-file.
-
valid()
- Returns weather this is valid or not.
deltaTime
int deltaTime
- Timedifference between this and the MIDI-event before this event in ticks.
absTime
int absTime
- Absolute time from starting in ticks.
valid
boolean valid
- Marks MIDI-event as valid or not.
status
public int status
- StatusByte of MIDI-event. If voice-message lower 4bit tell MIDI-channel.
dataVector
Vector dataVector
- Vector for storing the dataBytes.
MIDIEvent
public MIDIEvent()
- Creates an empty invalid MIDIEvent with all variables set to -1.
MIDIEvent
public MIDIEvent(int runningStatus,
int count[],
FileInputStream readFile) throws MIDIException
- Creates an valid MIDIEvent, reading its data from concerning file readFIle.
If no statusByte is found in readFile, status = runningStatus.
count[0] stores all read Bytes from readFile,
count[1] stores absTime when readFile is a standard MIDI-file,
or marks endOfTrack-event reached if readFile is an ASCII MIDITXT-file.
Throws Exception if MIDI-event could not be created with readFile.
valid
public boolean valid()
- Returns variable valid.
fromTXT
void fromTXT(int count[],
FileInputStream readFile) throws MIDIException
- Reads all neccessary data from ASCII MIDITXT-file readFile.
Throws Exception if event could not be created by readFile.
Should only be called by constructor!
Also see MIDIEvent constructor.
fromMIDI
void fromMIDI(int runningStatus,
int count[],
FileInputStream readFile) throws MIDIException
- Reads all neccessary data from standard MIDI-file readFile.
Throws Exception if event could not be created by readFile.
Should only be called by constructor!
Also see MIDIEvent constructor.
toTXT
void toTXT(int track,
FileOutputStream writeFile) throws MIDIException
- Writes MIDI_event to ASCII MIDITXT-file writeFile.
track is used to print comments with trackNumber.
Throws Exception if an error occurs.
toMIDI
void toMIDI(int runningStatus,
FileOutputStream writeFile) throws MIDIException
- Writes MIDI_event to standars MIDI-file writeFile.
runningStatus is used to skip status if equal to runningStatus.
Throws Exception if an error occurs.
size
public int size(int runningStatus) throws MIDIException
- Returns amount of Bytes used to represent this event in a standard MIDI-file.
runningStatus is used to know, weather status would be saved or not.