1 #ifndef ALC_DEVFORMAT_H
2 #define ALC_DEVFORMAT_H
54 enum DevFmtType
: ALenum
{
55 DevFmtByte
= ALC_BYTE_SOFT
,
56 DevFmtUByte
= ALC_UNSIGNED_BYTE_SOFT
,
57 DevFmtShort
= ALC_SHORT_SOFT
,
58 DevFmtUShort
= ALC_UNSIGNED_SHORT_SOFT
,
59 DevFmtInt
= ALC_INT_SOFT
,
60 DevFmtUInt
= ALC_UNSIGNED_INT_SOFT
,
61 DevFmtFloat
= ALC_FLOAT_SOFT
,
63 DevFmtTypeDefault
= DevFmtFloat
65 enum DevFmtChannels
: ALenum
{
66 DevFmtMono
= ALC_MONO_SOFT
,
67 DevFmtStereo
= ALC_STEREO_SOFT
,
68 DevFmtQuad
= ALC_QUAD_SOFT
,
69 DevFmtX51
= ALC_5POINT1_SOFT
,
70 DevFmtX61
= ALC_6POINT1_SOFT
,
71 DevFmtX71
= ALC_7POINT1_SOFT
,
72 DevFmtAmbi3D
= ALC_BFORMAT3D_SOFT
,
74 /* Similar to 5.1, except using rear channels instead of sides */
75 DevFmtX51Rear
= 0x70000000,
77 DevFmtChannelsDefault
= DevFmtStereo
79 #define MAX_OUTPUT_CHANNELS (16)
81 /* DevFmtType traits, providing the type, etc given a DevFmtType. */
82 template<DevFmtType T
>
83 struct DevFmtTypeTraits
{ };
86 struct DevFmtTypeTraits
<DevFmtByte
> { using Type
= int8_t; };
88 struct DevFmtTypeTraits
<DevFmtUByte
> { using Type
= uint8_t; };
90 struct DevFmtTypeTraits
<DevFmtShort
> { using Type
= int16_t; };
92 struct DevFmtTypeTraits
<DevFmtUShort
> { using Type
= uint16_t; };
94 struct DevFmtTypeTraits
<DevFmtInt
> { using Type
= int32_t; };
96 struct DevFmtTypeTraits
<DevFmtUInt
> { using Type
= uint32_t; };
98 struct DevFmtTypeTraits
<DevFmtFloat
> { using Type
= float; };
101 ALuint
BytesFromDevFmt(DevFmtType type
) noexcept
;
102 ALuint
ChannelsFromDevFmt(DevFmtChannels chans
, ALuint ambiorder
) noexcept
;
103 inline ALuint
FrameSizeFromDevFmt(DevFmtChannels chans
, DevFmtType type
, ALuint ambiorder
) noexcept
104 { return ChannelsFromDevFmt(chans
, ambiorder
) * BytesFromDevFmt(type
); }
106 enum class AmbiLayout
{
107 FuMa
= ALC_FUMA_SOFT
, /* FuMa channel order */
108 ACN
= ALC_ACN_SOFT
, /* ACN channel order */
113 enum class AmbiNorm
{
114 FuMa
= ALC_FUMA_SOFT
, /* FuMa normalization */
115 SN3D
= ALC_SN3D_SOFT
, /* SN3D normalization */
116 N3D
= ALC_N3D_SOFT
, /* N3D normalization */
121 #endif /* ALC_DEVFORMAT_H */