Java Doc for SoundScheduler.java in  » 6.0-JDK-Modules » java-3d » javax » media » j3d » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » java 3d » javax.media.j3d 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.media.j3d.J3dStructure
      javax.media.j3d.SoundScheduler

SoundScheduler
class SoundScheduler extends J3dStructure (Code)
This structure parallels the RenderBin structure and is used for sounds


Field Summary
final static  intEAR_POSITIONS_CHANGED
    
final static  intEYE_POSITIONS_CHANGED
    
final static  intHEAD_TO_VWORLD_CHANGED
    
final static  intIMAGE_PLATE_TO_VWORLD_CHANGED
    
final static  intLISTENER_CHANGED
    
 AuralAttributesRetainedaaImmed
    
 AuralAttributesRetainedaaRetained
    
 AudioDeviceaudioDevice
    
 AudioDevice3DaudioDevice3D
    
 AudioDevice3DL2audioDevice3DL2
    
final static  booleandebugFlag
    
 GraphicsContext3DgraphicsCtx
     The GraphicContext3D that we are currently unning in.
final static  booleaninternalErrors
    
 Bounds[]intersectedRegions
     Array of Bounds nodes for the corresponding intersectedSoundscapes array.
 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.
 AuralAttributesRetainedlastAA
     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.
 intlastEventReceived
    
 intnImmedSounds
    
 intnRetainedSounds
    
 ArrayListprioritizedSounds
     An array of prioritized sounds currently playing "live" sounds.
 booleanready
     This boolean tells the thread to suspend itself.
 Boundsregion
     Reference to last processed region within run().
 booleanresetAA
     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.
 UpdateTargetstargets
    
 inttotalChannels
    
 booleantransformMsg
    
 Viewview
    
 ViewPlatformRetainedviewPlatform
    

Constructor Summary
 SoundScheduler(VirtualUniverse u, View v)
    

