javax.microedition.amms.control
Interface MIDIChannelControl

All Superinterfaces:
Control

public interface MIDIChannelControl
extends Control

MIDIChannelControl is a Control that gives access to MIDI-channel-specific Controls. Essentially, it provides the same functionality as Controllable, but per channel, not per Player.

A MIDIChannelControl might be supported for MIDI Players.

If the played MIDI file or MIDI stream contains information that is contradictory to what is specified via the MIDIChannelControl the behavior will be implementation specific.

See Also:
Control, Controllable
Since:
BlackBerry API 5.0.0

Method Summary
 Control getChannelControl(String controlType, int channel)
          Obtains the object that implements the specified Control interface for the given channel.
 Control[] getChannelControls(int channel)
          Obtains the collection of Controls for the given channel.
 



Method Detail

getChannelControl

Control getChannelControl(String controlType,
                          int channel)
Obtains the object that implements the specified Control interface for the given channel.

If the specified Control interface is not supported then null is returned.

Parameters:
controlType - the class name of the Control. The class name should be given either as the fully-qualified name of the class; or if the package of the class is not given, the package javax.microedition.media.control is assumed.
channel - @return the object that implements the control, or nullnumber of the channel. It must be in the range 0-15.
Throws:
IllegalArgumentException - thrown if controlType is null or channel is out of range
IllegalStateException - thrown if getControl is called in a wrong state. (getControl and getControls cannot be called when the Player is in the UNREALIZED or CLOSED state.)
Since:
BlackBerry API 5.0.0

getChannelControls

Control[] getChannelControls(int channel)
Obtains the collection of Controls for the given channel.

Since a single channel can implement multiple Control interfaces, it is necessary to check each object against different Control types. For example:

MIDIChannelControl mc; // : Control cs[]; cs = mc.getChannelControls(1); for (int i = 0; i < cs.length; i++) {if (cs[i] instanceof ControlTypeA)doSomethingA();if (cs[i] instanceof ControlTypeB)doSomethingB();// etc. }

The list of Control objects returned will not contain any duplicates and the list will not change over time.

If no Control is supported, a zero length array is returned.

Parameters:
channel - @return the collection of Control objects number of the channel. It must be in the range 0-15.
Throws:
IllegalArgumentException - thrown if the channel is out of range
IllegalStateException - thrown if getControls is called in a wrong state. (getControl and getControls cannot be called when the Player is in the UNREALIZED or CLOSED state.)
Since:
BlackBerry API 5.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.