1 #ifndef ALC_BUFFER_FORMATS_H
2 #define ALC_BUFFER_FORMATS_H
12 /* Storable formats */
13 enum FmtType
: unsigned char {
21 enum FmtChannels
: unsigned char {
26 FmtX51
, /* (WFX order) */
27 FmtX61
, /* (WFX order) */
28 FmtX71
, /* (WFX order) */
33 enum class AmbiLayout
: unsigned char {
37 enum class AmbiScaling
: unsigned char {
43 ALuint
BytesFromFmt(FmtType type
) noexcept
;
44 ALuint
ChannelsFromFmt(FmtChannels chans
, ALuint ambiorder
) noexcept
;
45 inline ALuint
FrameSizeFromFmt(FmtChannels chans
, FmtType type
, ALuint ambiorder
) noexcept
46 { return ChannelsFromFmt(chans
, ambiorder
) * BytesFromFmt(type
); }
49 struct BufferStorage
{
50 al::vector
<al::byte
,16> mData
;
52 LPALBUFFERCALLBACKTYPESOFT mCallback
{nullptr};
53 void *mUserData
{nullptr};
55 ALuint mSampleRate
{0u};
56 FmtChannels mChannels
{};
58 ALuint mSampleLen
{0u};
60 AmbiLayout mAmbiLayout
{AmbiLayout::FuMa
};
61 AmbiScaling mAmbiScaling
{AmbiScaling::FuMa
};
62 ALuint mAmbiOrder
{0u};
64 inline ALuint
bytesFromFmt() const noexcept
{ return BytesFromFmt(mType
); }
65 inline ALuint
channelsFromFmt() const noexcept
66 { return ChannelsFromFmt(mChannels
, mAmbiOrder
); }
67 inline ALuint
frameSizeFromFmt() const noexcept
{ return channelsFromFmt() * bytesFromFmt(); }
69 inline bool isBFormat() const noexcept
70 { return mChannels
== FmtBFormat2D
|| mChannels
== FmtBFormat3D
; }
73 #endif /* ALC_BUFFER_FORMATS_H */