dk.klafbang.tincpn.animation.plugin
Class SoundPlayer

java.lang.Object
  extended by dk.klafbang.tincpn.animation.plugin.SoundPlayer

public class SoundPlayer
extends java.lang.Object

Author:
Michael Westergaard

Constructor Summary
SoundPlayer(java.lang.String name)
          Construct a new SoundPlayer.
 
Method Summary
 int loadSound(java.lang.String url)
          Load a sound for later playback.
 void playSound(int key)
          Play back an earlier loaded sound.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoundPlayer

public SoundPlayer(java.lang.String name)
Construct a new SoundPlayer.

Parameters:
name - name of the SoundPlayer -- not used.
Method Detail

loadSound

public int loadSound(java.lang.String url)
              throws java.lang.Exception
Load a sound for later playback.

Parameters:
url - the URL of the sound to load
Returns:
a key which can be used to play back the sound
Throws:
java.lang.Exception - if the URL is invalid

playSound

public void playSound(int key)
               throws java.lang.Exception
Play back an earlier loaded sound.

Parameters:
key - the key of the sound as returned by loadSound
Throws:
java.lang.Exception - if the key is invalid