net.kolls.railworld.sound
Class StreamSound

java.lang.Object
  extended by net.kolls.railworld.Sound
      extended by net.kolls.railworld.sound.StreamSound

public class StreamSound
extends Sound

Stream sound puts the details of sound playback in the program's hands. Requires more overhead but may allow for better sound behavior?

Author:
Steve Kollmansberger

Field Summary
 
Fields inherited from class net.kolls.railworld.Sound
frozen, fzlc, loopcnt
 
Constructor Summary
StreamSound(java.net.URL filen, boolean restart)
          Create a stream sound.
 
Method Summary
 boolean canPlay()
          Is the sound loaded and ready to play?
 void loop()
          Loop the sound.
 void play()
          Play the sound.
 boolean playing()
          Indicate if the sound is currently playing or looping.
 void stop()
          Stop the sound.
 
Methods inherited from class net.kolls.railworld.Sound
freeze, unfreeze
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamSound

public StreamSound(java.net.URL filen,
                   boolean restart)
Create a stream sound.

Parameters:
filen - URL of sound source
restart - Restart sound if play command given while currently playing
Method Detail

canPlay

public boolean canPlay()
Description copied from class: Sound
Is the sound loaded and ready to play?

Specified by:
canPlay in class Sound
Returns:
true if the sound can be played.

play

public void play()
Description copied from class: Sound
Play the sound.

Specified by:
play in class Sound

loop

public void loop()
Description copied from class: Sound
Loop the sound. If the sound is already looping, increment the loop counter.

Specified by:
loop in class Sound

stop

public void stop()
Description copied from class: Sound
Stop the sound. If multiple loops are in effect, simply decrement the loop counter.

Specified by:
stop in class Sound

playing

public boolean playing()
Description copied from class: Sound
Indicate if the sound is currently playing or looping.

Specified by:
playing in class Sound
Returns:
true if the sound is playing.