@Deprecated public class AudioTrack extends java.lang.Object implements ClonableTrack
AnimControl control model.getControl(AnimControl.class); AudioTrack track = new AudioTrack(existionAudioNode, control.getAnim("TheAnim").getLength()); control.getAnim("TheAnim").addTrack(track);This is mostly intended for short sounds, playInstance will be called on the AudioNode at time 0 + startOffset.
Modifier | Constructor and Description |
---|---|
protected |
AudioTrack()
Deprecated.
constructor for serialization only
|
|
AudioTrack(AudioNode audio,
float length)
Deprecated.
Creates an AudioTrack
|
|
AudioTrack(AudioNode audio,
float length,
float startOffset)
Deprecated.
Creates an AudioTrack
|
Modifier and Type | Method and Description |
---|---|
void |
cleanUp()
Deprecated.
Method responsible of cleaning UserData on referenced Spatials when the Track is deleted
|
Track |
clone()
Deprecated.
Clone this track
|
void |
cloneFields(Cloner cloner,
java.lang.Object original)
Deprecated.
Implemented to perform deep cloning for this object, resolving
local cloned references using the specified cloner.
|
Track |
cloneForSpatial(Spatial spatial)
Deprecated.
This method clone the Track and search for the cloned counterpart of the
original audio node in the given cloned spatial.
|
AudioNode |
getAudio()
Deprecated.
|
float[] |
getKeyFrameTimes()
Deprecated.
Get the times in seconds for all keyframes.
|
float |
getLength()
Deprecated.
Return the length of the track
|
float |
getStartOffset()
Deprecated.
|
java.lang.Object |
jmeClone()
Deprecated.
Performs a regular shallow clone of the object.
|
void |
read(JmeImporter im)
Deprecated.
Internal use only serialization
|
void |
setAudio(AudioNode audio)
Deprecated.
sets the audio node to be used for this track
|
void |
setStartOffset(float startOffset)
Deprecated.
set the start offset of the track
|
void |
setTime(float time,
float weight,
AnimControl control,
AnimChannel channel,
TempVars vars)
Deprecated.
Internal use only
|
void |
write(JmeExporter ex)
Deprecated.
Internal use only serialization
|
protected AudioTrack()
public AudioTrack(AudioNode audio, float length)
audio
- the AudioNodelength
- the length of the track (usually the length of the
animation you want to add the track to)public AudioTrack(AudioNode audio, float length, float startOffset)
audio
- the AudioNodelength
- the length of the track (usually the length of the
animation you want to add the track to)startOffset
- the time in second when the sound will be played after
the animation starts (default is 0)public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars)
setTime
in interface Track
time
- The time in the animationweight
- The weight from 0 to 1 on how much to apply the trackcontrol
- The control which the track should affectchannel
- The channel which the track should affectvars
- temporary storageTrack.setTime(float, float, com.jme3.animation.AnimControl,
com.jme3.animation.AnimChannel, com.jme3.util.TempVars)
public float getLength()
public float[] getKeyFrameTimes()
Track
length
.
Modifying the provided array is not allowed, as it may corrupt internal
state.getKeyFrameTimes
in interface Track
public Track clone()
public Track cloneForSpatial(Spatial spatial)
cloneForSpatial
in interface ClonableTrack
spatial
- the Spatial holding the AnimControlpublic java.lang.Object jmeClone()
JmeCloneable
This method is separate from the regular clone() method so that objects might still maintain their own regular java clone() semantics (perhaps even using Cloner for those methods). However, because Java's clone() has specific features in the sense of Object's clone() implementation, it's usually best to have some path for subclasses to bypass the public clone() method that might be cloning fields and instead get at the superclass protected clone() methods. For example, through super.jmeClone() or another protected clone method that some base class eventually calls super.clone() in.
jmeClone
in interface JmeCloneable
public void cloneFields(Cloner cloner, java.lang.Object original)
JmeCloneable
Note: during normal clone operations the original object will not be needed as the clone has already had all of the fields shallow copied.
cloneFields
in interface JmeCloneable
cloner
- The cloner that is performing the cloning operation. The
cloneFields method can call back into the cloner to make
clones of its subordinate fields.original
- The original object from which this object was cloned.
This is provided for the very rare case that this object needs
to refer to its original for some reason. In general, all of
the relevant values should have been transferred during the
shallow clone and this object need merely clone what it wants.public void cleanUp()
ClonableTrack
cleanUp
in interface ClonableTrack
public AudioNode getAudio()
public void setAudio(AudioNode audio)
audio
- the desired AudioNode (alias created)public float getStartOffset()
public void setStartOffset(float startOffset)
startOffset
- the desired start offsetpublic void write(JmeExporter ex) throws java.io.IOException
public void read(JmeImporter im) throws java.io.IOException