aboutsummaryrefslogtreecommitdiffstats
path: root/al
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-12-29 20:27:33 -0800
committerChris Robinson <[email protected]>2023-12-29 20:27:33 -0800
commit37171b7d9afd571820bd168fdad596a42bf04561 (patch)
treec51f58839311cbc116e3ff7d086f376d4ccd00f2 /al
parentcfab14287405a0d34f6a0fec1336f46415728fcf (diff)
Replace some macros
Diffstat (limited to 'al')
-rw-r--r--al/filter.cpp16
-rw-r--r--al/filter.h8
-rw-r--r--al/source.cpp24
3 files changed, 24 insertions, 24 deletions
diff --git a/al/filter.cpp b/al/filter.cpp
index 4a24a38f..0a999169 100644
--- a/al/filter.cpp
+++ b/al/filter.cpp
@@ -80,36 +80,36 @@ void InitFilterParams(ALfilter *filter, ALenum type)
{
filter->Gain = AL_LOWPASS_DEFAULT_GAIN;
filter->GainHF = AL_LOWPASS_DEFAULT_GAINHF;
- filter->HFReference = LOWPASSFREQREF;
+ filter->HFReference = LowPassFreqRef;
filter->GainLF = 1.0f;
- filter->LFReference = HIGHPASSFREQREF;
+ filter->LFReference = HighPassFreqRef;
filter->mTypeVariant.emplace<LowpassFilterTable>();
}
else if(type == AL_FILTER_HIGHPASS)
{
filter->Gain = AL_HIGHPASS_DEFAULT_GAIN;
filter->GainHF = 1.0f;
- filter->HFReference = LOWPASSFREQREF;
+ filter->HFReference = LowPassFreqRef;
filter->GainLF = AL_HIGHPASS_DEFAULT_GAINLF;
- filter->LFReference = HIGHPASSFREQREF;
+ filter->LFReference = HighPassFreqRef;
filter->mTypeVariant.emplace<HighpassFilterTable>();
}
else if(type == AL_FILTER_BANDPASS)
{
filter->Gain = AL_BANDPASS_DEFAULT_GAIN;
filter->GainHF = AL_BANDPASS_DEFAULT_GAINHF;
- filter->HFReference = LOWPASSFREQREF;
+ filter->HFReference = LowPassFreqRef;
filter->GainLF = AL_BANDPASS_DEFAULT_GAINLF;
- filter->LFReference = HIGHPASSFREQREF;
+ filter->LFReference = HighPassFreqRef;
filter->mTypeVariant.emplace<BandpassFilterTable>();
}
else
{
filter->Gain = 1.0f;
filter->GainHF = 1.0f;
- filter->HFReference = LOWPASSFREQREF;
+ filter->HFReference = LowPassFreqRef;
filter->GainLF = 1.0f;
- filter->LFReference = HIGHPASSFREQREF;
+ filter->LFReference = HighPassFreqRef;
filter->mTypeVariant.emplace<NullFilterTable>();
}
filter->type = type;
diff --git a/al/filter.h b/al/filter.h
index 20d5e012..dffe8c6e 100644
--- a/al/filter.h
+++ b/al/filter.h
@@ -13,9 +13,9 @@
#include "almalloc.h"
#include "alnumeric.h"
-#define LOWPASSFREQREF 5000.0f
-#define HIGHPASSFREQREF 250.0f
+inline constexpr float LowPassFreqRef{5000.0f};
+inline constexpr float HighPassFreqRef{250.0f};
template<typename T>
struct FilterTable {
@@ -41,9 +41,9 @@ struct ALfilter {
float Gain{1.0f};
float GainHF{1.0f};
- float HFReference{LOWPASSFREQREF};
+ float HFReference{LowPassFreqRef};
float GainLF{1.0f};
- float LFReference{HIGHPASSFREQREF};
+ float LFReference{HighPassFreqRef};
using TableTypes = std::variant<NullFilterTable,LowpassFilterTable,HighpassFilterTable,
BandpassFilterTable>;
diff --git a/al/source.cpp b/al/source.cpp
index 1ac3bf28..af58379b 100644
--- a/al/source.cpp
+++ b/al/source.cpp
@@ -1796,9 +1796,9 @@ NOINLINE void SetProperty(ALsource *const Source, ALCcontext *const Context, con
{
Source->Direct.Gain = 1.0f;
Source->Direct.GainHF = 1.0f;
- Source->Direct.HFReference = LOWPASSFREQREF;
+ Source->Direct.HFReference = LowPassFreqRef;
Source->Direct.GainLF = 1.0f;
- Source->Direct.LFReference = HIGHPASSFREQREF;
+ Source->Direct.LFReference = HighPassFreqRef;
}
return UpdateSourceProps(Source, Context);
}
@@ -1954,9 +1954,9 @@ NOINLINE void SetProperty(ALsource *const Source, ALCcontext *const Context, con
/* Disable filter */
send.Gain = 1.0f;
send.GainHF = 1.0f;
- send.HFReference = LOWPASSFREQREF;
+ send.HFReference = LowPassFreqRef;
send.GainLF = 1.0f;
- send.LFReference = HIGHPASSFREQREF;
+ send.LFReference = HighPassFreqRef;
}
/* We must force an update if the current auxiliary slot is valid
@@ -3573,17 +3573,17 @@ ALsource::ALsource()
{
Direct.Gain = 1.0f;
Direct.GainHF = 1.0f;
- Direct.HFReference = LOWPASSFREQREF;
+ Direct.HFReference = LowPassFreqRef;
Direct.GainLF = 1.0f;
- Direct.LFReference = HIGHPASSFREQREF;
+ Direct.LFReference = HighPassFreqRef;
for(auto &send : Send)
{
send.Slot = nullptr;
send.Gain = 1.0f;
send.GainHF = 1.0f;
- send.HFReference = LOWPASSFREQREF;
+ send.HFReference = LowPassFreqRef;
send.GainLF = 1.0f;
- send.LFReference = HIGHPASSFREQREF;
+ send.LFReference = HighPassFreqRef;
}
}
@@ -4078,9 +4078,9 @@ void ALsource::eax_update_direct_filter()
const auto& direct_param = eax_create_direct_filter_param();
Direct.Gain = direct_param.gain;
Direct.GainHF = direct_param.gain_hf;
- Direct.HFReference = LOWPASSFREQREF;
+ Direct.HFReference = LowPassFreqRef;
Direct.GainLF = 1.0f;
- Direct.LFReference = HIGHPASSFREQREF;
+ Direct.LFReference = HighPassFreqRef;
mPropsDirty = true;
}
@@ -4854,9 +4854,9 @@ void ALsource::eax_set_al_source_send(ALeffectslot *slot, size_t sendidx, const
auto &send = Send[sendidx];
send.Gain = filter.gain;
send.GainHF = filter.gain_hf;
- send.HFReference = LOWPASSFREQREF;
+ send.HFReference = LowPassFreqRef;
send.GainLF = 1.0f;
- send.LFReference = HIGHPASSFREQREF;
+ send.LFReference = HighPassFreqRef;
if(slot != nullptr)
IncrementRef(slot->ref);