cdox.gui
Class PlaySounds

java.lang.Object
  extended bycdox.gui.PlaySounds
All Implemented Interfaces:
java.lang.Runnable

public class PlaySounds
extends java.lang.Object
implements java.lang.Runnable

This class plays a sound. It plays four different sounds (defined in /cdox/sounds/) which (the file paths) are stored in a HashMap. To play a sound just call the static play method with the a key of the sound you want to play. The four keys are:

Version:
may 12th 2002
Author:
Rutger Bezema, Andreas Schmitz

Constructor Summary
PlaySounds()
           
 
Method Summary
static void play(java.lang.String key)
          This method should be called to play a sound.
 void run()
          This method is overwritten from the Runnable interface, here the real playing starts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlaySounds

public PlaySounds()
Method Detail

play

public static void play(java.lang.String key)
This method should be called to play a sound. The keys can be read in this class' discription. It opens an AudioInputStream which is given to the clip to read it's data from.

Parameters:
key - the key which sound to play.
See Also:
run()

run

public void run()
This method is overwritten from the Runnable interface, here the real playing starts. This method is called from play. It first creates a DataLine of type Clip() if no DataLine is available from the AudioSystem, Exceptions are trown.

Specified by:
run in interface java.lang.Runnable
See Also:
play(java.lang.String)