JPL Spatial
Sound spatialization and propagation library
Loading...
Searching...
No Matches
ChannelMap.h
Go to the documentation of this file.
1//
2// ██╗██████╗ ██╗ ██╗██████╗ ███████╗
3// ██║██╔══██╗ ██║ ██║██╔══██╗██╔════╝ ** JPLSpatial **
4// ██║██████╔╝ ██║ ██║██████╔╝███████╗
5// ██ ██║██╔═══╝ ██║ ██║██╔══██╗╚════██║ https://github.com/Jaytheway/JPLSpatial
6// ╚█████╔╝██║ ███████╗██║██████╔╝███████║
7// ╚════╝ ╚═╝ ╚══════╝╚═╝╚═════╝ ╚══════╝
8//
9// Copyright 2024 Jaroslav Pevno, JPLSpatial is offered under the terms of the ISC license:
10//
11// Permission to use, copy, modify, and/or distribute this software for any purpose with or
12// without fee is hereby granted, provided that the above copyright notice and this permission
13// notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
14// WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
16// CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
17// WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
18// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19
20#pragma once
21
22#include "Core.h"
23#include "ErrorReporting.h"
24
25#include <bit>
26#include <string_view>
27
28namespace JPL
29{
30 //==========================================================================
34 // This no longer conforms to WAVEFORMATEXTENSIBLE, but supposidely conforms
35 // to common speaker arrangements.
39 {
44
45 SideLeft = JPL_BIT(4), // also "left surround side", "left centre"
46 SideRight = JPL_BIT(5), // also "right surround side", "right centre"
47
50
51 BackLeft = JPL_BIT(8), // also "left surround", "left surround read"
52 BackRight = JPL_BIT(9), // also "right surround", "right surround rear"
53 BackCenter = JPL_BIT(10), // also "surround" or "centre surround"
54
57
62
63 // These used by Dolby Atmos 7.0.2 and 7.1.2
66
67 TopBackLeft = JPL_BIT(19), // also "top rear left"
69 TopBackRight = JPL_BIT(21), // also "top rear right"
70
71 // ..other speakers can be added here
72
73 NUM_GroundChannels = std::bit_width((uint32)WideRight), // Number of ground channels
74
75 TOP_Channels = TopCenter, // Top channels have value >= than TOP_Channels
76 NUM_TopChannels = std::bit_width((uint32)TopBackRight) - NUM_GroundChannels, // Number of ground channels
77
78 Invalid = 0
79 };
80
81 constexpr std::string_view ToString(EChannel channel);
82 constexpr std::string_view ToStringShort(EChannel channel);
83
84
85 //==========================================================================
87 namespace ChannelMask
88 {
89 // TODO: channel order matters and some formats differ only by it, so our simple bit mask may not be functional for everything
90
91 // TODO: Extended setups WIP. Integrate, test, etc...
92
93 inline constexpr uint32 Invalid = uint32(0);
94
95 //======================================================================
96 inline constexpr uint32 Mono = FrontCenter;
97 inline constexpr uint32 Stereo = FrontLeft | FrontRight;
98 inline constexpr uint32 LCR = FrontLeft | FrontRight | FrontCenter;
99 inline constexpr uint32 LRS = FrontLeft | FrontRight | BackCenter;
102
103 // Special case for headphones stereo profile
105
106 // TODO: this clashes with Surround 5.0, we should just remove it, or refactor ChannelMask to be a more than just an integer bitmask
108
109 //? Couldn't arrange in a way to preserve channel order across different setups
110 //?inline constexpr uint32 Hexagonal = FrontLeft | FrontRight | FrontCenter | BackCenter | BackLeft | BackRight;
111
113
114 //======================================================================
120
121 //======================================================================
122 // DTS surround setups
125
126 //======================================================================
131
132 //======================================================================
133 // Dolby Atmos surround setups
138
141
142 //======================================================================
143 // Atmos surround setups
148
149 JPL_INLINE std::string_view ToString(uint32 channelMask);
150 }
151
152 //==========================================================================
155 class [[nodiscard]] ChannelMap
156 {
157 constexpr explicit ChannelMap(uint32 value) : mChannelMask(value) {}
158 public:
159 constexpr ChannelMap() = default;
160
161 static constexpr uint32 InvalidChannelIndex = ~uint32(0);
162
163 [[nodiscard]] constexpr bool Has(EChannel channel) const noexcept { return (mChannelMask & static_cast<uint32_t>(channel)) == channel; }
164 [[nodiscard]] constexpr bool HasLFE() const noexcept { return (mChannelMask & static_cast<uint32_t>(EChannel::LFE)) == EChannel::LFE; }
165 [[nodiscard]] constexpr bool HasTopChannels() const noexcept { return mChannelMask >= EChannel::TOP_Channels; }
166 [[nodiscard]] constexpr bool IsValid() const noexcept { return mChannelMask != ChannelMask::Invalid; }
167
168 [[nodiscard]] constexpr uint32 GetNumChannels() const noexcept { return std::popcount(mChannelMask); }
169
170 [[nodiscard]] constexpr uint32 GetNumGroundChannels() const noexcept
171 {
172 return std::popcount(mChannelMask & static_cast<uint32>((1ull << EChannel::NUM_GroundChannels) - 1u));
173 }
174 [[nodiscard]] constexpr uint32 GetNumHeightChannels() const noexcept { return GetNumChannels() - GetNumGroundChannels(); }
175
176 [[nodiscard]] constexpr uint32 GetChannelIndex(EChannel channel) const
177 {
178 if (!Has(channel))
179 return InvalidChannelIndex;
180
181 uint32 channelIndex = 0;
182 int value = static_cast<int>(mChannelMask);
183 while (value != 0)
184 {
185 if (channel == static_cast<EChannel>(value & -value))
186 return channelIndex;
187
188 value &= (value - 1);
189 ++channelIndex;
190 }
191 return InvalidChannelIndex;
192 }
193
194 [[nodiscard]] constexpr EChannel GetChannelAtIndex(uint32 index) const
195 {
196 EChannel foundChannel = EChannel::Invalid;
197
198 ForEachChannel([index, &foundChannel](EChannel channel, uint32 channelIndex)
199 {
200 if (channelIndex == index)
201 foundChannel = channel;
202 });
203
204 return foundChannel;
205 }
206
207 [[nodiscard]] constexpr uint32 GetChannelMask() const { return mChannelMask; }
208
209 //[[nodiscard]] static constexpr uint32 MaxSupportedChannels() noexcept { return 8u; }
210
211 [[nodiscard]] static constexpr ChannelMap FromChannelMask(uint32 channelMask) { return ChannelMap(channelMask); }
212 [[nodiscard]] static constexpr ChannelMap FromNumChannels(uint32 numChannels)
213 {
214 switch (numChannels)
215 {
216 case 1: return ChannelMap(ChannelMask::Mono);
217 case 2: return ChannelMap(ChannelMask::Stereo);
218 case 3: return ChannelMap(ChannelMask::LCR);
219 case 4: return ChannelMap(ChannelMask::Quad);
220 case 5: return ChannelMap(ChannelMask::Surround_4_1);
221 case 6: return ChannelMap(ChannelMask::Surround_5_1);
222 case 7: return ChannelMap(ChannelMask::Surround_6_1);
223 case 8: return ChannelMap(ChannelMask::Surround_7_1);
224 default:
225 JPL_ASSERT("ChannelMap can be created from channel count up to 8 channels.");
226 return ChannelMap(ChannelMask::Invalid);
227 }
228 }
229
230 template<class Predicate>
231 constexpr void ForEachChannel(Predicate predicate) const
232 {
233 uint32 channelIndex = 0;
234 int value = static_cast<int>(mChannelMask);
235 while (value != 0)
236 {
237 static_assert(std::invocable<Predicate, EChannel, uint32> ||
238 std::invocable<Predicate, EChannel>, "Invalid predicate signature.");
239
240 const auto channel = static_cast<EChannel>(value & -value);
241 if constexpr (std::invocable<Predicate, EChannel, uint32>)
242 predicate(channel, channelIndex);
243 else
244 predicate(channel);
245
246 // Clear the lowest set bit
247 value &= (value - 1);
248 ++channelIndex;
249 }
250 }
251
252 [[nodiscard]] constexpr bool operator==(const ChannelMap& other) const noexcept { return mChannelMask == other.mChannelMask; }
253 [[nodiscard]] constexpr bool operator!=(const ChannelMap& other) const noexcept { return mChannelMask != other.mChannelMask; }
254
255 private:
256 friend struct std::hash<JPL::ChannelMap>;
257 uint32 mChannelMask = ChannelMask::Invalid;
258 };
259
260 //==========================================================================
263 {
264 std::string_view Name;
266
268 : Name(ChannelMask::ToString(channelMask))
269 , Layout(ChannelMap::FromChannelMask(channelMask))
270 {
271 }
272
273 NamedChannelMask() noexcept = default;
274
275 JPL_INLINE bool operator==(const NamedChannelMask& other) const noexcept { return other.Layout == Layout; }
276 };
277} // namespace JPL
278
279//==============================================================================
280namespace std
281{
282 template <>
283 struct [[nodiscard]] hash<JPL::ChannelMap>
284 {
285 constexpr std::size_t operator()(const JPL::ChannelMap& channelMap) const
286 {
287 return channelMap.mChannelMask;
288 }
289 };
290}
291
292namespace JPL
293{
294 JPL_INLINE std::string_view ChannelMask::ToString(uint32 channelMask)
295 {
296 switch (channelMask)
297 {
298 case ChannelMask::Invalid: return "INVALID";
299 case ChannelMask::Mono: return "Mono";
300 case ChannelMask::Stereo: return "Stereo";
301 case ChannelMask::StereoHeadphones: return "Stereo (headphones)";
302 case ChannelMask::LCR: return "LCR";
303 case ChannelMask::LRS: return "LRS";
304 case ChannelMask::LCRS: return "LCRS";
305 case ChannelMask::Quad: return "Quad";
306 //case ChannelMask::Pentagonal: return "Pentagonal"; //? clashes with Surround 5.0
307 case ChannelMask::Octagonal: return "Octagonal";
308 case ChannelMask::Surround_4_1: return "Surround 4.1";
309 case ChannelMask::Surround_5_0: return "Surround 5.0";
310 case ChannelMask::Surround_5_1: return "Surround 5.1";
311 case ChannelMask::Surround_6_0: return "Surround 6.0";
312 case ChannelMask::Surround_6_1: return "Surround 6.1";
313 case ChannelMask::Surround_7_0: return "Surround 7.0";
314 case ChannelMask::Surround_7_1: return "Surround 7.1";
315 case ChannelMask::Surround_5_0_2: return "Surround 5.0.2";
316 case ChannelMask::Surround_5_1_2: return "Surround 5.1.2";
317 case ChannelMask::Surround_5_0_4: return "Surround 5.0.4";
318 case ChannelMask::Surround_5_1_4: return "Surround 5.1.4";
319 case ChannelMask::Surround_7_0_2: return "Surround 7.0.2";
320 case ChannelMask::Surround_7_1_2: return "Surround 7.1.2";
321 case ChannelMask::Surround_7_0_4: return "Surround 7.0.4";
322 case ChannelMask::Surround_7_1_4: return "Surround 7.1.4";
323 case ChannelMask::Surround_7_0_6: return "Surround 7.0.6";
324 case ChannelMask::Surround_7_1_6: return "Surround 7.1.6";
325 case ChannelMask::Surround_9_0_4: return "Surround 9.0.4";
326 case ChannelMask::Surround_9_1_4: return "Surround 9.1.4";
327 case ChannelMask::Surround_9_0_6: return "Surround 9.0.6";
328 case ChannelMask::Surround_9_1_6: return "Surround 9.1.6";
329 default:
330 JPL_ASSERT(false, "Unknown channel mask.");
331 return "< UKNOWN >";
332 }
333 }
334
335 constexpr std::string_view ToString(EChannel channel)
336 {
337 switch (channel)
338 {
339 case EChannel::FrontLeft: return "FrontLeft";
340 case EChannel::FrontRight: return "FrontRight";
341 case EChannel::FrontCenter: return "FrontCenter";
342 case EChannel::LFE: return "LFE";
343 case EChannel::SideLeft: return "SideLeft";
344 case EChannel::SideRight: return "SideRight";
345 case EChannel::FrontLeftCenter: return "FrontLeftCenter";
346 case EChannel::FrontRightCenter: return "FrontRightCenter";
347 case EChannel::BackLeft: return "BackLeft";
348 case EChannel::BackRight: return "BackRight";
349 case EChannel::BackCenter: return "BackCenter";
350 case EChannel::WideLeft: return "WideLeft";
351 case EChannel::WideRight: return "WideRight";
352 case EChannel::TopCenter: return "TopCenter";
353 case EChannel::TopFrontLeft: return "TopFrontLeft";
354 case EChannel::TopFrontCenter: return "TopFrontCenter";
355 case EChannel::TopFrontRight: return "TopFrontRight";
356 case EChannel::TopSideLeft: return "TopSideLeft";
357 case EChannel::TopSideRight: return "TopSideRight";
358 case EChannel::TopBackLeft: return "TopBackLeft";
359 case EChannel::TopBackCenter: return "TopBackCenter";
360 case EChannel::TopBackRight: return "TopBackRight";
361 default:
362 case EChannel::Invalid: return "Invalid";
363 }
364 }
365
366 constexpr std::string_view ToStringShort(EChannel channel)
367 {
368 switch (channel)
369 {
370 case EChannel::FrontLeft: return "FL";
371 case EChannel::FrontRight: return "FR";
372 case EChannel::FrontCenter: return "FC";
373 case EChannel::LFE: return "LFE";
374 case EChannel::SideLeft: return "SL";
375 case EChannel::SideRight: return "SR";
376 case EChannel::FrontLeftCenter: return "FLC";
377 case EChannel::FrontRightCenter: return "FRC";
378 case EChannel::BackLeft: return "BL";
379 case EChannel::BackRight: return "BR";
380 case EChannel::BackCenter: return "BC";
381 case EChannel::WideLeft: return "WL";
382 case EChannel::WideRight: return "WR";
383 case EChannel::TopCenter: return "TC";
384 case EChannel::TopFrontLeft: return "TFL";
385 case EChannel::TopFrontCenter: return "TFC";
386 case EChannel::TopFrontRight: return "TFR";
387 case EChannel::TopSideLeft: return "TSL";
388 case EChannel::TopSideRight: return "TSR";
389 case EChannel::TopBackLeft: return "TBL";
390 case EChannel::TopBackCenter: return "TBC";
391 case EChannel::TopBackRight: return "TBR";
392 default:
393 case EChannel::Invalid: return "-";
394 }
395 }
396} // namespace JPL
397
398#if 0
399//==============================================================================
400namespace JPL::UnitTests
401{
402#define GROUND_CHANNEL_COUNT_OF(ChannelMask)\
403ChannelMap::FromChannelMask(ChannelMask).GetNumGroundChannels()
404
405 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Invalid) == 0);
406 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Mono) == 1);
407 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Stereo) == 2);
408 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::StereoHeadphones) == 2);
409 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::LCR) == 3);
410 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::LRS) == 3);
411 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::LCRS) == 4);
412 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Quad) == 4);
413 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Pentagonal) == 5);
414 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Octagonal) == 8);
415 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_4_1) == 5);
416 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_5_0) == 5);
417 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_5_1) == 6);
418 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_6_0) == 6);
419 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_6_1) == 7);
420 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_7_0) == 7);
421 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_7_1) == 8);
422
423 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_5_0_2) == 5);
424 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_5_0_4) == 5);
425 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_5_1_2) == 6);
426 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_5_1_4) == 6);
427 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_7_0_2) == 7);
428 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_7_0_4) == 7);
429 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_7_0_6) == 7);
430 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_7_1_2) == 8);
431 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_7_1_4) == 8);
432 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_7_1_6) == 8);
433 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_9_0_4) == 9);
434 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_9_0_6) == 9);
435 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_9_1_4) == 10);
436 static_assert(GROUND_CHANNEL_COUNT_OF(ChannelMask::Surround_9_1_6) == 10);
437
438#undef GROUND_CHANNEL_COUNT_OF
439
440 //==========================================================================
441#define HEIGHT_CHANNEL_COUNT_OF(ChannelMask)\
442ChannelMap::FromChannelMask(ChannelMask).GetNumHeightChannels()
443
444 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Invalid) == 0);
445 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Mono) == 0);
446 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Stereo) == 0);
447 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::StereoHeadphones) == 0);
448 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::LCR) == 0);
449 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::LRS) == 0);
450 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::LCRS) == 0);
451 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Quad) == 0);
452 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Pentagonal) == 0);
453 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Octagonal) == 0);
454 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_4_1) == 0);
455 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_5_0) == 0);
456 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_5_1) == 0);
457 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_6_0) == 0);
458 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_6_1) == 0);
459 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_7_0) == 0);
460 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_7_1) == 0);
461
462 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_5_0_2) == 2);
463 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_5_0_4) == 4);
464 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_5_1_2) == 2);
465 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_5_1_4) == 4);
466 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_7_0_2) == 2);
467 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_7_0_4) == 4);
468 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_7_0_6) == 6);
469 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_7_1_2) == 2);
470 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_7_1_4) == 4);
471 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_7_1_6) == 6);
472 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_9_0_4) == 4);
473 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_9_0_6) == 6);
474 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_9_1_4) == 4);
475 static_assert(HEIGHT_CHANNEL_COUNT_OF(ChannelMask::Surround_9_1_6) == 6);
476
477#undef HEIGHT_CHANNEL_COUNT_OF
478} // namespace JPL::UnitTests
479#endif
#define JPL_BIT(x)
Definition Core.h:359
#define JPL_ASSERT(inExpression,...)
Main assert macro, usage: JPL_ASSERT(condition, message) or JPL_ASSERT(condition)
Definition ErrorReporting.h:80
Definition ChannelMap.h:156
constexpr uint32 GetNumHeightChannels() const noexcept
Definition ChannelMap.h:174
constexpr uint32 GetNumChannels() const noexcept
Definition ChannelMap.h:168
constexpr bool IsValid() const noexcept
Definition ChannelMap.h:166
constexpr uint32 GetNumGroundChannels() const noexcept
Definition ChannelMap.h:170
constexpr bool operator==(const ChannelMap &other) const noexcept
Definition ChannelMap.h:252
static constexpr ChannelMap FromNumChannels(uint32 numChannels)
Definition ChannelMap.h:212
static constexpr ChannelMap FromChannelMask(uint32 channelMask)
Definition ChannelMap.h:211
constexpr bool operator!=(const ChannelMap &other) const noexcept
Definition ChannelMap.h:253
constexpr ChannelMap()=default
constexpr uint32 GetChannelMask() const
Definition ChannelMap.h:207
constexpr bool HasTopChannels() const noexcept
Definition ChannelMap.h:165
constexpr EChannel GetChannelAtIndex(uint32 index) const
Definition ChannelMap.h:194
constexpr uint32 GetChannelIndex(EChannel channel) const
Definition ChannelMap.h:176
constexpr bool HasLFE() const noexcept
Definition ChannelMap.h:164
constexpr bool Has(EChannel channel) const noexcept
Definition ChannelMap.h:163
constexpr void ForEachChannel(Predicate predicate) const
Definition ChannelMap.h:231
constexpr uint32 Surround_7_1
Definition ChannelMap.h:124
constexpr uint32 LCR
Definition ChannelMap.h:98
constexpr uint32 Surround_5_1
Definition ChannelMap.h:117
constexpr uint32 Pentagonal
Definition ChannelMap.h:107
constexpr uint32 Surround_9_0_6
Definition ChannelMap.h:146
constexpr uint32 Surround_7_0_2
Definition ChannelMap.h:134
constexpr uint32 Surround_7_0
Definition ChannelMap.h:123
constexpr uint32 Surround_7_1_4
Definition ChannelMap.h:137
constexpr uint32 Surround_6_1
Definition ChannelMap.h:119
constexpr uint32 Stereo
Definition ChannelMap.h:97
constexpr uint32 Surround_9_0_4
Definition ChannelMap.h:144
constexpr uint32 Surround_5_1_4
Definition ChannelMap.h:130
constexpr uint32 LRS
Definition ChannelMap.h:99
constexpr uint32 Octagonal
Definition ChannelMap.h:112
constexpr uint32 Surround_4_1
Definition ChannelMap.h:115
constexpr uint32 Surround_7_0_4
Definition ChannelMap.h:136
constexpr uint32 Invalid
Definition ChannelMap.h:93
constexpr uint32 Surround_6_0
Definition ChannelMap.h:118
constexpr uint32 LCRS
Definition ChannelMap.h:100
constexpr uint32 Surround_5_0
Definition ChannelMap.h:116
constexpr uint32 Surround_7_0_6
Definition ChannelMap.h:139
constexpr uint32 StereoHeadphones
Definition ChannelMap.h:104
JPL_INLINE std::string_view ToString(uint32 channelMask)
Definition ChannelMap.h:294
constexpr uint32 Surround_9_1_6
Definition ChannelMap.h:147
constexpr uint32 Surround_9_1_4
Definition ChannelMap.h:145
constexpr uint32 Surround_5_0_4
Definition ChannelMap.h:129
constexpr uint32 Quad
Definition ChannelMap.h:101
constexpr uint32 Surround_7_1_6
Definition ChannelMap.h:140
constexpr uint32 Surround_7_1_2
Definition ChannelMap.h:135
constexpr uint32 Surround_5_0_2
Definition ChannelMap.h:127
constexpr uint32 Mono
Definition ChannelMap.h:96
constexpr uint32 Surround_5_1_2
Definition ChannelMap.h:128
Definition DirectionEncoding.h:485
Definition AcousticMaterial.h:36
std::uint32_t uint32
Definition Core.h:311
constexpr std::string_view ToString(EChannel channel)
Definition ChannelMap.h:335
constexpr std::string_view ToStringShort(EChannel channel)
Definition ChannelMap.h:366
EChannel
Definition ChannelMap.h:39
@ TOP_Channels
Definition ChannelMap.h:75
@ TopBackLeft
Definition ChannelMap.h:67
@ TopFrontRight
Definition ChannelMap.h:61
@ BackCenter
Definition ChannelMap.h:53
@ TopSideRight
Definition ChannelMap.h:65
@ Invalid
Definition ChannelMap.h:78
@ TopFrontCenter
Definition ChannelMap.h:60
@ TopSideLeft
Definition ChannelMap.h:64
@ FrontLeftCenter
Definition ChannelMap.h:48
@ TopBackCenter
Definition ChannelMap.h:68
@ SideRight
Definition ChannelMap.h:46
@ SideLeft
Definition ChannelMap.h:45
@ FrontCenter
Definition ChannelMap.h:42
@ WideRight
Definition ChannelMap.h:56
@ BackRight
Definition ChannelMap.h:52
@ NUM_GroundChannels
Definition ChannelMap.h:73
@ NUM_TopChannels
Definition ChannelMap.h:76
@ TopBackRight
Definition ChannelMap.h:69
@ BackLeft
Definition ChannelMap.h:51
@ FrontRightCenter
Definition ChannelMap.h:49
@ TopCenter
Definition ChannelMap.h:58
@ LFE
Definition ChannelMap.h:43
@ FrontLeft
Definition ChannelMap.h:40
@ WideLeft
Definition ChannelMap.h:55
@ TopFrontLeft
Definition ChannelMap.h:59
@ FrontRight
Definition ChannelMap.h:41
Definition ChannelMap.h:281
Utility to hold some channel mask with a name.
Definition ChannelMap.h:263
NamedChannelMask(uint32 channelMask)
Definition ChannelMap.h:267
std::string_view Name
Definition ChannelMap.h:264
ChannelMap Layout
Definition ChannelMap.h:265
NamedChannelMask() noexcept=default
constexpr std::size_t operator()(const JPL::ChannelMap &channelMap) const
Definition ChannelMap.h:285