11#define HEPHAUDIO_CH_MASK_MONO (HephAudio::AudioChannelMask::FrontCenter)
17#define HEPHAUDIO_CH_MASK_STEREO (HephAudio::AudioChannelMask::FrontLeft | HephAudio::AudioChannelMask::FrontRight)
24#define HEPHAUDIO_CH_MASK_2_POINT_1 (HEPHAUDIO_CH_MASK_STEREO | HephAudio::AudioChannelMask::LowFrequency)
31#define HEPHAUDIO_CH_MASK_2_1 (HEPHAUDIO_CH_MASK_STEREO | HephAudio::AudioChannelMask::BackCenter)
38#define HEPHAUDIO_CH_MASK_SURROUND (HEPHAUDIO_CH_MASK_STEREO | HephAudio::AudioChannelMask::FrontCenter)
46#define HEPHAUDIO_CH_MASK_3_POINT_1 (HEPHAUDIO_CH_MASK_SURROUND | HephAudio::AudioChannelMask::LowFrequency)
54#define HEPHAUDIO_CH_MASK_4_POINT_0 (HEPHAUDIO_CH_MASK_SURROUND | HephAudio::AudioChannelMask::BackCenter)
62#define HEPHAUDIO_CH_MASK_2_2 (HEPHAUDIO_CH_MASK_STEREO | HephAudio::AudioChannelMask::SideLeft | HephAudio::AudioChannelMask::SideRight)
70#define HEPHAUDIO_CH_MASK_QUAD (HEPHAUDIO_CH_MASK_STEREO | HephAudio::AudioChannelMask::BackLeft | HephAudio::AudioChannelMask::BackRight)
79#define HEPHAUDIO_CH_MASK_4_POINT_1 (HEPHAUDIO_CH_MASK_4_POINT_0 | HephAudio::AudioChannelMask::LowFrequency)
88#define HEPHAUDIO_CH_MASK_5_POINT_0 (HEPHAUDIO_CH_MASK_SURROUND | HephAudio::AudioChannelMask::SideLeft | HephAudio::AudioChannelMask::SideRight)
97#define HEPHAUDIO_CH_MASK_5_POINT_0_BACK (HEPHAUDIO_CH_MASK_SURROUND | HephAudio::AudioChannelMask::BackLeft | HephAudio::AudioChannelMask::BackRight)
107#define HEPHAUDIO_CH_MASK_5_POINT_1 (HEPHAUDIO_CH_MASK_5_POINT_0 | HephAudio::AudioChannelMask::LowFrequency)
117#define HEPHAUDIO_CH_MASK_5_POINT_1_BACK (HEPHAUDIO_CH_MASK_5_POINT_0_BACK | HephAudio::AudioChannelMask::LowFrequency)
127#define HEPHAUDIO_CH_MASK_6_POINT_0 (HEPHAUDIO_CH_MASK_5_POINT_0 | HephAudio::AudioChannelMask::BackCenter)
137#define HEPHAUDIO_CH_MASK_6_POINT_0_FRONT (HEPHAUDIO_CH_MASK_2_2 | HephAudio::AudioChannelMask::FrontLeftOfCenter | HephAudio::AudioChannelMask::FrontRightOfCenter)
147#define HEPHAUDIO_CH_MASK_HEXAGONAL (HEPHAUDIO_CH_MASK_5_POINT_0_BACK | HephAudio::AudioChannelMask::BackCenter)
158#define HEPHAUDIO_CH_MASK_6_POINT_1 (HEPHAUDIO_CH_MASK_5_POINT_1 | HephAudio::AudioChannelMask::BackCenter)
169#define HEPHAUDIO_CH_MASK_6_POINT_1_BACK (HEPHAUDIO_CH_MASK_5_POINT_1_BACK | HephAudio::AudioChannelMask::BackCenter)
180#define HEPHAUDIO_CH_MASK_6_POINT_1_FRONT (HEPHAUDIO_CH_MASK_6_POINT_0_FRONT | HephAudio::AudioChannelMask::LowFrequency)
191#define HEPHAUDIO_CH_MASK_7_POINT_0 (HEPHAUDIO_CH_MASK_5_POINT_0 | HephAudio::AudioChannelMask::BackLeft | HephAudio::AudioChannelMask::BackRight)
202#define HEPHAUDIO_CH_MASK_7_POINT_0_FRONT (HEPHAUDIO_CH_MASK_5_POINT_0 | HephAudio::AudioChannelMask::FrontLeftOfCenter | HephAudio::AudioChannelMask::FrontRightOfCenter)
214#define HEPHAUDIO_CH_MASK_7_POINT_1 (HEPHAUDIO_CH_MASK_5_POINT_1 | HephAudio::AudioChannelMask::BackLeft | HephAudio::AudioChannelMask::BackRight)
226#define HEPHAUDIO_CH_MASK_7_POINT_1_WIDE (HEPHAUDIO_CH_MASK_5_POINT_1 | HephAudio::AudioChannelMask::FrontLeftOfCenter | HephAudio::AudioChannelMask::FrontRightOfCenter)
238#define HEPHAUDIO_CH_MASK_7_POINT_1_WIDE_BACK (HEPHAUDIO_CH_MASK_5_POINT_1_BACK | HephAudio::AudioChannelMask::FrontLeftOfCenter | HephAudio::AudioChannelMask::FrontRightOfCenter)
250#define HEPHAUDIO_CH_MASK_OCTAGONAL (HEPHAUDIO_CH_MASK_5_POINT_0 | HephAudio::AudioChannelMask::BackLeft | HephAudio::AudioChannelMask::BackCenter | HephAudio::AudioChannelMask::BackRight)
252#define HEPHAUDIO_CH_LAYOUT_MONO HephAudio::AudioChannelLayout(1, HEPHAUDIO_CH_MASK_MONO)
253#define HEPHAUDIO_CH_LAYOUT_STEREO HephAudio::AudioChannelLayout(2, HEPHAUDIO_CH_MASK_STEREO)
254#define HEPHAUDIO_CH_LAYOUT_2_POINT_1 HephAudio::AudioChannelLayout(3, HEPHAUDIO_CH_MASK_2_POINT_1)
255#define HEPHAUDIO_CH_LAYOUT_2_1 HephAudio::AudioChannelLayout(3, HEPHAUDIO_CH_MASK_2_1)
256#define HEPHAUDIO_CH_LAYOUT_SURROUND HephAudio::AudioChannelLayout(3, HEPHAUDIO_CH_MASK_SURROUND)
257#define HEPHAUDIO_CH_LAYOUT_3_POINT_1 HephAudio::AudioChannelLayout(4, HEPHAUDIO_CH_MASK_3_POINT_1)
258#define HEPHAUDIO_CH_LAYOUT_4_POINT_0 HephAudio::AudioChannelLayout(4, HEPHAUDIO_CH_MASK_4_POINT_0)
259#define HEPHAUDIO_CH_LAYOUT_2_2 HephAudio::AudioChannelLayout(4, HEPHAUDIO_CH_MASK_2_2)
260#define HEPHAUDIO_CH_LAYOUT_QUAD HephAudio::AudioChannelLayout(4, HEPHAUDIO_CH_MASK_QUAD)
261#define HEPHAUDIO_CH_LAYOUT_4_POINT_1 HephAudio::AudioChannelLayout(5, HEPHAUDIO_CH_MASK_4_POINT_1)
262#define HEPHAUDIO_CH_LAYOUT_5_POINT_0 HephAudio::AudioChannelLayout(5, HEPHAUDIO_CH_MASK_5_POINT_0)
263#define HEPHAUDIO_CH_LAYOUT_5_POINT_0_BACK HephAudio::AudioChannelLayout(5, HEPHAUDIO_CH_MASK_5_POINT_0_BACK)
264#define HEPHAUDIO_CH_LAYOUT_5_POINT_1 HephAudio::AudioChannelLayout(6, HEPHAUDIO_CH_MASK_5_POINT_1)
265#define HEPHAUDIO_CH_LAYOUT_5_POINT_1_BACK HephAudio::AudioChannelLayout(6, HEPHAUDIO_CH_MASK_5_POINT_1_BACK)
266#define HEPHAUDIO_CH_LAYOUT_6_POINT_0 HephAudio::AudioChannelLayout(6, HEPHAUDIO_CH_MASK_6_POINT_0)
267#define HEPHAUDIO_CH_LAYOUT_6_POINT_0_FRONT HephAudio::AudioChannelLayout(6, HEPHAUDIO_CH_MASK_6_POINT_0_FRONT)
268#define HEPHAUDIO_CH_LAYOUT_HEXAGONAL HephAudio::AudioChannelLayout(6, HEPHAUDIO_CH_MASK_HEXAGONAL)
269#define HEPHAUDIO_CH_LAYOUT_6_POINT_1 HephAudio::AudioChannelLayout(7, HEPHAUDIO_CH_MASK_6_POINT_1)
270#define HEPHAUDIO_CH_LAYOUT_6_POINT_1_BACK HephAudio::AudioChannelLayout(7, HEPHAUDIO_CH_MASK_6_POINT_1_BACK)
271#define HEPHAUDIO_CH_LAYOUT_6_POINT_1_FRONT HephAudio::AudioChannelLayout(7, HEPHAUDIO_CH_MASK_6_POINT_1_FRONT)
272#define HEPHAUDIO_CH_LAYOUT_7_POINT_0 HephAudio::AudioChannelLayout(7, HEPHAUDIO_CH_MASK_7_POINT_0)
273#define HEPHAUDIO_CH_LAYOUT_7_POINT_0_FRONT HephAudio::AudioChannelLayout(7, HEPHAUDIO_CH_MASK_7_POINT_0_FRONT)
274#define HEPHAUDIO_CH_LAYOUT_7_POINT_1 HephAudio::AudioChannelLayout(8, HEPHAUDIO_CH_MASK_7_POINT_1)
275#define HEPHAUDIO_CH_LAYOUT_7_POINT_1_WIDE HephAudio::AudioChannelLayout(8, HEPHAUDIO_CH_MASK_7_POINT_1_WIDE)
276#define HEPHAUDIO_CH_LAYOUT_7_POINT_1_WIDE_BACK HephAudio::AudioChannelLayout(8, HEPHAUDIO_CH_MASK_7_POINT_1_WIDE_BACK)
277#define HEPHAUDIO_CH_LAYOUT_OCTAGONAL HephAudio::AudioChannelLayout(8, HEPHAUDIO_CH_MASK_OCTAGONAL)
295 FrontLeftOfCenter = 0x40,
296 FrontRightOfCenter = 0x80,
301 TopFrontLeft = 0x1000,
302 TopFrontCenter = 0x2000,
303 TopFrontRight = 0x4000,
304 TopBackLeft = 0x8000,
305 TopBackCenter = 0x10000,
306 TopBackRight = 0x20000
310 inline constexpr AudioChannelMask operator|(
const AudioChannelMask& lhs,
const AudioChannelMask& rhs)
312 return (AudioChannelMask)(((int)lhs) | ((int)rhs));
315 inline constexpr AudioChannelMask& operator|=(AudioChannelMask& lhs,
const AudioChannelMask& rhs)
321 inline constexpr AudioChannelMask operator&(
const AudioChannelMask& lhs,
const AudioChannelMask& rhs)
323 return (AudioChannelMask)(((int)lhs) & ((int)rhs));
326 inline constexpr AudioChannelMask& operator&=(AudioChannelMask& lhs,
const AudioChannelMask& rhs)
363 return this->count == rhs.
count && this->mask == rhs.
mask;
366 constexpr bool operator!=(
const AudioChannelLayout& rhs)
const
368 return !((*this) == rhs);
377 switch (channelCount)
396 return AudioChannelMask::Unknown;
406 return AudioChannelLayout(channelCount, AudioChannelLayout::DefaultChannelMask(channelCount));
415 uint16_t channelCount = 0;
416 uint32_t mask32 = (uint32_t)mask;
417 for (
size_t i = 0; i < 32; i++)
434 return AudioChannelLayout::GetChannelCount(layout.
mask);
#define HEPHAUDIO_CH_MASK_4_POINT_0
Definition AudioChannelLayout.h:54
#define HEPHAUDIO_CH_MASK_5_POINT_1
Definition AudioChannelLayout.h:107
#define HEPHAUDIO_CH_MASK_SURROUND
Definition AudioChannelLayout.h:38
#define HEPHAUDIO_CH_MASK_STEREO
Definition AudioChannelLayout.h:17
#define HEPHAUDIO_CH_MASK_7_POINT_1
Definition AudioChannelLayout.h:214
#define HEPHAUDIO_CH_MASK_MONO
Definition AudioChannelLayout.h:11
#define HEPHAUDIO_CH_MASK_5_POINT_0
Definition AudioChannelLayout.h:88
AudioChannelMask
Definition AudioChannelLayout.h:287
#define HEPHAUDIO_CH_MASK_7_POINT_0
Definition AudioChannelLayout.h:191
#define HEPH_API
Definition HephShared.h:124
stores information about the channel layout.
Definition AudioChannelLayout.h:337
static constexpr uint16_t GetChannelCount(AudioChannelMask mask)
Definition AudioChannelLayout.h:413
static constexpr uint16_t GetChannelCount(const AudioChannelLayout &layout)
Definition AudioChannelLayout.h:432
static constexpr AudioChannelMask DefaultChannelMask(uint16_t channelCount)
Definition AudioChannelLayout.h:375
static std::vector< AudioChannelMask > GetChannelMapping(const AudioChannelLayout &layout)
static constexpr AudioChannelLayout DefaultChannelLayout(uint16_t channelCount)
Definition AudioChannelLayout.h:404
constexpr AudioChannelLayout()
Definition AudioChannelLayout.h:351
constexpr AudioChannelLayout(uint16_t count, AudioChannelMask mask)
Definition AudioChannelLayout.h:359
static std::vector< AudioChannelMask > GetChannelMapping(AudioChannelMask mask)
uint16_t count
Definition AudioChannelLayout.h:342
AudioChannelMask mask
Definition AudioChannelLayout.h:348