Crossfire JXClient, Trunk
|
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< Sounds > | mutedSounds = EnumSet.allOf(Sounds.class) |
final SoundTaskExecutor | soundTaskExecutor = new SoundTaskExecutor() |
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.
Definition at line 40 of file SoundManager.java.
com.realtime.crossfire.jxclient.sound.SoundManager.SoundManager | ( | @NotNull final GuiStateManager | guiStateManager, |
@Nullable final DebugWriter | debugSound | ||
) |
Creates a new instance.
guiStateManager | the gui state manager to watch |
debugSound | the writer for logging sound related information or null
|
Definition at line 138 of file SoundManager.java.
References com.realtime.crossfire.jxclient.sound.SoundManager.clipManager, com.realtime.crossfire.jxclient.sound.SoundManager.debugSound, com.realtime.crossfire.jxclient.sound.SoundManager.guiStateListener, com.realtime.crossfire.jxclient.sound.SoundManager.musicManager, and com.realtime.crossfire.jxclient.sound.SoundManager.soundTaskExecutor.
|
private |
Mutes or unmutes sound effects.
type | the sound type to affect |
mute | whether to mute ( true
false
|
Definition at line 209 of file SoundManager.java.
References com.realtime.crossfire.jxclient.sound.SoundManager.mutedSounds.
|
private |
Mutes or unmutes background music.
muted | whether to mute ( true
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.
void com.realtime.crossfire.jxclient.sound.SoundManager.playClip | ( | @NotNull final Sounds | type, |
@NotNull final CharSequence | action | ||
) |
Plays a sound clip.
type | the sound type |
action | the sound action name |
Definition at line 183 of file SoundManager.java.
References com.realtime.crossfire.jxclient.sound.SoundManager.clipManager, com.realtime.crossfire.jxclient.util.DebugWriter.debugProtocolWrite(), com.realtime.crossfire.jxclient.sound.SoundManager.debugSound, com.realtime.crossfire.jxclient.sound.SoundManager.effectsEnabled, com.realtime.crossfire.jxclient.sound.SoundManager.mutedSounds, and com.realtime.crossfire.jxclient.sound.ClipManager.play().
Referenced by com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.playClip().
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.
name | the 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.
void com.realtime.crossfire.jxclient.sound.SoundManager.setEffectsEnabled | ( | final boolean | enabled | ) |
Sets whether sound effects are enabled.
enabled | whether 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().
void com.realtime.crossfire.jxclient.sound.SoundManager.setMusicEnabled | ( | final boolean | enabled | ) |
Sets whether background music is enabled.
enabled | whether background music is enabled |
Definition at line 157 of file SoundManager.java.
References com.realtime.crossfire.jxclient.sound.SoundTaskExecutor.execute(), com.realtime.crossfire.jxclient.sound.SoundManager.musicEnabled, com.realtime.crossfire.jxclient.sound.SoundManager.musicManager, com.realtime.crossfire.jxclient.sound.MusicManager.setEnabled(), and com.realtime.crossfire.jxclient.sound.SoundManager.soundTaskExecutor.
Referenced by com.realtime.crossfire.jxclient.sound.SoundMusicCheckBoxOption.execute().
void com.realtime.crossfire.jxclient.sound.SoundManager.shutdown | ( | ) | throws InterruptedException |
Terminates all sounds and free resources.
InterruptedException | if the current thread was interrupted while waiting for the shutdown |
Definition at line 240 of file SoundManager.java.
References com.realtime.crossfire.jxclient.sound.SoundManager.clipManager, com.realtime.crossfire.jxclient.util.DebugWriter.debugProtocolWrite(), com.realtime.crossfire.jxclient.sound.SoundManager.debugSound, com.realtime.crossfire.jxclient.sound.SoundTaskExecutor.executeAndWait(), com.realtime.crossfire.jxclient.sound.ClipManager.shutdown(), and com.realtime.crossfire.jxclient.sound.SoundManager.soundTaskExecutor.
Referenced by com.realtime.crossfire.jxclient.main.JXClient.JXClient().
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().
|
private |
The clip manager for playing sound effects.
Definition at line 46 of file SoundManager.java.
Referenced by com.realtime.crossfire.jxclient.sound.SoundManager.playClip(), com.realtime.crossfire.jxclient.sound.SoundManager.shutdown(), and com.realtime.crossfire.jxclient.sound.SoundManager.SoundManager().
|
private |
The writer for logging sound related information or
to not log.
Definition at line 53 of file SoundManager.java.
Referenced by com.realtime.crossfire.jxclient.sound.SoundManager.playClip(), com.realtime.crossfire.jxclient.sound.SoundManager.shutdown(), and com.realtime.crossfire.jxclient.sound.SoundManager.SoundManager().
|
private |
Whether sound effects are enabled.
Definition at line 69 of file SoundManager.java.
Referenced by com.realtime.crossfire.jxclient.sound.SoundManager.playClip(), and com.realtime.crossfire.jxclient.sound.SoundManager.setEffectsEnabled().
|
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().
|
private |
Whether background music is enabled.
Definition at line 64 of file SoundManager.java.
Referenced by com.realtime.crossfire.jxclient.sound.SoundManager.setMusicEnabled().
|
private |
The music manager for playing background music.
Definition at line 59 of file SoundManager.java.
Referenced by com.realtime.crossfire.jxclient.sound.SoundManager.muteMusic(), com.realtime.crossfire.jxclient.sound.SoundManager.playMusic(), com.realtime.crossfire.jxclient.sound.SoundManager.setMusicEnabled(), and com.realtime.crossfire.jxclient.sound.SoundManager.SoundManager().
|
private |
The muted sounds.
Definition at line 75 of file SoundManager.java.
Referenced by com.realtime.crossfire.jxclient.sound.SoundManager.mute(), and com.realtime.crossfire.jxclient.sound.SoundManager.playClip().
|
private |
The global SoundTaskExecutor instance.
Definition at line 81 of file SoundManager.java.
Referenced by com.realtime.crossfire.jxclient.sound.SoundManager.muteMusic(), com.realtime.crossfire.jxclient.sound.SoundManager.playMusic(), com.realtime.crossfire.jxclient.sound.SoundManager.setMusicEnabled(), com.realtime.crossfire.jxclient.sound.SoundManager.shutdown(), com.realtime.crossfire.jxclient.sound.SoundManager.SoundManager(), and com.realtime.crossfire.jxclient.sound.SoundManager.start().