Use one PulseAudio mainloop per device
[openal-soft.git] / alc / devformat.h
blobe7ff2ec46b8e13314f91f9722b7363f3107aa3b6
1 #ifndef ALC_DEVFORMAT_H
2 #define ALC_DEVFORMAT_H
4 #include "AL/al.h"
5 #include "AL/alc.h"
6 #include "AL/alext.h"
8 #include "inprogext.h"
11 enum Channel {
12 FrontLeft = 0,
13 FrontRight,
14 FrontCenter,
15 LFE,
16 BackLeft,
17 BackRight,
18 BackCenter,
19 SideLeft,
20 SideRight,
22 UpperFrontLeft,
23 UpperFrontRight,
24 UpperBackLeft,
25 UpperBackRight,
26 LowerFrontLeft,
27 LowerFrontRight,
28 LowerBackLeft,
29 LowerBackRight,
31 Aux0,
32 Aux1,
33 Aux2,
34 Aux3,
35 Aux4,
36 Aux5,
37 Aux6,
38 Aux7,
39 Aux8,
40 Aux9,
41 Aux10,
42 Aux11,
43 Aux12,
44 Aux13,
45 Aux14,
46 Aux15,
48 MaxChannels
52 /* Device formats */
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 { };
84 template<>
85 struct DevFmtTypeTraits<DevFmtByte> { using Type = ALbyte; };
86 template<>
87 struct DevFmtTypeTraits<DevFmtUByte> { using Type = ALubyte; };
88 template<>
89 struct DevFmtTypeTraits<DevFmtShort> { using Type = ALshort; };
90 template<>
91 struct DevFmtTypeTraits<DevFmtUShort> { using Type = ALushort; };
92 template<>
93 struct DevFmtTypeTraits<DevFmtInt> { using Type = ALint; };
94 template<>
95 struct DevFmtTypeTraits<DevFmtUInt> { using Type = ALuint; };
96 template<>
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 */
109 Default = ACN
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 */
117 Default = SN3D
120 #endif /* ALC_DEVFORMAT_H */