public class ChainingParserListenerAdapter extends Parser implements ParserListener
Constructor and Description |
---|
ChainingParserListenerAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
afterParsingFinished()
Called when the parser has parsed its last item.
|
void |
beforeParsingStarts()
Called when the parser first starts up, but before it starts parsing anything.
|
void |
onBarLineParsed(long id)
The separator character which indicates a bar line has been parsed.
|
void |
onChannelPressureParsed(byte pressure) |
void |
onChordParsed(Chord chord) |
void |
onControllerEventParsed(byte controller,
byte value) |
void |
onFunctionParsed(java.lang.String id,
java.lang.Object message) |
void |
onInstrumentParsed(byte instrument)
Called when the parser encounters a new instrument selection.
|
void |
onKeySignatureParsed(byte key,
byte scale) |
void |
onLayerChanged(byte layer)
Called when the parser encounters a new layer.
|
void |
onLyricParsed(java.lang.String lyric) |
void |
onMarkerParsed(java.lang.String marker) |
void |
onNoteParsed(Note note)
We may have actually parsed a musical note!
In previous versions of JFugue, ParserListener had separate listeners for parallel notes and sequential notes
(now termed harmonic and melodic notes, respectively)
In this version of JFugue, whether a note is the first note, a harmonic note, or a melodic note is kept
as a property on the Note object itself.
|
void |
onNotePressed(Note note)
Used to indicate when a note is pressed.
|
void |
onNoteReleased(Note note)
Used to indicate when a note is released.
|
void |
onPitchWheelParsed(byte lsb,
byte msb) |
void |
onPolyphonicPressureParsed(byte key,
byte pressure) |
void |
onSystemExclusiveParsed(byte... bytes) |
void |
onTempoChanged(int tempoBPM)
Called when the parser encounters a new tempo selection.
|
void |
onTimeSignatureParsed(byte numerator,
byte powerOfTwo)
The first parameter is the number of beats per measure;
The second parameter is the power by which 2 must be raised to create the note that represents one beat.
|
void |
onTrackBeatTimeBookmarked(java.lang.String timeBookmarkId) |
void |
onTrackBeatTimeBookmarkRequested(java.lang.String timeBookmarkId) |
void |
onTrackBeatTimeRequested(double time) |
void |
onTrackChanged(byte track)
Called when the parser encounters a new track (also known as a channel; previously in JFugue,
known as a Voice).
|
addParserListener, clearParserListeners, fireAfterParsingFinished, fireBarLineParsed, fireBeforeParsingStarts, fireChannelPressureParsed, fireChordParsed, fireControllerEventParsed, fireFunctionParsed, fireInstrumentParsed, fireKeySignatureParsed, fireLayerChanged, fireLyricParsed, fireMarkerParsed, fireNoteParsed, fireNotePressed, fireNoteReleased, firePitchWheelParsed, firePolyphonicPressureParsed, fireSystemExclusiveParsed, fireTempoChanged, fireTimeSignatureParsed, fireTrackBeatTimeBookmarked, fireTrackBeatTimeBookmarkRequested, fireTrackBeatTimeRequested, fireTrackChanged, getParserListeners, removeParserListener
public void beforeParsingStarts()
ParserListener
beforeParsingStarts
in interface ParserListener
public void afterParsingFinished()
ParserListener
afterParsingFinished
in interface ParserListener
public void onTrackChanged(byte track)
ParserListener
onTrackChanged
in interface ParserListener
track
- the new track event that has been parsedpublic void onLayerChanged(byte layer)
ParserListener
onLayerChanged
in interface ParserListener
public void onInstrumentParsed(byte instrument)
ParserListener
onInstrumentParsed
in interface ParserListener
instrument
- the MIDI instrument value that has been parsedpublic void onTempoChanged(int tempoBPM)
ParserListener
onTempoChanged
in interface ParserListener
tempoBPM
- The new tempo valuepublic void onKeySignatureParsed(byte key, byte scale)
onKeySignatureParsed
in interface ParserListener
public void onTimeSignatureParsed(byte numerator, byte powerOfTwo)
ParserListener
onTimeSignatureParsed
in interface ParserListener
public void onBarLineParsed(long id)
ParserListener
onBarLineParsed
in interface ParserListener
id
- This is the id of the measure, which is an optional numeric value following the bar character.public void onTrackBeatTimeBookmarked(java.lang.String timeBookmarkId)
onTrackBeatTimeBookmarked
in interface ParserListener
public void onTrackBeatTimeBookmarkRequested(java.lang.String timeBookmarkId)
onTrackBeatTimeBookmarkRequested
in interface ParserListener
public void onTrackBeatTimeRequested(double time)
onTrackBeatTimeRequested
in interface ParserListener
public void onPitchWheelParsed(byte lsb, byte msb)
onPitchWheelParsed
in interface ParserListener
public void onChannelPressureParsed(byte pressure)
onChannelPressureParsed
in interface ParserListener
public void onPolyphonicPressureParsed(byte key, byte pressure)
onPolyphonicPressureParsed
in interface ParserListener
public void onSystemExclusiveParsed(byte... bytes)
onSystemExclusiveParsed
in interface ParserListener
public void onControllerEventParsed(byte controller, byte value)
onControllerEventParsed
in interface ParserListener
public void onLyricParsed(java.lang.String lyric)
onLyricParsed
in interface ParserListener
public void onMarkerParsed(java.lang.String marker)
onMarkerParsed
in interface ParserListener
public void onFunctionParsed(java.lang.String id, java.lang.Object message)
onFunctionParsed
in interface ParserListener
public void onNotePressed(Note note)
ParserListener
onNotePressed
in interface ParserListener
public void onNoteReleased(Note note)
ParserListener
onNoteReleased
in interface ParserListener
public void onNoteParsed(Note note)
ParserListener
onNoteParsed
in interface ParserListener
note
- The note that was parsed. Please see the Note class for more details about notes!Note
public void onChordParsed(Chord chord)
onChordParsed
in interface ParserListener