GF4J 0.9.4 Beta

gameframe.engines
Class NullSoundEngine

java.lang.Object
  |
  +--gameframe.engines.NullSoundEngine
All Implemented Interfaces:
Finalizable, SoundEngine

public class NullSoundEngine
extends java.lang.Object
implements SoundEngine, Finalizable

Do nothing implementation of the sound engine, used e.g. when no soundcard is found on the current platform.

Since:
GameFrame for Java 0.9
Version:
GameFrame for Java 0.9.4
See Also:
gameframe.SoundEngine

Field Summary
private  java.lang.String m_strDataDirectory
          The currently set datadirectory.
static NullSoundEngine mStatic_singletonInstance
          The singleton instance of Null Sample Engine class.
 
Constructor Summary
private NullSoundEngine()
          Private constructor of this class.
 
Method Summary
 void finalize()
          Clears the singleton instance.
 java.lang.String getDataDirectory()
          Returns the data directory wherefrom the sounds are loaded.
 java.lang.String getDescription()
          Returns the (possibly multiline) description of the implementation.
static NullSoundEngine getInstance()
          Returns the single instance of Null Sample Engine class.
 java.lang.String getName()
          Returns the short name (max 8 characters) of the implementation "NullSnd".
 Music loadMusic(java.lang.String fileName)
          Returns an do nothing implementation of music object.
 Sample loadSample(java.lang.String fileName)
          Returns an do nothing implementation of sample object.
 void setDataDirectory(java.lang.String strDirectoryName)
          Checks if the directory exists (like the other library implementations do).
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m_strDataDirectory

private java.lang.String m_strDataDirectory
The currently set datadirectory.

mStatic_singletonInstance

public static NullSoundEngine mStatic_singletonInstance
The singleton instance of Null Sample Engine class.
Since:
GameFrame for Java 0.9.1
Constructor Detail

NullSoundEngine

private NullSoundEngine()
Private constructor of this class.
Since:
GameFrame for Java 0.9
Method Detail

getInstance

public static NullSoundEngine getInstance()
Returns the single instance of Null Sample Engine class.
Returns:
The one and only instance of Null Sample Engine class.
Since:
GameFrame for Java 0.9.1

loadSample

public Sample loadSample(java.lang.String fileName)
Returns an do nothing implementation of sample object.
Specified by:
loadSample in interface SoundEngine
Parameters:
fileName - Ignored.
Returns:
Do nothing implementation of sample object.
Since:
GameFrame for Java 0.9

loadMusic

public Music loadMusic(java.lang.String fileName)
Returns an do nothing implementation of music object.
Specified by:
loadMusic in interface SoundEngine
Parameters:
fileName - Ignored.
Returns:
Do nothing implementation of music object.
Since:
GameFrame for Java 0.9.2

setDataDirectory

public void setDataDirectory(java.lang.String strDirectoryName)
                      throws java.io.FileNotFoundException
Checks if the directory exists (like the other library implementations do).
Specified by:
setDataDirectory in interface SoundEngine
Parameters:
strDirectoryName - Ignored.
Since:
GameFrame for Java 0.9

getDataDirectory

public java.lang.String getDataDirectory()
Returns the data directory wherefrom the sounds are loaded. The source directory defaults to the current directory. Note: The returned path will have the path separator as the last character.
Specified by:
getDataDirectory in interface SoundEngine
Returns:
The name of the directory that wherefrom the sounds are loaded.
Since:
GameFrame for Java 0.9.3
See Also:
loadSample(java.lang.String), loadMusic(java.lang.String)

getName

public java.lang.String getName()
Returns the short name (max 8 characters) of the implementation "NullSnd".
Specified by:
getName in interface SoundEngine
Returns:
The short name of the graphics engine.
Since:
GameFrame for Java 0.9.3

getDescription

public java.lang.String getDescription()
Returns the (possibly multiline) description of the implementation.
Specified by:
getDescription in interface SoundEngine
Returns:
A description of the graphics engine.
Since:
GameFrame for Java 0.9.3

finalize

public void finalize()
Clears the singleton instance.
Specified by:
finalize in interface Finalizable
Overrides:
finalize in class java.lang.Object
Since:
GameFrame for Java 0.9.0

GF4J 0.9.4 Beta