FileDocCategorySizeDatePackage
Configuration.javaAPI DocphoneME MR2 API (J2ME)6476Wed May 02 18:00:46 BST 2007com.sun.mmedia

Configuration

public abstract class Configuration extends Object
The configuration module for MMAPI.
created
January 13, 2005

Fields Summary
protected Hashtable
handlers
A hash table of the protocol and content handlers.
protected Hashtable
processors
A hash table of media processors.
protected Hashtable
mimeTypes
A table of mime types.
private static Configuration
config
The current configuration object.
protected static boolean
nativeLooping
True if players loop in native code, otherwise false
public static final String
TONE_DEVICE_LOCATOR
public static final String
MIDI_DEVICE_LOCATOR
public static final String
RADIO_CAPTURE_LOCATOR
public static final String
AUDIO_CAPTURE_LOCATOR
public static final String
VIDEO_CAPTURE_LOCATOR
protected Hashtable
properties
private static Object
singletonLock
Constructors Summary
public Configuration()
Constructor for the Configuration object

              
      
        handlers = new Hashtable();
        processors = new Hashtable();
        mimeTypes = new Hashtable();
        properties = new Hashtable();
    
Methods Summary
public java.lang.Stringext2Mime(java.lang.String name)
Convert from the name of a file to its corresponding Mime type based on the extension.

param
name Description of the Parameter
return
Description of the Return Value

        int idx = name.lastIndexOf('.");
        String ext;
        if (idx != -1) {
            ext = name.substring(idx + 1).toLowerCase();
        } else {
            ext = name.toLowerCase();
        }
        return (String) mimeTypes.get(ext);
    
public abstract PCMAudioOutgetAudioRenderer()
Gets the audio renderer.

return
The audio renderer

public static com.sun.mmedia.ConfigurationgetConfiguration()
Gets the configuration attribute of the Configuration class

return
The configuration value

        synchronized (singletonLock) {
            if (config != null) return config;

            String className = System.getProperty("mmapi-configuration");

            if (className != null) {        
                try {
                    // ... try and instantiate the configuration class ...
                    Class handlerClass = Class.forName(className);
                    config = (Configuration) handlerClass.newInstance();
                } catch (Exception e) {
                    // return DefaultConfiguration 
                    config = new DefaultConfiguration();
                }
            } else {            
                config = new DefaultConfiguration();
            }

            return config;
        }
    
public java.lang.StringgetHandler(java.lang.String type)
Gets the handler attribute of the Configuration object

param
type The content type
return
The handler value

        return (String) handlers.get(type);
    
public abstract ImageAccessgetImageAccessor()
Gets Accessor to platform specific Image classes To be defined in derived classes.

return
instance of ImageAccess class

public java.lang.StringgetMediaProcessor(java.lang.String type)
Gets the processor attribute of the Configuration object

param
type The content type
return
The processor value

        return (String) processors.get(type);
    
public abstract java.lang.StringgetProperty(java.lang.String key)

public abstract java.lang.String[]getSupportedContentTypes(java.lang.String protocol)
Gets the supportedContentTypes attribute of the Configuration object

param
protocol Description of the Parameter
return
The supportedContentTypes value

public abstract java.lang.String[]getSupportedMediaProcessorInputTypes()

public abstract java.lang.String[]getSupportedProtocols(java.lang.String content_types)
Gets the supportedProtocols attribute of the Configuration class

param
content_types Description of the Parameter
return
The supportedProtocols value

public abstract java.lang.String[]getSupportedSoundSource3DPlayerTypes()

public abstract TonePlayergetTonePlayer()
Gets the tonePlayer attribute of the Configuration object

return
The tonePlayer value

public abstract VideoRenderergetVideoRenderer(javax.microedition.media.Player player, int sourceWidth, int sourceHeight)
Gets the video renderer.

return
The video renderer

public static booleannativeLoopMode()
Description of the Method

return
Description of the Return Value

        return nativeLooping;
    
public abstract voidsetProperty(java.lang.String key, java.lang.String value)