mediaframe.mpeg1.audio.player
Class AudioDeviceFactory

java.lang.Object
  |
  +--mediaframe.mpeg1.audio.player.AudioDeviceFactory

public class AudioDeviceFactory
extends java.lang.Object

The AudioDeviceFactory class stores the factories for all the audio device implementations available in the system.

Instances of this class are thread-safe.

Since:
0.0.8
Author:
Mat McGowan

Field Summary
private  int deviceType
          The type of the Audio Device.
static int EIGHT_BIT
          The Eight Bit Audio Device type.
private static AudioDeviceFactory instance
          The single instance of the Audio Device Factory.
static int JAVA_SOUND
          The JavaSound Audio Device type.
 
Constructor Summary
AudioDeviceFactory()
           
 
Method Summary
 AudioDevice createAudioDevice()
          Creates and returns the implementation of the AudioDevice interface of a type that specified by the deviceType field.
static AudioDeviceFactory loadDriverClass()
          This method implements singelton pattern - creates (during the first call) and returns the single instance of AudioDeviceFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVA_SOUND

public static final int JAVA_SOUND
The JavaSound Audio Device type.

See Also:
Constant Field Values

EIGHT_BIT

public static final int EIGHT_BIT
The Eight Bit Audio Device type.

See Also:
Constant Field Values

deviceType

private int deviceType
The type of the Audio Device.


instance

private static AudioDeviceFactory instance
The single instance of the Audio Device Factory.

Constructor Detail

AudioDeviceFactory

public AudioDeviceFactory()
Method Detail

loadDriverClass

public static AudioDeviceFactory loadDriverClass()
This method implements singelton pattern - creates (during the first call) and returns the single instance of AudioDeviceFactory. Detects (during the first call) the type of the Audio Device that could be used under the current JRE.

Returns:
the instance of the Audio Device Factory.

createAudioDevice

public AudioDevice createAudioDevice()
                              throws mediaframe.mpeg1.audio.decoder.JavaLayerException
Creates and returns the implementation of the AudioDevice interface of a type that specified by the deviceType field.

Returns:
the implementation of the AudioDevice interface.
Throws:
mediaframe.mpeg1.audio.decoder.JavaLayerException - if the implementation of the AudioDevice interface could not be created.