org.deken.game.sound
Class TimeListeningSound

java.lang.Object
  extended by org.deken.game.sound.BaseSound
      extended by org.deken.game.sound.TimeListeningSound
All Implemented Interfaces:
AudioListener, Sound, Updateable

public class TimeListeningSound
extends BaseSound
implements Updateable

Title: TimeListeningSound

Description: TODO

Copyright: Copyright (c) Nov 22, 2011

Version:
1.0
Author:
Gary Deken

Nested Class Summary
 
Nested classes/interfaces inherited from class org.deken.game.sound.BaseSound
BaseSound.SEQUENCE
 
Field Summary
protected  int currentSound
           
protected  long[] playTimes
           
protected  long sequenceTime
           
protected  Sound sound
           
protected  long totalTime
           
 
Fields inherited from class org.deken.game.sound.BaseSound
audio, listeners, name, playing
 
Constructor Summary
TimeListeningSound(Sound sound, long totalTime, long[] playTimes)
          TimeListeningSound needs a Sound object.
 
Method Summary
 void audioStop()
           
 TimeListeningSound copy()
          Copies the sound.
 Sound getSound()
           
 void pause()
          Pauses the sound object at it's current location.
 void play()
          Plays the sound object, with an option to loop the sound.
 void reset()
           
 void resume()
          Resumes the sound object from where it was paused.
 void setPlayTimes(long[] playTimes)
           
 void setSound(Sound sound)
           
 void stop()
          Stops the sound object.
 void update(long elapseTime)
          The update method is used for filter updates, when sound does have regular updates.
 
Methods inherited from class org.deken.game.sound.BaseSound
addAudio, addSoundListener, copyParent, getName, isPlaying, notifyListeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.deken.game.Updateable
getName
 

Field Detail

sound

protected Sound sound

totalTime

protected long totalTime

playTimes

protected long[] playTimes

currentSound

protected int currentSound

sequenceTime

protected long sequenceTime
Constructor Detail

TimeListeningSound

public TimeListeningSound(Sound sound,
                          long totalTime,
                          long[] playTimes)
TimeListeningSound needs a Sound object. The totalTime is used to determine when to start the sound over again. The value is in Milliseconds. The Play time is how long individual sounds will play.

Parameters:
sound -
totalTime -
playTimes -
Method Detail

audioStop

public void audioStop()
Specified by:
audioStop in interface AudioListener

copy

public TimeListeningSound copy()
Description copied from interface: Sound
Copies the sound.

Specified by:
copy in interface Sound
Returns:
Sound

getSound

public Sound getSound()

pause

public void pause()
Description copied from interface: Sound
Pauses the sound object at it's current location.

Specified by:
pause in interface Sound

play

public void play()
Description copied from interface: Sound
Plays the sound object, with an option to loop the sound.

Specified by:
play in interface Sound

reset

public void reset()

resume

public void resume()
Description copied from interface: Sound
Resumes the sound object from where it was paused.

Specified by:
resume in interface Sound

stop

public void stop()
Description copied from interface: Sound
Stops the sound object.

Specified by:
stop in interface Sound

setPlayTimes

public void setPlayTimes(long[] playTimes)

setSound

public void setSound(Sound sound)

update

public void update(long elapseTime)
Description copied from class: BaseSound
The update method is used for filter updates, when sound does have regular updates. Such as Clip audio.

Specified by:
update in interface Sound
Specified by:
update in interface Updateable
Overrides:
update in class BaseSound
Parameters:
elapseTime - long