com.jme3.cinematic.events
Class SoundTrack

java.lang.Object
  extended by com.jme3.cinematic.events.AbstractCinematicEvent
      extended by com.jme3.cinematic.events.SoundTrack
All Implemented Interfaces:
CinematicEvent, Savable

public class SoundTrack
extends AbstractCinematicEvent

A sound track to be played in a cinematic.


Field Summary
protected  AudioNode audioNode
           
protected  java.lang.String path
           
protected  boolean stream
           
 
Fields inherited from class com.jme3.cinematic.events.AbstractCinematicEvent
initialDuration, listeners, loopMode, playState, resuming, speed, time
 
Constructor Summary
SoundTrack()
           
SoundTrack(java.lang.String path)
          creates a sound track from the given resource path
SoundTrack(java.lang.String path, boolean stream)
          creates a sound track from the given resource path
SoundTrack(java.lang.String path, boolean stream, float initialDuration)
           
SoundTrack(java.lang.String path, boolean stream, float initialDuration, LoopMode loopMode)
           
SoundTrack(java.lang.String path, boolean stream, LoopMode loopMode)
           
SoundTrack(java.lang.String path, float initialDuration)
           
SoundTrack(java.lang.String path, float initialDuration, LoopMode loopMode)
           
SoundTrack(java.lang.String path, LoopMode loopMode)
           
 
Method Summary
 AudioNode getAudioNode()
          Returns the underlying audion node of this sound track
 void initEvent(Application app, Cinematic cinematic)
          initialize this event (should be called internally only)
 void onPause()
          place here the code you want to execute when the event is paused
 void onPlay()
          Place here the code you want to execute when the event is started
 void onStop()
          Place here the code you want to execute when the event is stoped.
 void onUpdate(float tpf)
          Place here the code you want to execute on update (only called when the event is playing)
 void read(JmeImporter im)
          for serialization only
 void setLoopMode(LoopMode loopMode)
          Sets the loopMode of the animation
 void setTime(float time)
          When this method is invoked, the event should fast forward to the given time according tim 0 is the start of the event.
 void write(JmeExporter ex)
          for serialization only
 
Methods inherited from class com.jme3.cinematic.events.AbstractCinematicEvent
addListener, getDuration, getInitialDuration, getLoopMode, getPlayState, getSpeed, getTime, internalUpdate, pause, play, removeListener, setInitialDuration, setSpeed, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

path

protected java.lang.String path

audioNode

protected AudioNode audioNode

stream

protected boolean stream
Constructor Detail

SoundTrack

public SoundTrack(java.lang.String path)
creates a sound track from the given resource path

Parameters:
path - the path to an audi file (ie : "Sounds/mySound.wav")

SoundTrack

public SoundTrack(java.lang.String path,
                  boolean stream)
creates a sound track from the given resource path

Parameters:
path - the path to an audi file (ie : "Sounds/mySound.wav")
stream - true to make the audio data streamed

SoundTrack

public SoundTrack(java.lang.String path,
                  boolean stream,
                  float initialDuration)

SoundTrack

public SoundTrack(java.lang.String path,
                  boolean stream,
                  LoopMode loopMode)

SoundTrack

public SoundTrack(java.lang.String path,
                  boolean stream,
                  float initialDuration,
                  LoopMode loopMode)

SoundTrack

public SoundTrack(java.lang.String path,
                  float initialDuration)

SoundTrack

public SoundTrack(java.lang.String path,
                  LoopMode loopMode)

SoundTrack

public SoundTrack(java.lang.String path,
                  float initialDuration,
                  LoopMode loopMode)

SoundTrack

public SoundTrack()
Method Detail

initEvent

public void initEvent(Application app,
                      Cinematic cinematic)
Description copied from class: AbstractCinematicEvent
initialize this event (should be called internally only)

Specified by:
initEvent in interface CinematicEvent
Overrides:
initEvent in class AbstractCinematicEvent
Parameters:
app - the application
cinematic - the cinematic

setTime

public void setTime(float time)
Description copied from class: AbstractCinematicEvent
When this method is invoked, the event should fast forward to the given time according tim 0 is the start of the event.

Specified by:
setTime in interface CinematicEvent
Overrides:
setTime in class AbstractCinematicEvent
Parameters:
time - the time to fast forward to

onPlay

public void onPlay()
Description copied from class: AbstractCinematicEvent
Place here the code you want to execute when the event is started

Specified by:
onPlay in class AbstractCinematicEvent

onStop

public void onStop()
Description copied from class: AbstractCinematicEvent
Place here the code you want to execute when the event is stoped.

Specified by:
onStop in class AbstractCinematicEvent

onPause

public void onPause()
Description copied from class: AbstractCinematicEvent
place here the code you want to execute when the event is paused

Specified by:
onPause in class AbstractCinematicEvent

onUpdate

public void onUpdate(float tpf)
Description copied from class: AbstractCinematicEvent
Place here the code you want to execute on update (only called when the event is playing)

Specified by:
onUpdate in class AbstractCinematicEvent
Parameters:
tpf - time per frame

getAudioNode

public AudioNode getAudioNode()
Returns the underlying audion node of this sound track

Returns:

setLoopMode

public void setLoopMode(LoopMode loopMode)
Description copied from class: AbstractCinematicEvent
Sets the loopMode of the animation

Specified by:
setLoopMode in interface CinematicEvent
Overrides:
setLoopMode in class AbstractCinematicEvent
Parameters:
loopMode - Set the loop mode for the channel. The loop mode determines what will happen to the animation once it finishes playing. For more information, see the LoopMode enum class.
See Also:
LoopMode

write

public void write(JmeExporter ex)
           throws java.io.IOException
Description copied from class: AbstractCinematicEvent
for serialization only

Specified by:
write in interface Savable
Overrides:
write in class AbstractCinematicEvent
Parameters:
ex - exporter
Throws:
java.io.IOException

read

public void read(JmeImporter im)
          throws java.io.IOException
Description copied from class: AbstractCinematicEvent
for serialization only

Specified by:
read in interface Savable
Overrides:
read in class AbstractCinematicEvent
Parameters:
im - importer
Throws:
java.io.IOException