com.threerings.openal
Class Sounder.MetaStream

java.lang.Object
  extended by com.threerings.expr.SimpleScope
      extended by com.threerings.openal.Sounder.Implementation
          extended by com.threerings.openal.Sounder.BaseStream
              extended by com.threerings.openal.Sounder.MetaStream
All Implemented Interfaces:
Scope, ScopeUpdateListener
Enclosing class:
Sounder

public static class Sounder.MetaStream
extends Sounder.BaseStream

Selects from a number of streams.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.openal.Sounder.BaseStream
Sounder.BaseStream.StackedStream, Sounder.BaseStream.TransformedStream
 
Field Summary
protected  SounderConfig.MetaStream _config
          The implementation configuration.
protected  float[] _weights
          The weights of the streams.
 
Fields inherited from class com.threerings.openal.Sounder.BaseStream
_stream, _streamGain
 
Fields inherited from class com.threerings.openal.Sounder.Implementation
_ctx, _started, _transform
 
Fields inherited from class com.threerings.expr.SimpleScope
_parentScope
 
Fields inherited from interface com.threerings.expr.Scope
EPOCH, NOW
 
Constructor Summary
Sounder.MetaStream(AlContext ctx, Scope parentScope, SounderConfig.MetaStream config)
          Creates a new stream implementation.
 
Method Summary
protected  Sounder.BaseStream.StackedStream createStream(SounderConfig.WeightedFile wfile)
          Creates a stream to play the specified file.
 boolean loops()
          Checks whether the configured sound loops.
 void setConfig(SounderConfig.MetaStream config)
          (Re)configures the implementation.
 void start()
          Starts playing the sound.
protected  void startNextStream(float fadeIn)
          Plays the next stream.
 
Methods inherited from class com.threerings.openal.Sounder.BaseStream
isPlaying, setConfig, startStream, stop, stopStream
 
Methods inherited from class com.threerings.openal.Sounder.Implementation
dispose, getScopeName, update
 
Methods inherited from class com.threerings.expr.SimpleScope
addListener, get, getParentScope, removeListener, scopeUpdated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_config

protected SounderConfig.MetaStream _config
The implementation configuration.


_weights

protected float[] _weights
The weights of the streams.

Constructor Detail

Sounder.MetaStream

public Sounder.MetaStream(AlContext ctx,
                          Scope parentScope,
                          SounderConfig.MetaStream config)
Creates a new stream implementation.

Method Detail

setConfig

public void setConfig(SounderConfig.MetaStream config)
(Re)configures the implementation.


loops

public boolean loops()
Description copied from class: Sounder.Implementation
Checks whether the configured sound loops.

Overrides:
loops in class Sounder.Implementation

start

public void start()
Description copied from class: Sounder.Implementation
Starts playing the sound.

Specified by:
start in class Sounder.Implementation

startNextStream

protected void startNextStream(float fadeIn)
Plays the next stream.


createStream

protected Sounder.BaseStream.StackedStream createStream(SounderConfig.WeightedFile wfile)
                                                 throws IOException
Creates a stream to play the specified file.

Throws:
IOException