1 #ifndef ALC_DEVFORMAT_H
2 #define ALC_DEVFORMAT_H
53 enum DevFmtType
: ALenum
{
54 DevFmtByte
= ALC_BYTE_SOFT
,
55 DevFmtUByte
= ALC_UNSIGNED_BYTE_SOFT
,
56 DevFmtShort
= ALC_SHORT_SOFT
,
57 DevFmtUShort
= ALC_UNSIGNED_SHORT_SOFT
,
58 DevFmtInt
= ALC_INT_SOFT
,
59 DevFmtUInt
= ALC_UNSIGNED_INT_SOFT
,
60 DevFmtFloat
= ALC_FLOAT_SOFT
,
62 DevFmtTypeDefault
= DevFmtFloat
64 enum DevFmtChannels
: ALenum
{
65 DevFmtMono
= ALC_MONO_SOFT
,
66 DevFmtStereo
= ALC_STEREO_SOFT
,
67 DevFmtQuad
= ALC_QUAD_SOFT
,
68 DevFmtX51
= ALC_5POINT1_SOFT
,
69 DevFmtX61
= ALC_6POINT1_SOFT
,
70 DevFmtX71
= ALC_7POINT1_SOFT
,
71 DevFmtAmbi3D
= ALC_BFORMAT3D_SOFT
,
73 /* Similar to 5.1, except using rear channels instead of sides */
74 DevFmtX51Rear
= 0x70000000,
76 DevFmtChannelsDefault
= DevFmtStereo
78 #define MAX_OUTPUT_CHANNELS (16)
80 /* DevFmtType traits, providing the type, etc given a DevFmtType. */
81 template<DevFmtType T
>
82 struct DevFmtTypeTraits
{ };
85 struct DevFmtTypeTraits
<DevFmtByte
> { using Type
= ALbyte
; };
87 struct DevFmtTypeTraits
<DevFmtUByte
> { using Type
= ALubyte
; };
89 struct DevFmtTypeTraits
<DevFmtShort
> { using Type
= ALshort
; };
91 struct DevFmtTypeTraits
<DevFmtUShort
> { using Type
= ALushort
; };
93 struct DevFmtTypeTraits
<DevFmtInt
> { using Type
= ALint
; };
95 struct DevFmtTypeTraits
<DevFmtUInt
> { using Type
= ALuint
; };
97 struct DevFmtTypeTraits
<DevFmtFloat
> { using Type
= ALfloat
; };
100 ALuint
BytesFromDevFmt(DevFmtType type
) noexcept
;
101 ALuint
ChannelsFromDevFmt(DevFmtChannels chans
, ALuint ambiorder
) noexcept
;
102 inline ALuint
FrameSizeFromDevFmt(DevFmtChannels chans
, DevFmtType type
, ALuint ambiorder
) noexcept
103 { return ChannelsFromDevFmt(chans
, ambiorder
) * BytesFromDevFmt(type
); }
105 enum class AmbiLayout
{
106 FuMa
= ALC_FUMA_SOFT
, /* FuMa channel order */
107 ACN
= ALC_ACN_SOFT
, /* ACN channel order */
112 enum class AmbiNorm
{
113 FuMa
= ALC_FUMA_SOFT
, /* FuMa normalization */
114 SN3D
= ALC_SN3D_SOFT
, /* SN3D normalization */
115 N3D
= ALC_N3D_SOFT
, /* N3D normalization */
120 #endif /* ALC_DEVFORMAT_H */