org.deken.game.sound
Class BaseSound
java.lang.Object
org.deken.game.sound.BaseSound
- All Implemented Interfaces:
- AudioListener, Sound, Updateable
- Direct Known Subclasses:
- LoopedSound, RandomSound, SingleSound, TimeListeningSound
public abstract class BaseSound
- extends java.lang.Object
- implements Sound, AudioListener
Title: BaseSound
Description: A base Sound class for storing SoundListeners for
subclasses.
Copyright: Copyright (c) Nov 9, 2011 Gary Deken
- Version:
- 1.0
- Author:
- Gary Deken
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
listeners
protected java.util.List<SoundListener> listeners
playing
protected boolean playing
name
protected java.lang.String name
audio
protected Audio audio
BaseSound
public BaseSound(Audio audio,
java.lang.String name)
BaseSound
protected BaseSound()
addAudio
public void addAudio(Audio audio)
- Specified by:
addAudio
in interface Sound
addSoundListener
public void addSoundListener(SoundListener soundListener)
- Description copied from interface:
Sound
- Add a SoundListener to this sound.
- Specified by:
addSoundListener
in interface Sound
update
public void update(long elapseTime)
- 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
- Parameters:
elapseTime
-
getName
public java.lang.String getName()
- Description copied from interface:
Sound
- Name of the sound object.
- Specified by:
getName
in interface Sound
- Specified by:
getName
in interface Updateable
- Returns:
- String name.
isPlaying
public boolean isPlaying()
- Specified by:
isPlaying
in interface Sound
- Returns:
- if this sound object is play the sound or not.
notifyListeners
protected void notifyListeners(BaseSound.SEQUENCE sequence)
copyParent
protected BaseSound copyParent(BaseSound newSound)
- Parameters:
newSound
-
- Returns:
- BaseSound