com.jme3.audio
Class AudioKey

java.lang.Object
  extended by com.jme3.asset.AssetKey<AudioData>
      extended by com.jme3.audio.AudioKey
All Implemented Interfaces:
Savable, java.lang.Cloneable

public class AudioKey
extends AssetKey<AudioData>

AudioKey is extending AssetKey by holding stream flag.


Field Summary
 
Fields inherited from class com.jme3.asset.AssetKey
extension, folder, name
 
Constructor Summary
AudioKey()
           
AudioKey(java.lang.String name)
           
AudioKey(java.lang.String name, boolean stream)
          Create a new AudioKey
AudioKey(java.lang.String name, boolean stream, boolean streamCache)
          Create a new AudioKey.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Class<? extends AssetCache> getCacheType()
           
 java.lang.Class<? extends AssetProcessor> getProcessorType()
           
 int hashCode()
           
 boolean isStream()
           
 void read(JmeImporter im)
           
 java.lang.String toString()
           
 boolean useStreamCache()
          Specifies if the stream cache is used.
 void write(JmeExporter ex)
           
 
Methods inherited from class com.jme3.asset.AssetKey
clone, getExtension, getExtension, getFolder, getFolder, getName, reducePath
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AudioKey

public AudioKey(java.lang.String name,
                boolean stream,
                boolean streamCache)
Create a new AudioKey.

Parameters:
name - Name of the asset
stream - If true, the audio will be streamed from harddrive, otherwise it will be buffered entirely and then played.
streamCache - If stream is true, then this specifies if the stream cache is used. When enabled, the audio stream will be read entirely but not decoded, allowing features such as seeking, determining duration and looping.

AudioKey

public AudioKey(java.lang.String name,
                boolean stream)
Create a new AudioKey

Parameters:
name - Name of the asset
stream - If true, the audio will be streamed from harddrive, otherwise it will be buffered entirely and then played.

AudioKey

public AudioKey(java.lang.String name)

AudioKey

public AudioKey()
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class AssetKey<AudioData>

isStream

public boolean isStream()
Returns:
True if the loaded audio should be a AudioStream or false if it should be a AudioBuffer.

useStreamCache

public boolean useStreamCache()
Specifies if the stream cache is used. When enabled, the audio stream will be read entirely but not decoded, allowing features such as seeking, looping and determining duration.


getCacheType

public java.lang.Class<? extends AssetCache> getCacheType()
Overrides:
getCacheType in class AssetKey<AudioData>
Returns:
The preferred cache class for this asset type. Specify "null" if caching is to be disabled. By default the SimpleAssetCache is returned.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class AssetKey<AudioData>

hashCode

public int hashCode()
Overrides:
hashCode in class AssetKey<AudioData>

getProcessorType

public java.lang.Class<? extends AssetProcessor> getProcessorType()
Overrides:
getProcessorType in class AssetKey<AudioData>
Returns:
The preferred processor type for this asset type. Specify "null" if no processing is required.

write

public void write(JmeExporter ex)
           throws java.io.IOException
Specified by:
write in interface Savable
Overrides:
write in class AssetKey<AudioData>
Throws:
java.io.IOException

read

public void read(JmeImporter im)
          throws java.io.IOException
Specified by:
read in interface Savable
Overrides:
read in class AssetKey<AudioData>
Throws:
java.io.IOException