From 6d72727f0a7f8f1ca971c4eb4d7bc87a5c11fa80 Mon Sep 17 00:00:00 2001 From: Brian Matzon Date: Wed, 14 Jul 2010 13:12:24 +0000 Subject: [PATCH] OAL patches by Ciardhubh --- src/java/org/lwjgl/openal/ALC11.java | 3 +++ .../org/lwjgl/test/openal/OpenALInfo.java | 2 +- src/native/common/org_lwjgl_openal_ALC10.c | 13 +++++++--- src/templates/org/lwjgl/openal/AL10.java | 25 +++++++------------ 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/java/org/lwjgl/openal/ALC11.java b/src/java/org/lwjgl/openal/ALC11.java index 9b0bf098..8aff08d0 100644 --- a/src/java/org/lwjgl/openal/ALC11.java +++ b/src/java/org/lwjgl/openal/ALC11.java @@ -59,6 +59,9 @@ public final class ALC11 { public static final int ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER = 0x311; public static final int ALC_CAPTURE_SAMPLES = 0x312; + public static final int ALC_MONO_SOURCES = 0x1010; + public static final int ALC_STEREO_SOURCES = 0x1011; + /** * The alcCaptureOpenDevice function allows the application to connect to a capture * device. To obtain a list of all available capture devices, use getCaptureDevices a list of all diff --git a/src/java/org/lwjgl/test/openal/OpenALInfo.java b/src/java/org/lwjgl/test/openal/OpenALInfo.java index ed22b3f1..3c1dc482 100644 --- a/src/java/org/lwjgl/test/openal/OpenALInfo.java +++ b/src/java/org/lwjgl/test/openal/OpenALInfo.java @@ -191,7 +191,7 @@ public class OpenALInfo { effects.put("Compressor", new Integer(EFX10.AL_EFFECT_COMPRESSOR)); effects.put("Equalizer", new Integer(EFX10.AL_EFFECT_EQUALIZER)); - entries = filters.entrySet(); + entries = effects.entrySet(); for(Iterator i = entries.iterator(); i.hasNext();) { Map.Entry entry = (Entry) i.next(); int value = ((Integer)entry.getValue()).intValue(); diff --git a/src/native/common/org_lwjgl_openal_ALC10.c b/src/native/common/org_lwjgl_openal_ALC10.c index cbf9db39..8317d1ed 100644 --- a/src/native/common/org_lwjgl_openal_ALC10.c +++ b/src/native/common/org_lwjgl_openal_ALC10.c @@ -86,7 +86,7 @@ static jstring JNICALL Java_org_lwjgl_openal_ALC10_nalcGetString (JNIEnv *env, j int length; int i=1; - if(alcString == NULL) { + if (alcString == NULL) { return NULL; } @@ -94,14 +94,21 @@ static jstring JNICALL Java_org_lwjgl_openal_ALC10_nalcGetString (JNIEnv *env, j // These are encoded using \0 between elements and a finishing \0\0 switch(token) { case 0x1005: // ALC_DEVICE_SPECIFIER - case 0x310: // ALC_CAPTURE_DEVICE_SPECIFIER + case 0x310: // ALC_CAPTURE_DEVICE_SPECIFIER + // If deviceaddress is not 0, OpenAL returns a single device terminated by a + // single \0 character, if token is ALC_DEVICE_SPECIFIER or + // ALC_CAPTURE_DEVICE_SPECIFIER. + if (deviceaddress != 0) { + length = strlen(alcString); + break; + } case 0x1013: // ALC_ALL_DEVICES_SPECIFIER while (alcString[i - 1] != '\0' || alcString[i] != '\0') { i++; } length = i + 1; break; - default: + default: // e.g. ALC_DEFAULT_ALL_DEVICES_SPECIFIER length = strlen(alcString); } return NewStringNativeWithLength(env, alcString, length); diff --git a/src/templates/org/lwjgl/openal/AL10.java b/src/templates/org/lwjgl/openal/AL10.java index 761d273e..32910ee5 100644 --- a/src/templates/org/lwjgl/openal/AL10.java +++ b/src/templates/org/lwjgl/openal/AL10.java @@ -250,35 +250,28 @@ public interface AL10 { int AL_FREQUENCY = 0x2001; /** - * Sound buffers: frequency, in units of Hertz [Hz]. - * This is the number of samples per second. Half of the - * sample frequency marks the maximum significant - * frequency component. + * Sound buffers: The number of bits per sample for the + * data contained in the buffer. */ int AL_BITS = 0x2002; /** - * Sound buffers: frequency, in units of Hertz [Hz]. - * This is the number of samples per second. Half of the - * sample frequency marks the maximum significant - * frequency component. + * Sound buffers: The number of channels for the data + * contained in the buffer. */ int AL_CHANNELS = 0x2003; /** - * Sound buffers: frequency, in units of Hertz [Hz]. - * This is the number of samples per second. Half of the - * sample frequency marks the maximum significant - * frequency component. + * Sound buffers: Size in bytes of the buffer data. */ int AL_SIZE = 0x2004; /** - * Sound buffers: frequency, in units of Hertz [Hz]. - * This is the number of samples per second. Half of the - * sample frequency marks the maximum significant - * frequency component. + * @deprecated This token is a relict of the early OpenAL days and is + * no longer supported. Neither the OpenAL spec nor OpenAL Soft define + * it. */ + @Deprecated int AL_DATA = 0x2005; /**