Aviatrix3D
2.1.0

org.j3d.aviatrix3d.output.audio
Class OpenALAudioDevice

java.lang.Object
  extended by org.j3d.aviatrix3d.output.audio.OpenALAudioDevice
All Implemented Interfaces:
AudioOutputDevice, OutputDevice

public class OpenALAudioDevice
extends java.lang.Object
implements AudioOutputDevice

Implementation of the most basic audio device, supporting the minimal number of features using OpenAL.

Version:
$Revision: 2.14 $
Author:
Alan Hudson

Field Summary
protected  RenderableRequestData otherDataRequests
          Request object for deletions, shader stuff etc
 
Constructor Summary
OpenALAudioDevice()
          Construct a surface that requires the given set of capabilities.
 
Method Summary
 void dispose()
          Instruct this surface that you have finished with the resources needed and to dispose all rendering resources.
 void disposeSingleThreadResources()
          If the output device is marked as single threaded, this instructs the device that the current rendering thread has exited.
 boolean draw(ProfilingData profilingData)
          Instruct the surface to draw the collected set of nodes now.
 void enableSingleThreaded(boolean state)
          Notification that this surface is being drawn to with a single thread.
 java.lang.Object getSurfaceObject()
          Get the underlying object that this surface is rendered to.
 boolean isDisposed()
          Check to see the disposal state of the surface.
 void setDrawableObjects(RenderableRequestData otherData, AudioInstructions commands)
          Update the list of items to be rendered to the current list.
 void setErrorReporter(org.j3d.util.ErrorReporter reporter)
          Register an error reporter with the engine so that any errors generated by the node's internals can be reported in a nice, pretty fashion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

otherDataRequests

protected RenderableRequestData otherDataRequests
Request object for deletions, shader stuff etc

Constructor Detail

OpenALAudioDevice

public OpenALAudioDevice()
Construct a surface that requires the given set of capabilities.

Method Detail

setDrawableObjects

public void setDrawableObjects(RenderableRequestData otherData,
                               AudioInstructions commands)
Update the list of items to be rendered to the current list. Draw them at the next oppourtunity.

Specified by:
setDrawableObjects in interface AudioOutputDevice
Parameters:
otherData - data to be processed before the rendering
commands - The list of drawable surfaces to render

setErrorReporter

public void setErrorReporter(org.j3d.util.ErrorReporter reporter)
Register an error reporter with the engine so that any errors generated by the node's internals can be reported in a nice, pretty fashion. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.

Specified by:
setErrorReporter in interface OutputDevice
Parameters:
reporter - The instance to use or null

draw

public boolean draw(ProfilingData profilingData)
Instruct the surface to draw the collected set of nodes now. The registered view environment is used to draw to this surface. If no view is registered, the surface is cleared and then this call is exited. The drawing surface does not swap the buffers at this point.

The return value indicates success or failure in the ability to render this frame. Typically it will indicate failure if the underlying surface has been disposed of, either directly through the calling of the method on this interface, or through an internal check mechanism. If failure is indicated, then check to see if the surface has been disposed of and discontinue rendering if it has.

Specified by:
draw in interface OutputDevice
Parameters:
profilingData - The timing and load data
Returns:
true if the drawing succeeded, or false if not

getSurfaceObject

public java.lang.Object getSurfaceObject()
Get the underlying object that this surface is rendered to. If it is a screen display device, the surface can be one of AWT Component or Swing JComponent. An off-screen buffer would be a form of AWT Image etc.

Specified by:
getSurfaceObject in interface OutputDevice
Returns:
The drawable surface representation

dispose

public void dispose()
Instruct this surface that you have finished with the resources needed and to dispose all rendering resources.

Specified by:
dispose in interface OutputDevice

isDisposed

public boolean isDisposed()
Check to see the disposal state of the surface. Will return true if the dispose() method has been called or an internal dispose handler has detected the underlying surface is no longer valid to draw to.

Specified by:
isDisposed in interface OutputDevice
Returns:
true if the surface is disposed and no longer usable

enableSingleThreaded

public void enableSingleThreaded(boolean state)
Notification that this surface is being drawn to with a single thread. This can be used to optmise internal state handling when needed in a single versus multithreaded environment.

This method should never be called by end user code. It is purely for the purposes of the RenderManager to inform the device about what state it can expect.

Specified by:
enableSingleThreaded in interface OutputDevice
Parameters:
state - true if the device can expect single threaded behaviour

disposeSingleThreadResources

public void disposeSingleThreadResources()
If the output device is marked as single threaded, this instructs the device that the current rendering thread has exited. Next time the draw method is called, a new rendering context will need to be created for a new incoming thread instance. Also, if any other per-thread resources are around, clean those up now. This is called just before that thread exits.

Specified by:
disposeSingleThreadResources in interface OutputDevice

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org