|
1.0: Final Release | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
MIDIChannelControl
is a Control
that
gives access to MIDI-channel-specific Control
s.
Essentially, it provides the same functionality as Controllable,
but per channel, not per Player.
A MIDIChannelControl
might be supported for MIDI
Player
s.
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.
Control
,
Controllable
Method Summary | |
javax.microedition.media.Control |
getChannelControl(java.lang.String controlType,
int channel)
Obtains the object that implements the specified Control interface for the given channel. |
javax.microedition.media.Control[] |
getChannelControls(int channel)
Obtains the collection of Control s
for the given channel. |
Method Detail |
public javax.microedition.media.Control getChannelControl(java.lang.String controlType, int channel)
Control
interface for the given channel.
If the specified Control
interface is not supported
then null
is returned.
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
- number of the channel. It must be in the range 0-15.
null
java.lang.IllegalArgumentException
- thrown if controlType
is null
or channel
is out of range
java.lang.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.)getChannelControls(int channel)
public javax.microedition.media.Control[] getChannelControls(int channel)
Control
s
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.
channel
- number of the channel. It must be in the range 0-15.
Control
objects
java.lang.IllegalArgumentException
- thrown if the channel
is out of range
java.lang.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.)
|
1.0: Final Release | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |