aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Féry <[email protected]>2023-11-14 09:37:58 +0100
committerMathieu Féry <[email protected]>2023-11-14 09:40:39 +0100
commit0fde337685aa1feda82cc29ea852518135cb9eff (patch)
tree16bb3939e828ab9cd1ee363e93dcbbea0069442b
parent9ac10deb2fa4e965222fb0dcd8d3e1dd136e5944 (diff)
feat(devices): Move ALC_EXT constant from ALCconstants into ALHelpers with other ALC_EXT names
-rw-r--r--make/config/joal-alc-constants-CustomJavaCode.java3
-rw-r--r--make/config/joal-alc-constants.cfg2
-rw-r--r--src/java/com/jogamp/openal/JoalVersion.java17
-rw-r--r--src/java/com/jogamp/openal/util/ALHelpers.java3
-rw-r--r--src/java/jogamp/openal/ALCImpl.java6
5 files changed, 16 insertions, 15 deletions
diff --git a/make/config/joal-alc-constants-CustomJavaCode.java b/make/config/joal-alc-constants-CustomJavaCode.java
deleted file mode 100644
index fe97124..0000000
--- a/make/config/joal-alc-constants-CustomJavaCode.java
+++ /dev/null
@@ -1,3 +0,0 @@
-public final java.lang.String ALC_ENUMERATION_EXT_NAME = "ALC_ENUMERATION_EXT";
-
-public final java.lang.String ALC_ENUMERATE_ALL_EXT_NAME = "ALC_ENUMERATE_ALL_EXT"; \ No newline at end of file
diff --git a/make/config/joal-alc-constants.cfg b/make/config/joal-alc-constants.cfg
index b58f700..83ea061 100644
--- a/make/config/joal-alc-constants.cfg
+++ b/make/config/joal-alc-constants.cfg
@@ -6,5 +6,3 @@ JavaClass ALCConstants
# Factor out the OpenAL constants into their own interface
IgnoreNot ^ALC_.+
-
-IncludeAs CustomJavaCode ALCConstants joal-alc-constants-CustomJavaCode.java
diff --git a/src/java/com/jogamp/openal/JoalVersion.java b/src/java/com/jogamp/openal/JoalVersion.java
index 4ae784b..6469189 100644
--- a/src/java/com/jogamp/openal/JoalVersion.java
+++ b/src/java/com/jogamp/openal/JoalVersion.java
@@ -33,6 +33,7 @@ import com.jogamp.common.GlueGenVersion;
import com.jogamp.common.os.Platform;
import com.jogamp.common.util.VersionUtil;
import com.jogamp.common.util.JogampVersion;
+import com.jogamp.openal.util.ALHelpers;
import java.util.jar.Manifest;
@@ -138,16 +139,16 @@ public class JoalVersion extends JogampVersion {
sb.append(Platform.getNewline());
if (!enumerationExtIsPresent && !enumerateAllExtIsPresent) {
sb.append("ALC_DEF_OUTPUT Unknown (Missing "+
- ALCConstants.ALC_ENUMERATION_EXT_NAME+" and "+ALCConstants.ALC_ENUMERATE_ALL_EXT_NAME+")");
+ ALHelpers.ALC_ENUMERATION_EXT+" and "+ALHelpers.ALC_ENUMERATE_ALL_EXT+")");
sb.append(Platform.getNewline());
} else {
if (enumerationExtIsPresent) {
- sb.append("ALC_DEF_OUTPUT (With " + ALCConstants.ALC_ENUMERATION_EXT_NAME + ") ")
+ sb.append("ALC_DEF_OUTPUT (With " + ALHelpers.ALC_ENUMERATION_EXT + ") ")
.append(alc.alcGetString(device, ALCConstants.ALC_DEFAULT_DEVICE_SPECIFIER));
sb.append(Platform.getNewline());
}
if (enumerateAllExtIsPresent) {
- sb.append("ALC_DEF_OUTPUT (With " + ALCConstants.ALC_ENUMERATE_ALL_EXT_NAME + ") ")
+ sb.append("ALC_DEF_OUTPUT (With " + ALHelpers.ALC_ENUMERATE_ALL_EXT + ") ")
.append(alc.alcGetString(device, ALCConstants.ALC_DEFAULT_ALL_DEVICES_SPECIFIER));
sb.append(Platform.getNewline());
}
@@ -156,7 +157,7 @@ public class JoalVersion extends JogampVersion {
sb.append("ALC_DEF_CAPTURE ").append(alc.alcGetString(device, ALCConstants.ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER));
sb.append(Platform.getNewline());
} else {
- sb.append("ALC_DEF_CAPTURE Unknown (Missing "+ALCConstants.ALC_ENUMERATION_EXT_NAME+")");
+ sb.append("ALC_DEF_CAPTURE Unknown (Missing "+ALHelpers.ALC_ENUMERATION_EXT+")");
sb.append(Platform.getNewline());
}
}
@@ -270,11 +271,11 @@ public class JoalVersion extends JogampVersion {
public static void devicesToString(final StringBuilder sb, final ALC alc, final boolean enumerationExtIsPresent, final boolean enumerateAllExtIsPresent) {
if (!enumerationExtIsPresent && !enumerateAllExtIsPresent) {
sb.append("No output devices infos available (Missing "+
- ALCConstants.ALC_ENUMERATION_EXT_NAME+" and "+ALCConstants.ALC_ENUMERATE_ALL_EXT_NAME+")");
+ ALHelpers.ALC_ENUMERATION_EXT+" and "+ALHelpers.ALC_ENUMERATE_ALL_EXT+")");
} else {
if (enumerateAllExtIsPresent) {
final String defOutAllDeviceName = alc.alcGetString(null, ALCConstants.ALC_DEFAULT_ALL_DEVICES_SPECIFIER);
- sb.append("Output devices (With " + ALCConstants.ALC_ENUMERATE_ALL_EXT_NAME + "):" + System.lineSeparator());
+ sb.append("Output devices (With " + ALHelpers.ALC_ENUMERATE_ALL_EXT + "):" + System.lineSeparator());
{
final String[] outDevices = alc.alcGetAllDeviceSpecifiers();
if (null != outDevices) {
@@ -286,7 +287,7 @@ public class JoalVersion extends JogampVersion {
}
if (enumerationExtIsPresent) {
final String defOutDeviceName = alc.alcGetString(null, ALCConstants.ALC_DEFAULT_DEVICE_SPECIFIER);
- sb.append("Output devices (With " + ALCConstants.ALC_ENUMERATION_EXT_NAME + "):" + System.lineSeparator());
+ sb.append("Output devices (With " + ALHelpers.ALC_ENUMERATION_EXT + "):" + System.lineSeparator());
{
final String[] outDevices = alc.alcGetDeviceSpecifiers();
if (null != outDevices) {
@@ -298,7 +299,7 @@ public class JoalVersion extends JogampVersion {
}
}
if (!enumerationExtIsPresent) {
- sb.append("No capture devices infos available (Missing " + ALCConstants.ALC_ENUMERATION_EXT_NAME + ")");
+ sb.append("No capture devices infos available (Missing " + ALHelpers.ALC_ENUMERATION_EXT + ")");
} else {
final String defInDeviceName = alc.alcGetString(null, ALCConstants.ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER);
sb.append("Capture devices:" + System.lineSeparator());
diff --git a/src/java/com/jogamp/openal/util/ALHelpers.java b/src/java/com/jogamp/openal/util/ALHelpers.java
index 93dfa6e..fda3167 100644
--- a/src/java/com/jogamp/openal/util/ALHelpers.java
+++ b/src/java/com/jogamp/openal/util/ALHelpers.java
@@ -52,6 +52,9 @@ public class ALHelpers {
public static final String ALC_EXT_thread_local_context = "ALC_EXT_thread_local_context";
+ public static final String ALC_ENUMERATION_EXT = "ALC_ENUMERATION_EXT";
+ public static final String ALC_ENUMERATE_ALL_EXT = "ALC_ENUMERATE_ALL_EXT";
+
/**
* Returns a compatible {@link AudioFormat} based on given OpenAL channel-layout, sample-type and format,
* as well as the generic sample-rate and sample-size.
diff --git a/src/java/jogamp/openal/ALCImpl.java b/src/java/jogamp/openal/ALCImpl.java
index bdd0a8a..f08541c 100644
--- a/src/java/jogamp/openal/ALCImpl.java
+++ b/src/java/jogamp/openal/ALCImpl.java
@@ -7,6 +7,8 @@ import com.jogamp.common.nio.Buffers;
import com.jogamp.openal.ALCConstants;
import com.jogamp.openal.ALException;
import com.jogamp.openal.ALCdevice;
+import com.jogamp.openal.util.ALHelpers;
+
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
@@ -17,11 +19,11 @@ import java.util.ArrayList;
*/
public class ALCImpl extends ALCAbstractImpl {
public boolean aclEnumerationExtIsPresent() {
- return alcIsExtensionPresent(null, ALCConstants.ALC_ENUMERATION_EXT_NAME);
+ return alcIsExtensionPresent(null, ALHelpers.ALC_ENUMERATION_EXT);
}
public boolean aclEnumerateAllExtIsPresent() {
- return alcIsExtensionPresent(null, ALCConstants.ALC_ENUMERATE_ALL_EXT_NAME);
+ return alcIsExtensionPresent(null, ALHelpers.ALC_ENUMERATE_ALL_EXT);
}
public boolean alcIsDoubleNullTerminatedString(final ALCdevice device, final int param) {