Use fmt instead of to_string and concating strings
[openal-soft.git] / core / storage_formats.h
blobacced258a59faece0eb1c2b659f590394062ddc6
1 #ifndef CORE_STORAGE_FORMATS_H
2 #define CORE_STORAGE_FORMATS_H
4 using uint = unsigned int;
6 /* Storable formats */
7 enum FmtType : unsigned char {
8 FmtUByte,
9 FmtShort,
10 FmtInt,
11 FmtFloat,
12 FmtDouble,
13 FmtMulaw,
14 FmtAlaw,
15 FmtIMA4,
16 FmtMSADPCM,
18 enum FmtChannels : unsigned char {
19 FmtMono,
20 FmtStereo,
21 FmtRear,
22 FmtQuad,
23 FmtX51, /* (WFX order) */
24 FmtX61, /* (WFX order) */
25 FmtX71, /* (WFX order) */
26 FmtBFormat2D,
27 FmtBFormat3D,
28 FmtUHJ2, /* 2-channel UHJ, aka "BHJ", stereo-compatible */
29 FmtUHJ3, /* 3-channel UHJ, aka "THJ" */
30 FmtUHJ4, /* 4-channel UHJ, aka "PHJ" */
31 FmtSuperStereo, /* Stereo processed with Super Stereo. */
32 FmtMonoDup, /* Mono duplicated for left/right separation */
35 enum class AmbiLayout : unsigned char {
36 FuMa,
37 ACN,
39 enum class AmbiScaling : unsigned char {
40 FuMa,
41 SN3D,
42 N3D,
43 UHJ,
46 const char *NameFromFormat(FmtType type) noexcept;
47 const char *NameFromFormat(FmtChannels channels) noexcept;
49 uint BytesFromFmt(FmtType type) noexcept;
50 uint ChannelsFromFmt(FmtChannels chans, uint ambiorder) noexcept;
51 inline uint FrameSizeFromFmt(FmtChannels chans, FmtType type, uint ambiorder) noexcept
52 { return ChannelsFromFmt(chans, ambiorder) * BytesFromFmt(type); }
54 #endif /* CORE_STORAGE_FORMATS_H */