From 9b65ca4556611c0b5b582a57d0c7714614badcc0 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 24 Apr 2021 15:52:53 -0700 Subject: More include cleanup --- alc/alc.cpp | 2 +- alc/alu.h | 7 +++---- alc/effects/base.h | 3 +++ alc/voice.cpp | 7 +++---- 4 files changed, 10 insertions(+), 9 deletions(-) (limited to 'alc') diff --git a/alc/alc.cpp b/alc/alc.cpp index bd637f8a..1d96cef0 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -1128,7 +1128,7 @@ void alc_initconfig(void) AllowRTTimeLimit = *limopt; aluInit(); - aluInitMixer(); + aluInitMixer(ConfigValueStr(nullptr, nullptr, "resampler")); auto traperr = al::getenv("ALSOFT_TRAP_ERROR"); if(traperr && (al::strcasecmp(traperr->c_str(), "true") == 0 diff --git a/alc/alu.h b/alc/alu.h index 2aa1a652..b75c040e 100644 --- a/alc/alu.h +++ b/alc/alu.h @@ -4,8 +4,10 @@ #include #include #include +#include #include +#include "aloptional.h" #include "alspan.h" #include "core/ambidefs.h" #include "core/bufferline.h" @@ -32,9 +34,6 @@ constexpr float GainMixMax{1000.0f}; /* +60dB */ constexpr float SpeedOfSoundMetersPerSec{343.3f}; constexpr float AirAbsorbGainHF{0.99426f}; /* -0.05dB */ -/** Target gain for the reverb decay feedback reaching the decay time. */ -constexpr float ReverbDecayGain{0.001f}; /* -60 dB */ - enum HrtfRequestMode { Hrtf_Default = 0, @@ -44,7 +43,7 @@ enum HrtfRequestMode { void aluInit(void); -void aluInitMixer(void); +void aluInitMixer(al::optional resampler); /* aluInitRenderer * diff --git a/alc/effects/base.h b/alc/effects/base.h index 64621888..09c722f5 100644 --- a/alc/effects/base.h +++ b/alc/effects/base.h @@ -15,6 +15,9 @@ struct EffectSlot; struct BufferStorage; +/** Target gain for the reverb decay feedback reaching the decay time. */ +constexpr float ReverbDecayGain{0.001f}; /* -60 dB */ + enum class ChorusWaveform { Sinusoid, Triangle diff --git a/alc/voice.cpp b/alc/voice.cpp index 79c47588..6368d5c4 100644 --- a/alc/voice.cpp +++ b/alc/voice.cpp @@ -36,7 +36,6 @@ #include #include "albyte.h" -#include "alconfig.h" #include "alcontext.h" #include "alnumeric.h" #include "aloptional.h" @@ -131,9 +130,9 @@ inline HrtfMixerBlendFunc SelectHrtfBlendMixer() } // namespace -void aluInitMixer() +void aluInitMixer(al::optional resampler) { - if(auto resopt = ConfigValueStr(nullptr, nullptr, "resampler")) + if(resampler) { struct ResamplerEntry { const char name[16]; @@ -150,7 +149,7 @@ void aluInitMixer() { "fast_bsinc24", Resampler::FastBSinc24 }, }; - const char *str{resopt->c_str()}; + const char *str{resampler->c_str()}; if(al::strcasecmp(str, "bsinc") == 0) { WARN("Resampler option \"%s\" is deprecated, using bsinc12\n", str); -- cgit v1.2.3