public class SoundEvent extends AbstractCinematicEvent
| Modifier and Type | Field and Description |
|---|---|
protected AudioNode |
audioNode |
protected java.lang.String |
path |
protected boolean |
stream |
initialDuration, listeners, loopMode, playState, resuming, speed, time| Constructor and Description |
|---|
SoundEvent()
creates a sound event
used for serialization
|
SoundEvent(java.lang.String path)
creates a sound track from the given resource path
|
SoundEvent(java.lang.String path,
boolean stream)
creates a sound track from the given resource path
|
SoundEvent(java.lang.String path,
boolean stream,
float initialDuration)
creates a sound track from the given resource path
|
SoundEvent(java.lang.String path,
boolean stream,
float initialDuration,
LoopMode loopMode)
creates a sound track from the given resource path
|
SoundEvent(java.lang.String path,
boolean stream,
LoopMode loopMode)
creates a sound track from the given resource path
|
SoundEvent(java.lang.String path,
float initialDuration)
creates a sound track from the given resource path
|
SoundEvent(java.lang.String path,
float initialDuration,
LoopMode loopMode)
creates a sound track from the given resource path
|
SoundEvent(java.lang.String path,
LoopMode loopMode)
creates a sound track from the given resource path
|
| Modifier and Type | Method and Description |
|---|---|
AudioNode |
getAudioNode()
Returns the underlying audio node of this sound track
|
void |
initEvent(Application app,
Cinematic cinematic)
Initialize this event (called internally only).
|
void |
onPause()
Implement this method with code that you want to execute when the event is paused.
|
void |
onPlay()
Implement this method with code that you want to execute when the event is started.
|
void |
onStop()
Implement this method with code that you want to execute when the event is stopped.
|
void |
onUpdate(float tpf)
Implement this method with the code that you want to execute on update
(only called when the event is playing).
|
void |
read(JmeImporter im)
Used for serialization only.
|
void |
setLoopMode(LoopMode loopMode)
Sets the loopMode of the animation.
|
void |
setTime(float time)
Fast-forwards the event to the given timestamp.
|
void |
write(JmeExporter ex)
Used for serialization only.
|
addListener, dispose, forceStop, getDuration, getInitialDuration, getLoopMode, getPlayState, getSpeed, getTime, internalUpdate, pause, play, removeListener, setInitialDuration, setSpeed, stopprotected java.lang.String path
protected AudioNode audioNode
protected boolean stream
public SoundEvent(java.lang.String path)
path - the path to an audio file (ie : "Sounds/mySound.wav")public SoundEvent(java.lang.String path,
boolean stream)
path - the path to an audio file (ie : "Sounds/mySound.wav")stream - true to make the audio data streamedpublic SoundEvent(java.lang.String path,
boolean stream,
float initialDuration)
path - the path to an audio file (ie : "Sounds/mySound.wav")stream - true to make the audio data streamedinitialDuration - the initial duration of the eventpublic SoundEvent(java.lang.String path,
boolean stream,
LoopMode loopMode)
path - the path to an audio file (ie : "Sounds/mySound.wav")stream - true to make the audio data streamedloopMode - the loopModeLoopModepublic SoundEvent(java.lang.String path,
boolean stream,
float initialDuration,
LoopMode loopMode)
path - the path to an audio file (ie : "Sounds/mySound.wav")stream - true to make the audio data streamedinitialDuration - the initial duration of the eventloopMode - the loopModeLoopModepublic SoundEvent(java.lang.String path,
float initialDuration)
path - the path to an audio file (ie : "Sounds/mySound.wav")initialDuration - the initial duration of the eventpublic SoundEvent(java.lang.String path,
LoopMode loopMode)
path - the path to an audio file (ie : "Sounds/mySound.wav")loopMode - the loopModeLoopModepublic SoundEvent(java.lang.String path,
float initialDuration,
LoopMode loopMode)
path - the path to an audio file (ie : "Sounds/mySound.wav")initialDuration - the initial duration of the eventloopMode - the loopModeLoopModepublic SoundEvent()
public void initEvent(Application app, Cinematic cinematic)
AbstractCinematicEventinitEvent in interface CinematicEventinitEvent in class AbstractCinematicEventapp - ignoredcinematic - ignoredpublic void setTime(float time)
AbstractCinematicEventsetTime in interface CinematicEventsetTime in class AbstractCinematicEventtime - the time to fast-forward to.public void onPlay()
AbstractCinematicEventonPlay in class AbstractCinematicEventpublic void onStop()
AbstractCinematicEventonStop in class AbstractCinematicEventpublic void onPause()
AbstractCinematicEventonPause in class AbstractCinematicEventpublic void onUpdate(float tpf)
AbstractCinematicEventonUpdate in class AbstractCinematicEventtpf - time per framepublic AudioNode getAudioNode()
public void setLoopMode(LoopMode loopMode)
AbstractCinematicEventsetLoopMode in interface CinematicEventsetLoopMode in class AbstractCinematicEventloopMode - the desired mode (default=DontLoop)LoopModepublic void write(JmeExporter ex) throws java.io.IOException
AbstractCinematicEventwrite in interface Savablewrite in class AbstractCinematicEventex - exporterjava.io.IOException - from the exporterpublic void read(JmeImporter im) throws java.io.IOException
AbstractCinematicEventread in interface Savableread in class AbstractCinematicEventim - importerjava.io.IOException - from the importer