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

Allocates new sound clips. More...

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

Public Member Functions

DataLine allocateClip (@Nullable final String name, @NotNull final String action)
 Allocates a new clip. More...
 
 ClipCache (@NotNull final AudioFileLoader audioFileLoader, @Nullable final DebugWriter debugSound)
 Creates a new instance. More...
 
void freeClip (@NotNull final Line clip)
 Deallocates a clip. More...
 

Private Member Functions

DataLine newClip (@Nullable final String name, @NotNull final String action)
 Allocates a new clip. More...
 

Private Attributes

final AudioFileLoader audioFileLoader
 The AudioFileLoader for loading audio files. More...
 
final DebugWriter debugSound
 The writer for logging sound related information or. More...
 

Detailed Description

Allocates new sound clips.

Author
Andreas Kirschbaum

Definition at line 40 of file ClipCache.java.

Constructor & Destructor Documentation

◆ ClipCache()

com.realtime.crossfire.jxclient.sound.ClipCache.ClipCache ( @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 61 of file ClipCache.java.

References com.realtime.crossfire.jxclient.sound.ClipCache.audioFileLoader, and com.realtime.crossfire.jxclient.sound.ClipCache.debugSound.

Member Function Documentation

◆ allocateClip()

DataLine com.realtime.crossfire.jxclient.sound.ClipCache.allocateClip ( @Nullable final String  name,
@NotNull final String  action 
)

Allocates a new clip.

Parameters
namean optional prefix for the action name
actionthe action name of the clip to allocate
Returns
the new clip, or
null
if an error occurs

Definition at line 73 of file ClipCache.java.

References com.realtime.crossfire.jxclient.sound.ClipCache.newClip().

Referenced by com.realtime.crossfire.jxclient.sound.ClipManager.play().

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

◆ freeClip()

void com.realtime.crossfire.jxclient.sound.ClipCache.freeClip ( @NotNull final Line  clip)

Deallocates a clip.

Parameters
clipthe clip to deallocate

Definition at line 81 of file ClipCache.java.

References com.realtime.crossfire.jxclient.util.DebugWriter.debugProtocolWrite().

Referenced by com.realtime.crossfire.jxclient.sound.ClipManager.play().

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

◆ newClip()

DataLine com.realtime.crossfire.jxclient.sound.ClipCache.newClip ( @Nullable final String  name,
@NotNull final String  action 
)
private

Allocates a new clip.

Parameters
namean optional prefix for the action name
actionthe action name of the clip to allocate
Returns
the new clip, or
null
if an error occurs

Definition at line 95 of file ClipCache.java.

References com.realtime.crossfire.jxclient.util.DebugWriter.debugProtocolWrite(), and com.realtime.crossfire.jxclient.sound.AudioFileLoader.getInputStream().

Referenced by com.realtime.crossfire.jxclient.sound.ClipCache.allocateClip().

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

Member Data Documentation

◆ audioFileLoader

final AudioFileLoader com.realtime.crossfire.jxclient.sound.ClipCache.audioFileLoader
private

The AudioFileLoader for loading audio files.

Definition at line 46 of file ClipCache.java.

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

◆ debugSound

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

The writer for logging sound related information or.

null

to not log.

Definition at line 53 of file ClipCache.java.

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


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