Package com.jme3.cinematic.events
Class SoundEvent
java.lang.Object
com.jme3.cinematic.events.AbstractCinematicEvent
com.jme3.cinematic.events.SoundEvent
- All Implemented Interfaces:
- CinematicEvent,- Savable
- Direct Known Subclasses:
- SoundTrack
A sound track to be played in a cinematic.
- 
Field SummaryFieldsFields inherited from class com.jme3.cinematic.events.AbstractCinematicEventinitialDuration, listeners, loopMode, playState, resuming, speed, time
- 
Constructor SummaryConstructorsConstructorDescriptioncreates a sound event used for serializationSoundEvent(String path) creates a sound track from the given resource pathSoundEvent(String path, boolean stream) creates a sound track from the given resource pathSoundEvent(String path, boolean stream, float initialDuration) creates a sound track from the given resource pathSoundEvent(String path, boolean stream, float initialDuration, LoopMode loopMode) creates a sound track from the given resource pathSoundEvent(String path, boolean stream, LoopMode loopMode) creates a sound track from the given resource pathSoundEvent(String path, float initialDuration) creates a sound track from the given resource pathSoundEvent(String path, float initialDuration, LoopMode loopMode) creates a sound track from the given resource pathSoundEvent(String path, LoopMode loopMode) creates a sound track from the given resource path
- 
Method SummaryModifier and TypeMethodDescriptionReturns the underlying audio node of this sound trackvoidinitEvent(Application app, Cinematic cinematic) Initialize this event (called internally only).voidonPause()Implement this method with code that you want to execute when the event is paused.voidonPlay()Implement this method with code that you want to execute when the event is started.voidonStop()Implement this method with code that you want to execute when the event is stopped.voidonUpdate(float tpf) Implement this method with the code that you want to execute on update (only called when the event is playing).voidread(JmeImporter im) Used for serialization only.voidsetLoopMode(LoopMode loopMode) Sets the loopMode of the animation.voidsetTime(float time) Fast-forwards the event to the given timestamp.voidwrite(JmeExporter ex) Used for serialization only.Methods inherited from class com.jme3.cinematic.events.AbstractCinematicEventaddListener, dispose, forceStop, getDuration, getInitialDuration, getLoopMode, getPlayState, getSpeed, getTime, internalUpdate, pause, play, removeListener, setInitialDuration, setSpeed, stop
- 
Field Details- 
path
- 
audioNode
- 
streamprotected boolean stream
 
- 
- 
Constructor Details- 
SoundEventcreates a sound track from the given resource path- Parameters:
- path- the path to an audio file (ie : "Sounds/mySound.wav")
 
- 
SoundEventcreates a sound track from the given resource path- Parameters:
- path- the path to an audio file (ie : "Sounds/mySound.wav")
- stream- true to make the audio data streamed
 
- 
SoundEventcreates a sound track from the given resource path- Parameters:
- path- the path to an audio file (ie : "Sounds/mySound.wav")
- stream- true to make the audio data streamed
- initialDuration- the initial duration of the event
 
- 
SoundEventcreates a sound track from the given resource path- Parameters:
- path- the path to an audio file (ie : "Sounds/mySound.wav")
- stream- true to make the audio data streamed
- loopMode- the loopMode
- See Also:
 
- 
SoundEventcreates a sound track from the given resource path- Parameters:
- path- the path to an audio file (ie : "Sounds/mySound.wav")
- stream- true to make the audio data streamed
- initialDuration- the initial duration of the event
- loopMode- the loopMode
- See Also:
 
- 
SoundEventcreates a sound track from the given resource path- Parameters:
- path- the path to an audio file (ie : "Sounds/mySound.wav")
- initialDuration- the initial duration of the event
 
- 
SoundEventcreates a sound track from the given resource path- Parameters:
- path- the path to an audio file (ie : "Sounds/mySound.wav")
- loopMode- the loopMode
- See Also:
 
- 
SoundEventcreates a sound track from the given resource path- Parameters:
- path- the path to an audio file (ie : "Sounds/mySound.wav")
- initialDuration- the initial duration of the event
- loopMode- the loopMode
- See Also:
 
- 
SoundEventpublic SoundEvent()creates a sound event used for serialization
 
- 
- 
Method Details- 
initEventDescription copied from class:AbstractCinematicEventInitialize this event (called internally only).- Specified by:
- initEventin interface- CinematicEvent
- Overrides:
- initEventin class- AbstractCinematicEvent
- Parameters:
- app- ignored
- cinematic- ignored
 
- 
setTimepublic void setTime(float time) Description copied from class:AbstractCinematicEventFast-forwards the event to the given timestamp. Time=0 is the start of the event.- Specified by:
- setTimein interface- CinematicEvent
- Overrides:
- setTimein class- AbstractCinematicEvent
- Parameters:
- time- the time to fast-forward to.
 
- 
onPlaypublic void onPlay()Description copied from class:AbstractCinematicEventImplement this method with code that you want to execute when the event is started.- Specified by:
- onPlayin class- AbstractCinematicEvent
 
- 
onStoppublic void onStop()Description copied from class:AbstractCinematicEventImplement this method with code that you want to execute when the event is stopped.- Specified by:
- onStopin class- AbstractCinematicEvent
 
- 
onPausepublic void onPause()Description copied from class:AbstractCinematicEventImplement this method with code that you want to execute when the event is paused.- Specified by:
- onPausein class- AbstractCinematicEvent
 
- 
onUpdatepublic void onUpdate(float tpf) Description copied from class:AbstractCinematicEventImplement this method with the code that you want to execute on update (only called when the event is playing).- Specified by:
- onUpdatein class- AbstractCinematicEvent
- Parameters:
- tpf- time per frame
 
- 
getAudioNodeReturns the underlying audio node of this sound track- Returns:
- the pre-existing instance
 
- 
setLoopModeDescription copied from class:AbstractCinematicEventSets the loopMode of the animation.- Specified by:
- setLoopModein interface- CinematicEvent
- Overrides:
- setLoopModein class- AbstractCinematicEvent
- Parameters:
- loopMode- the desired mode (default=DontLoop)
- See Also:
 
- 
writeDescription copied from class:AbstractCinematicEventUsed for serialization only.- Specified by:
- writein interface- Savable
- Overrides:
- writein class- AbstractCinematicEvent
- Parameters:
- ex- exporter
- Throws:
- IOException- from the exporter
 
- 
readDescription copied from class:AbstractCinematicEventUsed for serialization only.- Specified by:
- readin interface- Savable
- Overrides:
- readin class- AbstractCinematicEvent
- Parameters:
- im- importer
- Throws:
- IOException- from the importer
 
 
-