fi.hut.tml.xsmiles.mlfc.aaml.nai
Class NativeAudioDirectX

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Canvas
          extended byfi.hut.tml.xsmiles.mlfc.aaml.nai.NativeAudioDirectX
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class NativeAudioDirectX
extends java.awt.Canvas

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
NativeAudioDirectX()
           
 
Method Summary
 float getAirAbsorption(int dso)
           
 float getDecayHFRatio(int dso)
           
 float getDecayTime(int dso)
           
 int getEnvironment(int dso)
           
 float getEnvironmentDiffusion(int dso)
           
 float getEnvironmentSize(int dso)
           
 java.lang.String getErrorMsg(int dso)
          Get Last Error Message.
 int getFlags(int dso)
           
 long getReflections(int dso)
           
 float getReflectionsDelay(int dso)
           
 long getReverb(int dso)
           
 float getReverbDelay(int dso)
           
 long getRoom(int dso)
          Get EAX values
 long getRoomHF(int dso)
           
 float getRoomRolloff(int dso)
           
 int init()
          Initialize audio lib.
 boolean isEAXAvailable(int dso)
          Check if EAX 2.0 is available.
 boolean isLibraryValid()
           
 boolean play(int dso, int id)
          Play audio.
 int prefetch(int dso, java.lang.String url)
          Prefetch audio, create buffers etc.
 boolean setAirAbsorption(int dso, float fValue)
           
 boolean setClipDecayHF(int dso, boolean bValue)
           
 boolean setDecayHFRatio(int dso, float fValue)
           
 boolean setDecayTime(int dso, float fValue)
           
 boolean setEnvironment(int dso, int dwValue)
           
 boolean setEnvironmentDiffusion(int dso, float fValue)
           
 boolean setEnvironmentParams(int dso, long lRoom, long lRoomHF, float flRoomRolloffFactor, float flDecayTime, float flDecayHFRatio, long lReflections, float flReflectionsDelay, long lReverb, float flReverbDelay, long dwEnvironment, float flEnvironmentSize, float flEnvironmentDiffusion, float flAirAbsorptionHF, long dwFlags)
          Set environment parameters.
 boolean setEnvironmentSize(int dso, float fValue)
           
 boolean setFlags(int dso, int dwValue)
           
 boolean setListenerParams(int dso, float x, float y, float z, float vx, float vy, float vz, float ofx, float ofy, float ofz, float otx, float oty, float otz, float distancefactor, float dopplerfactor, float rollofffactor)
          Set listener parameters.
 boolean setParams(int dso, int id, float x, float y, float z, float vx, float vy, float vz, float coneox, float coneoy, float coneoz, int coneOutVol, int insideConeAngle, float maxDist, float minDist, int mode, int outsideConeAngle, float freq, float vol, float pan, boolean loop)
          Set sound parameters.
 boolean setPosition(int dso, int id, float x, float y, float z)
          Set sound position.
 boolean setReflections(int dso, long lValue)
           
 boolean setReflectionsDelay(int dso, float fValue)
           
 boolean setReverb(int dso, long lValue)
           
 boolean setReverbDelay(int dso, float fValue)
           
 boolean setRoom(int dso, long lValue)
           
 boolean setRoomHF(int dso, long lValue)
           
 boolean setRoomRolloff(int dso, float fValue)
           
 boolean setScaleDecayTime(int dso, boolean bValue)
           
 boolean setScaleReflections(int dso, boolean bValue)
           
 boolean setScaleReflectionsDelay(int dso, boolean bValue)
           
 boolean setScaleReverb(int dso, boolean bValue)
           
 boolean setScaleReverbDelay(int dso, boolean bValue)
           
 boolean stop(int dso, int id)
          Stop audio.
 void terminate(int dso)
          Terminate audio lib.
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, paint, update
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NativeAudioDirectX

public NativeAudioDirectX()
Method Detail

isLibraryValid

public boolean isLibraryValid()

init

public int init()
Initialize audio lib.


prefetch

public int prefetch(int dso,
                    java.lang.String url)
Prefetch audio, create buffers etc.

Parameters:
dso - DirectSoundObject id, returned by init()
url - URL to be prefetched (currently, filename in local dir)
Returns:
Sound id - this id is used to play the sound.

play

public boolean play(int dso,
                    int id)
Play audio.

Parameters:
dso - DirectSoundObject id, returned by init()
id - audio id, returned by prefetch().

stop

public boolean stop(int dso,
                    int id)
Stop audio.

Parameters:
dso - DirectSoundObject id, returned by init()
id - audio id, returned by prefetch().

setPosition

public boolean setPosition(int dso,
                           int id,
                           float x,
                           float y,
                           float z)
