|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.media.j3d.J3dStructure
javax.media.j3d.SoundScheduler
class SoundScheduler
This structure parallels the RenderBin structure and is used for sounds
Field Summary | |
---|---|
(package private) AuralAttributesRetained |
aaImmed
Current active (selected) attribute node in the sceneGraph |
(package private) AuralAttributesRetained |
aaRetained
Current active (selected) attribute node in the sceneGraph |
(package private) AudioDevice |
audioDevice
Audio Device |
(package private) AudioDevice3D |
audioDevice3D
|
(package private) AudioDevice3DL2 |
audioDevice3DL2
|
private boolean |
auralAttribsChanged
Temporary flag that's denotes that some field auralAttribute was changed |
(package private) static boolean |
debugFlag
|
(package private) static int |
EAR_POSITIONS_CHANGED
|
(package private) static int |
EYE_POSITIONS_CHANGED
|
(package private) GraphicsContext3D |
graphicsCtx
The GraphicContext3D that we are currently unning in. |
(package private) static int |
HEAD_TO_VWORLD_CHANGED
|
(package private) static int |
IMAGE_PLATE_TO_VWORLD_CHANGED
|
(package private) static boolean |
internalErrors
|
(package private) Bounds[] |
intersectedRegions
Array of Bounds nodes for the corresponding intersectedSoundscapes array. |
(package private) SoundscapeRetained[] |
intersectedSoundscapes
Array of SoundScapeRetained nodes that intersect the viewPlatform This list is a subset of the soundscapes array, and is used when selecting the closest Soundscape. |
(package private) AuralAttributesRetained |
lastAA
Maintain what reference to the last AuralAttributes found active was so that only if there was a change do we need to reset these parameters in the AudioDevice3D. |
(package private) int |
lastEventReceived
|
(package private) static int |
LISTENER_CHANGED
|
private int |
listenerUpdated
|
(package private) int |
nImmedSounds
Current number of immediate mode sound nodes in the universe |
(package private) int |
nRetainedSounds
Current number of scene graph sound nodes in the universe |
private boolean |
positionalSoundUpdated
Temporary flag that's denotes that a positional sound was processed in the current loop of renderChange(). |
(package private) java.util.ArrayList |
prioritizedSounds
An array of prioritized sounds currently playing "live" sounds. |
(package private) boolean |
ready
This boolean tells the thread to suspend itself. |
(package private) Bounds |
region
Reference to last processed region within run(). |
(package private) boolean |
resetAA
Since AuralAttribute gain scale factor is multipled with sound's initialGain scale factor, any change in AuralAttrib gain scale factor should force an update of all active sounds' gains Also, change in AuralAttributes should force a sound update even if no other sound field changes occurred. |
private boolean |
stallThread
|
(package private) UpdateTargets |
targets
|
(package private) int |
totalChannels
|
(package private) boolean |
transformMsg
|
(package private) View |
view
The View that owns this SoundScheduler |
(package private) ViewPlatformRetained |
viewPlatform
The ViewPlatform that is associated with this SoundScheduler |
Fields inherited from class javax.media.j3d.J3dStructure |
---|
messageList, msgList, nMessage, threadData, threadType, universe, updateThread |
Constructor Summary | |
---|---|
SoundScheduler(VirtualUniverse u,
View v)
Constructs a new SoundScheduler |
Method Summary | |
---|---|
(package private) void |
activate()
|
(package private) void |
addPrioritizedSound(SoundRetained mirSound)
|
(package private) void |
addSound(SoundRetained sound)
Add sound to sounds list. |
(package private) void |
attachSoundData(SoundSchedulerAtom soundAtom,
MediaContainer soundData,
boolean forceReload)
Attempts to load sound data for a particular sound source onto the chosen/initialized audio device If this called, it is assumed that SoundRetained.audioDevice is NOT null. |
(package private) int |
calcSchedulingAction()
Determine scheduling action for each live sound |
(package private) void |
changeNodeAttrib(J3dMessage m)
|
(package private) void |
changeNodeState(J3dMessage m)
|
(package private) boolean |
checkAudioDevice3D()
Check (and set if necessary) AudioDevice3D field |
(package private) boolean |
checkState()
|
(package private) void |
cleanup()
Release resource associate with this structure before GC We need to clear all those IndexedUnorderSet/WakeupIndexedList so that the listIdx associate with IndexedObject reset to -1. |
(package private) void |
clearListenerFlag()
|
(package private) void |
clearSoundData(SoundSchedulerAtom soundAtom)
Clears the fields associated with sample data for this sound. |
(package private) void |
deactivate()
|
(package private) void |
deactivateAllSounds()
Deactive all playing sounds If the sound is continuous thendSilence it but leave it playing otherwise stop sound |
(package private) void |
debugPrint(java.lang.String message)
|
(package private) void |
deleteSound(SoundRetained sound)
|
(package private) void |
enableSound(SoundRetained sound)
|
(package private) int |
findActiveSoundscapes()
Process active Soundscapes (if there are any) and intersect these soundscapes with the viewPlatform. |
(package private) AuralAttributesRetained |
findClosestAAttribs(int nSelectedSScapes)
|
(package private) SoundSchedulerAtom |
findSoundAtom(SoundRetained node,
int nthInstance)
|
(package private) void |
insertNodes(J3dMessage m)
|
(package private) void |
loadSound(SoundRetained sound,
boolean forceReload)
|
(package private) void |
muteSilentSound(SoundSchedulerAtom soundAtom)
|
(package private) void |
muteSilentSounds()
Mute sounds that are to be played silently. |
(package private) void |
muteSound(SoundRetained sound)
|
(package private) void |
pause(SoundSchedulerAtom soundAtom)
pause the sample associated with this sound |
(package private) void |
pauseAllSounds()
Pause all activity playing sounds |
(package private) void |
pauseSound(SoundRetained sound)
|
(package private) int |
performActions()
Perform the scheduling action for each prioritized sound. |
(package private) void |
printAtomState(SoundSchedulerAtom atom)
|
(package private) int |
prioritizeSounds()
Prioritize all sounds associated with SoundScheduler (view) This only need be done once when scheduler is initialized since the priority list is updated when: a) PRIORITY_DIRTY_BIT in soundDirty field set; or b) sound added or removed from live array list |
(package private) void |
processBoundingLeafChanged(J3dMessage m)
|
(package private) void |
processImmediateNodes(java.lang.Object[] args,
long referenceTime)
|
(package private) void |
processMessages(long referenceTime)
This gets overriden by the structure |
(package private) void |
processSoundAtom(SoundSchedulerAtom soundAtom)
|
(package private) void |
processViewSpecificGroupChanged(J3dMessage m)
|
(package private) void |
receiveAWTEvent(java.awt.AWTEvent evt)
|
(package private) void |
removeNodes(J3dMessage m)
Node removed from tree |
(package private) void |
render(boolean startFlag,
SoundSchedulerAtom soundAtom,
AuralAttributesRetained attribs)
render (start or update) the oscillator associated with this sound |
(package private) void |
renderChanges()
The main loop for the Sound Scheduler. |
(package private) void |
reset()
|
(package private) void |
resumeAllSounds()
Resume playing all paused active sounds |
(package private) void |
setAttribsDirtyFlag(SoundRetained node,
int dirtyFlag)
set dirty flags associated with SoundSchedulerAtom |
(package private) void |
setListenerFlag(int flag)
'Dirty' flag == listenerUpdated flag The ambiguous name 'dirtyFlag' is a legacy from when there was only a single dirty flag set by Core yet tested and cleared in this scheduler. |
(package private) void |
setStateDirtyFlag(SoundRetained node,
int dirtyFlag)
|
(package private) long |
shortestTimeToFinish()
Determine amount of time before next playing sound will be is complete. |
(package private) void |
shuffleSound(SoundRetained sound)
|
(package private) void |
start(SoundSchedulerAtom soundAtom)
Start the sample associated with this sound Do everything necessary to start the sound: set start time the oscillator associated with this sound |
(package private) void |
stopAllSounds()
Stop all activity playing sounds |
(package private) void |
stopAllSounds(boolean setPlayingSoundsPending)
|
(package private) void |
stopSound(SoundSchedulerAtom soundAtom,
boolean setPending)
stop playing one specific sound node If setPending flag true, sound is stopped but enable state is set to pending-on so that it is restarted. |
(package private) boolean |
testListenerFlag()
|
(package private) void |
turnOff(SoundSchedulerAtom soundAtom)
stop the sample associated with this sound |
(package private) void |
unpause(SoundSchedulerAtom soundAtom)
|
(package private) void |
update(SoundSchedulerAtom soundAtom)
Exlicitly update the sound parameters associated with a sample |
(package private) void |
updateAuralAttribs(AuralAttributesRetained attribs)
Send current aural attributes to audio device Note that a AA's dirtyFlag is clear only after parameters are sent to audio device. |
(package private) void |
updateSoundParams(boolean updateAll,
SoundSchedulerAtom soundAtom,
AuralAttributesRetained attribs)
|
(package private) void |
updateTransformChange(UpdateTargets targets,
long referenceTime)
|
(package private) void |
updateTransformedFields(SoundRetained mirSound)
|
(package private) void |
updateXformedParams(boolean updateAll,
SoundSchedulerAtom soundAtom)
Update VirtualWorld local transform, sound position and direction. |
Methods inherited from class javax.media.j3d.J3dStructure |
---|
addMessage, clearMessages, getMessages, getNumMessage, getUpdateThreadData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
View view
boolean ready
ViewPlatformRetained viewPlatform
GraphicsContext3D graphicsCtx
AuralAttributesRetained lastAA
boolean resetAA
AudioDevice audioDevice
AudioDevice3D audioDevice3D
AudioDevice3DL2 audioDevice3DL2
int totalChannels
SoundscapeRetained[] intersectedSoundscapes
Bounds[] intersectedRegions
Bounds region
java.util.ArrayList prioritizedSounds
int nRetainedSounds
int nImmedSounds
AuralAttributesRetained aaRetained
boolean transformMsg
UpdateTargets targets
AuralAttributesRetained aaImmed
static final int EAR_POSITIONS_CHANGED
static final int EYE_POSITIONS_CHANGED
static final int IMAGE_PLATE_TO_VWORLD_CHANGED
static final int HEAD_TO_VWORLD_CHANGED
static final int LISTENER_CHANGED
private int listenerUpdated
private boolean positionalSoundUpdated
private boolean auralAttribsChanged
private boolean stallThread
int lastEventReceived
static final boolean debugFlag
static final boolean internalErrors
Constructor Detail |
---|
SoundScheduler(VirtualUniverse u, View v)
Method Detail |
---|
void processMessages(long referenceTime)
J3dStructure
processMessages
in class J3dStructure
void insertNodes(J3dMessage m)
void addSound(SoundRetained sound)
void removeNodes(J3dMessage m)
removeNodes
in class J3dStructure
void deleteSound(SoundRetained sound)
void changeNodeAttrib(J3dMessage m)
void changeNodeState(J3dMessage m)
void shuffleSound(SoundRetained sound)
void loadSound(SoundRetained sound, boolean forceReload)
void enableSound(SoundRetained sound)
void muteSound(SoundRetained sound)
void pauseSound(SoundRetained sound)
void processImmediateNodes(java.lang.Object[] args, long referenceTime)
void updateTransformChange(UpdateTargets targets, long referenceTime)
void updateTransformedFields(SoundRetained mirSound)
void activate()
void deactivate()
boolean checkState()
void reset()
void receiveAWTEvent(java.awt.AWTEvent evt)
void renderChanges()
int prioritizeSounds()
void addPrioritizedSound(SoundRetained mirSound)
int findActiveSoundscapes()
AuralAttributesRetained findClosestAAttribs(int nSelectedSScapes)
void updateAuralAttribs(AuralAttributesRetained attribs)
void processSoundAtom(SoundSchedulerAtom soundAtom)
int calcSchedulingAction()
void muteSilentSounds()
void muteSilentSound(SoundSchedulerAtom soundAtom)
long shortestTimeToFinish()
int performActions()
void render(boolean startFlag, SoundSchedulerAtom soundAtom, AuralAttributesRetained attribs)
void start(SoundSchedulerAtom soundAtom)
void update(SoundSchedulerAtom soundAtom)
void stopSound(SoundSchedulerAtom soundAtom, boolean setPending)
void deactivateAllSounds()
void pauseAllSounds()
void resumeAllSounds()
void stopAllSounds()
void stopAllSounds(boolean setPlayingSoundsPending)
void pause(SoundSchedulerAtom soundAtom)
void unpause(SoundSchedulerAtom soundAtom)
void turnOff(SoundSchedulerAtom soundAtom)
void updateXformedParams(boolean updateAll, SoundSchedulerAtom soundAtom)
void updateSoundParams(boolean updateAll, SoundSchedulerAtom soundAtom, AuralAttributesRetained attribs)
boolean checkAudioDevice3D()
void clearSoundData(SoundSchedulerAtom soundAtom)
void attachSoundData(SoundSchedulerAtom soundAtom, MediaContainer soundData, boolean forceReload)
soundData
- descrition of sound source dataSoundSchedulerAtom findSoundAtom(SoundRetained node, int nthInstance)
void setListenerFlag(int flag)
void clearListenerFlag()
boolean testListenerFlag()
void setAttribsDirtyFlag(SoundRetained node, int dirtyFlag)
void setStateDirtyFlag(SoundRetained node, int dirtyFlag)
void printAtomState(SoundSchedulerAtom atom)
void debugPrint(java.lang.String message)
void processViewSpecificGroupChanged(J3dMessage m)
void processBoundingLeafChanged(J3dMessage m)
void cleanup()
J3dStructure
cleanup
in class J3dStructure
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |