com.threerings.openal
Class ResourceStream

java.lang.Object
  extended by com.threerings.openal.Stream
      extended by com.threerings.openal.URLStream
          extended by com.threerings.openal.ResourceStream

public class ResourceStream
extends URLStream

An audio stream read from one or more resources (via "resource://" URLs, so ResourceManager.activateResourceProtocol() must be called).


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.openal.URLStream
URLStream.QueuedURL
 
Nested classes/interfaces inherited from class com.threerings.openal.Stream
Stream.FadeMode
 
Field Summary
 
Fields inherited from class com.threerings.openal.URLStream
_decoder, _queue, _url
 
Fields inherited from class com.threerings.openal.Stream
_abuf, _buffers, _fadeElapsed, _fadeInterval, _fadeMode, _gain, _nbuf, _qidx, _qlen, _soundmgr, _source, _state
 
Constructor Summary
ResourceStream(SoundManager soundmgr, String resource, boolean loop)
          Creates a new stream for the specified resource (from the default bundle).
ResourceStream(SoundManager soundmgr, String bundle, String resource, boolean loop)
          Creates a new stream for the specified resource.
 
Method Summary
 void queueResource(String resource, boolean loop)
          Adds a resource (from the default bundle) to the queue of files to play.
 void queueResource(String bundle, String resource, boolean loop)
          Adds a resource to the queue of files to play.
 
Methods inherited from class com.threerings.openal.URLStream
getFormat, getFrequency, populateBuffer, queueURL
 
Methods inherited from class com.threerings.openal.Stream
dispose, fadeIn, fadeOut, getBufferSize, getNumBuffers, getSource, isPlaying, pause, play, populateBuffer, queueBuffers, setGain, stop, update, updateFade
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceStream

public ResourceStream(SoundManager soundmgr,
                      String resource,
                      boolean loop)
               throws IOException
Creates a new stream for the specified resource (from the default bundle).

Parameters:
loop - whether or not to play the file in a continuous loop if there's nothing on the queue
Throws:
IOException

ResourceStream

public ResourceStream(SoundManager soundmgr,
                      String bundle,
                      String resource,
                      boolean loop)
               throws IOException
Creates a new stream for the specified resource.

Parameters:
loop - whether or not to play the file in a continuous loop if there's nothing on the queue
Throws:
IOException
Method Detail

queueResource

public void queueResource(String resource,
                          boolean loop)
Adds a resource (from the default bundle) to the queue of files to play.

Parameters:
loop - if true, play this file in a loop if there's nothing else on the queue

queueResource

public void queueResource(String bundle,
                          String resource,
                          boolean loop)
Adds a resource to the queue of files to play.

Parameters:
loop - if true, play this file in a loop if there's nothing else on the queue