aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-12-10 22:15:17 -0800
committerChris Robinson <[email protected]>2023-12-10 22:15:17 -0800
commitbb3387b0fc5d3071a30c6d003b415dc6e77f3d62 (patch)
tree1645291391b412040ce55ae8dc34232cde5d22e0 /alc
parentcf37d92442ccf3c7f4b979bd97282dcbe28ca64a (diff)
Much more clang-tidy cleanup
Diffstat (limited to 'alc')
-rw-r--r--alc/backends/null.cpp1
-rw-r--r--alc/backends/pipewire.cpp12
-rw-r--r--alc/backends/portaudio.cpp3
-rw-r--r--alc/backends/sdl2.cpp3
-rw-r--r--alc/context.cpp2
-rw-r--r--alc/device.cpp2
-rw-r--r--alc/effects/convolution.cpp2
-rw-r--r--alc/effects/null.cpp2
-rw-r--r--alc/panning.cpp247
9 files changed, 140 insertions, 134 deletions
diff --git a/alc/backends/null.cpp b/alc/backends/null.cpp
index 3c68e4ce..c149820c 100644
--- a/alc/backends/null.cpp
+++ b/alc/backends/null.cpp
@@ -42,6 +42,7 @@ using std::chrono::seconds;
using std::chrono::milliseconds;
using std::chrono::nanoseconds;
+/* NOLINTNEXTLINE(*-avoid-c-arrays) */
constexpr char nullDevice[] = "No Output";
diff --git a/alc/backends/pipewire.cpp b/alc/backends/pipewire.cpp
index d934071e..2c726cbe 100644
--- a/alc/backends/pipewire.cpp
+++ b/alc/backends/pipewire.cpp
@@ -1420,8 +1420,7 @@ class PipeWirePlayback final : public BackendBase {
PwStreamPtr mStream;
spa_hook mStreamListener{};
spa_io_rate_match *mRateMatch{};
- std::unique_ptr<float*[]> mChannelPtrs;
- uint mNumChannels{};
+ std::vector<float*> mChannelPtrs;
static constexpr pw_stream_events CreateEvents()
{
@@ -1468,7 +1467,7 @@ void PipeWirePlayback::outputCallback() noexcept
if(!pw_buf) UNLIKELY return;
const al::span<spa_data> datas{pw_buf->buffer->datas,
- minu(mNumChannels, pw_buf->buffer->n_datas)};
+ minz(mChannelPtrs.size(), pw_buf->buffer->n_datas)};
#if PW_CHECK_VERSION(0,3,49)
/* In 0.3.49, pw_buffer::requested specifies the number of samples needed
* by the resampler/graph for this audio update.
@@ -1488,7 +1487,7 @@ void PipeWirePlayback::outputCallback() noexcept
* buffer length in any one channel is smaller than we wanted (shouldn't
* be, but just in case).
*/
- float **chanptr_end{mChannelPtrs.get()};
+ auto chanptr_end = mChannelPtrs.begin();
for(const auto &data : datas)
{
length = minu(length, data.maxsize/sizeof(float));
@@ -1500,7 +1499,7 @@ void PipeWirePlayback::outputCallback() noexcept
data.chunk->size = length * sizeof(float);
}
- mDevice->renderSamples({mChannelPtrs.get(), chanptr_end}, length);
+ mDevice->renderSamples(mChannelPtrs, length);
pw_buf->size = length;
pw_stream_queue_buffer(mStream.get(), pw_buf);
@@ -1711,8 +1710,7 @@ bool PipeWirePlayback::reset()
*/
plock.unlock();
- mNumChannels = mDevice->channelsFromFmt();
- mChannelPtrs = std::make_unique<float*[]>(mNumChannels);
+ mChannelPtrs.resize(mDevice->channelsFromFmt());
setDefaultWFXChannelOrder();
diff --git a/alc/backends/portaudio.cpp b/alc/backends/portaudio.cpp
index 2e2e33cc..554efe9a 100644
--- a/alc/backends/portaudio.cpp
+++ b/alc/backends/portaudio.cpp
@@ -39,7 +39,8 @@
namespace {
-constexpr char pa_device[] = "PortAudio Default";
+/* NOLINTNEXTLINE(*-avoid-c-arrays) */
+constexpr char pa_device[]{"PortAudio Default"};
#ifdef HAVE_DYNLOAD
diff --git a/alc/backends/sdl2.cpp b/alc/backends/sdl2.cpp
index f5ed4316..d7f66d93 100644
--- a/alc/backends/sdl2.cpp
+++ b/alc/backends/sdl2.cpp
@@ -46,7 +46,8 @@ namespace {
#define DEVNAME_PREFIX ""
#endif
-constexpr char defaultDeviceName[] = DEVNAME_PREFIX "Default Device";
+/* NOLINTNEXTLINE(*-avoid-c-arrays) */
+constexpr char defaultDeviceName[]{DEVNAME_PREFIX "Default Device"};
struct Sdl2Backend final : public BackendBase {
Sdl2Backend(DeviceBase *device) noexcept : BackendBase{device} { }
diff --git a/alc/context.cpp b/alc/context.cpp
index 2e67f9ac..92e458cb 100644
--- a/alc/context.cpp
+++ b/alc/context.cpp
@@ -5,11 +5,11 @@
#include <algorithm>
#include <array>
+#include <cstddef>
#include <cstring>
#include <functional>
#include <limits>
#include <numeric>
-#include <stddef.h>
#include <stdexcept>
#include <string_view>
#include <utility>
diff --git a/alc/device.cpp b/alc/device.cpp
index 27aa6f36..5a34ad64 100644
--- a/alc/device.cpp
+++ b/alc/device.cpp
@@ -3,8 +3,8 @@
#include "device.h"
+#include <cstddef>
#include <numeric>
-#include <stddef.h>
#include "albit.h"
#include "alconfig.h"
diff --git a/alc/effects/convolution.cpp b/alc/effects/convolution.cpp
index 5e81f6d1..c877456d 100644
--- a/alc/effects/convolution.cpp
+++ b/alc/effects/convolution.cpp
@@ -5,10 +5,10 @@
#include <array>
#include <complex>
#include <cstddef>
+#include <cstdint>
#include <functional>
#include <iterator>
#include <memory>
-#include <stdint.h>
#include <utility>
#ifdef HAVE_SSE_INTRINSICS
diff --git a/alc/effects/null.cpp b/alc/effects/null.cpp
index 1f9ae67b..12d1688e 100644
--- a/alc/effects/null.cpp
+++ b/alc/effects/null.cpp
@@ -1,7 +1,7 @@
#include "config.h"
-#include <stddef.h>
+#include <cstddef>
#include "almalloc.h"
#include "alspan.h"
diff --git a/alc/panning.cpp b/alc/panning.cpp
index add07051..c0fe83ee 100644
--- a/alc/panning.cpp
+++ b/alc/panning.cpp
@@ -227,10 +227,10 @@ struct DecoderConfig<DualBand, 0> {
using DecoderView = DecoderConfig<DualBand, 0>;
-void InitNearFieldCtrl(ALCdevice *device, float ctrl_dist, uint order, bool is3d)
+void InitNearFieldCtrl(ALCdevice *device, const float ctrl_dist, const uint order, const bool is3d)
{
- static const uint chans_per_order2d[MaxAmbiOrder+1]{ 1, 2, 2, 2 };
- static const uint chans_per_order3d[MaxAmbiOrder+1]{ 1, 3, 5, 7 };
+ static const std::array<uint,MaxAmbiOrder+1> chans_per_order2d{{1, 2, 2, 2}};
+ static const std::array<uint,MaxAmbiOrder+1> chans_per_order3d{{1, 3, 5, 7}};
/* NFC is only used when AvgSpeakerDist is greater than 0. */
if(!device->getConfigValueBool("decoder", "nfc", false) || !(ctrl_dist > 0.0f))
@@ -243,7 +243,7 @@ void InitNearFieldCtrl(ALCdevice *device, float ctrl_dist, uint order, bool is3d
(device->AvgSpeakerDist * static_cast<float>(device->Frequency))};
device->mNFCtrlFilter.init(w1);
- auto iter = std::copy_n(is3d ? chans_per_order3d : chans_per_order2d, order+1u,
+ auto iter = std::copy_n(is3d ? chans_per_order3d.begin() : chans_per_order2d.begin(), order+1u,
std::begin(device->NumChannelsPerOrder));
std::fill(iter, std::end(device->NumChannelsPerOrder), 0u);
}
@@ -361,8 +361,7 @@ DecoderView MakeDecoderView(ALCdevice *device, const AmbDecConf *conf,
const auto lfmatrix = conf->LFMatrix;
uint chan_count{0};
- using const_speaker_span = al::span<const AmbDecConf::SpeakerConf>;
- for(auto &speaker : const_speaker_span{conf->Speakers.get(), conf->NumSpeakers})
+ for(auto &speaker : al::span<const AmbDecConf::SpeakerConf>{conf->Speakers})
{
/* NOTE: AmbDec does not define any standard speaker names, however
* for this to work we have to by able to find the output channel
@@ -708,120 +707,126 @@ void InitPanning(ALCdevice *device, const bool hqdec=false, const bool stablize=
void InitHrtfPanning(ALCdevice *device)
{
- constexpr float Deg180{al::numbers::pi_v<float>};
- constexpr float Deg_90{Deg180 / 2.0f /* 90 degrees*/};
- constexpr float Deg_45{Deg_90 / 2.0f /* 45 degrees*/};
- constexpr float Deg135{Deg_45 * 3.0f /*135 degrees*/};
- constexpr float Deg_21{3.648638281e-01f /* 20~ 21 degrees*/};
- constexpr float Deg_32{5.535743589e-01f /* 31~ 32 degrees*/};
- constexpr float Deg_35{6.154797087e-01f /* 35~ 36 degrees*/};
- constexpr float Deg_58{1.017221968e+00f /* 58~ 59 degrees*/};
- constexpr float Deg_69{1.205932499e+00f /* 69~ 70 degrees*/};
- constexpr float Deg111{1.935660155e+00f /*110~111 degrees*/};
- constexpr float Deg122{2.124370686e+00f /*121~122 degrees*/};
- static const AngularPoint AmbiPoints1O[]{
- { EvRadians{ Deg_35}, AzRadians{-Deg_45} },
- { EvRadians{ Deg_35}, AzRadians{-Deg135} },
- { EvRadians{ Deg_35}, AzRadians{ Deg_45} },
- { EvRadians{ Deg_35}, AzRadians{ Deg135} },
- { EvRadians{-Deg_35}, AzRadians{-Deg_45} },
- { EvRadians{-Deg_35}, AzRadians{-Deg135} },
- { EvRadians{-Deg_35}, AzRadians{ Deg_45} },
- { EvRadians{-Deg_35}, AzRadians{ Deg135} },
- }, AmbiPoints2O[]{
- { EvRadians{-Deg_32}, AzRadians{ 0.0f} },
- { EvRadians{ 0.0f}, AzRadians{ Deg_58} },
- { EvRadians{ Deg_58}, AzRadians{ Deg_90} },
- { EvRadians{ Deg_32}, AzRadians{ 0.0f} },
- { EvRadians{ 0.0f}, AzRadians{ Deg122} },
- { EvRadians{-Deg_58}, AzRadians{-Deg_90} },
- { EvRadians{-Deg_32}, AzRadians{ Deg180} },
- { EvRadians{ 0.0f}, AzRadians{-Deg122} },
- { EvRadians{ Deg_58}, AzRadians{-Deg_90} },
- { EvRadians{ Deg_32}, AzRadians{ Deg180} },
- { EvRadians{ 0.0f}, AzRadians{-Deg_58} },
- { EvRadians{-Deg_58}, AzRadians{ Deg_90} },
- }, AmbiPoints3O[]{
- { EvRadians{ Deg_69}, AzRadians{-Deg_90} },
- { EvRadians{ Deg_69}, AzRadians{ Deg_90} },
- { EvRadians{-Deg_69}, AzRadians{-Deg_90} },
- { EvRadians{-Deg_69}, AzRadians{ Deg_90} },
- { EvRadians{ 0.0f}, AzRadians{-Deg_69} },
- { EvRadians{ 0.0f}, AzRadians{-Deg111} },
- { EvRadians{ 0.0f}, AzRadians{ Deg_69} },
- { EvRadians{ 0.0f}, AzRadians{ Deg111} },
- { EvRadians{ Deg_21}, AzRadians{ 0.0f} },
- { EvRadians{ Deg_21}, AzRadians{ Deg180} },
- { EvRadians{-Deg_21}, AzRadians{ 0.0f} },
- { EvRadians{-Deg_21}, AzRadians{ Deg180} },
- { EvRadians{ Deg_35}, AzRadians{-Deg_45} },
- { EvRadians{ Deg_35}, AzRadians{-Deg135} },
- { EvRadians{ Deg_35}, AzRadians{ Deg_45} },
- { EvRadians{ Deg_35}, AzRadians{ Deg135} },
- { EvRadians{-Deg_35}, AzRadians{-Deg_45} },
- { EvRadians{-Deg_35}, AzRadians{-Deg135} },
- { EvRadians{-Deg_35}, AzRadians{ Deg_45} },
- { EvRadians{-Deg_35}, AzRadians{ Deg135} },
+ static constexpr float Deg180{al::numbers::pi_v<float>};
+ static constexpr float Deg_90{Deg180 / 2.0f /* 90 degrees*/};
+ static constexpr float Deg_45{Deg_90 / 2.0f /* 45 degrees*/};
+ static constexpr float Deg135{Deg_45 * 3.0f /*135 degrees*/};
+ static constexpr float Deg_21{3.648638281e-01f /* 20~ 21 degrees*/};
+ static constexpr float Deg_32{5.535743589e-01f /* 31~ 32 degrees*/};
+ static constexpr float Deg_35{6.154797087e-01f /* 35~ 36 degrees*/};
+ static constexpr float Deg_58{1.017221968e+00f /* 58~ 59 degrees*/};
+ static constexpr float Deg_69{1.205932499e+00f /* 69~ 70 degrees*/};
+ static constexpr float Deg111{1.935660155e+00f /*110~111 degrees*/};
+ static constexpr float Deg122{2.124370686e+00f /*121~122 degrees*/};
+ static constexpr std::array AmbiPoints1O{
+ AngularPoint{EvRadians{ Deg_35}, AzRadians{-Deg_45}},
+ AngularPoint{EvRadians{ Deg_35}, AzRadians{-Deg135}},
+ AngularPoint{EvRadians{ Deg_35}, AzRadians{ Deg_45}},
+ AngularPoint{EvRadians{ Deg_35}, AzRadians{ Deg135}},
+ AngularPoint{EvRadians{-Deg_35}, AzRadians{-Deg_45}},
+ AngularPoint{EvRadians{-Deg_35}, AzRadians{-Deg135}},
+ AngularPoint{EvRadians{-Deg_35}, AzRadians{ Deg_45}},
+ AngularPoint{EvRadians{-Deg_35}, AzRadians{ Deg135}},
};
- static const float AmbiMatrix1O[][MaxAmbiChannels]{
- { 1.250000000e-01f, 1.250000000e-01f, 1.250000000e-01f, 1.250000000e-01f },
- { 1.250000000e-01f, 1.250000000e-01f, 1.250000000e-01f, -1.250000000e-01f },
- { 1.250000000e-01f, -1.250000000e-01f, 1.250000000e-01f, 1.250000000e-01f },
- { 1.250000000e-01f, -1.250000000e-01f, 1.250000000e-01f, -1.250000000e-01f },
- { 1.250000000e-01f, 1.250000000e-01f, -1.250000000e-01f, 1.250000000e-01f },
- { 1.250000000e-01f, 1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f },
- { 1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f, 1.250000000e-01f },
- { 1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f },
- }, AmbiMatrix2O[][MaxAmbiChannels]{
- { 8.333333333e-02f, 0.000000000e+00f, -7.588274978e-02f, 1.227808683e-01f, 0.000000000e+00f, 0.000000000e+00f, -1.591525047e-02f, -1.443375673e-01f, 1.167715449e-01f, },
- { 8.333333333e-02f, -1.227808683e-01f, 0.000000000e+00f, 7.588274978e-02f, -1.443375673e-01f, 0.000000000e+00f, -9.316949906e-02f, 0.000000000e+00f, -7.216878365e-02f, },
- { 8.333333333e-02f, -7.588274978e-02f, 1.227808683e-01f, 0.000000000e+00f, 0.000000000e+00f, -1.443375673e-01f, 1.090847495e-01f, 0.000000000e+00f, -4.460276122e-02f, },
- { 8.333333333e-02f, 0.000000000e+00f, 7.588274978e-02f, 1.227808683e-01f, 0.000000000e+00f, 0.000000000e+00f, -1.591525047e-02f, 1.443375673e-01f, 1.167715449e-01f, },
- { 8.333333333e-02f, -1.227808683e-01f, 0.000000000e+00f, -7.588274978e-02f, 1.443375673e-01f, 0.000000000e+00f, -9.316949906e-02f, 0.000000000e+00f, -7.216878365e-02f, },
- { 8.333333333e-02f, 7.588274978e-02f, -1.227808683e-01f, 0.000000000e+00f, 0.000000000e+00f, -1.443375673e-01f, 1.090847495e-01f, 0.000000000e+00f, -4.460276122e-02f, },
- { 8.333333333e-02f, 0.000000000e+00f, -7.588274978e-02f, -1.227808683e-01f, 0.000000000e+00f, 0.000000000e+00f, -1.591525047e-02f, 1.443375673e-01f, 1.167715449e-01f, },
- { 8.333333333e-02f, 1.227808683e-01f, 0.000000000e+00f, -7.588274978e-02f, -1.443375673e-01f, 0.000000000e+00f, -9.316949906e-02f, 0.000000000e+00f, -7.216878365e-02f, },
- { 8.333333333e-02f, 7.588274978e-02f, 1.227808683e-01f, 0.000000000e+00f, 0.000000000e+00f, 1.443375673e-01f, 1.090847495e-01f, 0.000000000e+00f, -4.460276122e-02f, },
- { 8.333333333e-02f, 0.000000000e+00f, 7.588274978e-02f, -1.227808683e-01f, 0.000000000e+00f, 0.000000000e+00f, -1.591525047e-02f, -1.443375673e-01f, 1.167715449e-01f, },
- { 8.333333333e-02f, 1.227808683e-01f, 0.000000000e+00f, 7.588274978e-02f, 1.443375673e-01f, 0.000000000e+00f, -9.316949906e-02f, 0.000000000e+00f, -7.216878365e-02f, },
- { 8.333333333e-02f, -7.588274978e-02f, -1.227808683e-01f, 0.000000000e+00f, 0.000000000e+00f, 1.443375673e-01f, 1.090847495e-01f, 0.000000000e+00f, -4.460276122e-02f, },
- }, AmbiMatrix3O[][MaxAmbiChannels]{
- { 5.000000000e-02f, 3.090169944e-02f, 8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, 6.454972244e-02f, 9.045084972e-02f, 0.000000000e+00f, -1.232790000e-02f, -1.256118221e-01f, 0.000000000e+00f, 1.126112056e-01f, 7.944389175e-02f, 0.000000000e+00f, 2.421151497e-02f, 0.000000000e+00f, },
- { 5.000000000e-02f, -3.090169944e-02f, 8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -6.454972244e-02f, 9.045084972e-02f, 0.000000000e+00f, -1.232790000e-02f, 1.256118221e-01f, 0.000000000e+00f, -1.126112056e-01f, 7.944389175e-02f, 0.000000000e+00f, 2.421151497e-02f, 0.000000000e+00f, },
- { 5.000000000e-02f, 3.090169944e-02f, -8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -6.454972244e-02f, 9.045084972e-02f, 0.000000000e+00f, -1.232790000e-02f, -1.256118221e-01f, 0.000000000e+00f, 1.126112056e-01f, -7.944389175e-02f, 0.000000000e+00f, -2.421151497e-02f, 0.000000000e+00f, },
- { 5.000000000e-02f, -3.090169944e-02f, -8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, 6.454972244e-02f, 9.045084972e-02f, 0.000000000e+00f, -1.232790000e-02f, 1.256118221e-01f, 0.000000000e+00f, -1.126112056e-01f, -7.944389175e-02f, 0.000000000e+00f, -2.421151497e-02f, 0.000000000e+00f, },
- { 5.000000000e-02f, 8.090169944e-02f, 0.000000000e+00f, 3.090169944e-02f, 6.454972244e-02f, 0.000000000e+00f, -5.590169944e-02f, 0.000000000e+00f, -7.216878365e-02f, -7.763237543e-02f, 0.000000000e+00f, -2.950836627e-02f, 0.000000000e+00f, -1.497759251e-01f, 0.000000000e+00f, -7.763237543e-02f, },
- { 5.000000000e-02f, 8.090169944e-02f, 0.000000000e+00f, -3.090169944e-02f, -6.454972244e-02f, 0.000000000e+00f, -5.590169944e-02f, 0.000000000e+00f, -7.216878365e-02f, -7.763237543e-02f, 0.000000000e+00f, -2.950836627e-02f, 0.000000000e+00f, 1.497759251e-01f, 0.000000000e+00f, 7.763237543e-02f, },
- { 5.000000000e-02f, -8.090169944e-02f, 0.000000000e+00f, 3.090169944e-02f, -6.454972244e-02f, 0.000000000e+00f, -5.590169944e-02f, 0.000000000e+00f, -7.216878365e-02f, 7.763237543e-02f, 0.000000000e+00f, 2.950836627e-02f, 0.000000000e+00f, -1.497759251e-01f, 0.000000000e+00f, -7.763237543e-02f, },
- { 5.000000000e-02f, -8.090169944e-02f, 0.000000000e+00f, -3.090169944e-02f, 6.454972244e-02f, 0.000000000e+00f, -5.590169944e-02f, 0.000000000e+00f, -7.216878365e-02f, 7.763237543e-02f, 0.000000000e+00f, 2.950836627e-02f, 0.000000000e+00f, 1.497759251e-01f, 0.000000000e+00f, 7.763237543e-02f, },
- { 5.000000000e-02f, 0.000000000e+00f, 3.090169944e-02f, 8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -3.454915028e-02f, 6.454972244e-02f, 8.449668365e-02f, 0.000000000e+00f, 0.000000000e+00f, 0.000000000e+00f, 3.034486645e-02f, -6.779013272e-02f, 1.659481923e-01f, 4.797944664e-02f, },
- { 5.000000000e-02f, 0.000000000e+00f, 3.090169944e-02f, -8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -3.454915028e-02f, -6.454972244e-02f, 8.449668365e-02f, 0.000000000e+00f, 0.000000000e+00f, 0.000000000e+00f, 3.034486645e-02f, 6.779013272e-02f, 1.659481923e-01f, -4.797944664e-02f, },
- { 5.000000000e-02f, 0.000000000e+00f, -3.090169944e-02f, 8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -3.454915028e-02f, -6.454972244e-02f, 8.449668365e-02f, 0.000000000e+00f, 0.000000000e+00f, 0.000000000e+00f, -3.034486645e-02f, -6.779013272e-02f, -1.659481923e-01f, 4.797944664e-02f, },
- { 5.000000000e-02f, 0.000000000e+00f, -3.090169944e-02f, -8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -3.454915028e-02f, 6.454972244e-02f, 8.449668365e-02f, 0.000000000e+00f, 0.000000000e+00f, 0.000000000e+00f, -3.034486645e-02f, 6.779013272e-02f, -1.659481923e-01f, -4.797944664e-02f, },
- { 5.000000000e-02f, 5.000000000e-02f, 5.000000000e-02f, 5.000000000e-02f, 6.454972244e-02f, 6.454972244e-02f, 0.000000000e+00f, 6.454972244e-02f, 0.000000000e+00f, 1.016220987e-01f, 6.338656910e-02f, -1.092600649e-02f, -7.364853795e-02f, 1.011266756e-01f, -7.086833869e-02f, -1.482646439e-02f, },
- { 5.000000000e-02f, 5.000000000e-02f, 5.000000000e-02f, -5.000000000e-02f, -6.454972244e-02f, 6.454972244e-02f, 0.000000000e+00f, -6.454972244e-02f, 0.000000000e+00f, 1.016220987e-01f, -6.338656910e-02f, -1.092600649e-02f, -7.364853795e-02f, -1.011266756e-01f, -7.086833869e-02f, 1.482646439e-02f, },
- { 5.000000000e-02f, -5.000000000e-02f, 5.000000000e-02f, 5.000000000e-02f, -6.454972244e-02f, -6.454972244e-02f, 0.000000000e+00f, 6.454972244e-02f, 0.000000000e+00f, -1.016220987e-01f, -6.338656910e-02f, 1.092600649e-02f, -7.364853795e-02f, 1.011266756e-01f, -7.086833869e-02f, -1.482646439e-02f, },
- { 5.000000000e-02f, -5.000000000e-02f, 5.000000000e-02f, -5.000000000e-02f, 6.454972244e-02f, -6.454972244e-02f, 0.000000000e+00f, -6.454972244e-02f, 0.000000000e+00f, -1.016220987e-01f, 6.338656910e-02f, 1.092600649e-02f, -7.364853795e-02f, -1.011266756e-01f, -7.086833869e-02f, 1.482646439e-02f, },
- { 5.000000000e-02f, 5.000000000e-02f, -5.000000000e-02f, 5.000000000e-02f, 6.454972244e-02f, -6.454972244e-02f, 0.000000000e+00f, -6.454972244e-02f, 0.000000000e+00f, 1.016220987e-01f, -6.338656910e-02f, -1.092600649e-02f, 7.364853795e-02f, 1.011266756e-01f, 7.086833869e-02f, -1.482646439e-02f, },
- { 5.000000000e-02f, 5.000000000e-02f, -5.000000000e-02f, -5.000000000e-02f, -6.454972244e-02f, -6.454972244e-02f, 0.000000000e+00f, 6.454972244e-02f, 0.000000000e+00f, 1.016220987e-01f, 6.338656910e-02f, -1.092600649e-02f, 7.364853795e-02f, -1.011266756e-01f, 7.086833869e-02f, 1.482646439e-02f, },
- { 5.000000000e-02f, -5.000000000e-02f, -5.000000000e-02f, 5.000000000e-02f, -6.454972244e-02f, 6.454972244e-02f, 0.000000000e+00f, -6.454972244e-02f, 0.000000000e+00f, -1.016220987e-01f, 6.338656910e-02f, 1.092600649e-02f, 7.364853795e-02f, 1.011266756e-01f, 7.086833869e-02f, -1.482646439e-02f, },
- { 5.000000000e-02f, -5.000000000e-02f, -5.000000000e-02f, -5.000000000e-02f, 6.454972244e-02f, 6.454972244e-02f, 0.000000000e+00f, 6.454972244e-02f, 0.000000000e+00f, -1.016220987e-01f, -6.338656910e-02f, 1.092600649e-02f, 7.364853795e-02f, -1.011266756e-01f, 7.086833869e-02f, 1.482646439e-02f, },
+ static constexpr std::array AmbiPoints2O{
+ AngularPoint{EvRadians{-Deg_32}, AzRadians{ 0.0f}},
+ AngularPoint{EvRadians{ 0.0f}, AzRadians{ Deg_58}},
+ AngularPoint{EvRadians{ Deg_58}, AzRadians{ Deg_90}},
+ AngularPoint{EvRadians{ Deg_32}, AzRadians{ 0.0f}},
+ AngularPoint{EvRadians{ 0.0f}, AzRadians{ Deg122}},
+ AngularPoint{EvRadians{-Deg_58}, AzRadians{-Deg_90}},
+ AngularPoint{EvRadians{-Deg_32}, AzRadians{ Deg180}},
+ AngularPoint{EvRadians{ 0.0f}, AzRadians{-Deg122}},
+ AngularPoint{EvRadians{ Deg_58}, AzRadians{-Deg_90}},
+ AngularPoint{EvRadians{ Deg_32}, AzRadians{ Deg180}},
+ AngularPoint{EvRadians{ 0.0f}, AzRadians{-Deg_58}},
+ AngularPoint{EvRadians{-Deg_58}, AzRadians{ Deg_90}},
};
- static const float AmbiOrderHFGain1O[MaxAmbiOrder+1]{
+ static constexpr std::array AmbiPoints3O{
+ AngularPoint{EvRadians{ Deg_69}, AzRadians{-Deg_90}},
+ AngularPoint{EvRadians{ Deg_69}, AzRadians{ Deg_90}},
+ AngularPoint{EvRadians{-Deg_69}, AzRadians{-Deg_90}},
+ AngularPoint{EvRadians{-Deg_69}, AzRadians{ Deg_90}},
+ AngularPoint{EvRadians{ 0.0f}, AzRadians{-Deg_69}},
+ AngularPoint{EvRadians{ 0.0f}, AzRadians{-Deg111}},
+ AngularPoint{EvRadians{ 0.0f}, AzRadians{ Deg_69}},
+ AngularPoint{EvRadians{ 0.0f}, AzRadians{ Deg111}},
+ AngularPoint{EvRadians{ Deg_21}, AzRadians{ 0.0f}},
+ AngularPoint{EvRadians{ Deg_21}, AzRadians{ Deg180}},
+ AngularPoint{EvRadians{-Deg_21}, AzRadians{ 0.0f}},
+ AngularPoint{EvRadians{-Deg_21}, AzRadians{ Deg180}},
+ AngularPoint{EvRadians{ Deg_35}, AzRadians{-Deg_45}},
+ AngularPoint{EvRadians{ Deg_35}, AzRadians{-Deg135}},
+ AngularPoint{EvRadians{ Deg_35}, AzRadians{ Deg_45}},
+ AngularPoint{EvRadians{ Deg_35}, AzRadians{ Deg135}},
+ AngularPoint{EvRadians{-Deg_35}, AzRadians{-Deg_45}},
+ AngularPoint{EvRadians{-Deg_35}, AzRadians{-Deg135}},
+ AngularPoint{EvRadians{-Deg_35}, AzRadians{ Deg_45}},
+ AngularPoint{EvRadians{-Deg_35}, AzRadians{ Deg135}},
+ };
+ static constexpr std::array AmbiMatrix1O{
+ std::array<float,MaxAmbiChannels>{{1.250000000e-01f, 1.250000000e-01f, 1.250000000e-01f, 1.250000000e-01f}},
+ std::array<float,MaxAmbiChannels>{{1.250000000e-01f, 1.250000000e-01f, 1.250000000e-01f, -1.250000000e-01f}},
+ std::array<float,MaxAmbiChannels>{{1.250000000e-01f, -1.250000000e-01f, 1.250000000e-01f, 1.250000000e-01f}},
+ std::array<float,MaxAmbiChannels>{{1.250000000e-01f, -1.250000000e-01f, 1.250000000e-01f, -1.250000000e-01f}},
+ std::array<float,MaxAmbiChannels>{{1.250000000e-01f, 1.250000000e-01f, -1.250000000e-01f, 1.250000000e-01f}},
+ std::array<float,MaxAmbiChannels>{{1.250000000e-01f, 1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f}},
+ std::array<float,MaxAmbiChannels>{{1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f, 1.250000000e-01f}},
+ std::array<float,MaxAmbiChannels>{{1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f}},
+ };
+ static constexpr std::array AmbiMatrix2O{
+ std::array<float,MaxAmbiChannels>{{8.333333333e-02f, 0.000000000e+00f, -7.588274978e-02f, 1.227808683e-01f, 0.000000000e+00f, 0.000000000e+00f, -1.591525047e-02f, -1.443375673e-01f, 1.167715449e-01f}},
+ std::array<float,MaxAmbiChannels>{{8.333333333e-02f, -1.227808683e-01f, 0.000000000e+00f, 7.588274978e-02f, -1.443375673e-01f, 0.000000000e+00f, -9.316949906e-02f, 0.000000000e+00f, -7.216878365e-02f}},
+ std::array<float,MaxAmbiChannels>{{8.333333333e-02f, -7.588274978e-02f, 1.227808683e-01f, 0.000000000e+00f, 0.000000000e+00f, -1.443375673e-01f, 1.090847495e-01f, 0.000000000e+00f, -4.460276122e-02f}},
+ std::array<float,MaxAmbiChannels>{{8.333333333e-02f, 0.000000000e+00f, 7.588274978e-02f, 1.227808683e-01f, 0.000000000e+00f, 0.000000000e+00f, -1.591525047e-02f, 1.443375673e-01f, 1.167715449e-01f}},
+ std::array<float,MaxAmbiChannels>{{8.333333333e-02f, -1.227808683e-01f, 0.000000000e+00f, -7.588274978e-02f, 1.443375673e-01f, 0.000000000e+00f, -9.316949906e-02f, 0.000000000e+00f, -7.216878365e-02f}},
+ std::array<float,MaxAmbiChannels>{{8.333333333e-02f, 7.588274978e-02f, -1.227808683e-01f, 0.000000000e+00f, 0.000000000e+00f, -1.443375673e-01f, 1.090847495e-01f, 0.000000000e+00f, -4.460276122e-02f}},
+ std::array<float,MaxAmbiChannels>{{8.333333333e-02f, 0.000000000e+00f, -7.588274978e-02f, -1.227808683e-01f, 0.000000000e+00f, 0.000000000e+00f, -1.591525047e-02f, 1.443375673e-01f, 1.167715449e-01f}},
+ std::array<float,MaxAmbiChannels>{{8.333333333e-02f, 1.227808683e-01f, 0.000000000e+00f, -7.588274978e-02f, -1.443375673e-01f, 0.000000000e+00f, -9.316949906e-02f, 0.000000000e+00f, -7.216878365e-02f}},
+ std::array<float,MaxAmbiChannels>{{8.333333333e-02f, 7.588274978e-02f, 1.227808683e-01f, 0.000000000e+00f, 0.000000000e+00f, 1.443375673e-01f, 1.090847495e-01f, 0.000000000e+00f, -4.460276122e-02f}},
+ std::array<float,MaxAmbiChannels>{{8.333333333e-02f, 0.000000000e+00f, 7.588274978e-02f, -1.227808683e-01f, 0.000000000e+00f, 0.000000000e+00f, -1.591525047e-02f, -1.443375673e-01f, 1.167715449e-01f}},
+ std::array<float,MaxAmbiChannels>{{8.333333333e-02f, 1.227808683e-01f, 0.000000000e+00f, 7.588274978e-02f, 1.443375673e-01f, 0.000000000e+00f, -9.316949906e-02f, 0.000000000e+00f, -7.216878365e-02f}},
+ std::array<float,MaxAmbiChannels>{{8.333333333e-02f, -7.588274978e-02f, -1.227808683e-01f, 0.000000000e+00f, 0.000000000e+00f, 1.443375673e-01f, 1.090847495e-01f, 0.000000000e+00f, -4.460276122e-02f}},
+ };
+ static constexpr std::array AmbiMatrix3O{
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, 3.090169944e-02f, 8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, 6.454972244e-02f, 9.045084972e-02f, 0.000000000e+00f, -1.232790000e-02f, -1.256118221e-01f, 0.000000000e+00f, 1.126112056e-01f, 7.944389175e-02f, 0.000000000e+00f, 2.421151497e-02f, 0.000000000e+00f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, -3.090169944e-02f, 8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -6.454972244e-02f, 9.045084972e-02f, 0.000000000e+00f, -1.232790000e-02f, 1.256118221e-01f, 0.000000000e+00f, -1.126112056e-01f, 7.944389175e-02f, 0.000000000e+00f, 2.421151497e-02f, 0.000000000e+00f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, 3.090169944e-02f, -8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -6.454972244e-02f, 9.045084972e-02f, 0.000000000e+00f, -1.232790000e-02f, -1.256118221e-01f, 0.000000000e+00f, 1.126112056e-01f, -7.944389175e-02f, 0.000000000e+00f, -2.421151497e-02f, 0.000000000e+00f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, -3.090169944e-02f, -8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, 6.454972244e-02f, 9.045084972e-02f, 0.000000000e+00f, -1.232790000e-02f, 1.256118221e-01f, 0.000000000e+00f, -1.126112056e-01f, -7.944389175e-02f, 0.000000000e+00f, -2.421151497e-02f, 0.000000000e+00f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, 8.090169944e-02f, 0.000000000e+00f, 3.090169944e-02f, 6.454972244e-02f, 0.000000000e+00f, -5.590169944e-02f, 0.000000000e+00f, -7.216878365e-02f, -7.763237543e-02f, 0.000000000e+00f, -2.950836627e-02f, 0.000000000e+00f, -1.497759251e-01f, 0.000000000e+00f, -7.763237543e-02f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, 8.090169944e-02f, 0.000000000e+00f, -3.090169944e-02f, -6.454972244e-02f, 0.000000000e+00f, -5.590169944e-02f, 0.000000000e+00f, -7.216878365e-02f, -7.763237543e-02f, 0.000000000e+00f, -2.950836627e-02f, 0.000000000e+00f, 1.497759251e-01f, 0.000000000e+00f, 7.763237543e-02f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, -8.090169944e-02f, 0.000000000e+00f, 3.090169944e-02f, -6.454972244e-02f, 0.000000000e+00f, -5.590169944e-02f, 0.000000000e+00f, -7.216878365e-02f, 7.763237543e-02f, 0.000000000e+00f, 2.950836627e-02f, 0.000000000e+00f, -1.497759251e-01f, 0.000000000e+00f, -7.763237543e-02f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, -8.090169944e-02f, 0.000000000e+00f, -3.090169944e-02f, 6.454972244e-02f, 0.000000000e+00f, -5.590169944e-02f, 0.000000000e+00f, -7.216878365e-02f, 7.763237543e-02f, 0.000000000e+00f, 2.950836627e-02f, 0.000000000e+00f, 1.497759251e-01f, 0.000000000e+00f, 7.763237543e-02f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, 0.000000000e+00f, 3.090169944e-02f, 8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -3.454915028e-02f, 6.454972244e-02f, 8.449668365e-02f, 0.000000000e+00f, 0.000000000e+00f, 0.000000000e+00f, 3.034486645e-02f, -6.779013272e-02f, 1.659481923e-01f, 4.797944664e-02f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, 0.000000000e+00f, 3.090169944e-02f, -8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -3.454915028e-02f, -6.454972244e-02f, 8.449668365e-02f, 0.000000000e+00f, 0.000000000e+00f, 0.000000000e+00f, 3.034486645e-02f, 6.779013272e-02f, 1.659481923e-01f, -4.797944664e-02f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, 0.000000000e+00f, -3.090169944e-02f, 8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -3.454915028e-02f, -6.454972244e-02f, 8.449668365e-02f, 0.000000000e+00f, 0.000000000e+00f, 0.000000000e+00f, -3.034486645e-02f, -6.779013272e-02f, -1.659481923e-01f, 4.797944664e-02f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, 0.000000000e+00f, -3.090169944e-02f, -8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -3.454915028e-02f, 6.454972244e-02f, 8.449668365e-02f, 0.000000000e+00f, 0.000000000e+00f, 0.000000000e+00f, -3.034486645e-02f, 6.779013272e-02f, -1.659481923e-01f, -4.797944664e-02f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, 5.000000000e-02f, 5.000000000e-02f, 5.000000000e-02f, 6.454972244e-02f, 6.454972244e-02f, 0.000000000e+00f, 6.454972244e-02f, 0.000000000e+00f, 1.016220987e-01f, 6.338656910e-02f, -1.092600649e-02f, -7.364853795e-02f, 1.011266756e-01f, -7.086833869e-02f, -1.482646439e-02f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, 5.000000000e-02f, 5.000000000e-02f, -5.000000000e-02f, -6.454972244e-02f, 6.454972244e-02f, 0.000000000e+00f, -6.454972244e-02f, 0.000000000e+00f, 1.016220987e-01f, -6.338656910e-02f, -1.092600649e-02f, -7.364853795e-02f, -1.011266756e-01f, -7.086833869e-02f, 1.482646439e-02f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, -5.000000000e-02f, 5.000000000e-02f, 5.000000000e-02f, -6.454972244e-02f, -6.454972244e-02f, 0.000000000e+00f, 6.454972244e-02f, 0.000000000e+00f, -1.016220987e-01f, -6.338656910e-02f, 1.092600649e-02f, -7.364853795e-02f, 1.011266756e-01f, -7.086833869e-02f, -1.482646439e-02f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, -5.000000000e-02f, 5.000000000e-02f, -5.000000000e-02f, 6.454972244e-02f, -6.454972244e-02f, 0.000000000e+00f, -6.454972244e-02f, 0.000000000e+00f, -1.016220987e-01f, 6.338656910e-02f, 1.092600649e-02f, -7.364853795e-02f, -1.011266756e-01f, -7.086833869e-02f, 1.482646439e-02f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, 5.000000000e-02f, -5.000000000e-02f, 5.000000000e-02f, 6.454972244e-02f, -6.454972244e-02f, 0.000000000e+00f, -6.454972244e-02f, 0.000000000e+00f, 1.016220987e-01f, -6.338656910e-02f, -1.092600649e-02f, 7.364853795e-02f, 1.011266756e-01f, 7.086833869e-02f, -1.482646439e-02f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, 5.000000000e-02f, -5.000000000e-02f, -5.000000000e-02f, -6.454972244e-02f, -6.454972244e-02f, 0.000000000e+00f, 6.454972244e-02f, 0.000000000e+00f, 1.016220987e-01f, 6.338656910e-02f, -1.092600649e-02f, 7.364853795e-02f, -1.011266756e-01f, 7.086833869e-02f, 1.482646439e-02f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, -5.000000000e-02f, -5.000000000e-02f, 5.000000000e-02f, -6.454972244e-02f, 6.454972244e-02f, 0.000000000e+00f, -6.454972244e-02f, 0.000000000e+00f, -1.016220987e-01f, 6.338656910e-02f, 1.092600649e-02f, 7.364853795e-02f, 1.011266756e-01f, 7.086833869e-02f, -1.482646439e-02f}},
+ std::array<float,MaxAmbiChannels>{{5.000000000e-02f, -5.000000000e-02f, -5.000000000e-02f, -5.000000000e-02f, 6.454972244e-02f, 6.454972244e-02f, 0.000000000e+00f, 6.454972244e-02f, 0.000000000e+00f, -1.016220987e-01f, -6.338656910e-02f, 1.092600649e-02f, 7.364853795e-02f, -1.011266756e-01f, 7.086833869e-02f, 1.482646439e-02f}},
+ };
+ static constexpr std::array<float,MaxAmbiOrder+1> AmbiOrderHFGain1O{
/*ENRGY*/ 2.000000000e+00f, 1.154700538e+00f
- }, AmbiOrderHFGain2O[MaxAmbiOrder+1]{
+ };
+ static constexpr std::array<float,MaxAmbiOrder+1> AmbiOrderHFGain2O{
/*ENRGY*/ 1.825741858e+00f, 1.414213562e+00f, 7.302967433e-01f
/*AMP 1.000000000e+00f, 7.745966692e-01f, 4.000000000e-01f*/
/*RMS 9.128709292e-01f, 7.071067812e-01f, 3.651483717e-01f*/
- }, AmbiOrderHFGain3O[MaxAmbiOrder+1]{
+ };
+ static constexpr std::array<float,MaxAmbiOrder+1> AmbiOrderHFGain3O{
/*ENRGY 1.865086714e+00f, 1.606093894e+00f, 1.142055301e+00f, 5.683795528e-01f*/
/*AMP*/ 1.000000000e+00f, 8.611363116e-01f, 6.123336207e-01f, 3.047469850e-01f
/*RMS 8.340921354e-01f, 7.182670250e-01f, 5.107426573e-01f, 2.541870634e-01f*/
};
- static_assert(std::size(AmbiPoints1O) == std::size(AmbiMatrix1O), "First-Order Ambisonic HRTF mismatch");
- static_assert(std::size(AmbiPoints2O) == std::size(AmbiMatrix2O), "Second-Order Ambisonic HRTF mismatch");
- static_assert(std::size(AmbiPoints3O) == std::size(AmbiMatrix3O), "Third-Order Ambisonic HRTF mismatch");
+ static_assert(AmbiPoints1O.size() == AmbiMatrix1O.size(), "First-Order Ambisonic HRTF mismatch");
+ static_assert(AmbiPoints2O.size() == AmbiMatrix2O.size(), "Second-Order Ambisonic HRTF mismatch");
+ static_assert(AmbiPoints3O.size() == AmbiMatrix3O.size(), "Third-Order Ambisonic HRTF mismatch");
/* A 700hz crossover frequency provides tighter sound imaging at the sweet
* spot with ambisonic decoding, as the distance between the ears is closer
@@ -844,15 +849,15 @@ void InitHrtfPanning(ALCdevice *device)
if(auto modeopt = device->configValue<std::string>(nullptr, "hrtf-mode"))
{
struct HrtfModeEntry {
- char name[8];
+ char name[7]; /* NOLINT(*-avoid-c-arrays) */
RenderMode mode;
uint order;
};
- static const HrtfModeEntry hrtf_modes[]{
- { "full", RenderMode::Hrtf, 1 },
- { "ambi1", RenderMode::Normal, 1 },
- { "ambi2", RenderMode::Normal, 2 },
- { "ambi3", RenderMode::Normal, 3 },
+ static constexpr std::array hrtf_modes{
+ HrtfModeEntry{"full", RenderMode::Hrtf, 1},
+ HrtfModeEntry{"ambi1", RenderMode::Normal, 1},
+ HrtfModeEntry{"ambi2", RenderMode::Normal, 2},
+ HrtfModeEntry{"ambi3", RenderMode::Normal, 3},
};
const char *mode{modeopt->c_str()};
@@ -882,9 +887,9 @@ void InitHrtfPanning(ALCdevice *device)
device->mHrtfName.c_str());
bool perHrirMin{false};
- al::span<const AngularPoint> AmbiPoints{AmbiPoints1O};
- const float (*AmbiMatrix)[MaxAmbiChannels]{AmbiMatrix1O};
- al::span<const float,MaxAmbiOrder+1> AmbiOrderHFGain{AmbiOrderHFGain1O};
+ auto AmbiPoints = al::span{AmbiPoints1O}.subspan(0);
+ auto AmbiMatrix = al::span{AmbiMatrix1O}.subspan(0);
+ auto AmbiOrderHFGain = al::span{AmbiOrderHFGain1O};
if(ambi_order >= 3)
{
perHrirMin = true;
@@ -903,7 +908,7 @@ void InitHrtfPanning(ALCdevice *device)
const size_t count{AmbiChannelsFromOrder(ambi_order)};
std::transform(AmbiIndex::FromACN.begin(), AmbiIndex::FromACN.begin()+count,
- std::begin(device->Dry.AmbiMap),
+ device->Dry.AmbiMap.begin(),
[](const uint8_t &index) noexcept { return BFChannelConfig{1.0f, index}; }
);
AllocChannels(device, count, device->channelsFromFmt());
@@ -981,9 +986,9 @@ void aluInitRenderer(ALCdevice *device, int hrtf_id, std::optional<StereoEncodin
ERR(" %s\n", err->c_str());
return false;
}
- else if(conf.NumSpeakers > MaxOutputChannels)
+ else if(conf.Speakers.size() > MaxOutputChannels)
{
- ERR("Unsupported decoder speaker count %zu (max %zu)\n", conf.NumSpeakers,
+ ERR("Unsupported decoder speaker count %zu (max %zu)\n", conf.Speakers.size(),
MaxOutputChannels);
return false;
}