Method Summary
 voidactivate()
    
 voidaddPrioritizedSound(SoundRetained mirSound)
    
 voidaddSound(SoundRetained sound)
     Add sound to sounds list.
 voidattachSoundData(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.
 intcalcSchedulingAction()
    
 voidchangeNodeAttrib(J3dMessage m)
    
 voidchangeNodeState(J3dMessage m)
    
 booleancheckAudioDevice3D()
    
 booleancheckState()
    
 voidcleanup()
    
 voidclearListenerFlag()
    
 voidclearSoundData(SoundSchedulerAtom soundAtom)
     Clears the fields associated with sample data for this sound.
 voiddeactivate()
    
synchronized  voiddeactivateAllSounds()
    
 voiddebugPrint(String message)
    
 voiddeleteSound(SoundRetained sound)
    
 voidenableSound(SoundRetained sound)
    
 intfindActiveSoundscapes()
     Process active Soundscapes (if there are any) and intersect these soundscapes with the viewPlatform.
 AuralAttributesRetainedfindClosestAAttribs(int nSelectedSScapes)
    
 SoundSchedulerAtomfindSoundAtom(SoundRetained node, int nthInstance)
    
 voidinsertNodes(J3dMessage m)
    
 voidloadSound(SoundRetained sound, boolean forceReload)
    
 voidmuteSilentSound(SoundSchedulerAtom soundAtom)
    
 voidmuteSilentSounds()
     Mute sounds that are to be played silently. Not all the sound in the prioritized enabled sound list may be able to be played.
 voidmuteSound(SoundRetained sound)
    
 voidpause(SoundSchedulerAtom soundAtom)
    
synchronized  voidpauseAllSounds()
    
 voidpauseSound(SoundRetained sound)
    
 intperformActions()
     Perform the scheduling action for each prioritized sound.
 voidprintAtomState(SoundSchedulerAtom atom)
    
 intprioritizeSounds()
    
 voidprocessBoundingLeafChanged(J3dMessage m)
    
 voidprocessImmediateNodes(Object[] args, long referenceTime)
    
 voidprocessMessages(long referenceTime)
    
 voidprocessSoundAtom(SoundSchedulerAtom soundAtom)
    
 voidprocessViewSpecificGroupChanged(J3dMessage m)
    
 voidreceiveAWTEvent(AWTEvent evt)
    
 voidremoveNodes(J3dMessage m)
    
 voidrender(boolean startFlag, SoundSchedulerAtom soundAtom, AuralAttributesRetained attribs)
    
 voidrenderChanges()
     The main loop for the Sound Scheduler.
synchronized  voidreset()
    
synchronized  voidresumeAllSounds()
    
 voidsetAttribsDirtyFlag(SoundRetained node, int dirtyFlag)
    
 voidsetListenerFlag(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.
 voidsetStateDirtyFlag(SoundRetained node, int dirtyFlag)
    
 longshortestTimeToFinish()
     Determine amount of time before next playing sound will be is complete. find the atom that has the least amount of time before is finished playing and return this time length of time in millisecond until the next active soundwill be complete.
 voidshuffleSound(SoundRetained sound)
    
 voidstart(SoundSchedulerAtom soundAtom)
    
synchronized  voidstopAllSounds()
    
synchronized  voidstopAllSounds(boolean setPlayingSoundsPending)
    
 voidstopSound(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.
 booleantestListenerFlag()
    
 voidturnOff(SoundSchedulerAtom soundAtom)
    
 voidunpause(SoundSchedulerAtom soundAtom)
    
 voidupdate(SoundSchedulerAtom soundAtom)
    
 voidupdateAuralAttribs(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.
 voidupdateSoundParams(boolean updateAll, SoundSchedulerAtom soundAtom, AuralAttributesRetained attribs)
    
 voidupdateTransformChange(UpdateTargets targets, long referenceTime)
    
 voidupdateTransformedFields(SoundRetained mirSound)
    
 voidupdateXformedParams(boolean updateAll, SoundSchedulerAtom soundAtom)
     Update VirtualWorld local transform, sound position and direction.

Field Detail
EAR_POSITIONS_CHANGED
final static int EAR_POSITIONS_CHANGED(Code)



EYE_POSITIONS_CHANGED
final static int EYE_POSITIONS_CHANGED(Code)



HEAD_TO_VWORLD_CHANGED
final static int HEAD_TO_VWORLD_CHANGED(Code)



IMAGE_PLATE_TO_VWORLD_CHANGED
final static int IMAGE_PLATE_TO_VWORLD_CHANGED(Code)



LISTENER_CHANGED
final static int LISTENER_CHANGED(Code)



aaImmed
AuralAttributesRetained aaImmed(Code)
Current active (selected) attribute node in the sceneGraph



aaRetained
AuralAttributesRetained aaRetained(Code)
Current active (selected) attribute node in the sceneGraph



audioDevice
AudioDevice audioDevice(Code)
Audio Device



audioDevice3D
AudioDevice3D audioDevice3D(Code)



audioDevice3DL2
AudioDevice3DL2 audioDevice3DL2(Code)



debugFlag
final static boolean debugFlag(Code)



graphicsCtx
GraphicsContext3D graphicsCtx(Code)
The GraphicContext3D that we are currently unning in.



internalErrors
final static boolean internalErrors(Code)



intersectedRegions
Bounds[] intersectedRegions(Code)
Array of Bounds nodes for the corresponding intersectedSoundscapes array. This array is used when selecting the closest Soundscape. This list is used when selecting the closest Soundscape. Maintained as an expandable array.



intersectedSoundscapes
SoundscapeRetained[] intersectedSoundscapes(Code)
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. Maintained as an expandable array.



lastAA
AuralAttributesRetained lastAA(Code)
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.



lastEventReceived
int lastEventReceived(Code)



nImmedSounds
int nImmedSounds(Code)
Current number of immediate mode sound nodes in the universe



nRetainedSounds
int nRetainedSounds(Code)
Current number of scene graph sound nodes in the universe



prioritizedSounds
ArrayList prioritizedSounds(Code)
An array of prioritized sounds currently playing "live" sounds. This prioritized sound list is NO longer re-create instead sounds are insert, shuffled or removed as messages are processed.



ready
boolean ready(Code)
This boolean tells the thread to suspend itself. This is true ONLY when everythings ready to render using run loop



region
Bounds region(Code)
Reference to last processed region within run(). Maintained to avoid re-transforming this bounds.



resetAA
boolean resetAA(Code)
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.



targets
UpdateTargets targets(Code)



totalChannels
int totalChannels(Code)



transformMsg
boolean transformMsg(Code)



view
View view(Code)
The View that owns this SoundScheduler



viewPlatform
ViewPlatformRetained viewPlatform(Code)
The ViewPlatform that is associated with this SoundScheduler




Constructor Detail
SoundScheduler
SoundScheduler(VirtualUniverse u, View v)(Code)
Constructs a new SoundScheduler




Method Detail
activate
void activate()(Code)



addPrioritizedSound
void addPrioritizedSound(SoundRetained mirSound)(Code)



addSound
void addSound(SoundRetained sound)(Code)
Add sound to sounds list.



attachSoundData
void attachSoundData(SoundSchedulerAtom soundAtom, MediaContainer soundData, boolean forceReload)(Code)
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. If an error in loading occurs (an exception is caught,...) an error is printed out to stderr - an exception is not thrown.
Parameters:
  soundData - descrition of sound source data



calcSchedulingAction
int calcSchedulingAction()(Code)
Determine scheduling action for each live sound



changeNodeAttrib
void changeNodeAttrib(J3dMessage m)(Code)



changeNodeState
void changeNodeState(J3dMessage m)(Code)



checkAudioDevice3D
boolean checkAudioDevice3D()(Code)
Check (and set if necessary) AudioDevice3D field



checkState
boolean checkState()(Code)



cleanup
void cleanup()(Code)



clearListenerFlag
void clearListenerFlag()(Code)



clearSoundData
void clearSoundData(SoundSchedulerAtom soundAtom)(Code)
Clears the fields associated with sample data for this sound. Assumes soundAtom is non-null, and that non-null atom would have non-null sound field.



deactivate
void deactivate()(Code)



deactivateAllSounds
synchronized void deactivateAllSounds()(Code)
Deactive all playing sounds If the sound is continuous thendSilence it but leave it playing otherwise stop sound



debugPrint
void debugPrint(String message)(Code)



deleteSound
void deleteSound(SoundRetained sound)(Code)



enableSound
void enableSound(SoundRetained sound)(Code)



findActiveSoundscapes
int findActiveSoundscapes()(Code)
Process active Soundscapes (if there are any) and intersect these soundscapes with the viewPlatform. Returns the number of soundscapes that intesect with view volume.



findClosestAAttribs
AuralAttributesRetained findClosestAAttribs(int nSelectedSScapes)(Code)



findSoundAtom
SoundSchedulerAtom findSoundAtom(SoundRetained node, int nthInstance)(Code)



insertNodes
void insertNodes(J3dMessage m)(Code)



loadSound
void loadSound(SoundRetained sound, boolean forceReload)(Code)



muteSilentSound
void muteSilentSound(SoundSchedulerAtom soundAtom)(Code)



muteSilentSounds
void muteSilentSounds()(Code)
Mute sounds that are to be played silently. Not all the sound in the prioritized enabled sound list may be able to be played. Due to low priority, some sounds must be muted/silenced (if such an action frees up channel resources) to make way for sounds with higher priority. For each sound in priority list: For sounds whose actions are X_SILENT: Mute sounds to be silenced Add the number of channels used by this muted sound to current total number of channels used For all remaining sounds (with actions other than above) The number of channels that 'would be used' to play potentially audible sounds is compared with the number left on the device: If this sound would use more channels than available Change it's X_AUDIBLE action to X_SILENT Mute sounds to be silenced Add the number of channels used by this sound, muted or not, to current total number of channels used NOTE: requests for sounds to play beyond channel capability of the audio device do NOT throw an exception when more sounds are started than can be played. Rather the unplayable sounds are muted. It is up to the AudioDevice3D implementation to determine how muted/silent sounds are implememted (playing with gain zero and thus using up channel resources, or stop and restarted with correct offset when inactivated then re-actived.



muteSound
void muteSound(SoundRetained sound)(Code)



pause
void pause(SoundSchedulerAtom soundAtom)(Code)
pause the sample associated with this sound



pauseAllSounds
synchronized void pauseAllSounds()(Code)
Pause all activity playing sounds



pauseSound
void pauseSound(SoundRetained sound)(Code)



performActions
int performActions()(Code)
Perform the scheduling action for each prioritized sound. Now, finally, the scheduling action value reflects what is requested and what is physically posible to perform. So, for each sound in list of prioritized enabled sounds, start/update sounds that are REALLY supposed to be either playing audibly or playing silently. number of active (audible and silent) sounds



printAtomState
void printAtomState(SoundSchedulerAtom atom)(Code)



prioritizeSounds
int prioritizeSounds()(Code)
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



processBoundingLeafChanged
void processBoundingLeafChanged(J3dMessage m)(Code)



processImmediateNodes
void processImmediateNodes(Object[] args, long referenceTime)(Code)



processMessages
void processMessages(long referenceTime)(Code)



processSoundAtom
void processSoundAtom(SoundSchedulerAtom soundAtom)(Code)



processViewSpecificGroupChanged
void processViewSpecificGroupChanged(J3dMessage m)(Code)



receiveAWTEvent
void receiveAWTEvent(AWTEvent evt)(Code)



removeNodes
void removeNodes(J3dMessage m)(Code)
Node removed from tree



render
void render(boolean startFlag, SoundSchedulerAtom soundAtom, AuralAttributesRetained attribs)(Code)
render (start or update) the oscillator associated with this sound



renderChanges
void renderChanges()(Code)
The main loop for the Sound Scheduler.



reset
synchronized void reset()(Code)



resumeAllSounds
synchronized void resumeAllSounds()(Code)
Resume playing all paused active sounds



setAttribsDirtyFlag
void setAttribsDirtyFlag(SoundRetained node, int dirtyFlag)(Code)
set dirty flags associated with SoundSchedulerAtom



setListenerFlag
void setListenerFlag(int flag)(Code)
'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. These methods specifically set/test/clear the local listenerUpdated flag.



setStateDirtyFlag
void setStateDirtyFlag(SoundRetained node, int dirtyFlag)(Code)



shortestTimeToFinish
long shortestTimeToFinish()(Code)
Determine amount of time before next playing sound will be is complete. find the atom that has the least amount of time before is finished playing and return this time length of time in millisecond until the next active soundwill be complete. Returns -1 if no sounds are playing (or all arecomplete).



shuffleSound
void shuffleSound(SoundRetained sound)(Code)



start
void start(SoundSchedulerAtom soundAtom)(Code)
Start the sample associated with this sound Do everything necessary to start the sound: set start time the oscillator associated with this sound



stopAllSounds
synchronized void stopAllSounds()(Code)
Stop all activity playing sounds



stopAllSounds
synchronized void stopAllSounds(boolean setPlayingSoundsPending)(Code)



stopSound
void stopSound(SoundSchedulerAtom soundAtom, boolean setPending)(Code)
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.



testListenerFlag
boolean testListenerFlag()(Code)



turnOff
void turnOff(SoundSchedulerAtom soundAtom)(Code)
stop the sample associated with this sound



unpause
void unpause(SoundSchedulerAtom soundAtom)(Code)



update
void update(SoundSchedulerAtom soundAtom)(Code)
Exlicitly update the sound parameters associated with a sample



updateAuralAttribs
void updateAuralAttribs(AuralAttributesRetained attribs)(Code)
Send current aural attributes to audio device Note that a AA's dirtyFlag is clear only after parameters are sent to audio device.



updateSoundParams
void updateSoundParams(boolean updateAll, SoundSchedulerAtom soundAtom, AuralAttributesRetained attribs)(Code)



updateTransformChange
void updateTransformChange(UpdateTargets targets, long referenceTime)(Code)



updateTransformedFields
void updateTransformedFields(SoundRetained mirSound)(Code)



updateXformedParams
void updateXformedParams(boolean updateAll, SoundSchedulerAtom soundAtom)(Code)
Update VirtualWorld local transform, sound position and direction. This is done dynamically from PointSoundRetained as these fields are updated (when soundAtom.status is AUDIBLE or SILENT), or by this. render() method when sound is started (sound.enabled is true). This method should only be called if mirror sound is a Point or ConeSound. Important: pre-transformed position and direction sent to AudioDevice.



Fields inherited from javax.media.j3d.J3dStructure
UnorderList messageList(Code)(Java Doc)
J3dMessage[] msgList(Code)(Java Doc)
int nMessage(Code)(Java Doc)
J3dThreadData threadData(Code)(Java Doc)
int threadType(Code)(Java Doc)
VirtualUniverse universe(Code)(Java Doc)
StructureUpdateThread updateThread(Code)(Java Doc)

Methods inherited from javax.media.j3d.J3dStructure
final void addMessage(J3dMessage message)(Code)(Java Doc)
abstract void cleanup()(Code)(Java Doc)
final void clearMessages()(Code)(Java Doc)
final J3dMessage[] getMessages(long referenceTime)(Code)(Java Doc)
int getNumMessage()(Code)(Java Doc)
final J3dThreadData getUpdateThreadData()(Code)(Java Doc)
abstract void processMessages(long referenceTime)(Code)(Java Doc)
abstract void removeNodes(J3dMessage m)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.