Crossfire JXClient, Trunk
Public Member Functions | Private Member Functions | Private Attributes | List of all members
com.realtime.crossfire.jxclient.sound.SoundManager Class Reference
Collaboration diagram for com.realtime.crossfire.jxclient.sound.SoundManager:
Collaboration graph

Public Member Functions

void playClip (@NotNull final Sounds type, @NotNull final CharSequence action)
 
void playMusic (@Nullable final CharSequence name)
 
void setEffectsEnabled (final boolean enabled)
 
void setMusicEnabled (final boolean enabled)
 
void shutdown () throws InterruptedException
 
 SoundManager (@NotNull final GuiStateManager guiStateManager, @Nullable final DebugWriter debugSound)
 
void start ()
 

Private Member Functions

void mute (@NotNull final Sounds type, final boolean mute)
 
void muteMusic (final boolean muted)
 

Private Attributes

final ClipManager clipManager
 
final DebugWriter debugSound
 
boolean effectsEnabled
 
final GuiStateListener guiStateListener
 
boolean musicEnabled
 
final MusicManager musicManager
 
final Collection< SoundsmutedSounds = EnumSet.allOf(Sounds.class)
 
final SoundTaskExecutor soundTaskExecutor = new SoundTaskExecutor()
 

Detailed Description

Manages all sounds. Each sound has a sound type (Sounds) attached. Sound types can be disabled (by the user) or muted (by the application). A sound is played only if it is neither disabled nor muted.

Author
Andreas Kirschbaum

Definition at line 40 of file SoundManager.java.

Constructor & Destructor Documentation

◆ SoundManager()

com.realtime.crossfire.jxclient.sound.SoundManager.SoundManager ( @NotNull final GuiStateManager  guiStateManager,
@Nullable final DebugWriter  debugSound 
)

Member Function Documentation

◆ mute()

void com.realtime.crossfire.jxclient.sound.SoundManager.mute ( @NotNull final Sounds  type,
final boolean  mute 
)
private

Mutes or unmutes sound effects.

Parameters
typethe sound type to affect
mutewhether to mute (
true
) or unmute (
false
)

Definition at line 209 of file SoundManager.java.

References com.realtime.crossfire.jxclient.sound.SoundManager.mutedSounds.

◆ muteMusic()

void com.realtime.crossfire.jxclient.sound.SoundManager.muteMusic ( final boolean  muted)
private

Mutes or unmutes background music.

Parameters
mutedwhether to mute (
true
) or unmute (
false
)

Definition at line 231 of file SoundManager.java.

References com.realtime.crossfire.jxclient.sound.SoundTaskExecutor.execute(), com.realtime.crossfire.jxclient.sound.SoundManager.musicManager, com.realtime.crossfire.jxclient.sound.MusicManager.setMuted(), and com.realtime.crossfire.jxclient.sound.SoundManager.soundTaskExecutor.

Here is the call graph for this function:

◆ playClip()

void com.realtime.crossfire.jxclient.sound.SoundManager.playClip ( @NotNull final Sounds  type,
@NotNull final CharSequence  action 
)

◆ playMusic()

void com.realtime.crossfire.jxclient.sound.SoundManager.playMusic ( @Nullable final CharSequence  name)

Plays a background music. If the new music name is unchanged, continue playing.

Parameters
namethe music name

Definition at line 223 of file SoundManager.java.

References com.realtime.crossfire.jxclient.sound.SoundTaskExecutor.execute(), com.realtime.crossfire.jxclient.sound.SoundManager.musicManager, com.realtime.crossfire.jxclient.sound.MusicManager.play(), and com.realtime.crossfire.jxclient.sound.SoundManager.soundTaskExecutor.

Here is the call graph for this function:

◆ setEffectsEnabled()

void com.realtime.crossfire.jxclient.sound.SoundManager.setEffectsEnabled ( final boolean  enabled)

Sets whether sound effects are enabled.

Parameters
enabledwhether sound effects are enabled

Definition at line 170 of file SoundManager.java.

References com.realtime.crossfire.jxclient.sound.SoundManager.effectsEnabled.

Referenced by com.realtime.crossfire.jxclient.sound.SoundEffectsCheckBoxOption.execute().

Here is the caller graph for this function:

◆ setMusicEnabled()

void com.realtime.crossfire.jxclient.sound.SoundManager.setMusicEnabled ( final boolean  enabled)

◆ shutdown()

void com.realtime.crossfire.jxclient.sound.SoundManager.shutdown ( ) throws InterruptedException

◆ start()

void com.realtime.crossfire.jxclient.sound.SoundManager.start ( )

Activates this instance.

Definition at line 149 of file SoundManager.java.

References com.realtime.crossfire.jxclient.sound.SoundManager.soundTaskExecutor, and com.realtime.crossfire.jxclient.sound.SoundTaskExecutor.start().

Referenced by com.realtime.crossfire.jxclient.main.JXClient.JXClient().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ clipManager

final ClipManager com.realtime.crossfire.jxclient.sound.SoundManager.clipManager
private

◆ debugSound

final DebugWriter com.realtime.crossfire.jxclient.sound.SoundManager.debugSound
private

◆ effectsEnabled

boolean com.realtime.crossfire.jxclient.sound.SoundManager.effectsEnabled
private

◆ guiStateListener

final GuiStateListener com.realtime.crossfire.jxclient.sound.SoundManager.guiStateListener
private

The GuiStateListener for detecting established or dropped connections.

Definition at line 89 of file SoundManager.java.

Referenced by com.realtime.crossfire.jxclient.sound.SoundManager.SoundManager().

◆ musicEnabled

boolean com.realtime.crossfire.jxclient.sound.SoundManager.musicEnabled
private

Whether background music is enabled.

Definition at line 64 of file SoundManager.java.

Referenced by com.realtime.crossfire.jxclient.sound.SoundManager.setMusicEnabled().

◆ musicManager

final MusicManager com.realtime.crossfire.jxclient.sound.SoundManager.musicManager
private

◆ mutedSounds

final Collection<Sounds> com.realtime.crossfire.jxclient.sound.SoundManager.mutedSounds = EnumSet.allOf(Sounds.class)
private

◆ soundTaskExecutor

final SoundTaskExecutor com.realtime.crossfire.jxclient.sound.SoundManager.soundTaskExecutor = new SoundTaskExecutor()
private

The documentation for this class was generated from the following file: