|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MIDIChannelControl
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 | ||
---|---|---|
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 Control s
for the given channel. |
Method Detail |
---|
Control getChannelControl(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
- @return the object that implements the control,
or null
number of the channel. It must be in the range 0-15.
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.)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
- @return the collection of Control
objects
number of the channel. It must be in the range 0-15.
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.)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal