JSR-234 1.1

javax.microedition.amms
Interface Module

All Superinterfaces:
javax.microedition.media.Controllable
All Known Subinterfaces:
EffectModule, SoundSource3D

public interface Module
extends javax.microedition.media.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

Method Summary
 void addMIDIChannel(javax.microedition.media.Player player, int channel)
          Adds an individual MIDI channel of a MIDI Player to the module.
 void addPlayer(javax.microedition.media.Player player)
          Adds a Player to the module.
 void removeMIDIChannel(javax.microedition.media.Player player, int channel)
          Removes a MIDI channel from the module.
 void removePlayer(javax.microedition.media.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(javax.microedition.media.Player player,
                    int channel)
                    throws javax.microedition.media.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:
javax.microedition.media.MediaException - if adding of channels is not supported
java.lang.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
java.lang.IllegalArgumentException - if channel > 15 or channel < 0
java.lang.IllegalStateException - if some Player in the Module (or the player to be added) is in PREFETCHED or STARTED state

removeMIDIChannel

void removeMIDIChannel(javax.microedition.media.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:
java.lang.IllegalArgumentException - if the given channel is not part of the Module or if the player is null
java.lang.IllegalStateException - if some Player in the Module (including the player to be removed) is in PREFETCHED or STARTED state

addPlayer

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

Parameters:
player - the Player to be added
Throws:
java.lang.IllegalArgumentException - if the player is null or if the player or some channels of the player already belong to the module
javax.microedition.media.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.)
java.lang.IllegalStateException - if some Player in the Module (or the player to be added) is in PREFETCHED or STARTED state

removePlayer

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

Parameters:
player - the Player to be removed
Throws:
java.lang.IllegalArgumentException - if player is not part of the module or if player is null
java.lang.IllegalStateException - if some Player in the Module (including the player to be removed) is in PREFETCHED or STARTED state

JSR-234 1.1

Copyright © 2004-2007 Nokia Corporation. See the Copyright for details.