From: Brian M. <ma...@us...> - 2002-08-19 01:10:05
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory usw-pr-cvs1:/tmp/cvs-serv30949 Modified Files: CoreAL.java Log Message: add: more al methods (work in progress) Index: CoreAL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/CoreAL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/CoreAL.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- CoreAL.java 15 Aug 2002 15:14:42 -0000 1.3 +++ CoreAL.java 19 Aug 2002 01:10:00 -0000 1.4 @@ -47,11 +47,58 @@ } /** - * Retrieve the current error state and then clears the error state. + * Enables a feature of the OpenAL driver. * - * @return current error state + * @param capability name of a capability to enable */ - public native int getError(); + public native void enable(int capability); + + /** + * Disables a feature of the OpenAL driver. + * + * @param capability name of a capability to disable + */ + public native void disable(int capability); + + /** + * Checks if a specific feature is enabled in the OpenAL driver. + * + * @param capability name of a capability to check + * @return true if named feature is enabled + */ + public native boolean isEnabled(int capability); + + /** + * Returns a boolean OpenAL state. + * + * @param parameter state to be queried + * @return boolean state described by pname will be returned. + */ + public native boolean getBoolean(int pname); + + /** + * Returns an int OpenAL state. + * + * @param parameter state to be queried + * @return int state described by pname will be returned. + */ + public native int getInteger(int pname); + + /** + * Returns a float OpenAL state. + * + * @param parameter state to be queried + * @return float state described by pname will be returned. + */ + public native float getFloat(int pname); + + /** + * Returns a double OpenAL state. + * + * @param parameter state to be queried + * @return double state described by pname will be returned. + */ + public native double getDouble(int pname); /** * Retrieve an OpenAL string property. @@ -59,15 +106,80 @@ * @param param The property to be returned * @return OpenAL String property */ - public native String getString(int param); + public native String getString(int param); /** - * Generate one or more buffers. + * Retrieve the current error state and then clears the error state. * - * @param n number of buffers to generate - * @param buffers array holding buffers + * @return current error state */ - public native void genBuffers(int n, int[] buffers); + public native int getError(); + + /** + * Test if a specific extension is available for the OpenAL driver. + * + * @param fname String describing the desired extension + * @return true if extension is available, false if not + */ + public native boolean isExtensionPresent(String fname); + + /** + * Returns the address of an OpenAL extension function. + * + * @param fname String containing the function name + * @return int specifying offset of extension + */ + public native int getProcAddress(String fname); + + /** + * Returns the enumeration value of an OpenAL enum described by a string. + * + * @param ename String describing an OpenAL enum + * @return Actual int for the described enumeration name + */ + public native int getEnumValue(String ename); + + /** + * Sets an integer property of the listener + * + * @param pname name of the attribute to be set + * @param integer value to set the attribute to + */ + public native void listeneri(int pname, int value); + + /** + * Sets a floating point property of the listener + * + * @param pname name of the attribute to be set + * @param value floating point value to set the attribute to + */ + public native void listenerf(int pname, float value); + + /** + * Sets a floating point property of the listener + * + * @param pname name of the attribute to be set + * @param v1 value value 1 + * @param v2 value value 2 + * @param v3 float value 3 + */ + public native void listener3f(int pname, float v1, float v2, float v3); + + /** + * Gets an integer property of the listener. + * + * @param pname name of the attribute to be retrieved + * @return integer value of property + */ + public native int getListeneri(int pname); + + /** + * Gets a floating point property of the listener. + * + * @param pname name of the attribute to be retrieved + * @return floating point value of property + */ + public native float getListenerf(int pname); /** * Generate one or more sources. @@ -76,17 +188,22 @@ * @param sources array holding sources */ public native void genSources(int n, int[] sources); - + /** - * Fill a buffer with audio data. + * Delete one or more sources. * - * @param buffer Buffer to fill - * @param format format sound data is in - * @param data location of data (pointer) - * @param size size of data segment - * @param freq frequency of data + * @param n Number of sources to delete + * @param source Source array to delete from */ - public native void bufferData(int buffer, int format, int data, int size, int freq); + public native void deleteSources(int n, int[] source); + + /** + * Tests if a source is valid. + * + * @param id id of source to be testes for validity + * @return true if id is valid, false if not + */ + public native boolean isSource(int id); /** * Set an integer property of a source. @@ -98,11 +215,88 @@ public native void sourcei(int source, int param, int value); /** + * Set a floating point property of a source. + * + * @param source Source to det property on + * @param param property to set + * @param value value of property + */ + public native void sourcef(int source, int param, float value); + + /** + * Sets a source property requiring three floating point values. + * + * @param source Source to det property on + * @param param property to set + * @param v1 value 1 of property + * @param v2 value 2 of property + * @param v3 value 3 of property + */ + public native void source3f(int source, int param, float v1, float v2, float v3); + + /** + * Retrieves an integer property of a source. + * + * @param source source to get property from + * @param pname name of property + * @return integer value of pname + */ + public native int getSourcei(int source, int param); + + /** + * Retrieves a floating point property of a source. + * + * @param source source to get property from + * @param pname name of property + * @return integer value of pname + */ + public native float getSourcef(int source, int param); + + /** + * Plays a set of sources. + * + * @param n number of sources to play + * @param source array of sources to play + */ + public native void sourcePlayv(int n, int[] sources); + + /** + * Pauses a set of sources. + * + * @param n number of sources to pause + * @param source array of sources to pause + */ + public native void sourcePausev(int n, int[] sources); + + /** + * Stops a set of sources. + * + * @param n number of sources to stop + * @param source array of sources to stop + */ + public native void sourceStopv(int n, int[] sources); + + /** + * Rewinds a set of sources. + * + * @param n number of sources to rewind + * @param source array of sources to rewind + */ + public native void sourceRewindv(int n, int[] sources); + + /** * Play a source. * * @param source Source to play */ public native void sourcePlay(int source); + + /** + * Pauses a source. + * + * @param source Source to pause + */ + public native void sourcePause(int source); /** * Stops a source. @@ -112,13 +306,19 @@ public native void sourceStop(int source); /** - * Delete one or more sources. + * Rewinds a source. * - * @param n Number of sources to delete - * @param source Source array to delete from + * @param source Source to rewind + */ + public native void sourceRewind(int source); + + /** + * Generate one or more buffers. + * + * @param n number of buffers to generate + * @param buffers array holding buffers */ - public native void deleteSources(int n, int[] source); - + public native void genBuffers(int n, int[] buffers); /** * Delete one or more buffers. @@ -126,5 +326,79 @@ * @param n Number of buffers to delete * @param buffers Buffer array to delete from */ - public native void deleteBuffers(int n, int[] buffers); + public native void deleteBuffers(int n, int[] buffers); + + /** + * Tests if buffer is valid. + * + * @param buffer buffer to be tested for validity + * @return true if supplied buffer is valid, false if not + */ + public native boolean isBuffer(int buffer); + + /** + * Fill a buffer with audio data. + * + * @param buffer Buffer to fill + * @param format format sound data is in + * @param data location of data (pointer) + * @param size size of data segment + * @param freq frequency of data + */ + public native void bufferData(int buffer, int format, int data, int size, int freq); + + /** + * Queues a set of buffers on a source. + * + * @param source source to queue buffers onto + * @param n number of buffers to be queued + * @param buffers buffers to be queued + */ + public native void sourceQueueBuffers(int source, int n, int[] buffers); + + /** + * Unqueues a set of buffers attached to a source. + * + * @param source source to unqueue buffers from + * @param n number of buffers to be unqueued + * @param buffers buffers to be unqueued + */ + public native void sourceUnqueueBuffers(int source, int n, int[] buffers); + + /** + * Selects the OpenAL distance model. + * + * @param value distance model to be set + */ + public native void distanceModel(int value); + + /** + * Selects the OpenAL Doppler factor value. + * + * @param value Doppler scale value to set + */ + public native void dopplerFactor(float value); + + /** + * Selects the OpenAL Doppler velocity value. + * + * @param value Doppler velocity value to set + */ + public native void dopplerVelocity(float value); + + //non implemented methods: + //=========================================== + //public native void getBooleanv(int pname, boolean* data); + //public native void fetIntegerv(int pname, int* data); + //public native void getFloatv(int pname, float* data); + //public native void getDoublev(int pname, double* data); + //public native float listenerfv(int pname, float* values); + //public native void getListener3f(int pname, ALfloat* v1, ALfloat* v2, ALfloat* v3); + //public native void getListenerfv(int pname, ALfloat* values); + //public native void hint(int target, int mode); + //public native void sourcefv(int source, int param, ALfloat* values); + //public native void getSource3f(int source, int param, ALfloat* v1, ALfloat* v2, ALfloat* v3 ; + //public native void getSourcefv(int source, int param, ALfloat* values); + //public native void getBufferi(int buffer, int param, ALint* value); + //public native void getBufferf(int buffer, int param, ALfloat* value); } |