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, stop
protected 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 loopModeLoopMode
public 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 loopModeLoopMode
public 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 loopModeLoopMode
public 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 loopModeLoopMode
public SoundEvent()
public void initEvent(Application app, Cinematic cinematic)
AbstractCinematicEvent
initEvent
in interface CinematicEvent
initEvent
in class AbstractCinematicEvent
app
- ignoredcinematic
- ignoredpublic void setTime(float time)
AbstractCinematicEvent
setTime
in interface CinematicEvent
setTime
in class AbstractCinematicEvent
time
- the time to fast forward to.public void onPlay()
AbstractCinematicEvent
onPlay
in class AbstractCinematicEvent
public void onStop()
AbstractCinematicEvent
onStop
in class AbstractCinematicEvent
public void onPause()
AbstractCinematicEvent
onPause
in class AbstractCinematicEvent
public void onUpdate(float tpf)
AbstractCinematicEvent
onUpdate
in class AbstractCinematicEvent
tpf
- time per framepublic AudioNode getAudioNode()
public void setLoopMode(LoopMode loopMode)
AbstractCinematicEvent
setLoopMode
in interface CinematicEvent
setLoopMode
in class AbstractCinematicEvent
loopMode
- the desired mode (default=DontLoop)LoopMode
public void write(JmeExporter ex) throws java.io.IOException
AbstractCinematicEvent
write
in interface Savable
write
in class AbstractCinematicEvent
ex
- exporterjava.io.IOException
- from the exporterpublic void read(JmeImporter im) throws java.io.IOException
AbstractCinematicEvent
read
in interface Savable
read
in class AbstractCinematicEvent
im
- importerjava.io.IOException
- from the importer