edu.columbia.ee.csmit.MidiKaraoke.MidiMessage
Class MidiCommandParser

java.lang.Object
  extended by edu.columbia.ee.csmit.MidiKaraoke.MidiMessage.MidiCommandParser
All Implemented Interfaces:
RawMidiMessageParser.Parser
Direct Known Subclasses:
MetaCommandParser, MidiCommandWithChannelParser

public class MidiCommandParser
extends java.lang.Object
implements RawMidiMessageParser.Parser

Parses a generic midi command. Does not attempt to interpret the command message.

See Also:
MidiCommand

Nested Class Summary
static class MidiCommandParser.Command
           
 
Constructor Summary
MidiCommandParser()
           
 
Method Summary
 MidiCommand parse(javax.sound.midi.MidiMessage mm)
          If this parser recognizes mm, it should return a parsed midi message.
protected static java.lang.String parseString(byte[] message, int offset)
          Returns a string extracted from a raw midi message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MidiCommandParser

public MidiCommandParser()
Method Detail

parse

public MidiCommand parse(javax.sound.midi.MidiMessage mm)
Description copied from interface: RawMidiMessageParser.Parser
If this parser recognizes mm, it should return a parsed midi message. Otherwise it should return null.

Specified by:
parse in interface RawMidiMessageParser.Parser
Parameters:
mm - the message to parse
Returns:
a midi command or null

parseString

protected static java.lang.String parseString(byte[] message,
                                              int offset)
Returns a string extracted from a raw midi message. This is a helper function for the many midi commands that contain strings.

Parameters:
message - the raw message
offset - the index of the string length
Returns:
the string in the midi message