summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-07-10 17:01:27 +0200
committerMichael Bien <[email protected]>2010-07-10 17:01:27 +0200
commit728c9b6e348520d778009f42633ea9f6e0e782a1 (patch)
tree3083e40cb3ca80ad91a53b8dccd8afced4210e8b /src/java/com/jogamp
parentdcbe272c504e348f4479ffaaecb185c7a42caaa3 (diff)
EAXFactory initializes JOAL if nessesary.
Diffstat (limited to 'src/java/com/jogamp')
-rw-r--r--src/java/com/jogamp/openal/eax/EAX.java101
-rw-r--r--src/java/com/jogamp/openal/eax/EAXFactory.java93
2 files changed, 91 insertions, 103 deletions
diff --git a/src/java/com/jogamp/openal/eax/EAX.java b/src/java/com/jogamp/openal/eax/EAX.java
index 5f97d1b..45bdfe3 100644
--- a/src/java/com/jogamp/openal/eax/EAX.java
+++ b/src/java/com/jogamp/openal/eax/EAX.java
@@ -1,63 +1,58 @@
/**
-* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* -Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-*
-* -Redistribution in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-*
-* Neither the name of Sun Microsystems, Inc. or the names of contributors may
-* be used to endorse or promote products derived from this software without
-* specific prior written permission.
-*
-* This software is provided "AS IS," without a warranty of any kind.
-* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
-* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
-* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS
-* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
-* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
-* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
-* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
-* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
-* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-*
-* You acknowledge that this software is not designed or intended for use in the
-* design, construction, operation or maintenance of any nuclear facility.
-*/
-
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * -Redistribution of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * -Redistribution in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind.
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
+ * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS
+ * LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+ * IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+ * OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+ * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
+ * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use in the
+ * design, construction, operation or maintenance of any nuclear facility.
+ */
package com.jogamp.openal.eax;
import java.nio.Buffer;
-
/**
* @author Athomas Goldberg
*
*/
public class EAX implements EAXConstants {
- static {
- System.loadLibrary("joal");
- }
-
- public static final int SOURCE = 0;
- public static final int LISTENER = 1;
-
- private final int sourceGUID = SOURCE;
- private final int listenerGUID = LISTENER;
+
+ public static final int SOURCE = 0;
+ public static final int LISTENER = 1;
+
+ private final int sourceGUID;
+ private final int listenerGUID;
/**
* @param sourceGUID
* @param listenerGUID
*/
EAX(int sourceGUID, int listenerGUID) {
- // this.sourceGUID = sourceGUID;
- // this.listenerGUID = listenerGUID;
+ this.sourceGUID = sourceGUID;
+ this.listenerGUID = listenerGUID;
}
/**
@@ -72,13 +67,7 @@ public class EAX implements EAXConstants {
* @param value a direct Buffer to hold the value retrieved
* @param size the size of the Buffer
*/
- public native void EAXSet(
- int objectFlag,
- int pname,
- int source,
- Buffer value,
- int size
- );
+ public native void EAXSet(int objectFlag, int pname, int source, Buffer value, int size);
/**
* This method retrieves an EAX property value. <br>
@@ -91,14 +80,8 @@ public class EAX implements EAXConstants {
* @param source the ID of the source, or 0 for Listener properties
* @param value a direct Buffer to hold the value retrieved
* @param size the size of the Buffer
- */
- public native void EAXGet(
- int objectFlag,
- int pname,
- int source,
- Buffer value,
- int size
- );
+ */
+ public native void EAXGet(int objectFlag, int pname, int source, Buffer value, int size);
/**
* This method sets a source property.
diff --git a/src/java/com/jogamp/openal/eax/EAXFactory.java b/src/java/com/jogamp/openal/eax/EAXFactory.java
index 9aa2e9d..0e305a5 100644
--- a/src/java/com/jogamp/openal/eax/EAXFactory.java
+++ b/src/java/com/jogamp/openal/eax/EAXFactory.java
@@ -1,54 +1,59 @@
/**
-* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* -Redistribution of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-*
-* -Redistribution in binary form must reproduce the above copyright notice,
-* this list of conditions and the following disclaimer in the documentation
-* and/or other materials provided with the distribution.
-*
-* Neither the name of Sun Microsystems, Inc. or the names of contributors may
-* be used to endorse or promote products derived from this software without
-* specific prior written permission.
-*
-* This software is provided "AS IS," without a warranty of any kind.
-* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
-* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
-* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS
-* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
-* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
-* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
-* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
-* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
-* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-*
-* You acknowledge that this software is not designed or intended for use in the
-* design, construction, operation or maintenance of any nuclear facility.
-*/
-
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * -Redistribution of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * -Redistribution in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind.
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
+ * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS
+ * LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+ * IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+ * OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+ * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
+ * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use in the
+ * design, construction, operation or maintenance of any nuclear facility.
+ */
package com.jogamp.openal.eax;
+import com.jogamp.openal.ALFactory;
+
/**
* @author Athomas Goldberg
*
*/
public final class EAXFactory {
- private static int SOURCE_GUID;
- private static int LISTENER_GUID;
- private static EAX eax;
-
- private static native void init();
- public static EAX getEAX() {
- if(eax == null) {
- init();
- eax = new EAX(SOURCE_GUID, LISTENER_GUID);
- }
- return eax;
- }
+ static {
+ //initializes JOAL
+ ALFactory.getAL();
+ }
+
+ private static EAX eax;
+
+ private static native void init();
+
+ public static EAX getEAX() {
+ if (eax == null) {
+ init();
+ eax = new EAX(EAX.SOURCE, EAX.LISTENER);
+ }
+ return eax;
+ }
}