APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.media.sound

pack-priv final Class FastShortMessage

extends ShortMessage
Class Inheritance
Imports
javax.sound.midi.InvalidMidiDataException, .ShortMessage

an optimized ShortMessage that does not need an array.
Author
Florian Bomers

Field Summary

Modifier and TypeField and Description
private int
Inherited from javax.sound.midi.ShortMessage:
ACTIVE_SENSINGCHANNEL_PRESSURECONTINUECONTROL_CHANGEEND_OF_EXCLUSIVEMIDI_TIME_CODENOTE_OFFNOTE_ONPITCH_BENDPOLY_PRESSUREPROGRAM_CHANGESONG_POSITION_POINTERSONG_SELECTSTARTSTOPSYSTEM_RESETTIMING_CLOCKTUNE_REQUEST

Constructor Summary

AccessConstructor and Description
pack-priv
FastShortMessage(int packedMsg)

pack-priv
FastShortMessage(ShortMessage msg)

Creates a FastShortMessage from this ShortMessage

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

a clone of this instance.
clone
()

Overrides javax.sound.midi.ShortMessage.clone.

Creates a new object of the same class and with the same contents as this object.

public int
getChannel()

Overrides javax.sound.midi.ShortMessage.getChannel.

Obtains the MIDI channel associated with this event.

public int
getCommand()

Overrides javax.sound.midi.ShortMessage.getCommand.

Obtains the MIDI command associated with this event.

public int
getData1()

Overrides javax.sound.midi.ShortMessage.getData1.

Obtains the first data byte in the message.

public int
getData2()

Overrides javax.sound.midi.ShortMessage.getData2.

Obtains the second data byte in the message.

public int
getLength()

Overrides javax.sound.midi.MidiMessage.getLength.

Obtains the total length of the MIDI message in bytes.

public byte[]
getMessage()

Overrides javax.sound.midi.MidiMessage.getMessage.

Obtains the MIDI message data.

pack-priv int
public int
getStatus()

Overrides javax.sound.midi.MidiMessage.getStatus.

Obtains the status byte for the MIDI message.

public void
setMessage(int status)

Overrides javax.sound.midi.ShortMessage.setMessage.

Sets the parameters for a MIDI message that takes no data bytes.

public void
setMessage(int status, int data1, int data2)

Overrides javax.sound.midi.ShortMessage.setMessage.

Sets the parameters for a MIDI message that takes one or two data bytes.

public void
setMessage(int command, int channel, int data1, int data2)

Overrides javax.sound.midi.ShortMessage.setMessage.

Sets the short message parameters for a channel message which takes up to two data bytes.

Inherited from javax.sound.midi.ShortMessage:
getDataLength

Field Detail

packedMsgback to summary
private int packedMsg

Constructor Detail

FastShortMessageback to summary
pack-priv FastShortMessage(int packedMsg) throws InvalidMidiDataException
FastShortMessageback to summary
pack-priv FastShortMessage(ShortMessage msg)

Creates a FastShortMessage from this ShortMessage

Method Detail

cloneback to summary
public Object clone()

Overrides javax.sound.midi.ShortMessage.clone.

Creates a new object of the same class and with the same contents as this object.

Returns:Object

a clone of this instance.

Annotations
@Override
getChannelback to summary
public int getChannel()

Overrides javax.sound.midi.ShortMessage.getChannel.

Doc from javax.sound.midi.ShortMessage.getChannel.

Obtains the MIDI channel associated with this event. This method assumes that the event is a MIDI channel message; if not, the return value will not be meaningful.

Annotations
@Override
getCommandback to summary
public int getCommand()

Overrides javax.sound.midi.ShortMessage.getCommand.

Doc from javax.sound.midi.ShortMessage.getCommand.

Obtains the MIDI command associated with this event. This method assumes that the event is a MIDI channel message; if not, the return value will not be meaningful.

Annotations
@Override
getData1back to summary
public int getData1()

Overrides javax.sound.midi.ShortMessage.getData1.

Doc from javax.sound.midi.ShortMessage.getData1.

Obtains the first data byte in the message.

Annotations
@Override
getData2back to summary
public int getData2()

Overrides javax.sound.midi.ShortMessage.getData2.

Doc from javax.sound.midi.ShortMessage.getData2.

Obtains the second data byte in the message.

Annotations
@Override
getLengthback to summary
public int getLength()

Overrides javax.sound.midi.MidiMessage.getLength.

Doc from javax.sound.midi.MidiMessage.getLength.

Obtains the total length of the MIDI message in bytes. A MIDI message consists of one status byte and zero or more data bytes. The return value ranges from 1 for system real-time messages, to 2 or 3 for channel messages, to any value for meta and system exclusive messages.

Annotations
@Override
getMessageback to summary
public byte[] getMessage()

Overrides javax.sound.midi.MidiMessage.getMessage.

Doc from javax.sound.midi.MidiMessage.getMessage.

Obtains the MIDI message data. The first byte of the returned byte array is the status byte of the message. Any subsequent bytes up to the length of the message are data bytes. The byte array may have a length which is greater than that of the actual message; the total length of the message in bytes is reported by the getLength method.

Annotations
@Override
getPackedMsgback to summary
pack-priv int getPackedMsg()
getStatusback to summary
public int getStatus()

Overrides javax.sound.midi.MidiMessage.getStatus.

Doc from javax.sound.midi.MidiMessage.getStatus.

Obtains the status byte for the MIDI message. The status "byte" is represented as an integer; see the discussion in the MidiMessage class description.

Annotations
@Override
setMessageback to summary
public void setMessage(int status) throws InvalidMidiDataException

Overrides javax.sound.midi.ShortMessage.setMessage.

Doc from javax.sound.midi.ShortMessage.setMessage.

Sets the parameters for a MIDI message that takes no data bytes.

Annotations
@Override
Exceptions
InvalidMidiDataException:
if status does not specify a valid MIDI status byte for a message that requires no data bytes
setMessageback to summary
public void setMessage(int status, int data1, int data2) throws InvalidMidiDataException

Overrides javax.sound.midi.ShortMessage.setMessage.

Doc from javax.sound.midi.ShortMessage.setMessage.

Sets the parameters for a MIDI message that takes one or two data bytes. If the message takes only one data byte, the second data byte is ignored; if the message does not take any data bytes, both data bytes are ignored.

Annotations
@Override
Exceptions
InvalidMidiDataException:
if the status byte, or all data bytes belonging to the message, do not specify a valid MIDI message
setMessageback to summary
public void setMessage(int command, int channel, int data1, int data2) throws InvalidMidiDataException

Overrides javax.sound.midi.ShortMessage.setMessage.

Doc from javax.sound.midi.ShortMessage.setMessage.

Sets the short message parameters for a channel message which takes up to two data bytes. If the message only takes one data byte, the second data byte is ignored; if the message does not take any data bytes, both data bytes are ignored.

Annotations
@Override
Exceptions
InvalidMidiDataException:
if the status byte or all data bytes belonging to the message, do not specify a valid MIDI message