com.golden.gamedev.engine
Class BaseAudio

java.lang.Object
  |
  +--com.golden.gamedev.engine.BaseAudio

public class BaseAudio
extends Object


Field Summary
static int MULTIPLE
          Multiple audio clips can be played at the same time.
static int SINGLE
          Audio clip with a same resource can only be played once at a time.
static int SINGLE_REPLAY
          Same as SINGLE except the audio clip is force to replay.
 
Constructor Summary
BaseAudio(BaseIO base, BaseAudioRenderer renderer)
           
 
Method Summary
 BaseAudioRenderer getAudioRenderer(int slot)
           
 BaseAudioRenderer getAudioRenderer(String audiofile)
           
 BaseIO getBaseIO()
           
 int getBuffer()
           
 int getCountRenderers()
           
 BaseAudioRenderer[] getRenderers()
           
 float getVolume()
           
 boolean isExclusive()
           
 boolean isLoop()
           
 int play(String audiofile)
          Plays audio clip with MULTIPLE policy.
 int play(String audiofile, int policy)
          Plays an audio clip based on specified policy (SINGLE, MULTIPLE, SINGLE_REPLAY).
 void setBaseIO(BaseIO base)
           
 void setBuffer(int i)
           
 void setExclusive(boolean b)
           
 void setLoop(boolean b)
           
 void setVolume(float volume)
           
 void stop(int slot)
           
 void stop(String audiofile)
           
 void stopAll()
           
 void stopAll(BaseAudioRenderer except)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SINGLE

public static final int SINGLE
Audio clip with a same resource can only be played once at a time. Clip is continued if the clip is currently playing. To force the clip to replay, set policy to SINGLE_REPLAY.

See Also:
play(String, int), Constant Field Values

MULTIPLE

public static final int MULTIPLE
Multiple audio clips can be played at the same time.
Note: when using exclusive mode (only one audio clip playing), MULTIPLE policy is obsolete, and automatically set to SINGLE.

See Also:
play(String, int), setExclusive(boolean), Constant Field Values

SINGLE_REPLAY

public static final int SINGLE_REPLAY
Same as SINGLE except the audio clip is force to replay.

See Also:
play(String, int), Constant Field Values
Constructor Detail

BaseAudio

public BaseAudio(BaseIO base,
                 BaseAudioRenderer renderer)
Method Detail

play

public int play(String audiofile,
                int policy)
Plays an audio clip based on specified policy (SINGLE, MULTIPLE, SINGLE_REPLAY).


play

public int play(String audiofile)
Plays audio clip with MULTIPLE policy.


getAudioRenderer

public BaseAudioRenderer getAudioRenderer(int slot)

getAudioRenderer

public BaseAudioRenderer getAudioRenderer(String audiofile)

stop

public void stop(int slot)

stop

public void stop(String audiofile)

stopAll

public void stopAll()

stopAll

public void stopAll(BaseAudioRenderer except)

getVolume

public float getVolume()

setVolume

public void setVolume(float volume)

setExclusive

public void setExclusive(boolean b)

isExclusive

public boolean isExclusive()

getRenderers

public BaseAudioRenderer[] getRenderers()

getCountRenderers

public int getCountRenderers()

getBuffer

public int getBuffer()

setBuffer

public void setBuffer(int i)

isLoop

public boolean isLoop()

setLoop

public void setLoop(boolean b)

getBaseIO

public BaseIO getBaseIO()

setBaseIO

public void setBaseIO(BaseIO base)