|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.SceneGraphObject org.j3d.aviatrix3d.Node org.j3d.aviatrix3d.Leaf org.j3d.aviatrix3d.Sound
public abstract class Sound
A Sound class represents all sound emiting nodes in the system.
Field Summary | |
---|---|
protected int |
buffer
The buffer created for this sound |
protected boolean |
dataChanged
Has the sound data changed |
protected boolean |
enabled
Is the sound currently enabled |
protected int |
format
The format of this sound. |
protected int |
freq
The frequency of the samples |
protected boolean |
loop
Whether to loop this sample |
protected boolean |
paramsChanged
Has the sound params |
protected boolean |
paused
Is the sound paused |
protected float |
pitch
The sounds pitch |
protected boolean |
playChanged
Has the play state changed |
protected boolean |
playing
Is the sound playing |
protected int |
seq
The current seq |
protected AudioComponent |
soundSource
The source feeding this sound |
protected java.nio.IntBuffer |
values
A temporary value used to fetch values from OpenAL. |
Fields inherited from class org.j3d.aviatrix3d.Node |
---|
bounds, implicitBounds, INVALID_BOUNDS, parent |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
Fields inherited from interface org.j3d.aviatrix3d.rendering.LeafCullable |
---|
AUDIO_CULLABLE, CLIP_CULLABLE, FOG_CULLABLE, GEOMETRY_CULLABLE, LIGHT_CULLABLE, OVERRIDE_CULLABLE |
Constructor Summary | |
---|---|
Sound()
Creates a sound. |
Method Summary | |
---|---|
void |
audioUpdated(int format,
int frequency,
int seq)
Notification that the audio has updated a section of the sample. |
protected int |
compareTo(Sound snd)
Compares this object with the specified object for order. |
protected boolean |
equals(Sound snd)
Compares this object with the specified object to check for equivalence. |
BoundingVolume |
getBounds()
Get the currently set bounds for this object. |
int |
getCullableType()
Get the type that this cullable represents. |
Renderable |
getRenderable()
Get the child renderable of this object. |
boolean |
isEnabled()
State check to see whether the sound is enabled. |
boolean |
isPaused()
Is this sound currently paused; |
boolean |
isPlaying()
Is this sound currently playing. |
boolean |
isSpatialised()
Check to see if this renderable is spatialised in any way. |
protected void |
markBoundsDirty()
Mark this node as having dirty bounds due to one of it's children having their bounds changed. |
void |
paramsUpdated(boolean loop,
float pitch)
Notification that the audio's parameters have changed. |
void |
pauseSound()
Pause a sound playing. |
protected void |
recomputeBounds()
Internal method to recalculate the implicit bounds of this Node. |
void |
setAudioSource(AudioComponent src)
Set the source for the sound to use. |
void |
setEnabled(boolean state)
Set the enabled state of the light. |
void |
startSound()
Start a sound playing. |
void |
stopSound()
Stop a sound playing. |
Methods inherited from class org.j3d.aviatrix3d.Node |
---|
boundsChanged, checkForCyclicParent, getParent, removeParent, requestBoundsUpdate, setBounds, setParent, updateBounds, updateParentBounds |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
checkForCyclicChild, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setLive, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.j3d.aviatrix3d.rendering.AudioRenderable |
---|
postRender, render |
Methods inherited from interface org.j3d.aviatrix3d.rendering.Renderable |
---|
equals |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Field Detail |
---|
protected AudioComponent soundSource
protected int format
protected int freq
protected boolean loop
protected int buffer
protected float pitch
protected int seq
protected boolean dataChanged
protected boolean playChanged
protected boolean paramsChanged
protected boolean playing
protected boolean paused
protected boolean enabled
protected java.nio.IntBuffer values
Constructor Detail |
---|
public Sound()
Method Detail |
---|
protected void markBoundsDirty()
markBoundsDirty
in class Node
protected void recomputeBounds()
recomputeBounds
in class Node
public BoundingVolume getBounds()
getBounds
in interface LeafCullable
getBounds
in class Node
public void audioUpdated(int format, int frequency, int seq)
audioUpdated
in interface AudioUpdateListener
format
- The format of the samplesfrequency
- The frequency of the samplesseq
- The sample seq. Seq 0 means complete file.
Streamed sources start at 1public void paramsUpdated(boolean loop, float pitch)
paramsUpdated
in interface AudioUpdateListener
loop
- Whether to loop this samplepitch
- The pitch to play at.public int getCullableType()
getCullableType
in interface LeafCullable
public Renderable getRenderable()
getRenderable
in interface LeafCullable
public boolean isEnabled()
isEnabled
in interface AudioRenderable
public boolean isSpatialised()
Default implementation returns true. Derived classes should overrride as needed.
isSpatialised
in interface AudioRenderable
public void setEnabled(boolean state) throws InvalidWriteTimingException
state
- The new state of the light
InvalidWriteTimingException
- This was not called during the
data changed callback timepublic void startSound() throws InvalidWriteTimingException
InvalidWriteTimingException
- This was not called during the
data changed callback timepublic void stopSound() throws InvalidWriteTimingException
InvalidWriteTimingException
- This was not called during the
data changed callback timepublic boolean isPlaying()
public void pauseSound() throws InvalidWriteTimingException
startSound()
InvalidWriteTimingException
- This was not called during the
data changed callback timepublic boolean isPaused()
public void setAudioSource(AudioComponent src)
src
- The source of the sound
InvalidWriteTimingException
- This was not called during the
data changed callback timeprotected int compareTo(Sound snd)
snd
- The argument instance to be compared
protected boolean equals(Sound snd)
snd
- The sound instance to be compared
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |