< prev index next >

src/java.desktop/share/classes/javax/sound/midi/MetaMessage.java

Print this page




  42  * reset message. In MIDI files, this same status value denotes a
  43  * {@code MetaMessage}. The types of meta-message are distinguished from each
  44  * other by the first byte that follows the status byte {@code 0xFF}. The
  45  * subsequent bytes are data bytes. As with system exclusive messages, there are
  46  * an arbitrary number of data bytes, depending on the type of
  47  * {@code MetaMessage}.
  48  *
  49  * @author David Rivas
  50  * @author Kara Kytle
  51  * @see MetaEventListener
  52  */
  53 public class MetaMessage extends MidiMessage {
  54 
  55     /**
  56      * Status byte for {@code MetaMessage} (0xFF, or 255), which is used in MIDI
  57      * files. It has the same value as SYSTEM_RESET, which is used in the
  58      * real-time "MIDI wire" protocol.
  59      *
  60      * @see MidiMessage#getStatus
  61      */
  62     public static final int META                                                = 0xFF; // 255
  63 
  64     /**
  65      * The length of the actual message in the data array. This is used to
  66      * determine how many bytes of the data array is the message, and how many
  67      * are the status byte, the type byte, and the variable-length-int
  68      * describing the length of the message.
  69      */
  70     private int dataLength = 0;
  71 
  72     /**
  73      * Constructs a new {@code MetaMessage}. The contents of the message are not
  74      * set here; use {@link #setMessage(int, byte[], int) setMessage} to set
  75      * them subsequently.
  76      */
  77     public MetaMessage() {
  78         // Default meta message data: just the META status byte value
  79         this(new byte[]{(byte) META, 0});
  80     }
  81 
  82     /**




  42  * reset message. In MIDI files, this same status value denotes a
  43  * {@code MetaMessage}. The types of meta-message are distinguished from each
  44  * other by the first byte that follows the status byte {@code 0xFF}. The
  45  * subsequent bytes are data bytes. As with system exclusive messages, there are
  46  * an arbitrary number of data bytes, depending on the type of
  47  * {@code MetaMessage}.
  48  *
  49  * @author David Rivas
  50  * @author Kara Kytle
  51  * @see MetaEventListener
  52  */
  53 public class MetaMessage extends MidiMessage {
  54 
  55     /**
  56      * Status byte for {@code MetaMessage} (0xFF, or 255), which is used in MIDI
  57      * files. It has the same value as SYSTEM_RESET, which is used in the
  58      * real-time "MIDI wire" protocol.
  59      *
  60      * @see MidiMessage#getStatus
  61      */
  62     public static final int META = 0xFF; // 255
  63 
  64     /**
  65      * The length of the actual message in the data array. This is used to
  66      * determine how many bytes of the data array is the message, and how many
  67      * are the status byte, the type byte, and the variable-length-int
  68      * describing the length of the message.
  69      */
  70     private int dataLength = 0;
  71 
  72     /**
  73      * Constructs a new {@code MetaMessage}. The contents of the message are not
  74      * set here; use {@link #setMessage(int, byte[], int) setMessage} to set
  75      * them subsequently.
  76      */
  77     public MetaMessage() {
  78         // Default meta message data: just the META status byte value
  79         this(new byte[]{(byte) META, 0});
  80     }
  81 
  82     /**


< prev index next >