com.realtime.crossfire.jxclient.sound
Class AudioFileLoader

java.lang.Object
  extended by com.realtime.crossfire.jxclient.sound.AudioFileLoader

public class AudioFileLoader
extends java.lang.Object

Locates audio files.


Field Summary
private  DebugWriter debugSound
          The writer for logging sound related information or null to not log.
 
Constructor Summary
AudioFileLoader(DebugWriter debugSound)
          Private constructor to prevent instantiation.
 
Method Summary
 java.io.InputStream getInputStream(java.lang.String name, java.lang.String action)
          Returns an input stream for an audio file.
private  java.io.InputStream getResource(java.lang.String name)
          Returns an input stream for an audio file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugSound

@Nullable
private final DebugWriter debugSound
The writer for logging sound related information or null to not log.

Constructor Detail

AudioFileLoader

public AudioFileLoader(@Nullable
                       DebugWriter debugSound)
Private constructor to prevent instantiation.

Parameters:
debugSound - the writer for logging sound related information or null to not log
Method Detail

getInputStream

@NotNull
public java.io.InputStream getInputStream(@Nullable
                                                  java.lang.String name,
                                                  @NotNull
                                                  java.lang.String action)
                                   throws java.io.IOException
Returns an input stream for an audio file. action identifies the audio file. name is an optional prefix.

Parameters:
name - the name
action - the action; may be null
Returns:
the input stream
Throws:
java.io.IOException - if the file cannot be located

getResource

@NotNull
private java.io.InputStream getResource(@NotNull
                                                java.lang.String name)
                                 throws java.io.IOException
Returns an input stream for an audio file.

Parameters:
name - the resource name
Returns:
the input stream
Throws:
java.io.IOException - if the file cannot be located