aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-12-12 15:53:53 -0800
committerChris Robinson <[email protected]>2021-12-12 15:53:53 -0800
commit953745d38643b62dd10ba6d8c1e2e4c7fa20eb30 (patch)
tree1b6ced2e22f166513b4c9dbc8b9f53dd46541b98 /core
parent5e3fcb3a934844f1d70aa23a8a871a6915565ed2 (diff)
Make an inline function to check for 2D ambisonic formats
Diffstat (limited to 'core')
-rw-r--r--core/buffer_storage.h6
-rw-r--r--core/voice.cpp4
2 files changed, 7 insertions, 3 deletions
diff --git a/core/buffer_storage.h b/core/buffer_storage.h
index 091882f9..cde7704e 100644
--- a/core/buffer_storage.h
+++ b/core/buffer_storage.h
@@ -66,6 +66,12 @@ constexpr bool IsUHJ(FmtChannels chans) noexcept
constexpr bool IsAmbisonic(FmtChannels chans) noexcept
{ return IsBFormat(chans) || IsUHJ(chans); }
+constexpr bool Is2DAmbisonic(FmtChannels chans) noexcept
+{
+ return chans == FmtBFormat2D || chans == FmtUHJ2 || chans == FmtUHJ3
+ || chans == FmtSuperStereo;
+}
+
using CallbackType = int(*)(void*, void*, int);
diff --git a/core/voice.cpp b/core/voice.cpp
index f7a5940a..44ba897a 100644
--- a/core/voice.cpp
+++ b/core/voice.cpp
@@ -839,9 +839,7 @@ void Voice::prepare(DeviceBase *device)
*/
if(mAmbiOrder && device->mAmbiOrder > mAmbiOrder)
{
- const uint8_t *OrderFromChan{(mFmtChannels == FmtBFormat2D
- || mFmtChannels == FmtUHJ2 || mFmtChannels == FmtUHJ3
- || mFmtChannels == FmtSuperStereo) ?
+ const uint8_t *OrderFromChan{Is2DAmbisonic(mFmtChannels) ?
AmbiIndex::OrderFrom2DChannel().data() : AmbiIndex::OrderFromChannel().data()};
const auto scales = AmbiScale::GetHFOrderScales(mAmbiOrder, device->mAmbiOrder);