All Packages Class Hierarchy This Package Previous Next Index
Class com.nosuch.midi.MidiText
java.lang.Object
|
+----com.nosuch.midi.MidiMsg
|
+----com.nosuch.midi.MidiText
- public class MidiText
- extends MidiMsg
- implements Cloneable
Manage MIDI "text" messages, used to represent Standard MIDI File
metatext and other miscellaneous things.
-
MidiText(long, String)
- Create a MidiText message.
-
MidiText(String)
- Create a MidiText message.
-
clone()
- Return a new copy.
-
equals(MidiMsg)
- Return true if this object equals another.
-
getBytesOff()
- Return an array of bytes containing the ending half of the message.
-
getBytesOn()
- Return an array of bytes containing the contents of the message.
-
getChannel()
- Return the channel of this message.
-
getDuration()
- Return the duration of this message.
-
getPitch()
- Return the pitch of this message.
-
getVelocity()
- Return the velocity of this message.
-
setChannel(int)
- Set the channel of this message.
-
setDuration(long)
- Set the duration of this message.
-
setPitch(int)
- Set the pitch of this message.
-
setVelocity(int)
- Set the velocity of this message.
-
toString()
- Return a human-readable representation of the message.
MidiText
public MidiText(long t,
String s)
- Create a MidiText message.
- Parameters:
- t - time (in clicks) of the message.
- s - string of text in the message.
MidiText
public MidiText(String s)
- Create a MidiText message.
- Parameters:
- s - string of text in the message.
clone
public Object clone()
- Return a new copy.
- Overrides:
- clone in class MidiMsg
equals
public boolean equals(MidiMsg m)
- Return true if this object equals another.
- Overrides:
- equals in class MidiMsg
getPitch
public int getPitch()
- Return the pitch of this message.
For MidiByte messages, this is meaningless, so -1 is returned.
This method (and the next few methods) are included so that
code can be written conveniently using just the MidiMsg methods.
- Overrides:
- getPitch in class MidiMsg
setPitch
public void setPitch(int p)
- Set the pitch of this message.
For MidiByte messages, this is meaningless, so it is ignored.
- Overrides:
- setPitch in class MidiMsg
getDuration
public long getDuration()
- Return the duration of this message.
For MidiByte messages, this is meaningless, so -1 is returned.
- Overrides:
- getDuration in class MidiMsg
setDuration
public void setDuration(long d)
- Set the duration of this message.
For MidiByte messages, this is meaningless, so it is ignored.
- Overrides:
- setDuration in class MidiMsg
getChannel
public int getChannel()
- Return the channel of this message.
For MidiText messages, this is is potentially useful (e.g. for
controller messages and things), but for the moment we return -1.
- Overrides:
- getChannel in class MidiMsg
setChannel
public void setChannel(int c)
- Set the channel of this message.
For MidiText messages, this is is potentially useful (e.g. for
controller messages and things), but for the moment we ignore it.
- Overrides:
- setChannel in class MidiMsg
getVelocity
public int getVelocity()
- Return the velocity of this message.
For MidiText messages, this is meaningless, so we return -1.
- Overrides:
- getVelocity in class MidiMsg
setVelocity
public void setVelocity(int v)
- Set the velocity of this message.
For MidiText messages, this is meaningless, so we ignore it.
- Overrides:
- setVelocity in class MidiMsg
getBytesOn
public byte[] getBytesOn()
- Return an array of bytes containing the contents of the message.
This is used when generating actual MIDI output, so for "text"
messages this is null.
- Overrides:
- getBytesOn in class MidiMsg
getBytesOff
public byte[] getBytesOff()
- Return an array of bytes containing the ending half of the message.
- Overrides:
- getBytesOff in class MidiMsg
toString
public String toString()
- Return a human-readable representation of the message.
- Overrides:
- toString in class MidiMsg
All Packages Class Hierarchy This Package Previous Next Index