jplay
Class Sound

java.lang.Object
  extended by jplay.Sound

public class Sound
extends java.lang.Object

Class responsible for controlling the execution of sounds.


Constructor Summary
Sound(java.lang.String fileName)
          Class Constructor.
 
Method Summary
 void decreaseVolume(float value)
          Method responsible for decrease the volume.
 void increaseVolume(float value)
          Method responsible for increasing the volume.
 boolean isExecuting()
          Returns true if the sound is running, false otherwise.
 void load(java.lang.String fileName)
          Loads a sound.
 void pause()
          Pauses the execution of the sound.
 void play()
          Starts the execution of the sound.
 void setRepeat(boolean value)
          This method is responsible for making the sound to run indefinitely.
 void setVolume(float value)
          Sets the current volume.
 void stop()
          Stops the execution of the sound.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sound

public Sound(java.lang.String fileName)
Class Constructor. Create an instance of this class. The sound will be executed only once.

Parameters:
fileName -
Method Detail

load

public void load(java.lang.String fileName)
Loads a sound.

Parameters:
fileName - File path.

increaseVolume

public void increaseVolume(float value)
Method responsible for increasing the volume.

Parameters:
value - This value will be added to the current volume value.

decreaseVolume

public void decreaseVolume(float value)
Method responsible for decrease the volume.

Parameters:
value - This value will be subtracted from the current volume value.

setVolume

public void setVolume(float value)
Sets the current volume.

Parameters:
value -

play

public void play()
Starts the execution of the sound.


stop

public void stop()
Stops the execution of the sound.


pause

public void pause()
Pauses the execution of the sound.


setRepeat

public void setRepeat(boolean value)
This method is responsible for making the sound to run indefinitely.

Parameters:
value -

isExecuting

public boolean isExecuting()
Returns true if the sound is running, false otherwise.

Returns:
boolean