javax.sound.midi
Class MidiEvent

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.sound.midi.MidiEvent

public class MidiEvent
extends Object sample code for java.lang.Object definition code for java.lang.Object

MIDI events contain a MIDI message and a corresponding time-stamp expressed in ticks, and can represent the MIDI event information stored in a MIDI file or a Sequence sample code for javax.sound.midi.Sequence definition code for javax.sound.midi.Sequence object. The duration of a tick is specified by the timing information contained in the MIDI file or Sequence object.

In Java Sound, MidiEvent objects are typically contained in a Track sample code for javax.sound.midi.Track definition code for javax.sound.midi.Track , and Tracks are likewise contained in a Sequence.


Constructor Summary
MidiEvent sample code for javax.sound.midi.MidiEvent.MidiEvent(javax.sound.midi.MidiMessage, long) definition code for javax.sound.midi.MidiEvent.MidiEvent(javax.sound.midi.MidiMessage, long) (MidiMessage sample code for javax.sound.midi.MidiMessage definition code for javax.sound.midi.MidiMessage  message, long tick)
          Constructs a new MidiEvent.
 
Method Summary
 MidiMessage sample code for javax.sound.midi.MidiMessage definition code for javax.sound.midi.MidiMessage getMessage sample code for javax.sound.midi.MidiEvent.getMessage() definition code for javax.sound.midi.MidiEvent.getMessage() ()
          Obtains the MIDI message contained in the event.
 long getTick sample code for javax.sound.midi.MidiEvent.getTick() definition code for javax.sound.midi.MidiEvent.getTick() ()
          Obtains the time-stamp for the event, in MIDI ticks
 void setTick sample code for javax.sound.midi.MidiEvent.setTick(long) definition code for javax.sound.midi.MidiEvent.setTick(long) (long tick)
          Sets the time-stamp for the event, in MIDI ticks
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

MidiEvent sample code for javax.sound.midi.MidiEvent(javax.sound.midi.MidiMessage, long) definition code for javax.sound.midi.MidiEvent(javax.sound.midi.MidiMessage, long)

public MidiEvent(MidiMessage sample code for javax.sound.midi.MidiMessage definition code for javax.sound.midi.MidiMessage  message,
                 long tick)
Constructs a new MidiEvent.

Parameters:
message - the MIDI message contained in the event
tick - the time-stamp for the event, in MIDI ticks
Method Detail

getMessage sample code for javax.sound.midi.MidiEvent.getMessage() definition code for javax.sound.midi.MidiEvent.getMessage()

public MidiMessage sample code for javax.sound.midi.MidiMessage definition code for javax.sound.midi.MidiMessage  getMessage()
Obtains the MIDI message contained in the event.

Returns:
the MIDI message

setTick sample code for javax.sound.midi.MidiEvent.setTick(long) definition code for javax.sound.midi.MidiEvent.setTick(long)

public void setTick(long tick)
Sets the time-stamp for the event, in MIDI ticks

Parameters:
tick - the new time-stamp, in MIDI ticks

getTick sample code for javax.sound.midi.MidiEvent.getTick() definition code for javax.sound.midi.MidiEvent.getTick()

public long getTick()
Obtains the time-stamp for the event, in MIDI ticks

Returns:
the time-stamp for the event, in MIDI ticks