aboutsummaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-11-28 10:18:31 +0100
committerSven Gothel <[email protected]>2023-11-28 10:18:31 +0100
commit072c55ca78d57ce6cee44a83a78cffe1559f2b81 (patch)
tree34cc9e1ac115b44ddb69cfcb2f1e05652b99485a /make
parent316e80eaa678c9bf1b03685c081d48d2cf927f43 (diff)
parent0fde337685aa1feda82cc29ea852518135cb9eff (diff)
Merge remote-tracking branch 'Mathieu_Fery/1475-devices-specifiers'
Diffstat (limited to 'make')
-rw-r--r--make/config/joal-alc-CustomJavaCode.java19
-rw-r--r--make/config/joal-alc-impl-CustomCCode.c12
2 files changed, 30 insertions, 1 deletions
diff --git a/make/config/joal-alc-CustomJavaCode.java b/make/config/joal-alc-CustomJavaCode.java
index be28d8c..6615c01 100644
--- a/make/config/joal-alc-CustomJavaCode.java
+++ b/make/config/joal-alc-CustomJavaCode.java
@@ -1,3 +1,18 @@
+/** Specify if ALC_ENUMERATION_EXT is present */
+public boolean aclEnumerationExtIsPresent();
+
+/** Specify if ALC_ENUMERATE_ALL_EXT is present */
+public boolean aclEnumerateAllExtIsPresent();
+
+/** Specify if call of alGetString(device, param) must
+ must retrun a double null terminted string */
+public boolean alcIsDoubleNullTerminatedString(final com.jogamp.openal.ALCdevice device, final int param);
+
+/** Fetches all values of device and param supplied from result of call to alcGetString
+ Each value is extracted from string because is a string double null terminated
+ Equivalent to the C call alcGetString(device, param). */
+public java.lang.String[] alcGetStringAsDoubleNullTerminatedString(final com.jogamp.openal.ALCdevice device, final int param);
+
/** Fetches the names of the available ALC device specifiers.
Equivalent to the C call alcGetString(NULL, ALC_DEVICE_SPECIFIER). */
public java.lang.String[] alcGetDeviceSpecifiers();
@@ -5,3 +20,7 @@ public java.lang.String[] alcGetDeviceSpecifiers();
/** Fetches the names of the available ALC capture device specifiers.
Equivalent to the C call alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER). */
public java.lang.String[] alcGetCaptureDeviceSpecifiers();
+
+/** Fetches the names of the available ALC all capture device specifiers.
+ Equivalent to the C call alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER). */
+public java.lang.String[] alcGetAllDeviceSpecifiers();
diff --git a/make/config/joal-alc-impl-CustomCCode.c b/make/config/joal-alc-impl-CustomCCode.c
index 9207210..bd4a57a 100644
--- a/make/config/joal-alc-impl-CustomCCode.c
+++ b/make/config/joal-alc-impl-CustomCCode.c
@@ -1,6 +1,16 @@
+#include <stdbool.h>
+
+bool alc_is_double_null_terminated_string(ALCdevice *device, int param) {
+ return device == NULL && (
+ param == ALC_DEVICE_SPECIFIER ||
+ param == ALC_CAPTURE_DEVICE_SPECIFIER ||
+ param == ALC_ALL_DEVICES_SPECIFIER
+ );
+}
+
int strlen_alc(ALCdevice *device, int param, const char* str) {
int len = 0;
- if ((device == NULL) && (param == ALC_DEVICE_SPECIFIER)) {
+ if (alc_is_double_null_terminated_string(device, param)) {
while (*str != 0) {
while (*str != 0) {
++str;