Package net.sf.freecol.client.control
Class SoundController
- java.lang.Object
-
- net.sf.freecol.client.control.SoundController
-
public class SoundController extends java.lang.ObjectControls the SoundPlayer.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Loggerloggerprivate SoundPlayersoundPlayerThe internal sound player.
-
Constructor Summary
Constructors Constructor Description SoundController(FreeColClient freeColClient, boolean sound)Prepare the sound system.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanPlaySound()Can this client play sounds?java.lang.StringgetSoundMixerLabelText()Get the label text for the sound player mixer.voidplaySound(java.lang.String sound)Play a sound.
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
soundPlayer
private SoundPlayer soundPlayer
The internal sound player.
-
-
Constructor Detail
-
SoundController
public SoundController(FreeColClient freeColClient, boolean sound)
Prepare the sound system.- Parameters:
freeColClient- TheFreeColClientfor the game.sound- Enable sound if true.
-
-
Method Detail
-
canPlaySound
public boolean canPlaySound()
Can this client play sounds?- Returns:
- True if there is a sound player with a valid mixer present.
-
playSound
public void playSound(java.lang.String sound)
Play a sound.- Parameters:
sound- The sound resource to play, or if null stop playing.
-
getSoundMixerLabelText
public java.lang.String getSoundMixerLabelText()
Get the label text for the sound player mixer. Needed by the audio mixer option UI.- Returns:
- The text.
-
-