Crossfire JXClient, Trunk  R20561
com.realtime.crossfire.jxclient.sound.ClipManager Class Reference

Manages a set of sound clips (short sound effects). More...

+ Collaboration diagram for com.realtime.crossfire.jxclient.sound.ClipManager:

Public Member Functions

 ClipManager (@NotNull final AudioFileLoader audioFileLoader, @Nullable final DebugWriter debugSound)
 Creates a new instance. More...
 
void play (@Nullable final String name, @NotNull final String action)
 Plays the given sound effect. More...
 
void shutdown ()
 Terminates all running clips and free resources. More...
 

Private Attributes

final ClipCache clipCache
 The clip cache used to allocate new clips. More...
 
final ExecutorService executorService = Executors.newCachedThreadPool()
 The executor service used to play sound clips. More...
 

Detailed Description

Manages a set of sound clips (short sound effects).

Multiple sound effects can be played simultaneously.

Author
Andreas Kirschbaum

Definition at line 36 of file ClipManager.java.

Constructor & Destructor Documentation

◆ ClipManager()

com.realtime.crossfire.jxclient.sound.ClipManager.ClipManager ( @NotNull final AudioFileLoader  audioFileLoader,
@Nullable final DebugWriter  debugSound 
)

Creates a new instance.

Parameters
audioFileLoaderthe audio file loader for loading audio files
debugSoundthe writer for logging sound related information or
null
to not log

Definition at line 56 of file ClipManager.java.

Member Function Documentation

◆ play()

void com.realtime.crossfire.jxclient.sound.ClipManager.play ( @Nullable final String  name,
@NotNull final String  action 
)

Plays the given sound effect.

This function returns immediately.

Parameters
namean optional prefix for the action name
actionthe action name of the sound effect

Definition at line 65 of file ClipManager.java.

References com.realtime.crossfire.jxclient.sound.ClipCache.allocateClip(), and com.realtime.crossfire.jxclient.sound.ClipCache.freeClip().

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

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

◆ shutdown()

void com.realtime.crossfire.jxclient.sound.ClipManager.shutdown ( )

Terminates all running clips and free resources.

Definition at line 88 of file ClipManager.java.

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

+ Here is the caller graph for this function:

Member Data Documentation

◆ clipCache

final ClipCache com.realtime.crossfire.jxclient.sound.ClipManager.clipCache
private

The clip cache used to allocate new clips.

Definition at line 48 of file ClipManager.java.

◆ executorService

final ExecutorService com.realtime.crossfire.jxclient.sound.ClipManager.executorService = Executors.newCachedThreadPool()
private

The executor service used to play sound clips.

Definition at line 42 of file ClipManager.java.


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