4 #include "buffer_storage.h"
9 const char *NameFromFormat(FmtType type
) noexcept
13 case FmtUByte
: return "UInt8";
14 case FmtShort
: return "Int16";
15 case FmtFloat
: return "Float";
16 case FmtDouble
: return "Double";
17 case FmtMulaw
: return "muLaw";
18 case FmtAlaw
: return "aLaw";
19 case FmtIMA4
: return "IMA4 ADPCM";
20 case FmtMSADPCM
: return "MS ADPCM";
22 return "<internal error>";
25 const char *NameFromFormat(FmtChannels channels
) noexcept
29 case FmtMono
: return "Mono";
30 case FmtStereo
: return "Stereo";
31 case FmtRear
: return "Rear";
32 case FmtQuad
: return "Quadraphonic";
33 case FmtX51
: return "Surround 5.1";
34 case FmtX61
: return "Surround 6.1";
35 case FmtX71
: return "Surround 7.1";
36 case FmtBFormat2D
: return "B-Format 2D";
37 case FmtBFormat3D
: return "B-Format 3D";
38 case FmtUHJ2
: return "UHJ2";
39 case FmtUHJ3
: return "UHJ3";
40 case FmtUHJ4
: return "UHJ4";
41 case FmtSuperStereo
: return "Super Stereo";
43 return "<internal error>";
46 uint
BytesFromFmt(FmtType type
) noexcept
50 case FmtUByte
: return sizeof(uint8_t);
51 case FmtShort
: return sizeof(int16_t);
52 case FmtFloat
: return sizeof(float);
53 case FmtDouble
: return sizeof(double);
54 case FmtMulaw
: return sizeof(uint8_t);
55 case FmtAlaw
: return sizeof(uint8_t);
57 case FmtMSADPCM
: break;
62 uint
ChannelsFromFmt(FmtChannels chans
, uint ambiorder
) noexcept
66 case FmtMono
: return 1;
67 case FmtStereo
: return 2;
68 case FmtRear
: return 2;
69 case FmtQuad
: return 4;
70 case FmtX51
: return 6;
71 case FmtX61
: return 7;
72 case FmtX71
: return 8;
73 case FmtBFormat2D
: return (ambiorder
*2) + 1;
74 case FmtBFormat3D
: return (ambiorder
+1) * (ambiorder
+1);
75 case FmtUHJ2
: return 2;
76 case FmtUHJ3
: return 3;
77 case FmtUHJ4
: return 4;
78 case FmtSuperStereo
: return 2;