aboutsummaryrefslogtreecommitdiffstats
path: root/alc/effects
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-12-04 13:53:56 -0800
committerChris Robinson <[email protected]>2020-12-04 13:53:56 -0800
commit50e33ce8f49fdf40a9c48871d63e2cb49d72c94f (patch)
tree71273dd81371f9b14db1ffe138baf769f471d886 /alc/effects
parentc4132b80ede60ead27fae595623ac61674ed166a (diff)
Change some macros into constexpr variables
Diffstat (limited to 'alc/effects')
-rw-r--r--alc/effects/autowah.cpp4
-rw-r--r--alc/effects/compressor.cpp4
-rw-r--r--alc/effects/convolution.cpp8
-rw-r--r--alc/effects/equalizer.cpp4
-rw-r--r--alc/effects/modulator.cpp4
-rw-r--r--alc/effects/reverb.cpp6
-rw-r--r--alc/effects/vmorpher.cpp4
7 files changed, 17 insertions, 17 deletions
diff --git a/alc/effects/autowah.cpp b/alc/effects/autowah.cpp
index f2ffab44..4e089a80 100644
--- a/alc/effects/autowah.cpp
+++ b/alc/effects/autowah.cpp
@@ -63,7 +63,7 @@ struct AutowahState final : public EffectState {
/* Effect gains for each output channel */
float CurrentGains[MAX_OUTPUT_CHANNELS];
float TargetGains[MAX_OUTPUT_CHANNELS];
- } mChans[MAX_AMBI_CHANNELS];
+ } mChans[MaxAmbiChannels];
/* Effects buffers */
alignas(16) float mBufferOut[BufferLineSize];
@@ -121,7 +121,7 @@ void AutowahState::update(const ALCcontext *context, const EffectSlot *slot,
mBandwidthNorm = (MAX_FREQ-MIN_FREQ) / frequency;
mOutTarget = target.Main->Buffer;
- auto set_gains = [slot,target](auto &chan, al::span<const float,MAX_AMBI_CHANNELS> coeffs)
+ auto set_gains = [slot,target](auto &chan, al::span<const float,MaxAmbiChannels> coeffs)
{ ComputePanGains(target.Main, coeffs.data(), slot->Gain, chan.TargetGains); };
SetAmbiPanIdentity(std::begin(mChans), slot->Wet.Buffer.size(), set_gains);
}
diff --git a/alc/effects/compressor.cpp b/alc/effects/compressor.cpp
index f1fe6f36..00ccb59c 100644
--- a/alc/effects/compressor.cpp
+++ b/alc/effects/compressor.cpp
@@ -40,7 +40,7 @@ namespace {
struct CompressorState final : public EffectState {
/* Effect gains for each channel */
- float mGain[MAX_AMBI_CHANNELS][MAX_OUTPUT_CHANNELS]{};
+ float mGain[MaxAmbiChannels][MAX_OUTPUT_CHANNELS]{};
/* Effect parameters */
bool mEnabled{true};
@@ -79,7 +79,7 @@ void CompressorState::update(const ALCcontext*, const EffectSlot *slot,
mEnabled = props->Compressor.OnOff;
mOutTarget = target.Main->Buffer;
- auto set_gains = [slot,target](auto &gains, al::span<const float,MAX_AMBI_CHANNELS> coeffs)
+ auto set_gains = [slot,target](auto &gains, al::span<const float,MaxAmbiChannels> coeffs)
{ ComputePanGains(target.Main, coeffs.data(), slot->Gain, gains); };
SetAmbiPanIdentity(std::begin(mGain), slot->Wet.Buffer.size(), set_gains);
}
diff --git a/alc/effects/convolution.cpp b/alc/effects/convolution.cpp
index 2442f97e..733a0a27 100644
--- a/alc/effects/convolution.cpp
+++ b/alc/effects/convolution.cpp
@@ -74,20 +74,20 @@ void LoadSamples(double *RESTRICT dst, const al::byte *src, const size_t srcstep
}
-auto GetAmbiScales(AmbiScaling scaletype) noexcept -> const std::array<float,MAX_AMBI_CHANNELS>&
+auto GetAmbiScales(AmbiScaling scaletype) noexcept -> const std::array<float,MaxAmbiChannels>&
{
if(scaletype == AmbiScaling::FuMa) return AmbiScale::FromFuMa;
if(scaletype == AmbiScaling::SN3D) return AmbiScale::FromSN3D;
return AmbiScale::FromN3D;
}
-auto GetAmbiLayout(AmbiLayout layouttype) noexcept -> const std::array<uint8_t,MAX_AMBI_CHANNELS>&
+auto GetAmbiLayout(AmbiLayout layouttype) noexcept -> const std::array<uint8_t,MaxAmbiChannels>&
{
if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa;
return AmbiIndex::FromACN;
}
-auto GetAmbi2DLayout(AmbiLayout layouttype) noexcept -> const std::array<uint8_t,MAX_AMBI2D_CHANNELS>&
+auto GetAmbi2DLayout(AmbiLayout layouttype) noexcept -> const std::array<uint8_t,MaxAmbi2DChannels>&
{
if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa2D;
return AmbiIndex::From2D;
@@ -382,7 +382,7 @@ void ConvolutionState::update(const ALCcontext *context, const EffectSlot *slot,
GetAmbi2DLayout(mAmbiLayout).data() :
GetAmbiLayout(mAmbiLayout).data()};
- std::array<float,MAX_AMBI_CHANNELS> coeffs{};
+ std::array<float,MaxAmbiChannels> coeffs{};
for(size_t c{0u};c < mChans->size();++c)
{
const size_t acn{index_map[c]};
diff --git a/alc/effects/equalizer.cpp b/alc/effects/equalizer.cpp
index c311a941..e4544e49 100644
--- a/alc/effects/equalizer.cpp
+++ b/alc/effects/equalizer.cpp
@@ -85,7 +85,7 @@ struct EqualizerState final : public EffectState {
/* Effect gains for each channel */
float CurrentGains[MAX_OUTPUT_CHANNELS]{};
float TargetGains[MAX_OUTPUT_CHANNELS]{};
- } mChans[MAX_AMBI_CHANNELS];
+ } mChans[MaxAmbiChannels];
FloatBufferLine mSampleBuffer{};
@@ -149,7 +149,7 @@ void EqualizerState::update(const ALCcontext *context, const EffectSlot *slot,
}
mOutTarget = target.Main->Buffer;
- auto set_gains = [slot,target](auto &chan, al::span<const float,MAX_AMBI_CHANNELS> coeffs)
+ auto set_gains = [slot,target](auto &chan, al::span<const float,MaxAmbiChannels> coeffs)
{ ComputePanGains(target.Main, coeffs.data(), slot->Gain, chan.TargetGains); };
SetAmbiPanIdentity(std::begin(mChans), slot->Wet.Buffer.size(), set_gains);
}
diff --git a/alc/effects/modulator.cpp b/alc/effects/modulator.cpp
index a0af9890..56394566 100644
--- a/alc/effects/modulator.cpp
+++ b/alc/effects/modulator.cpp
@@ -78,7 +78,7 @@ struct ModulatorState final : public EffectState {
float CurrentGains[MAX_OUTPUT_CHANNELS]{};
float TargetGains[MAX_OUTPUT_CHANNELS]{};
- } mChans[MAX_AMBI_CHANNELS];
+ } mChans[MaxAmbiChannels];
void deviceUpdate(const ALCdevice *device) override;
@@ -124,7 +124,7 @@ void ModulatorState::update(const ALCcontext *context, const EffectSlot *slot,
mChans[i].Filter.copyParamsFrom(mChans[0].Filter);
mOutTarget = target.Main->Buffer;
- auto set_gains = [slot,target](auto &chan, al::span<const float,MAX_AMBI_CHANNELS> coeffs)
+ auto set_gains = [slot,target](auto &chan, al::span<const float,MaxAmbiChannels> coeffs)
{ ComputePanGains(target.Main, coeffs.data(), slot->Gain, chan.TargetGains); };
SetAmbiPanIdentity(std::begin(mChans), slot->Wet.Buffer.size(), set_gains);
}
diff --git a/alc/effects/reverb.cpp b/alc/effects/reverb.cpp
index a4b423c7..3e643969 100644
--- a/alc/effects/reverb.cpp
+++ b/alc/effects/reverb.cpp
@@ -435,7 +435,7 @@ struct ReverbState final : public EffectState {
const size_t counter, const size_t offset, const size_t todo);
MixOutT mMixOut{&ReverbState::MixOutPlain};
- std::array<float,MAX_AMBI_ORDER+1> mOrderScales{};
+ std::array<float,MaxAmbiOrder+1> mOrderScales{};
std::array<std::array<BandSplitter,NUM_LINES>,2> mAmbiSplitter;
@@ -973,13 +973,13 @@ void ReverbState::update3DPanning(const float *ReflectionsPan, const float *Late
mOutTarget = target.Main->Buffer;
for(size_t i{0u};i < NUM_LINES;i++)
{
- const float coeffs[MAX_AMBI_CHANNELS]{earlymat[0][i], earlymat[1][i], earlymat[2][i],
+ const float coeffs[MaxAmbiChannels]{earlymat[0][i], earlymat[1][i], earlymat[2][i],
earlymat[3][i]};
ComputePanGains(target.Main, coeffs, earlyGain, mEarly.PanGain[i]);
}
for(size_t i{0u};i < NUM_LINES;i++)
{
- const float coeffs[MAX_AMBI_CHANNELS]{latemat[0][i], latemat[1][i], latemat[2][i],
+ const float coeffs[MaxAmbiChannels]{latemat[0][i], latemat[1][i], latemat[2][i],
latemat[3][i]};
ComputePanGains(target.Main, coeffs, lateGain, mLate.PanGain[i]);
}
diff --git a/alc/effects/vmorpher.cpp b/alc/effects/vmorpher.cpp
index 2adcab56..d8c71d16 100644
--- a/alc/effects/vmorpher.cpp
+++ b/alc/effects/vmorpher.cpp
@@ -124,7 +124,7 @@ struct VmorpherState final : public EffectState {
/* Effect gains for each channel */
float CurrentGains[MAX_OUTPUT_CHANNELS]{};
float TargetGains[MAX_OUTPUT_CHANNELS]{};
- } mChans[MAX_AMBI_CHANNELS];
+ } mChans[MaxAmbiChannels];
void (*mGetSamples)(float*RESTRICT, ALuint, const ALuint, size_t){};
@@ -241,7 +241,7 @@ void VmorpherState::update(const ALCcontext *context, const EffectSlot *slot,
}
mOutTarget = target.Main->Buffer;
- auto set_gains = [slot,target](auto &chan, al::span<const float,MAX_AMBI_CHANNELS> coeffs)
+ auto set_gains = [slot,target](auto &chan, al::span<const float,MaxAmbiChannels> coeffs)
{ ComputePanGains(target.Main, coeffs.data(), slot->Gain, chan.TargetGains); };
SetAmbiPanIdentity(std::begin(mChans), slot->Wet.Buffer.size(), set_gains);
}