JSR-234 1.1

javax.microedition.amms
Class GlobalManager

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

public class GlobalManager
extends java.lang.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).


Method Summary
static EffectModule createEffectModule()
          Creates an EffectModule.
static MediaProcessor createMediaProcessor(java.lang.String inputType)
          Creates a MediaProcessor object.
static SoundSource3D createSoundSource3D()
          Creates a SoundSource3D.
static javax.microedition.media.Control getControl(java.lang.String controlType)
          Obtain the object that implements the specified Control interface.
static javax.microedition.media.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 java.lang.String[] getSupportedMediaProcessorInputTypes()
          Gets the supported MediaProcessor input content types.
static java.lang.String[] getSupportedSoundSource3DPlayerTypes()
          Gets the supported player content types that can be added to a SoundSource3D.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getControls

public static javax.microedition.media.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

getControl

public static javax.microedition.media.Control getControl(java.lang.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 - 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.
Returns:
the object that implements the control, or null
Throws:
java.lang.IllegalArgumentException - if controlType is null

createEffectModule

public static EffectModule createEffectModule()
                                       throws javax.microedition.media.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:
javax.microedition.media.MediaException - if creation of EffectModules is not supported.

createSoundSource3D

public static SoundSource3D createSoundSource3D()
                                         throws javax.microedition.media.MediaException
Creates a SoundSource3D.

Returns:
a SoundSource3D object that represents a virtual sound source and that may be used to group Players
Throws:
javax.microedition.media.MediaException - if creation of SoundSource3Ds is not supported
See Also:
getSupportedSoundSource3DPlayerTypes()

getSupportedSoundSource3DPlayerTypes

public static java.lang.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")

getSpectator

public static Spectator getSpectator()
                              throws javax.microedition.media.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:
javax.microedition.media.MediaException - if the device does not support Spectator

createMediaProcessor

public static MediaProcessor createMediaProcessor(java.lang.String inputType)
                                           throws javax.microedition.media.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 - the content type of the source data to be processed
Returns:
an instance of MediaProcessor
Throws:
javax.microedition.media.MediaException - if a MediaProcessor could not be created for the given content type
See Also:
getSupportedMediaProcessorInputTypes()

getSupportedMediaProcessorInputTypes

public static java.lang.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

JSR-234 1.1

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