aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/openal/util
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-05-20 20:38:12 +0200
committerSven Gothel <[email protected]>2023-05-20 20:38:12 +0200
commit772cde0c3cc97a0c2a932f9398539500363f60c0 (patch)
tree72f09da84d329bb7eee38df41918df1135b706b7 /src/java/com/jogamp/openal/util
parent72b08cf8fbf51c1467975b9e1213e38a2c7a9516 (diff)
ALHelpers.getALFormat(..): Drop alGetEnumValue("type") and use 'type' via ALExtConstants directly: Fixes failing al.alGetEnumValue("AL_FORMAT_STEREO_DOUBLE")
al.alGetEnumValue("AL_FORMAT_STEREO_DOUBLE") failed w/ OpenAL-Soft, despite having AL_EXT_MCFORMATS, AL_EXT_FLOAT32 and AL_EXT_DOUBLE supported. Notable, al.alGetEnumValue("AL_FORMAT_MONO_FLOAT32") did work.
Diffstat (limited to 'src/java/com/jogamp/openal/util')
-rw-r--r--src/java/com/jogamp/openal/util/ALHelpers.java35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/java/com/jogamp/openal/util/ALHelpers.java b/src/java/com/jogamp/openal/util/ALHelpers.java
index 65869cc..a232fe3 100644
--- a/src/java/com/jogamp/openal/util/ALHelpers.java
+++ b/src/java/com/jogamp/openal/util/ALHelpers.java
@@ -313,13 +313,13 @@ public class ALHelpers {
else if( hasEXTMcFormats )
{
if(alChannelLayout == AL_QUAD_SOFT)
- format = al.alGetEnumValue("AL_FORMAT_QUAD8");
+ format = AL_FORMAT_QUAD8;
else if(alChannelLayout == AL_5POINT1_SOFT)
- format = al.alGetEnumValue("AL_FORMAT_51CHN8");
+ format = AL_FORMAT_51CHN8;
else if(alChannelLayout == AL_6POINT1_SOFT)
- format = al.alGetEnumValue("AL_FORMAT_61CHN8");
+ format = AL_FORMAT_61CHN8;
else if(alChannelLayout == AL_7POINT1_SOFT)
- format = al.alGetEnumValue("AL_FORMAT_71CHN8");
+ format = AL_FORMAT_71CHN8;
}
}
else if(alSampleType == AL_SHORT_SOFT)
@@ -331,39 +331,40 @@ public class ALHelpers {
else if( hasEXTMcFormats )
{
if(alChannelLayout == AL_QUAD_SOFT)
- format = al.alGetEnumValue("AL_FORMAT_QUAD16");
+ format = AL_FORMAT_QUAD16;
else if(alChannelLayout == AL_5POINT1_SOFT)
- format = al.alGetEnumValue("AL_FORMAT_51CHN16");
+ format = AL_FORMAT_51CHN16;
else if(alChannelLayout == AL_6POINT1_SOFT)
- format = al.alGetEnumValue("AL_FORMAT_61CHN16");
+ format = AL_FORMAT_61CHN16;
else if(alChannelLayout == AL_7POINT1_SOFT)
- format = al.alGetEnumValue("AL_FORMAT_71CHN16");
+ format = AL_FORMAT_71CHN16;
}
}
else if(alSampleType == AL_FLOAT_SOFT && hasEXTFloat32)
{
if(alChannelLayout == AL_MONO_SOFT)
- format = al.alGetEnumValue("AL_FORMAT_MONO_FLOAT32");
+ format = AL_FORMAT_MONO_FLOAT32;
else if(alChannelLayout == AL_STEREO_SOFT)
- format = al.alGetEnumValue("AL_FORMAT_STEREO_FLOAT32");
+ format = AL_FORMAT_STEREO_FLOAT32;
else if( hasEXTMcFormats )
{
if(alChannelLayout == AL_QUAD_SOFT)
- format = al.alGetEnumValue("AL_FORMAT_QUAD32");
+ format = AL_FORMAT_QUAD32;
else if(alChannelLayout == AL_5POINT1_SOFT)
- format = al.alGetEnumValue("AL_FORMAT_51CHN32");
+ format = AL_FORMAT_51CHN32;
else if(alChannelLayout == AL_6POINT1_SOFT)
- format = al.alGetEnumValue("AL_FORMAT_61CHN32");
+ format = AL_FORMAT_61CHN32;
else if(alChannelLayout == AL_7POINT1_SOFT)
- format = al.alGetEnumValue("AL_FORMAT_71CHN32");
+ format = AL_FORMAT_71CHN32;
}
}
else if(alSampleType == AL_DOUBLE_SOFT && hasEXTDouble)
{
if(alChannelLayout == AL_MONO_SOFT)
- format = al.alGetEnumValue("AL_FORMAT_MONO_DOUBLE");
- else if(alChannelLayout == AL_STEREO_SOFT)
- format = al.alGetEnumValue("AL_FORMAT_STEREO_DOUBLE");
+ format = AL_FORMAT_MONO_DOUBLE_EXT;
+ else if(alChannelLayout == AL_STEREO_SOFT) {
+ format = AL_FORMAT_STEREO_DOUBLE_EXT;
+ }
}
/* NOTE: It seems OSX returns -1 from alGetEnumValue for unknown enums, as