aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorMathieu Féry <[email protected]>2023-12-04 18:04:06 +0100
committerMathieu Féry <[email protected]>2023-12-05 13:55:50 +0100
commitb2ed5ecd2a675f132daea1594ac0b93fa9a09955 (patch)
treeb24fcd40f6e1b8bc93c911bf812e5a5b3d0db673 /src/java
parent41a2967c25a3be64733262eb8b1f1c6b23cfd1dc (diff)
feat(alext): Add ALC_SOFT_system_events inside JoalVersion.getALStrings if supported
Diffstat (limited to 'src/java')
-rw-r--r--src/java/com/jogamp/openal/JoalVersion.java22
-rw-r--r--src/java/jogamp/openal/ALCImpl.java5
2 files changed, 27 insertions, 0 deletions
diff --git a/src/java/com/jogamp/openal/JoalVersion.java b/src/java/com/jogamp/openal/JoalVersion.java
index 2181242..0de3687 100644
--- a/src/java/com/jogamp/openal/JoalVersion.java
+++ b/src/java/com/jogamp/openal/JoalVersion.java
@@ -35,6 +35,7 @@ import com.jogamp.common.util.VersionUtil;
import com.jogamp.common.util.JogampVersion;
import com.jogamp.openal.util.ALHelpers;
+import java.util.Map;
import java.util.jar.Manifest;
public class JoalVersion extends JogampVersion {
@@ -125,6 +126,7 @@ public class JoalVersion extends JogampVersion {
}
final AL al = ALFactory.getAL(); // valid after makeContextCurrent(..)
final ALVersion alv = new ALVersion(al);
+ final ALExt alExt = ALFactory.getALExt();
alv.toString(true, sb);
sb.append("AL_EXTENSIONS ").append(al.alGetString(ALConstants.AL_EXTENSIONS));
@@ -132,6 +134,7 @@ public class JoalVersion extends JogampVersion {
final boolean enumerationExtIsPresent = alc.alcEnumerationExtIsPresent();
final boolean enumerateAllExtIsPresent = alc.alcEnumerateAllExtIsPresent();
final String enumExtAvailInfo = "(enumExt[def "+enumerationExtIsPresent+", all "+enumerateAllExtIsPresent+"])";
+ final boolean softEventsIsPresent = alc.alcSoftSystemEventsIsPresent();
{
final int[] iversion = { 0, 0 };
alc.alcGetIntegerv(device, ALCConstants.ALC_MAJOR_VERSION, 1, iversion, 0);
@@ -159,6 +162,25 @@ public class JoalVersion extends JogampVersion {
sb.append("ALC_DEF_CAPTURE Unknown ").append(enumExtAvailInfo);
}
sb.append(Platform.getNewline());
+ sb.append(ALHelpers.ALC_SOFT_system_events).append(" ")
+ .append(softEventsIsPresent ? "supported" : "unsupported");
+ sb.append(Platform.getNewline());
+ if (softEventsIsPresent) {
+ for (final Map.Entry<String, Integer> event : Map.of(
+ "ALC_EVENT_TYPE_DEVICE_ADDED_SOFT", ALExtConstants.ALC_EVENT_TYPE_DEVICE_ADDED_SOFT,
+ "ALC_EVENT_TYPE_DEVICE_REMOVED_SOFT", ALExtConstants.ALC_EVENT_TYPE_DEVICE_REMOVED_SOFT,
+ "ALC_EVENT_TYPE_DEFAULT_DEVICE_CHANGED_SOFT", ALExtConstants.ALC_EVENT_TYPE_DEFAULT_DEVICE_CHANGED_SOFT
+ ).entrySet()) {
+ final int playbackSupported = alExt.alcEventIsSupportedSOFT(event.getValue(), ALExtConstants.ALC_PLAYBACK_DEVICE_SOFT);
+ sb.append(" ").append(event.getKey()).append(" event for playback devices is ")
+ .append(playbackSupported == ALExtConstants.ALC_EVENT_SUPPORTED_SOFT ? "supported" : "unsupported");
+ sb.append(Platform.getNewline());
+ final int captureSupported = alExt.alcEventIsSupportedSOFT(event.getValue(), ALExtConstants.ALC_CAPTURE_DEVICE_SOFT);
+ sb.append(" ").append(event.getKey()).append(" event for capture devices is ")
+ .append(captureSupported == ALExtConstants.ALC_EVENT_SUPPORTED_SOFT ? "supported" : "unsupported");
+ sb.append(Platform.getNewline());
+ }
+ }
}
if( null == initialContext ) {
diff --git a/src/java/jogamp/openal/ALCImpl.java b/src/java/jogamp/openal/ALCImpl.java
index 0e85780..4754e21 100644
--- a/src/java/jogamp/openal/ALCImpl.java
+++ b/src/java/jogamp/openal/ALCImpl.java
@@ -27,6 +27,11 @@ public class ALCImpl extends ALCAbstractImpl {
return alcIsExtensionPresent(null, ALHelpers.ALC_ENUMERATE_ALL_EXT);
}
+ @Override
+ public boolean alcSoftSystemEventsIsPresent() {
+ return alcIsExtensionPresent(null, ALHelpers.ALC_SOFT_system_events);
+ }
+
public boolean alcIsDoubleNullTerminatedString(final ALCdevice device, final int param) {
return ( null == device || 0 == device.getDirectBufferAddress() ) &&
( param == ALC_DEVICE_SPECIFIER ||