From 0fde337685aa1feda82cc29ea852518135cb9eff Mon Sep 17 00:00:00 2001 From: Mathieu Féry Date: Tue, 14 Nov 2023 09:37:58 +0100 Subject: feat(devices): Move ALC_EXT constant from ALCconstants into ALHelpers with other ALC_EXT names --- src/java/com/jogamp/openal/JoalVersion.java | 17 +++++++++-------- src/java/com/jogamp/openal/util/ALHelpers.java | 3 +++ 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'src/java/com/jogamp/openal') 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. -- cgit v1.2.3