org.deken.game.sound.audio.clipAudioFilter
Class DistanceClipFilter
java.lang.Object
org.deken.game.sound.audio.clipAudioFilter.ClipAudioFilter
org.deken.game.sound.audio.clipAudioFilter.DistanceClipFilter
- All Implemented Interfaces:
- Updateable
public class DistanceClipFilter
- extends ClipAudioFilter
Title: DistanceFilter
Description: DistanceFilter is based on the Volume changing code from
Andrew Davison. The sound fades in and out based on the distance from the
listener.
Copyright: Copyright (c) Dec 11, 2012
- Version:
- 1.0
- Author:
- Gary Deken
Constructor Summary |
DistanceClipFilter(Sprite source,
Sprite listener,
int maxDistance)
DistanceFilter Creates a new DistanceFilter with the specified source and
listener GamePieces. |
Method Summary |
java.lang.String |
getName()
|
void |
setName(java.lang.String name)
|
void |
setParent(javax.sound.sampled.Clip parent)
|
void |
update(long elapseTime)
Update Filters the sound so that it gets more quiet with distance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DistanceClipFilter
public DistanceClipFilter(Sprite source,
Sprite listener,
int maxDistance)
- DistanceFilter Creates a new DistanceFilter with the specified source and
listener GamePieces. The GamePiece's position can be changed while this
filter is running.
The maxDistance parameter is the maximum distance that the sound can be
heard.
- Parameters:
source
- GamePiecelistener
- GamePiecemaxDistance
- int
getName
public java.lang.String getName()
- Returns:
setName
public void setName(java.lang.String name)
setParent
public void setParent(javax.sound.sampled.Clip parent)
- Overrides:
setParent
in class ClipAudioFilter
update
public void update(long elapseTime)
- Update Filters the sound so that it gets more quiet with distance.
- Specified by:
update
in interface Updateable
- Specified by:
update
in class ClipAudioFilter
- Parameters:
elapseTime
- long