aboutsummaryrefslogtreecommitdiffstats
path: root/alc/effects/chorus.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-04-25 11:36:37 -0700
committerChris Robinson <[email protected]>2021-04-25 11:36:37 -0700
commit0fe38c053d8dd827e774fbe0aef121e7aa0a0f28 (patch)
treeaaa18481969ff730ff2c287016644aca03622506 /alc/effects/chorus.cpp
parent9b65ca4556611c0b5b582a57d0c7714614badcc0 (diff)
Move some functions to core
And clean up more includes
Diffstat (limited to 'alc/effects/chorus.cpp')
-rw-r--r--alc/effects/chorus.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/alc/effects/chorus.cpp b/alc/effects/chorus.cpp
index 805c57d5..4171cef8 100644
--- a/alc/effects/chorus.cpp
+++ b/alc/effects/chorus.cpp
@@ -21,20 +21,24 @@
#include "config.h"
#include <algorithm>
+#include <array>
#include <climits>
-#include <cmath>
#include <cstdlib>
#include <iterator>
-#include "alcmain.h"
#include "alcontext.h"
#include "almalloc.h"
#include "alnumeric.h"
#include "alspan.h"
-#include "alu.h"
-#include "core/ambidefs.h"
+#include "core/bufferline.h"
+#include "core/devformat.h"
+#include "core/device.h"
+#include "core/mixer.h"
+#include "core/mixer/defs.h"
+#include "core/resampler_limits.h"
#include "effects/base.h"
#include "effectslot.h"
+#include "intrusive_ptr.h"
#include "math_defs.h"
#include "opthelpers.h"
#include "vector.h"
@@ -42,6 +46,8 @@
namespace {
+using uint = unsigned int;
+
#define MAX_UPDATE_SAMPLES 256
struct ChorusState final : public EffectState {
@@ -79,7 +85,7 @@ struct ChorusState final : public EffectState {
void ChorusState::deviceUpdate(const DeviceBase *Device, const Buffer&)
{
- constexpr float max_delay{maxf(AL_CHORUS_MAX_DELAY, AL_FLANGER_MAX_DELAY)};
+ constexpr float max_delay{maxf(ChorusMaxDelay, FlangerMaxDelay)};
const auto frequency = static_cast<float>(Device->Frequency);
const size_t maxlen{NextPowerOf2(float2uint(max_delay*2.0f*frequency) + 1u)};
@@ -247,7 +253,7 @@ void ChorusState::process(const size_t samplesToDo, const al::span<const FloatBu
++offset;
}
- for(ALsizei c{0};c < 2;++c)
+ for(size_t c{0};c < 2;++c)
MixSamples({temps[c], todo}, samplesOut, mGains[c].Current, mGains[c].Target,
samplesToDo-base, base);