org.deken.game.sound.audio
Class ClipAudio

java.lang.Object
  extended by org.deken.game.sound.audio.ClipAudio
All Implemented Interfaces:
java.util.EventListener, javax.sound.sampled.LineListener, Audio, Updateable

public class ClipAudio
extends java.lang.Object
implements Audio, javax.sound.sampled.LineListener

Title: ClipAudio

Description: Wrapper for a Clip audio class. Audio for playing sound Clips. The update method is used for ClipAudioFilter classes, since the update(LineEvent) only occurs when the audio stops. The ClipAudio will need to be added to the GameMap's updateable List in order to work.

Copyright: Copyright (c) Nov 19, 2011

Version:
1.0
Author:
Gary Deken

Constructor Summary
ClipAudio(javax.sound.sampled.Clip clip)
           
ClipAudio(javax.sound.sampled.Clip clip, ClipAudioFilter filter)
           
 
Method Summary
 void close()
           
 ClipAudio copy()
           
 double getLength()
           
 java.lang.String getName()
           
 void pause()
           
 void play()
           
 void resume()
           
 void setAudioListener(AudioListener listener)
           
 void setClipAudioFilter(ClipAudioFilter clipAudioFilter)
          Sets the ClipAudioFilter, and sets it's parent to this class.
 void setLength(double length)
           
 void setName(java.lang.String name)
           
 void stop()
           
 void update(javax.sound.sampled.LineEvent lineEvent)
           
 void update(long elapseTime)
          The update method is used for filter updates, when sound does have regular updates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClipAudio

public ClipAudio(javax.sound.sampled.Clip clip)

ClipAudio

public ClipAudio(javax.sound.sampled.Clip clip,
                 ClipAudioFilter filter)
Method Detail

close

public void close()
Specified by:
close in interface Audio

copy

public ClipAudio copy()
Specified by:
copy in interface Audio

getLength

public double getLength()
Specified by:
getLength in interface Audio

getName

public java.lang.String getName()
Specified by:
getName in interface Updateable
Returns:

pause

public void pause()
Specified by:
pause in interface Audio

play

public void play()
Specified by:
play in interface Audio

resume

public void resume()
Specified by:
resume in interface Audio

setLength

public void setLength(double length)
Specified by:
setLength in interface Audio

stop

public void stop()
Specified by:
stop in interface Audio

setAudioListener

public void setAudioListener(AudioListener listener)
Specified by:
setAudioListener in interface Audio

setClipAudioFilter

public void setClipAudioFilter(ClipAudioFilter clipAudioFilter)
Sets the ClipAudioFilter, and sets it's parent to this class.

Parameters:
clipAudioFilter -

setName

public void setName(java.lang.String name)

update

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

Specified by:
update in interface Audio
Specified by:
update in interface Updateable
Parameters:
elapseTime - long

update

public void update(javax.sound.sampled.LineEvent lineEvent)
Specified by:
update in interface javax.sound.sampled.LineListener