aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/openal
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-07-10 16:42:36 +0200
committerSven Gothel <[email protected]>2023-07-10 16:42:36 +0200
commit2d3237ef72a0ce908f1ca61e4f151e01dc8e27f3 (patch)
treefb2549d599cc5da899bc3149a0e52b6b04a376b7 /src/java/com/jogamp/openal
parent9eb33b0016e8f0781140a3b03509562cb6d95bc1 (diff)
AL_SOFT_events: Define 'ALCcontext` as `UserParam` type for more clarity
Diffstat (limited to 'src/java/com/jogamp/openal')
-rw-r--r--src/java/com/jogamp/openal/ALContextKey.java11
-rw-r--r--src/java/com/jogamp/openal/util/ALAudioSink.java4
2 files changed, 6 insertions, 9 deletions
diff --git a/src/java/com/jogamp/openal/ALContextKey.java b/src/java/com/jogamp/openal/ALContextKey.java
index 2e85a05..450c42b 100644
--- a/src/java/com/jogamp/openal/ALContextKey.java
+++ b/src/java/com/jogamp/openal/ALContextKey.java
@@ -43,15 +43,12 @@ public class ALContextKey {
private final int hashCodeValue;
/** Creates an instance using the current context as key. */
- public ALContextKey( final Object userParam ) {
- if( null == userParam ) {
- throw new IllegalArgumentException("userParam null");
- }
- if( !(userParam instanceof ALCcontext) ) {
- throw new IllegalArgumentException("userParam not ALCcontext but "+userParam.getClass());
+ public ALContextKey( final ALCcontext context ) {
+ if( null == context ) {
+ throw new IllegalArgumentException("null context");
}
// alCtx = alc.alcGetCurrentContext();
- alCtx = (ALCcontext) userParam;
+ alCtx = context;
if( null != alCtx ) {
nativeAddress = alCtx.getDirectBufferAddress();
hashCodeValue = HashUtil.getAddrHash32_EqualDist(nativeAddress);
diff --git a/src/java/com/jogamp/openal/util/ALAudioSink.java b/src/java/com/jogamp/openal/util/ALAudioSink.java
index e579084..21fcce9 100644
--- a/src/java/com/jogamp/openal/util/ALAudioSink.java
+++ b/src/java/com/jogamp/openal/util/ALAudioSink.java
@@ -785,9 +785,9 @@ public final class ALAudioSink implements AudioSink {
@SuppressWarnings("unused")
@Override
public void callback(final int eventType, final int object, final int param,
- final int length, final String message, final Object userParam) {
+ final int length, final String message, final ALCcontext context) {
if( false ) {
- final com.jogamp.openal.ALContextKey k = new com.jogamp.openal.ALContextKey(userParam);
+ final com.jogamp.openal.ALContextKey k = new com.jogamp.openal.ALContextKey(context);
System.err.println("ALAudioSink.Event: type "+toHexString(eventType)+", obj "+toHexString(object)+", param "+param+
", msg[len "+length+", val '"+message+"'], userParam "+k);
}