diff options
author | Chris Robinson <[email protected]> | 2023-11-18 05:33:30 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-11-18 06:04:38 -0800 |
commit | 6e224443096a85f5eefa8d815d6905824f230604 (patch) | |
tree | 7e928b75692ca1bba0386ce27b21735e20353d73 /alc | |
parent | fe5b3f4fed727b6cf0e98a3454070a53ffcb2ee6 (diff) |
Start a 32-bit sample format extension
This ultimately is to properly distinguish and clarify formats being 32-bit
integer and 32-bit float.
Diffstat (limited to 'alc')
-rw-r--r-- | alc/alc.cpp | 48 | ||||
-rw-r--r-- | alc/export_list.h | 63 | ||||
-rw-r--r-- | alc/inprogext.h | 20 |
3 files changed, 89 insertions, 42 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index 96b641f7..08ef0063 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -740,29 +740,39 @@ std::optional<DevFmtPair> DecomposeDevFormat(ALenum format) DevFmtChannels channels; DevFmtType type; } list[] = { - { AL_FORMAT_MONO8, DevFmtMono, DevFmtUByte }, - { AL_FORMAT_MONO16, DevFmtMono, DevFmtShort }, + { AL_FORMAT_MONO8, DevFmtMono, DevFmtUByte }, + { AL_FORMAT_MONO16, DevFmtMono, DevFmtShort }, + { AL_FORMAT_MONO_I32, DevFmtMono, DevFmtInt }, { AL_FORMAT_MONO_FLOAT32, DevFmtMono, DevFmtFloat }, - { AL_FORMAT_STEREO8, DevFmtStereo, DevFmtUByte }, - { AL_FORMAT_STEREO16, DevFmtStereo, DevFmtShort }, + { AL_FORMAT_STEREO8, DevFmtStereo, DevFmtUByte }, + { AL_FORMAT_STEREO16, DevFmtStereo, DevFmtShort }, + { AL_FORMAT_STEREO_I32, DevFmtStereo, DevFmtInt }, { AL_FORMAT_STEREO_FLOAT32, DevFmtStereo, DevFmtFloat }, - { AL_FORMAT_QUAD8, DevFmtQuad, DevFmtUByte }, - { AL_FORMAT_QUAD16, DevFmtQuad, DevFmtShort }, - { AL_FORMAT_QUAD32, DevFmtQuad, DevFmtFloat }, - - { AL_FORMAT_51CHN8, DevFmtX51, DevFmtUByte }, - { AL_FORMAT_51CHN16, DevFmtX51, DevFmtShort }, - { AL_FORMAT_51CHN32, DevFmtX51, DevFmtFloat }, - - { AL_FORMAT_61CHN8, DevFmtX61, DevFmtUByte }, - { AL_FORMAT_61CHN16, DevFmtX61, DevFmtShort }, - { AL_FORMAT_61CHN32, DevFmtX61, DevFmtFloat }, - - { AL_FORMAT_71CHN8, DevFmtX71, DevFmtUByte }, - { AL_FORMAT_71CHN16, DevFmtX71, DevFmtShort }, - { AL_FORMAT_71CHN32, DevFmtX71, DevFmtFloat }, + { AL_FORMAT_QUAD8, DevFmtQuad, DevFmtUByte }, + { AL_FORMAT_QUAD16, DevFmtQuad, DevFmtShort }, + { AL_FORMAT_QUAD32, DevFmtQuad, DevFmtFloat }, + { AL_FORMAT_QUAD_I32, DevFmtQuad, DevFmtInt }, + { AL_FORMAT_QUAD_FLOAT32, DevFmtQuad, DevFmtFloat }, + + { AL_FORMAT_51CHN8, DevFmtX51, DevFmtUByte }, + { AL_FORMAT_51CHN16, DevFmtX51, DevFmtShort }, + { AL_FORMAT_51CHN32, DevFmtX51, DevFmtFloat }, + { AL_FORMAT_51CHN_I32, DevFmtX51, DevFmtInt }, + { AL_FORMAT_51CHN_FLOAT32, DevFmtX51, DevFmtFloat }, + + { AL_FORMAT_61CHN8, DevFmtX61, DevFmtUByte }, + { AL_FORMAT_61CHN16, DevFmtX61, DevFmtShort }, + { AL_FORMAT_61CHN32, DevFmtX61, DevFmtFloat }, + { AL_FORMAT_61CHN_I32, DevFmtX61, DevFmtInt }, + { AL_FORMAT_61CHN_FLOAT32, DevFmtX61, DevFmtFloat }, + + { AL_FORMAT_71CHN8, DevFmtX71, DevFmtUByte }, + { AL_FORMAT_71CHN16, DevFmtX71, DevFmtShort }, + { AL_FORMAT_71CHN32, DevFmtX71, DevFmtFloat }, + { AL_FORMAT_71CHN_I32, DevFmtX71, DevFmtInt }, + { AL_FORMAT_71CHN_FLOAT32, DevFmtX71, DevFmtFloat }, }; for(const auto &item : list) diff --git a/alc/export_list.h b/alc/export_list.h index 2ef0d777..47b04a08 100644 --- a/alc/export_list.h +++ b/alc/export_list.h @@ -598,6 +598,46 @@ inline const EnumExport alcEnumerations[]{ DECL(AL_FORMAT_BFORMAT3D_FLOAT32), DECL(AL_FORMAT_BFORMAT3D_MULAW), + DECL(AL_FORMAT_UHJ2CHN8_SOFT), + DECL(AL_FORMAT_UHJ2CHN16_SOFT), + DECL(AL_FORMAT_UHJ2CHN_FLOAT32_SOFT), + DECL(AL_FORMAT_UHJ3CHN8_SOFT), + DECL(AL_FORMAT_UHJ3CHN16_SOFT), + DECL(AL_FORMAT_UHJ3CHN_FLOAT32_SOFT), + DECL(AL_FORMAT_UHJ4CHN8_SOFT), + DECL(AL_FORMAT_UHJ4CHN16_SOFT), + DECL(AL_FORMAT_UHJ4CHN_FLOAT32_SOFT), + DECL(AL_STEREO_MODE_SOFT), + DECL(AL_NORMAL_SOFT), + DECL(AL_SUPER_STEREO_SOFT), + DECL(AL_SUPER_STEREO_WIDTH_SOFT), + + DECL(AL_FORMAT_UHJ2CHN_MULAW_SOFT), + DECL(AL_FORMAT_UHJ2CHN_ALAW_SOFT), + DECL(AL_FORMAT_UHJ2CHN_IMA4_SOFT), + DECL(AL_FORMAT_UHJ2CHN_MSADPCM_SOFT), + DECL(AL_FORMAT_UHJ3CHN_MULAW_SOFT), + DECL(AL_FORMAT_UHJ3CHN_ALAW_SOFT), + DECL(AL_FORMAT_UHJ4CHN_MULAW_SOFT), + DECL(AL_FORMAT_UHJ4CHN_ALAW_SOFT), + + DECL(AL_FORMAT_MONO_I32), + DECL(AL_FORMAT_STEREO_I32), + DECL(AL_FORMAT_REAR_I32), + DECL(AL_FORMAT_QUAD_I32), + DECL(AL_FORMAT_51CHN_I32), + DECL(AL_FORMAT_61CHN_I32), + DECL(AL_FORMAT_71CHN_I32), + DECL(AL_FORMAT_UHJ2CHN_I32), + DECL(AL_FORMAT_UHJ3CHN_I32), + DECL(AL_FORMAT_UHJ4CHN_I32), + + DECL(AL_FORMAT_REAR_FLOAT32), + DECL(AL_FORMAT_QUAD_FLOAT32), + DECL(AL_FORMAT_51CHN_FLOAT32), + DECL(AL_FORMAT_61CHN_FLOAT32), + DECL(AL_FORMAT_71CHN_FLOAT32), + DECL(AL_FREQUENCY), DECL(AL_BITS), DECL(AL_CHANNELS), @@ -823,29 +863,6 @@ inline const EnumExport alcEnumerations[]{ DECL(AL_EFFECT_CONVOLUTION_SOFT), DECL(AL_EFFECTSLOT_STATE_SOFT), - DECL(AL_FORMAT_UHJ2CHN8_SOFT), - DECL(AL_FORMAT_UHJ2CHN16_SOFT), - DECL(AL_FORMAT_UHJ2CHN_FLOAT32_SOFT), - DECL(AL_FORMAT_UHJ3CHN8_SOFT), - DECL(AL_FORMAT_UHJ3CHN16_SOFT), - DECL(AL_FORMAT_UHJ3CHN_FLOAT32_SOFT), - DECL(AL_FORMAT_UHJ4CHN8_SOFT), - DECL(AL_FORMAT_UHJ4CHN16_SOFT), - DECL(AL_FORMAT_UHJ4CHN_FLOAT32_SOFT), - DECL(AL_STEREO_MODE_SOFT), - DECL(AL_NORMAL_SOFT), - DECL(AL_SUPER_STEREO_SOFT), - DECL(AL_SUPER_STEREO_WIDTH_SOFT), - - DECL(AL_FORMAT_UHJ2CHN_MULAW_SOFT), - DECL(AL_FORMAT_UHJ2CHN_ALAW_SOFT), - DECL(AL_FORMAT_UHJ2CHN_IMA4_SOFT), - DECL(AL_FORMAT_UHJ2CHN_MSADPCM_SOFT), - DECL(AL_FORMAT_UHJ3CHN_MULAW_SOFT), - DECL(AL_FORMAT_UHJ3CHN_ALAW_SOFT), - DECL(AL_FORMAT_UHJ4CHN_MULAW_SOFT), - DECL(AL_FORMAT_UHJ4CHN_ALAW_SOFT), - DECL(AL_DONT_CARE_EXT), DECL(AL_DEBUG_OUTPUT_EXT), DECL(AL_DEBUG_CALLBACK_FUNCTION_EXT), diff --git a/alc/inprogext.h b/alc/inprogext.h index a145b8e4..8764c85b 100644 --- a/alc/inprogext.h +++ b/alc/inprogext.h @@ -398,6 +398,26 @@ ALenum AL_APIENTRY EAXGetBufferModeDirect(ALCcontext *context, ALuint buffer, AL #endif #endif +#ifndef AL_EXT_int32 +#define AL_EXT_int32 +#define AL_FORMAT_MONO_I32 0x9999 /* TBD, same as AL_FORMAT_MONO32 */ +#define AL_FORMAT_STEREO_I32 0x1203 /* Same as AL_FORMAT_STEREO32 */ +#define AL_FORMAT_REAR_I32 0x19D9 +#define AL_FORMAT_QUAD_I32 0x19DA +#define AL_FORMAT_51CHN_I32 0x19DB +#define AL_FORMAT_61CHN_I32 0x19DC +#define AL_FORMAT_71CHN_I32 0x19DD +#define AL_FORMAT_UHJ2CHN_I32 0x19DE +#define AL_FORMAT_UHJ3CHN_I32 0x19DF +#define AL_FORMAT_UHJ4CHN_I32 0x19E0 + +#define AL_FORMAT_REAR_FLOAT32 0x19E1 +#define AL_FORMAT_QUAD_FLOAT32 0x19E2 +#define AL_FORMAT_51CHN_FLOAT32 0x19E3 +#define AL_FORMAT_61CHN_FLOAT32 0x19E4 +#define AL_FORMAT_71CHN_FLOAT32 0x19E5 +#endif + /* Non-standard exports. Not part of any extension. */ AL_API const ALchar* AL_APIENTRY alsoft_get_version(void) noexcept; |