Set sound position.

Parameters:
dso - DirectSoundObject id, returned by init()
id - audio id, returned by prefetch().

setParams

public boolean setParams(int dso,
                         int id,
                         float x,
                         float y,
                         float z,
                         float vx,
                         float vy,
                         float vz,
                         float coneox,
                         float coneoy,
                         float coneoz,
                         int coneOutVol,
                         int insideConeAngle,
                         float maxDist,
                         float minDist,
                         int mode,
                         int outsideConeAngle,
                         float freq,
                         float vol,
                         float pan,
                         boolean loop)
Set sound parameters.

Parameters:
dso - DirectSoundObject id, returned by init()
id - audio id, returned by prefetch().

setListenerParams

public boolean setListenerParams(int dso,
                                 float x,
                                 float y,
                                 float z,
                                 float vx,
                                 float vy,
                                 float vz,
                                 float ofx,
                                 float ofy,
                                 float ofz,
                                 float otx,
                                 float oty,
                                 float otz,
                                 float distancefactor,
                                 float dopplerfactor,
                                 float rollofffactor)
Set listener parameters.

Parameters:
dso - DirectSoundObject id, returned by init()

getErrorMsg

public java.lang.String getErrorMsg(int dso)
Get Last Error Message.


terminate

public void terminate(int dso)
Terminate audio lib.


isEAXAvailable

public boolean isEAXAvailable(int dso)
Check if EAX 2.0 is available. Returns valid values after init().


setEnvironmentParams

public boolean setEnvironmentParams(int dso,
                                    long lRoom,
                                    long lRoomHF,
                                    float flRoomRolloffFactor,
                                    float flDecayTime,
                                    float flDecayHFRatio,
                                    long lReflections,
                                    float flReflectionsDelay,
                                    long lReverb,
                                    float flReverbDelay,
                                    long dwEnvironment,
                                    float flEnvironmentSize,
                                    float flEnvironmentDiffusion,
                                    float flAirAbsorptionHF,
                                    long dwFlags)
Set environment parameters.

Parameters:
dso - DirectSoundObject id, returned by init()

getRoom

public long getRoom(int dso)
Get EAX values


getRoomHF

public long getRoomHF(int dso)

getRoomRolloff

public float getRoomRolloff(int dso)

getDecayTime

public float getDecayTime(int dso)

getDecayHFRatio

public float getDecayHFRatio(int dso)

getReflections

public long getReflections(int dso)

getReflectionsDelay

public float getReflectionsDelay(int dso)

getReverb

public long getReverb(int dso)

getReverbDelay

public float getReverbDelay(int dso)

getEnvironment

public int getEnvironment(int dso)

getEnvironmentSize

public float getEnvironmentSize(int dso)

getEnvironmentDiffusion

public float getEnvironmentDiffusion(int dso)

getAirAbsorption

public float getAirAbsorption(int dso)

getFlags

public int getFlags(int dso)

setRoom

public boolean setRoom(int dso,
                       long lValue)

setRoomHF

public boolean setRoomHF(int dso,
                         long lValue)

setRoomRolloff

public boolean setRoomRolloff(int dso,
                              float fValue)

setDecayTime

public boolean setDecayTime(int dso,
                            float fValue)

setDecayHFRatio

public boolean setDecayHFRatio(int dso,
                               float fValue)

setReflections

public boolean setReflections(int dso,
                              long lValue)

setReflectionsDelay

public boolean setReflectionsDelay(int dso,
                                   float fValue)

setReverb

public boolean setReverb(int dso,
                         long lValue)

setReverbDelay

public boolean setReverbDelay(int dso,
                              float fValue)

setEnvironment

public boolean setEnvironment(int dso,
                              int dwValue)

setEnvironmentSize

public boolean setEnvironmentSize(int dso,
                                  float fValue)

setEnvironmentDiffusion

public boolean setEnvironmentDiffusion(int dso,
                                       float fValue)

setAirAbsorption

public boolean setAirAbsorption(int dso,
                                float fValue)

setFlags

public boolean setFlags(int dso,
                        int dwValue)

setScaleDecayTime

public boolean setScaleDecayTime(int dso,
                                 boolean bValue)

setScaleReflections

public boolean setScaleReflections(int dso,
                                   boolean bValue)

setScaleReflectionsDelay

public boolean setScaleReflectionsDelay(int dso,
                                        boolean bValue)

setScaleReverb

public boolean setScaleReverb(int dso,
                              boolean bValue)

setScaleReverbDelay

public boolean setScaleReverbDelay(int dso,
                                   boolean bValue)

setClipDecayHF

public boolean setClipDecayHF(int dso,
                              boolean bValue)


X-Smiles 1.2