aboutsummaryrefslogtreecommitdiffstats
path: root/alc/panning.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-09-04 13:38:54 -0700
committerChris Robinson <[email protected]>2022-09-04 13:38:54 -0700
commit92d135de3c5ef80f9d8e7d453f23954d47e46489 (patch)
treef61a620ff3cd52961e87d83880a1665a6f73ff47 /alc/panning.cpp
parent14bb4ad1b7a0126fe5dfdd2e62bea750ce12d961 (diff)
Track if doing 2D mixing only
And use it to select the proper HF scales
Diffstat (limited to 'alc/panning.cpp')
-rw-r--r--alc/panning.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/alc/panning.cpp b/alc/panning.cpp
index 121a8526..678a2639 100644
--- a/alc/panning.cpp
+++ b/alc/panning.cpp
@@ -611,6 +611,7 @@ void InitPanning(ALCdevice *device, const bool hqdec=false, const bool stablize=
[&n3dscale](const uint8_t &acn) noexcept -> BFChannelConfig
{ return BFChannelConfig{1.0f/n3dscale[acn], acn}; });
AllocChannels(device, count, 0);
+ device->m2DMixing = false;
float avg_dist{};
if(auto distopt = device->configValue<float>("decoder", "speaker-dist"))
@@ -667,6 +668,7 @@ void InitPanning(ALCdevice *device, const bool hqdec=false, const bool stablize=
/* For non-DevFmtAmbi3D, set the ambisonic order. */
device->mAmbiOrder = decoder.mOrder;
+ device->m2DMixing = !decoder.mIs3D;
const size_t ambicount{decoder.mIs3D ? AmbiChannelsFromOrder(decoder.mOrder) :
Ambi2DChannelsFromOrder(decoder.mOrder)};
@@ -906,6 +908,7 @@ void InitHrtfPanning(ALCdevice *device)
AmbiOrderHFGain = AmbiOrderHFGain2O;
}
device->mAmbiOrder = ambi_order;
+ device->m2DMixing = false;
const size_t count{AmbiChannelsFromOrder(ambi_order)};
std::transform(AmbiIndex::FromACN().begin(), AmbiIndex::FromACN().begin()+count,
@@ -929,8 +932,9 @@ void InitUhjPanning(ALCdevice *device)
constexpr size_t count{Ambi2DChannelsFromOrder(1)};
device->mAmbiOrder = 1;
+ device->m2DMixing = true;
- auto acnmap_begin = AmbiIndex::FromFuMa().begin();
+ auto acnmap_begin = AmbiIndex::FromFuMa2D().begin();
std::transform(acnmap_begin, acnmap_begin + count, std::begin(device->Dry.AmbiMap),
[](const uint8_t &acn) noexcept -> BFChannelConfig
{ return BFChannelConfig{1.0f/AmbiScale::FromUHJ()[acn], acn}; });
@@ -949,6 +953,7 @@ void aluInitRenderer(ALCdevice *device, int hrtf_id, al::optional<StereoEncoding
device->mIrSize = 0;
device->mHrtfName.clear();
device->mXOverFreq = 400.0f;
+ device->m2DMixing = false;
device->mRenderMode = RenderMode::Normal;
if(device->FmtChans != DevFmtStereo)