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-forward 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 - the applicationcinematic - the cinematicpublic 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 - 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.LoopModepublic void write(JmeExporter ex) throws java.io.IOException
AbstractCinematicEventwrite in interface Savablewrite in class AbstractCinematicEventex - exporterjava.io.IOExceptionpublic void read(JmeImporter im) throws java.io.IOException
AbstractCinematicEventread in interface Savableread in class AbstractCinematicEventim - importerjava.io.IOException