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.


Constructor Index

 o MidiText(long, String)
Create a MidiText message.
 o MidiText(String)
Create a MidiText message.

Method Index

 o clone()
Return a new copy.
 o equals(MidiMsg)
Return true if this object equals another.
 o getBytesOff()
Return an array of bytes containing the ending half of the message.
 o getBytesOn()
Return an array of bytes containing the contents of the message.
 o getChannel()
Return the channel of this message.
 o getDuration()
Return the duration of this message.
 o getPitch()
Return the pitch of this message.
 o getVelocity()
Return the velocity of this message.
 o setChannel(int)
Set the channel of this message.
 o setDuration(long)
Set the duration of this message.
 o setPitch(int)
Set the pitch of this message.
 o setVelocity(int)
Set the velocity of this message.
 o toString()
Return a human-readable representation of the message.

Constructors

 o 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.
 o MidiText
 public MidiText(String s)
Create a MidiText message.

Parameters:
s - string of text in the message.

Methods

 o clone
 public Object clone()
Return a new copy.

Overrides:
clone in class MidiMsg
 o equals
 public boolean equals(MidiMsg m)
Return true if this object equals another.

Overrides:
equals in class MidiMsg
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o getBytesOff
 public byte[] getBytesOff()
Return an array of bytes containing the ending half of the message.

Overrides:
getBytesOff in class MidiMsg
 o 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