com.planeth.common.audio
Class AudioResource

java.lang.Object
  extended bycom.planeth.common.audio.AudioResource

public class AudioResource
extends java.lang.Object

Handles the usage of audioResources
(Singleton pattern)

Author:
Andreas Grässer, gal@planet-h.com.
created Jun 18, 2005
See Also:
BufferedClip, AudioClipConfig

Field Summary
static java.lang.String ALARM
           
static java.lang.String BASS_LOOP
           
static java.lang.String BEEP2_HI
           
static java.lang.String BEEP2_LO
           
static java.lang.String CURE
           
static java.lang.String DEEDLE
           
static java.lang.String DOWN
           
static java.lang.String ENEMY_SPAWN
           
static java.lang.String EXPL_BIG
           
static java.lang.String EXPL_DEEP2
           
static java.lang.String EXPL_HI
           
static java.lang.String EXPL_MID
           
static java.lang.String EXPL_VERY_DEEP
           
static java.lang.String EXTEND_SHOT
           
static java.lang.String EXTRASHIP
           
static java.lang.String FINISHED
           
static java.lang.String HALLOFFAME
           
static java.lang.String LASER_CANNON
           
static java.lang.String LASER_LONG
           
static java.lang.String LASER1
           
static java.lang.String LASER2
           
static java.lang.String LASER3_LO
           
static java.lang.String LASER5
           
static java.lang.String SHIELD_LOOP
           
static java.lang.String START
           
static java.lang.String STROM
           
static java.lang.String THROTTLE_LOOP
           
static java.lang.String UP
           
 
Method Summary
static AudioResource getInstance()
          Returns the singleton instance
static int getNrOfFiles()
          Returns the complete number of audioFiles
static int getNrOfFilesLoaded()
          Returns the number of audioFiles loaded
 boolean isSoundEnabled()
          Returns true, if sound is enabled.
 void play(java.lang.String fileName)
          Plays a specific sound
 void setSoundEnabled(boolean soundEnabled)
          Sets the sound enabled(true) or disabled(false)
 void stop(java.lang.String fileName)
          Stops a specific sound
 void stopAll()
          Stops all sounds
 void stopAllLoops()
          Stops all loop sounds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHIELD_LOOP

public static final java.lang.String SHIELD_LOOP
See Also:
Constant Field Values

HALLOFFAME

public static final java.lang.String HALLOFFAME
See Also:
Constant Field Values

CURE

public static final java.lang.String CURE
See Also:
Constant Field Values

BEEP2_LO

public static final java.lang.String BEEP2_LO
See Also:
Constant Field Values

BEEP2_HI

public static final java.lang.String BEEP2_HI
See Also:
Constant Field Values

DEEDLE

public static final java.lang.String DEEDLE
See Also:
Constant Field Values

ENEMY_SPAWN

public static final java.lang.String ENEMY_SPAWN
See Also:
Constant Field Values

EXPL_BIG

public static final java.lang.String EXPL_BIG
See Also:
Constant Field Values

EXPL_DEEP2

public static final java.lang.String EXPL_DEEP2
See Also:
Constant Field Values

EXPL_VERY_DEEP

public static final java.lang.String EXPL_VERY_DEEP
See Also:
Constant Field Values

EXPL_HI

public static final java.lang.String EXPL_HI
See Also:
Constant Field Values

EXPL_MID

public static final java.lang.String EXPL_MID
See Also:
Constant Field Values

EXTRASHIP

public static final java.lang.String EXTRASHIP
See Also:
Constant Field Values

FINISHED

public static final java.lang.String FINISHED
See Also:
Constant Field Values

LASER1

public static final java.lang.String LASER1
See Also:
Constant Field Values

LASER2

public static final java.lang.String LASER2
See Also:
Constant Field Values

EXTEND_SHOT

public static final java.lang.String EXTEND_SHOT
See Also:
Constant Field Values

LASER3_LO

public static final java.lang.String LASER3_LO
See Also:
Constant Field Values

LASER5

public static final java.lang.String LASER5
See Also:
Constant Field Values

ALARM

public static final java.lang.String ALARM
See Also:
Constant Field Values

DOWN

public static final java.lang.String DOWN
See Also:
Constant Field Values

LASER_LONG

public static final java.lang.String LASER_LONG
See Also:
Constant Field Values

STROM

public static final java.lang.String STROM
See Also:
Constant Field Values

UP

public static final java.lang.String UP
See Also:
Constant Field Values

START

public static final java.lang.String START
See Also:
Constant Field Values

THROTTLE_LOOP

public static final java.lang.String THROTTLE_LOOP
See Also:
Constant Field Values

BASS_LOOP

public static final java.lang.String BASS_LOOP
See Also:
Constant Field Values

LASER_CANNON

public static final java.lang.String LASER_CANNON
See Also:
Constant Field Values
Method Detail

getInstance

public static AudioResource getInstance()
Returns the singleton instance

Returns:
Returns the singleton instance

getNrOfFiles

public static int getNrOfFiles()
Returns the complete number of audioFiles

Returns:
Returns the complete number of audioFiles

getNrOfFilesLoaded

public static int getNrOfFilesLoaded()
Returns the number of audioFiles loaded

Returns:
Returns the number of audioFiles loaded

play

public void play(java.lang.String fileName)
Plays a specific sound

Parameters:
fileName - filename of the clip

stop

public void stop(java.lang.String fileName)
Stops a specific sound

Parameters:
fileName - filename of the clip

stopAllLoops

public void stopAllLoops()
Stops all loop sounds


stopAll

public void stopAll()
Stops all sounds


isSoundEnabled

public boolean isSoundEnabled()
Returns true, if sound is enabled.

Returns:
Returns true, if sound is enabled.

setSoundEnabled

public void setSoundEnabled(boolean soundEnabled)
Sets the sound enabled(true) or disabled(false)

Parameters:
soundEnabled - true = enabled, false = disabled