javax.microedition.amms
Interface Module

All Superinterfaces:
Controllable
All Known Subinterfaces:
EffectModule, SoundSource3D

public interface Module
extends Controllable

Module is a logical group of Players and/or MIDI channels.

Adding or removing Players or MIDI channels is not possible if any of the Players is in PREFETCHED or STARTED state.

Typically, a Module object as such can not be fetched from anywhere; the subinterfaces EffectModule and SoundSource3D are used instead.

See Also:
EffectModule, SoundSource3D
Since:
BlackBerry API 5.0.0

Method Summary
 void addMIDIChannel(Player player, int channel)
          Adds an individual MIDI channel of a MIDI Player to the module.
 void addPlayer(Player player)
          Adds a Player to the module.
 void removeMIDIChannel(Player player, int channel)
          Removes a MIDI channel from the module.
 void removePlayer(Player player)
          Removes a Player or all channels of a Player from the module.
 
Methods inherited from interface javax.microedition.media.Controllable
getControl, getControls
 



Method Detail

addMIDIChannel

void addMIDIChannel(Player player,
                    int channel)
                    throws MediaException
Adds an individual MIDI channel of a MIDI Player to the module.

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

Parameters:
player - the MIDI Player whose channel is to be added
channel - the channel of the given Player to be added. The range is 0-15
Throws:
MediaException - if adding of channels is not supported
IllegalArgumentException - if the player is not a MIDI player or the player is null or if the channel or the whole player is already part of the module
IllegalArgumentException - if channel > 15 or channel< 0
IllegalStateException - if some Player in the Module (or the player to be added) is in PREFETCHED or STARTED state
Since:
BlackBerry API 5.0.0

removeMIDIChannel

void removeMIDIChannel(Player player,
                       int channel)
Removes a MIDI channel from the module. All channels can be removed at once by removePlayer.

Parameters:
player - the MIDI Player whose channel is to be removed
channel - the channel of the given MIDI Player to be removed
Throws:
IllegalArgumentException - if the given channel is not part of the Module or if the player is null
IllegalStateException - if some Player in the Module (including the player to be removed) is in PREFETCHED or STARTED state
Since:
BlackBerry API 5.0.0

addPlayer

void addPlayer(Player player)
               throws MediaException
Adds a Player to the module.

Parameters:
player - the Player to be added
Throws:
IllegalArgumentException - if the player is null or if the player or some channels of the player already belong to the module
MediaException - if the player cannot be added. (For example, if the implementation does not support adding the same Player to multiple modules or if the implementation does not support the type of the Player.)
IllegalStateException - if some Player in the Module (or the player to be added) is in PREFETCHED or STARTED state
Since:
BlackBerry API 5.0.0

removePlayer

void removePlayer(Player player)
Removes a Player or all channels of a Player from the module.

Parameters:
player - the Player to be removed
Throws:
IllegalArgumentException - if player is not part of the module or if player is null
IllegalStateException - if some Player in the Module (including the player to be removed) is in PREFETCHED or STARTED 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.