com.confusionists.mjdjApi.midi
Class ShortMessageWrapper

java.lang.Object
  extended by com.confusionists.mjdjApi.midi.MessageWrapper
      extended by com.confusionists.mjdjApi.midi.ShortMessageWrapper

public class ShortMessageWrapper
extends MessageWrapper


Field Summary
 
Fields inherited from class com.confusionists.mjdjApi.midi.MessageWrapper
userData
 
Method Summary
 void alterCommand(int command)
          Replaces the guts of (the guts of) this wrapper.
Particularly useful is more than one object shares this wrapper.
 void alterData1(int data1)
          Replaces the guts of this wrapper.
Particularly useful is more than one object shares this wrapper.
 void alterData2(int data2)
          Replaces the guts of this wrapper.
 ShortMessageWrapper deepClone()
          This class does not clone the userData
 boolean filter(int command, ChannelCc channelCc)
          Convenience method to check if a message has a certain command, channel and data1 (cc).
 boolean filterControlCommand(ChannelCc channelCc)
          Same as filter (above), but here command is assumed to be ShortMessage.CONTROL_CHANGE
 int getCommand()
           
 int getData1()
           
 int getData2()
           
 javax.sound.midi.ShortMessage getShortMessage()
           
 boolean isControlChange()
           
 boolean isNoteOff()
           
 boolean isNoteOn()
           
 java.lang.String toString()
           
 
Methods inherited from class com.confusionists.mjdjApi.midi.MessageWrapper
getAsShortMessageWrapper, getInt, getKeystrokes, getMessage, newInstance, newInstance, newInstance, newInstance, setMessage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getShortMessage

public javax.sound.midi.ShortMessage getShortMessage()

filter

public boolean filter(int command,
                      ChannelCc channelCc)
Convenience method to check if a message has a certain command, channel and data1 (cc).

Parameters:
command - - second half of first byte of MidiMessage. -1 value means accept any.
channelCc - - channel and data1 of the MidiMessage. -1 value means accept any.
Returns:
true if the message matches the command and channelCc, otherwise false.

Will also return false if the message is not a ShortMessage instance.


filterControlCommand

public boolean filterControlCommand(ChannelCc channelCc)
Same as filter (above), but here command is assumed to be ShortMessage.CONTROL_CHANGE

Parameters:
channelCc - - channel and data1 of the MidiMessage. -1 values mean accept any.
Returns:
true if the message matches the channelCc

alterCommand

public void alterCommand(int command)
Replaces the guts of (the guts of) this wrapper.
Particularly useful is more than one object shares this wrapper.


alterData1

public void alterData1(int data1)
Replaces the guts of this wrapper.
Particularly useful is more than one object shares this wrapper.


alterData2

public void alterData2(int data2)
Replaces the guts of this wrapper. Particularly useful is more than one object has a reference to this wrapper.


getData2

public int getData2()
Returns:
data2 (note velocity in a note-on, parameter value in a command).

getData1

public int getData1()

getCommand

public int getCommand()

isControlChange

public boolean isControlChange()

isNoteOn

public boolean isNoteOn()

isNoteOff

public boolean isNoteOff()

deepClone

public ShortMessageWrapper deepClone()
This class does not clone the userData

Returns:
a clone with the guts cloned too

toString

public java.lang.String toString()
Overrides:
toString in class MessageWrapper