Aviatrix3D
2.0 Dev

org.j3d.aviatrix3d
Class AudioComponent

java.lang.Object
  extended byorg.j3d.aviatrix3d.SceneGraphObject
      extended byorg.j3d.aviatrix3d.NodeComponent
          extended byorg.j3d.aviatrix3d.AudioComponent
All Implemented Interfaces:
AudioSource
Direct Known Subclasses:
ByteAudioComponent

public abstract class AudioComponent
extends NodeComponent
implements AudioSource

Common representation of a component that contains source data to be used in audio.

Version:
$Revision: 1.5 $
Author:
Alan Hudson

Field Summary
protected  java.nio.ByteBuffer data
          Buffer to hold the data
protected  int format
          The format of the data.
protected  int frequency
          The frequency
protected  boolean loop
          Does the sample loop
protected  float pitch
          The pitch
 
Fields inherited from class org.j3d.aviatrix3d.NodeComponent
lastParent, liveCount, parentList
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_NOT_LIVE_MESSAGE, updateHandler, WRITE_TIMING_MSG
 
Fields inherited from interface org.j3d.aviatrix3d.AudioSource
FORMAT_MONO16, FORMAT_MONO8, FORMAT_SETERO8, FORMAT_STEREO16
 
Constructor Summary
AudioComponent()
          Constructs an Audio component with default values.
 
Method Summary
 void addUpdateListener(AudioUpdateListener l)
          Add a listener for audio change updates.
abstract  void clearLocalData()
          Clear local data stored in this node.
 int getBufferId(net.java.games.joal.AL al, int seq)
          Get a bufferId for a given seq and context.
 int getFormat()
          Get the format of this audio source.
 int getFrequency()
          Get the frequency of this sound source.
 boolean getLoop()
          Does the sample loop.
 float getPitch()
          The pitch to play the sound at.
 void removeUpdateListener(AudioUpdateListener l)
          Remove a listener for audio change updates.
protected  void sendAudioUpdate(int seq)
          Send off a audio update event.
protected  void sendParamUpdate()
          Send off a audio update event.
 void setLoop(boolean val)
          Does the sample loop.
 void setPitch(float val)
          The pitch to play the sound at.
 
Methods inherited from class org.j3d.aviatrix3d.NodeComponent
addParent, getParents, getRenderable, hasChanged, numParents, removeParent
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
checkForCyclicChild, checkForCyclicParent, dataChanged, getUserData, isLive, setLive, setUpdateHandler, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected java.nio.ByteBuffer data
Buffer to hold the data


format

protected int format
The format of the data. Defined in AudioSource


frequency

protected int frequency
The frequency


pitch

protected float pitch
The pitch


loop

protected boolean loop
Does the sample loop

Constructor Detail

AudioComponent

public AudioComponent()
Constructs an Audio component with default values.

Method Detail

getFormat

public int getFormat()
Get the format of this audio source. Defintions are provided in AudioSource.

Specified by:
getFormat in interface AudioSource
Returns:
the format.

getFrequency

public int getFrequency()
Get the frequency of this sound source.

Specified by:
getFrequency in interface AudioSource
Returns:
the format

getLoop

public boolean getLoop()
Does the sample loop.

Specified by:
getLoop in interface AudioSource
Returns:
TRUE if it loops.

getPitch

public float getPitch()
The pitch to play the sound at.

Specified by:
getPitch in interface AudioSource
Returns:
the pitch, (0 to 2)

setLoop

public void setLoop(boolean val)
Does the sample loop.

Returns:
TRUE if it loops.

setPitch

public void setPitch(float val)
The pitch to play the sound at.

Returns:
the pitch, (0 to 2)

getBufferId

public int getBufferId(net.java.games.joal.AL al,
                       int seq)
Get a bufferId for a given seq and context.

Specified by:
getBufferId in interface AudioSource
Parameters:
seq - The sequence number
Returns:
The bufferId.

addUpdateListener

public void addUpdateListener(AudioUpdateListener l)
Add a listener for audio change updates.

Parameters:
l - The listener instance to add

removeUpdateListener

public void removeUpdateListener(AudioUpdateListener l)
Remove a listener for audio change updates.

Parameters:
l - The listener instance to add

clearLocalData

public abstract void clearLocalData()
Clear local data stored in this node. Only data needed for OpenGL calls will be retained;


sendAudioUpdate

protected void sendAudioUpdate(int seq)
Send off a audio update event.

Parameters:
seq - The sample seq. Seq 0 means complete file. Streamed sources start at 1

sendParamUpdate

protected void sendParamUpdate()
Send off a audio update event.


Aviatrix3D
2.0 Dev

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