javax.microedition.amms
Class GlobalManager

java.lang.Object
  extended by javax.microedition.amms.GlobalManager

public class GlobalManager
extends Object

The GlobalManager handles the creation of EffectModules, SoundSource3Ds and MediaProcessors. Furthermore, a Spectator can be get from the GlobalManager.

Global Effects

The GlobalManager has similar methods as Controllable has. It is supposed that implementations mostly return different subclasses of EffectControl. These effects will be treated as global effects concerning all the Players of the application.

Global VolumeControl fetched from GlobalManager does not send any VOLUME_CHANGED events to PlayerListeners (since no global listener mechanism exists).

Since:
BlackBerry API 5.0.0

Method Summary
static EffectModule createEffectModule()
          Creates an EffectModule.
static MediaProcessor createMediaProcessor(String inputType)
          Creates a MediaProcessor object.
static SoundSource3D createSoundSource3D()
          Creates a SoundSource3D.
static Control getControl(String controlType)
          Obtain the object that implements the specified Control interface.
static Control[] getControls()
          Obtain the collection of Controls from the GlobalManager.
static Spectator getSpectator()
          Gets the Spectator, which represents the listener in the virtual acoustical space.
static String[] getSupportedMediaProcessorInputTypes()
          Gets the supported MediaProcessor input content types.
static String[] getSupportedSoundSource3DPlayerTypes()
          Gets the supported player content types that can be added to a SoundSource3D.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Method Detail

getControls

public static Control[] getControls()
Obtain the collection of Controls from the GlobalManager.

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

Control cs[]; cs = GlobalManager.getControls(); 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.

Returns:
an array of Control objects
Since:
BlackBerry API 5.0.0

getControl

public static Control getControl(String controlType)
Obtain the object that implements the specified Control interface.

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

Parameters:
controlType - @return the object that implements the control, or nullthe 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.
Throws:
IllegalArgumentException - if controlType is null
Since:
BlackBerry API 5.0.0

createEffectModule

public static EffectModule createEffectModule()
                                       throws MediaException
Creates an EffectModule.

MediaException is thrown if EffectModules are not supported at all. If they are supported creation will always succeed but the number of active EffectModules, ones containing a Player in PREFETCHED or STARTED state, can be limited by the implementation.

Returns:
an EffectModule object that may be used to group Players
Throws:
MediaException - if creation of EffectModules is not supported.
Since:
BlackBerry API 5.0.0

createSoundSource3D

public static SoundSource3D createSoundSource3D()
                                         throws MediaException
Creates a SoundSource3D.

Returns:
a SoundSource3D object that represents a virtual sound source and that may be used to group Players
Throws:
MediaException - if creation of SoundSource3Ds is not supported
Since:
BlackBerry API 5.0.0

getSupportedSoundSource3DPlayerTypes

public static String[] getSupportedSoundSource3DPlayerTypes()
Gets the supported player content types that can be added to a SoundSource3D. Format Definitions for JSR-234 specifies constants (in its "Format" column) for content types commonly used with SoundSource3D.

Returns:
a list of content types that can be used to create Players supported by SoundSource3D (e.g. "audio/midi") and of device and capture locators that can be used to create Players supported by SoundSource3D (e.g. "capture://radio")
Since:
BlackBerry API 5.0.0

getSpectator

public static Spectator getSpectator()
                              throws MediaException
Gets the Spectator, which represents the listener in the virtual acoustical space.

Returns:
the Spectator, which represents the listener in the virtual acoustical space
Throws:
MediaException - if the device does not support Spectator
Since:
BlackBerry API 5.0.0

createMediaProcessor

public static MediaProcessor createMediaProcessor(String inputType)
                                           throws MediaException
Creates a MediaProcessor object. The input content type is passed as a MIME type as specified in javax.microedition.media.Manager. Format Definitions for JSR-234 specifies constants (in its "Format" column) for a set of commonly used content types. The supported input content types can be obtained by calling getSupportedMediaProcessorInputTypes().

MediaProcessor to process Images must be created by using input type "image/raw".

Parameters:
inputType - @return an instance of MediaProcessorthe content type of the source data to be processed
Throws:
MediaException - if a MediaProcessor could not be created for the given content type
Since:
BlackBerry API 5.0.0

getSupportedMediaProcessorInputTypes

public static String[] getSupportedMediaProcessorInputTypes()
Gets the supported MediaProcessor input content types. Format Definitions for JSR-234 specifies constants (in its "Format" column) for a set of commonly used content types.

Returns:
the supported MediaProcessor input content types
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.