edu.uiuc.cs397rhc.sound
Class ChannelGroupCondition

java.lang.Object
  extended by edu.uiuc.cs397rhc.sound.ChannelGroupCondition
All Implemented Interfaces:
MidiCondition

public class ChannelGroupCondition
extends java.lang.Object
implements MidiCondition

ChannelGroupCondition is a convenience MidiCondition that is satisfied by a MidiMessage whose channel is one of a given group of channels.

Author:
Pedro DeRose

Constructor Summary
ChannelGroupCondition(int[] channels)
          Create a ChannelGroupCondition that is satisfied by MidiMessage whose channel is one of the given group of channels.
 
Method Summary
 java.lang.String getPrettyString()
          Returns a pretty, printable representation of this condition.
 boolean isSatisfiedBy(javax.sound.midi.MidiMessage msg, long time)
          Whether the condition is satisfied by the given MidiMessage and timestamp.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChannelGroupCondition

public ChannelGroupCondition(int[] channels)
Create a ChannelGroupCondition that is satisfied by MidiMessage whose channel is one of the given group of channels.

Parameters:
channels - the group of channels
Method Detail

isSatisfiedBy

public boolean isSatisfiedBy(javax.sound.midi.MidiMessage msg,
                             long time)
Description copied from interface: MidiCondition
Whether the condition is satisfied by the given MidiMessage and timestamp.

Specified by:
isSatisfiedBy in interface MidiCondition
Parameters:
msg - the message being checked
time - the timestamp of the message
Returns:
true if satisfied, false otherwise.

getPrettyString

public java.lang.String getPrettyString()
Description copied from interface: MidiCondition
Returns a pretty, printable representation of this condition. This will be used to recursively print out complex conditions.

Specified by:
getPrettyString in interface MidiCondition
Returns:
a pretty, printable representation of this condition

toString

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