Package com.jme3.animation
Class AudioTrack
java.lang.Object
com.jme3.animation.AudioTrack
- All Implemented Interfaces:
ClonableTrack
,Track
,Savable
,JmeCloneable
,Cloneable
Deprecated.
AudioTrack is a track to add to an existing animation, to play a sound during
an animations for example : gunshot, footstep, shout, etcetera.
Typical usage is:
AnimControl control model.getControl(AnimControl.class); AudioTrack track = new AudioTrack(existingAudioNode, 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.
-
Constructor Summary
ModifierConstructorDescriptionprotected
Deprecated.constructor for serialization onlyAudioTrack
(AudioNode audio, float length) Deprecated.Creates an AudioTrackAudioTrack
(AudioNode audio, float length, float startOffset) Deprecated.Creates an AudioTrack -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanUp()
Deprecated.Method responsible for cleaning UserData on referenced Spatials when the Track is deletedclone()
Deprecated.Clone this trackvoid
cloneFields
(Cloner cloner, Object original) Deprecated.Implemented to perform deep cloning for this object, resolving local cloned references using the specified cloner.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.getAudio()
Deprecated.float[]
Deprecated.Get the times in seconds for all keyframes.float
Deprecated.Return the length of the trackfloat
Deprecated.jmeClone()
Deprecated.Performs a regular shallow clone of the object.void
read
(JmeImporter im) Deprecated.Internal use only serializationvoid
Deprecated.sets the audio node to be used for this trackvoid
setStartOffset
(float startOffset) Deprecated.set the start offset of the trackvoid
setTime
(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) Deprecated.Internal use onlyvoid
write
(JmeExporter ex) Deprecated.Internal use only serialization
-
Constructor Details
-
AudioTrack
protected AudioTrack()Deprecated.constructor for serialization only -
AudioTrack
Deprecated.Creates an AudioTrack- Parameters:
audio
- the AudioNodelength
- the length of the track (usually the length of the animation you want to add the track to)
-
AudioTrack
Deprecated.Creates an AudioTrack- Parameters:
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)
-
-
Method Details
-
setTime
public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) Deprecated.Internal use only -
getLength
public float getLength()Deprecated.Return the length of the track -
getKeyFrameTimes
public float[] getKeyFrameTimes()Deprecated.Description copied from interface:Track
Get the times in seconds for all keyframes. All keyframe times should be between 0.0 andlength
. Modifying the provided array is not allowed, as it may corrupt internal state.- Specified by:
getKeyFrameTimes
in interfaceTrack
- Returns:
- the keyframe times
-
clone
Deprecated.Clone this track -
cloneForSpatial
Deprecated.This method clone the Track and search for the cloned counterpart of the original audio node in the given cloned spatial. The spatial is assumed to be the Spatial holding the AnimControl controlling the animation using this Track.- Specified by:
cloneForSpatial
in interfaceClonableTrack
- Parameters:
spatial
- the Spatial holding the AnimControl- Returns:
- the cloned Track with proper reference
-
jmeClone
Deprecated.Description copied from interface:JmeCloneable
Performs a regular shallow clone of the object. Some fields may also be cloned but generally only if they will never be shared with other objects. (For example, local Vector3fs and so on.)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.
- Specified by:
jmeClone
in interfaceJmeCloneable
- Returns:
- a new instance
-
cloneFields
Deprecated.Description copied from interface:JmeCloneable
Implemented to perform deep cloning for this object, resolving local cloned references using the specified cloner. The object can call cloner.clone(fieldValue) to deep clone any of its fields.Note: during normal clone operations the original object will not be needed as the clone has already had all of the fields shallow copied.
- Specified by:
cloneFields
in interfaceJmeCloneable
- Parameters:
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 only clone what it wants.
-
cleanUp
public void cleanUp()Deprecated.Description copied from interface:ClonableTrack
Method responsible for cleaning UserData on referenced Spatials when the Track is deleted- Specified by:
cleanUp
in interfaceClonableTrack
-
getAudio
Deprecated.- Returns:
- the audio node used by this track
-
setAudio
Deprecated.sets the audio node to be used for this track- Parameters:
audio
- the desired AudioNode (alias created)
-
getStartOffset
public float getStartOffset()Deprecated.- Returns:
- the start offset of the track
-
setStartOffset
public void setStartOffset(float startOffset) Deprecated.set the start offset of the track- Parameters:
startOffset
- the desired start offset
-
write
Deprecated.Internal use only serialization- Specified by:
write
in interfaceSavable
- Parameters:
ex
- exporter- Throws:
IOException
- exception
-
read
Deprecated.Internal use only serialization- Specified by:
read
in interfaceSavable
- Parameters:
im
- importer- Throws:
IOException
- Exception
-