package greenfoot.sound;
| Interface for different types of sounds supported by Greenfoot.
|
| @see SoundStream
| @see MidiFileSound
| @see SoundClip
| @author Poul Henriksen
|
public interface Sound
{
| Closes this sound. Will immediately release any resources for the sound.
|
public abstract void close();
| Stop this sound.
|
| After this method has been called: isStopped=true, isPlaying=false, isPaused=false.
|
public abstract void stop();
| Pause the song. Paused sounds can be resumed.
|
| After this method has been called: isStopped=false, isPlaying=false, isPaused=true.
|
public abstract void pause();
| Play this sound.
|
| After this method has been called and no exception occurs: isStopped=false, isPlaying=true, isPaused=false.
| If a problem occurs it should be: isStopped=true, isPlaying=false, isPaused=false.
|
public abstract void play();
| Plays this sound in a loop.
|
| After this method has been called and no exception occurs: isStopped=false, isPlaying=true, isPaused=false.
| If a problem occurs it should be: isStopped=true, isPlaying=false, isPaused=false.
|
public abstract void loop();
| True if the sound is currently playing.
|
public abstract boolean isPlaying();
| True if the sound is currently paused.
|
public abstract boolean isPaused();
| True if the sound is currently paused.
|
public abstract boolean isStopped();
| Set the sound volume.
| @param level the level between 0-100 of the sound.
|
public abstract void setVolume(int level);
| Get the current volume of the sound.
| @return the sound volume, between 0-100.
|
public abstract int getVolume();
}
top,
use,
map,
interface Sound
. close
. stop
. pause
. play
. loop
. isPlaying
. isPaused
. isStopped
. setVolume
. getVolume
43 neLoCode
+ 23 LoComm