|
Aviatrix3D 1.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.j3d.aviatrix3d.SceneGraphObject
org.j3d.aviatrix3d.Node
org.j3d.aviatrix3d.Leaf
org.j3d.aviatrix3d.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 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 |
Fields inherited from class org.j3d.aviatrix3d.Node |
bounds, implicitBounds, INVALID_BOUNDS, parent |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
alive, LISTENER_SET_NOT_LIVE_MESSAGE, updateHandler, WRITE_TIMING_MSG |
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 void |
checkForCyclicChild(SceneGraphObject parent)
Check to see if this node is the same reference as the passed node that is a parent of this node. |
BoundingVolume |
getBounds()
Get the currently set bounds for 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. |
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. |
void |
postRender(net.java.games.joal.AL al)
|
protected void |
recomputeBounds()
Internal method to recalculate the implicit bounds of this Node. |
void |
render(net.java.games.joal.AL al,
javax.vecmath.Matrix4f transform)
This method is called to render this node. |
void |
requestBoundsUpdate()
Request a recomputation of the bounds of this object. |
void |
setAudioSource(AudioComponent src)
|
protected void |
setLive(boolean state)
Notification that this object is live now. |
protected void |
setUpdateHandler(NodeUpdateHandler handler)
Set the scenegraph update handler for this node. |
void |
startSound()
Start a sound playing. |
void |
stopSound()
Stop a sound playing. |
Methods inherited from class org.j3d.aviatrix3d.Node |
boundsChanged, checkForCyclicParent, getParent, removeParent, setBounds, setParent, updateBounds, updateParentBounds |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
dataChanged, getUserData, isLive, setUserData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
Constructor Detail |
public Sound()
Method Detail |
public void setAudioSource(AudioComponent src)
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 void startSound()
public void stopSound()
public void pauseSound()
public boolean isPlaying()
public boolean isPaused()
public void render(net.java.games.joal.AL al, javax.vecmath.Matrix4f transform)
al
- The al context to render withtransform
- The transformation stack to this nodepublic void postRender(net.java.games.joal.AL al)
protected void markBoundsDirty()
markBoundsDirty
in class Node
protected void recomputeBounds()
recomputeBounds
in class Node
public void requestBoundsUpdate()
This will request the geometry to recompute the bounds. If the geometry is found to be live during this process, it will not update, and thus the value used will be the last updated (ie from the previous frame it was processed).
public BoundingVolume getBounds()
getBounds
in class Node
public boolean isEnabled()
protected void setUpdateHandler(NodeUpdateHandler handler)
setUpdateHandler
in class SceneGraphObject
handler
- The instance to use as a handlerprotected void setLive(boolean state)
setLive
in class Node
state
- true if this should be marked as live nowprotected void checkForCyclicChild(SceneGraphObject parent) throws CyclicSceneGraphStructureException
checkForCyclicChild
in class SceneGraphObject
parent
- The reference to check against this class
CyclicSceneGraphStructureException
- Equal parent and child
|
Aviatrix3D 1.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |