com.confusionists.mjdjApi.midi
Class MessageWrapper

java.lang.Object
  extended by com.confusionists.mjdjApi.midi.MessageWrapper
Direct Known Subclasses:
ShortMessageWrapper

public class MessageWrapper
extends java.lang.Object

MessageWrapper class for MidiMessage. See ShortMessageWrapper.

It can also hold a String (keystrokes) which represents keystrokes to be typed into the active window.

It holds either keystrokes or a MIDI message, but not both.

Client classes should use one of the factory methods to get an instance.


Field Summary
 java.lang.Object userData
          used by Morphs to add functionality without subclassing
 
Method Summary
 ShortMessageWrapper getAsShortMessageWrapper()
          Convenience method.
static int getInt(byte value)
          good to have around: see the MidiMessage documentation for the meaning of this
 java.lang.String getKeystrokes()
           
 javax.sound.midi.MidiMessage getMessage()
           
static MessageWrapper newInstance(byte[] bytes)
          Static Factory Method
static MessageWrapper newInstance(ChannelCc channelCc, int data2)
          Static Factory Method
static MessageWrapper newInstance(javax.sound.midi.MidiMessage message)
          Static Factory Method
static MessageWrapper newInstance(java.lang.String keystrokes)
          Static Factory Method
 void setMessage(javax.sound.midi.MidiMessage message)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

userData

public java.lang.Object userData
used by Morphs to add functionality without subclassing

Method Detail

newInstance

public static MessageWrapper newInstance(javax.sound.midi.MidiMessage message)
Static Factory Method


newInstance

public static MessageWrapper newInstance(byte[] bytes)
Static Factory Method


newInstance

public static MessageWrapper newInstance(java.lang.String keystrokes)
Static Factory Method


newInstance

public static MessageWrapper newInstance(ChannelCc channelCc,
                                         int data2)
Static Factory Method


getKeystrokes

public java.lang.String getKeystrokes()

setMessage

public void setMessage(javax.sound.midi.MidiMessage message)

getMessage

public javax.sound.midi.MidiMessage getMessage()

getInt

public static int getInt(byte value)
good to have around: see the MidiMessage documentation for the meaning of this


getAsShortMessageWrapper

public ShortMessageWrapper getAsShortMessageWrapper()
Convenience method.

Returns:
null if cast cannot be performed.

toString

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