public class MidiListener
extends java.lang.Object
implements javax.sound.midi.MetaEventListener
This class is used as a meta event listener for a playing MIDI sequence. An object of this class is provided to the sequencer. If a meta event occurs in the MIDI sequence, this listener is triggered.
This is especially important for self-made meta events that are used to inform us about note-on or note-off events. If those events occur, the widgets in the player are updated accordingly.
Modifier and Type | Field and Description |
---|---|
static byte |
MARKER_BITMASK_ACTIVITY |
static byte |
MARKER_BITMASK_CHANNEL |
static byte |
MARKER_BITMASK_HISTORY |
static byte |
MARKER_BITMASK_INSTRUMENT |
static byte |
MARKER_BITMASK_LYRICS |
static int |
META_CHANNEL_PREFIX |
static int |
META_COPYRIGHT |
static int |
META_CUE_POINT |
static int |
META_END_OF_SEQUENCE |
static int |
META_INSTRUMENT_NAME |
static int |
META_KEY_SIGNATURE |
static int |
META_LYRICS |
static int |
META_MARKER |
static int |
META_MIDI_PORT |
static int |
META_SEQUENCE_NUMBER |
static int |
META_SEQUENCER_SPECIFIC |
static int |
META_SET_TEMPO |
static int |
META_SMPTE_OFFSET |
static int |
META_TEXT |
static int |
META_TIME_SIGNATURE |
static int |
META_TRACK_NAME |
private PlayerController |
playerControler |
Constructor and Description |
---|
MidiListener(PlayerController controller)
Creates a new meta event listener object.
|
Modifier and Type | Method and Description |
---|---|
void |
meta(javax.sound.midi.MetaMessage msg)
This method is called if a meta event in the MIDI stream is detected.
|
private PlayerController playerControler
public static final int META_SEQUENCE_NUMBER
public static final int META_TEXT
public static final int META_COPYRIGHT
public static final int META_TRACK_NAME
public static final int META_INSTRUMENT_NAME
public static final int META_LYRICS
public static final int META_MARKER
public static final int META_CUE_POINT
public static final int META_CHANNEL_PREFIX
public static final int META_MIDI_PORT
public static final int META_END_OF_SEQUENCE
public static final int META_SET_TEMPO
public static final int META_SMPTE_OFFSET
public static final int META_TIME_SIGNATURE
public static final int META_KEY_SIGNATURE
public static final int META_SEQUENCER_SPECIFIC
public static final byte MARKER_BITMASK_LYRICS
public static final byte MARKER_BITMASK_ACTIVITY
public static final byte MARKER_BITMASK_HISTORY
public static final byte MARKER_BITMASK_INSTRUMENT
public static final byte MARKER_BITMASK_CHANNEL
public MidiListener(PlayerController controller)
Creates a new meta event listener object.
controller
- Player controller.public void meta(javax.sound.midi.MetaMessage msg)
This method is called if a meta event in the MIDI stream is detected. It determines the exact event type and informs the PlayerController
and the MidiDevices
about the changes.
meta
in interface javax.sound.midi.MetaEventListener