From 504745abec35c4718833cd7c7ed8db3b242e0aa2 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 28 Mar 2020 15:03:38 -0700 Subject: Use a standard bool instead of ALboolean --- alc/effects/autowah.cpp | 6 +++--- alc/effects/base.h | 2 +- alc/effects/chorus.cpp | 6 +++--- alc/effects/compressor.cpp | 6 +++--- alc/effects/dedicated.cpp | 6 +++--- alc/effects/distortion.cpp | 6 +++--- alc/effects/echo.cpp | 6 +++--- alc/effects/equalizer.cpp | 10 +++++----- alc/effects/fshifter.cpp | 6 +++--- alc/effects/modulator.cpp | 6 +++--- alc/effects/null.cpp | 6 +++--- alc/effects/pshifter.cpp | 8 ++++---- alc/effects/reverb.cpp | 8 ++++---- alc/effects/vmorpher.cpp | 6 +++--- 14 files changed, 44 insertions(+), 44 deletions(-) (limited to 'alc') diff --git a/alc/effects/autowah.cpp b/alc/effects/autowah.cpp index a79c21d9..48a90f76 100644 --- a/alc/effects/autowah.cpp +++ b/alc/effects/autowah.cpp @@ -69,14 +69,14 @@ struct AutowahState final : public EffectState { alignas(16) ALfloat mBufferOut[BUFFERSIZE]; - ALboolean deviceUpdate(const ALCdevice *device) override; + bool deviceUpdate(const ALCdevice *device) override; void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) override; void process(const size_t samplesToDo, const al::span samplesIn, const al::span samplesOut) override; DEF_NEWDEL(AutowahState) }; -ALboolean AutowahState::deviceUpdate(const ALCdevice*) +bool AutowahState::deviceUpdate(const ALCdevice*) { /* (Re-)initializing parameters and clear the buffers. */ @@ -101,7 +101,7 @@ ALboolean AutowahState::deviceUpdate(const ALCdevice*) chan.Filter.z2 = 0.0f; } - return AL_TRUE; + return true; } void AutowahState::update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) diff --git a/alc/effects/base.h b/alc/effects/base.h index e8134290..5d77e904 100644 --- a/alc/effects/base.h +++ b/alc/effects/base.h @@ -157,7 +157,7 @@ struct EffectState : public al::intrusive_ref { virtual ~EffectState() = default; - virtual ALboolean deviceUpdate(const ALCdevice *device) = 0; + virtual bool deviceUpdate(const ALCdevice *device) = 0; virtual void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) = 0; virtual void process(const size_t samplesToDo, const al::span samplesIn, const al::span samplesOut) = 0; }; diff --git a/alc/effects/chorus.cpp b/alc/effects/chorus.cpp index 59e05be0..a6408fce 100644 --- a/alc/effects/chorus.cpp +++ b/alc/effects/chorus.cpp @@ -108,14 +108,14 @@ struct ChorusState final : public EffectState { ALfloat mFeedback{0.0f}; - ALboolean deviceUpdate(const ALCdevice *device) override; + bool deviceUpdate(const ALCdevice *device) override; void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) override; void process(const size_t samplesToDo, const al::span samplesIn, const al::span samplesOut) override; DEF_NEWDEL(ChorusState) }; -ALboolean ChorusState::deviceUpdate(const ALCdevice *Device) +bool ChorusState::deviceUpdate(const ALCdevice *Device) { constexpr ALfloat max_delay{maxf(AL_CHORUS_MAX_DELAY, AL_FLANGER_MAX_DELAY)}; @@ -134,7 +134,7 @@ ALboolean ChorusState::deviceUpdate(const ALCdevice *Device) std::fill(std::begin(e.Target), std::end(e.Target), 0.0f); } - return AL_TRUE; + return true; } void ChorusState::update(const ALCcontext *Context, const ALeffectslot *Slot, const EffectProps *props, const EffectTarget target) diff --git a/alc/effects/compressor.cpp b/alc/effects/compressor.cpp index 44ffaaef..ad82037a 100644 --- a/alc/effects/compressor.cpp +++ b/alc/effects/compressor.cpp @@ -49,14 +49,14 @@ struct CompressorState final : public EffectState { ALfloat mEnvFollower{1.0f}; - ALboolean deviceUpdate(const ALCdevice *device) override; + bool deviceUpdate(const ALCdevice *device) override; void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) override; void process(const size_t samplesToDo, const al::span samplesIn, const al::span samplesOut) override; DEF_NEWDEL(CompressorState) }; -ALboolean CompressorState::deviceUpdate(const ALCdevice *device) +bool CompressorState::deviceUpdate(const ALCdevice *device) { /* Number of samples to do a full attack and release (non-integer sample * counts are okay). @@ -70,7 +70,7 @@ ALboolean CompressorState::deviceUpdate(const ALCdevice *device) mAttackMult = std::pow(AMP_ENVELOPE_MAX/AMP_ENVELOPE_MIN, 1.0f/attackCount); mReleaseMult = std::pow(AMP_ENVELOPE_MIN/AMP_ENVELOPE_MAX, 1.0f/releaseCount); - return AL_TRUE; + return true; } void CompressorState::update(const ALCcontext*, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) diff --git a/alc/effects/dedicated.cpp b/alc/effects/dedicated.cpp index aa81e13b..e1640498 100644 --- a/alc/effects/dedicated.cpp +++ b/alc/effects/dedicated.cpp @@ -37,17 +37,17 @@ struct DedicatedState final : public EffectState { ALfloat mTargetGains[MAX_OUTPUT_CHANNELS]; - ALboolean deviceUpdate(const ALCdevice *device) override; + bool deviceUpdate(const ALCdevice *device) override; void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) override; void process(const size_t samplesToDo, const al::span samplesIn, const al::span samplesOut) override; DEF_NEWDEL(DedicatedState) }; -ALboolean DedicatedState::deviceUpdate(const ALCdevice*) +bool DedicatedState::deviceUpdate(const ALCdevice*) { std::fill(std::begin(mCurrentGains), std::end(mCurrentGains), 0.0f); - return AL_TRUE; + return true; } void DedicatedState::update(const ALCcontext*, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) diff --git a/alc/effects/distortion.cpp b/alc/effects/distortion.cpp index 48fc83ee..85b8c6fc 100644 --- a/alc/effects/distortion.cpp +++ b/alc/effects/distortion.cpp @@ -46,18 +46,18 @@ struct DistortionState final : public EffectState { ALfloat mBuffer[2][BUFFERSIZE]{}; - ALboolean deviceUpdate(const ALCdevice *device) override; + bool deviceUpdate(const ALCdevice *device) override; void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) override; void process(const size_t samplesToDo, const al::span samplesIn, const al::span samplesOut) override; DEF_NEWDEL(DistortionState) }; -ALboolean DistortionState::deviceUpdate(const ALCdevice*) +bool DistortionState::deviceUpdate(const ALCdevice*) { mLowpass.clear(); mBandpass.clear(); - return AL_TRUE; + return true; } void DistortionState::update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) diff --git a/alc/effects/echo.cpp b/alc/effects/echo.cpp index e68baddc..bc778d46 100644 --- a/alc/effects/echo.cpp +++ b/alc/effects/echo.cpp @@ -57,14 +57,14 @@ struct EchoState final : public EffectState { alignas(16) ALfloat mTempBuffer[2][BUFFERSIZE]; - ALboolean deviceUpdate(const ALCdevice *device) override; + bool deviceUpdate(const ALCdevice *device) override; void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) override; void process(const size_t samplesToDo, const al::span samplesIn, const al::span samplesOut) override; DEF_NEWDEL(EchoState) }; -ALboolean EchoState::deviceUpdate(const ALCdevice *Device) +bool EchoState::deviceUpdate(const ALCdevice *Device) { const auto frequency = static_cast(Device->Frequency); @@ -85,7 +85,7 @@ ALboolean EchoState::deviceUpdate(const ALCdevice *Device) std::fill(std::begin(e.Target), std::end(e.Target), 0.0f); } - return AL_TRUE; + return true; } void EchoState::update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) diff --git a/alc/effects/equalizer.cpp b/alc/effects/equalizer.cpp index a4204b3a..072a87e7 100644 --- a/alc/effects/equalizer.cpp +++ b/alc/effects/equalizer.cpp @@ -88,17 +88,17 @@ struct EqualizerState final : public EffectState { ALfloat TargetGains[MAX_OUTPUT_CHANNELS]{}; } mChans[MAX_AMBI_CHANNELS]; - ALfloat mSampleBuffer[BUFFERSIZE]{}; + FloatBufferLine mSampleBuffer{}; - ALboolean deviceUpdate(const ALCdevice *device) override; + bool deviceUpdate(const ALCdevice *device) override; void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) override; void process(const size_t samplesToDo, const al::span samplesIn, const al::span samplesOut) override; DEF_NEWDEL(EqualizerState) }; -ALboolean EqualizerState::deviceUpdate(const ALCdevice*) +bool EqualizerState::deviceUpdate(const ALCdevice*) { for(auto &e : mChans) { @@ -106,7 +106,7 @@ ALboolean EqualizerState::deviceUpdate(const ALCdevice*) std::mem_fn(&BiquadFilter::clear)); std::fill(std::begin(e.CurrentGains), std::end(e.CurrentGains), 0.0f); } - return AL_TRUE; + return true; } void EqualizerState::update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) @@ -158,7 +158,7 @@ void EqualizerState::update(const ALCcontext *context, const ALeffectslot *slot, void EqualizerState::process(const size_t samplesToDo, const al::span samplesIn, const al::span samplesOut) { - const al::span buffer{mSampleBuffer, samplesToDo}; + const al::span buffer{mSampleBuffer.data(), samplesToDo}; auto chandata = std::addressof(mChans[0]); for(const auto &input : samplesIn) { diff --git a/alc/effects/fshifter.cpp b/alc/effects/fshifter.cpp index cb62adaa..fb859e23 100644 --- a/alc/effects/fshifter.cpp +++ b/alc/effects/fshifter.cpp @@ -82,14 +82,14 @@ struct FshifterState final : public EffectState { } mGains[2]; - ALboolean deviceUpdate(const ALCdevice *device) override; + bool deviceUpdate(const ALCdevice *device) override; void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) override; void process(const size_t samplesToDo, const al::span samplesIn, const al::span samplesOut) override; DEF_NEWDEL(FshifterState) }; -ALboolean FshifterState::deviceUpdate(const ALCdevice*) +bool FshifterState::deviceUpdate(const ALCdevice*) { /* (Re-)initializing parameters and clear the buffers. */ mCount = FIFO_LATENCY; @@ -108,7 +108,7 @@ ALboolean FshifterState::deviceUpdate(const ALCdevice*) std::fill(std::begin(gain.Target), std::end(gain.Target), 0.0f); } - return AL_TRUE; + return true; } void FshifterState::update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) diff --git a/alc/effects/modulator.cpp b/alc/effects/modulator.cpp index 00afa052..5967cd40 100644 --- a/alc/effects/modulator.cpp +++ b/alc/effects/modulator.cpp @@ -82,21 +82,21 @@ struct ModulatorState final : public EffectState { } mChans[MAX_AMBI_CHANNELS]; - ALboolean deviceUpdate(const ALCdevice *device) override; + bool deviceUpdate(const ALCdevice *device) override; void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) override; void process(const size_t samplesToDo, const al::span samplesIn, const al::span samplesOut) override; DEF_NEWDEL(ModulatorState) }; -ALboolean ModulatorState::deviceUpdate(const ALCdevice*) +bool ModulatorState::deviceUpdate(const ALCdevice*) { for(auto &e : mChans) { e.Filter.clear(); std::fill(std::begin(e.CurrentGains), std::end(e.CurrentGains), 0.0f); } - return AL_TRUE; + return true; } void ModulatorState::update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) diff --git a/alc/effects/null.cpp b/alc/effects/null.cpp index e0497296..306b9365 100644 --- a/alc/effects/null.cpp +++ b/alc/effects/null.cpp @@ -18,7 +18,7 @@ struct NullState final : public EffectState { NullState(); ~NullState() override; - ALboolean deviceUpdate(const ALCdevice *device) override; + bool deviceUpdate(const ALCdevice *device) override; void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) override; void process(const size_t samplesToDo, const al::span samplesIn, const al::span samplesOut) override; @@ -40,9 +40,9 @@ NullState::~NullState() = default; * format) have been changed. Will always be followed by a call to the update * method, if successful. */ -ALboolean NullState::deviceUpdate(const ALCdevice* /*device*/) +bool NullState::deviceUpdate(const ALCdevice* /*device*/) { - return AL_TRUE; + return true; } /* This updates the effect state with new properties. This is called any time diff --git a/alc/effects/pshifter.cpp b/alc/effects/pshifter.cpp index 993c26e7..f433ec46 100644 --- a/alc/effects/pshifter.cpp +++ b/alc/effects/pshifter.cpp @@ -53,7 +53,7 @@ using complex_d = std::complex; std::array InitHannWindow() { std::array ret; - /* Create lookup table of the Hann window for the desired size, i.e. HIL_SIZE */ + /* Create lookup table of the Hann window for the desired size, i.e. STFT_SIZE */ for(size_t i{0};i < STFT_SIZE>>1;i++) { constexpr double scale{al::MathDefs::Pi() / double{STFT_SIZE-1}}; @@ -96,14 +96,14 @@ struct PshifterState final : public EffectState { float mTargetGains[MAX_OUTPUT_CHANNELS]; - ALboolean deviceUpdate(const ALCdevice *device) override; + bool deviceUpdate(const ALCdevice *device) override; void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) override; void process(const size_t samplesToDo, const al::span samplesIn, const al::span samplesOut) override; DEF_NEWDEL(PshifterState) }; -ALboolean PshifterState::deviceUpdate(const ALCdevice *device) +bool PshifterState::deviceUpdate(const ALCdevice *device) { /* (Re-)initializing parameters and clear the buffers. */ mCount = FIFO_LATENCY; @@ -122,7 +122,7 @@ ALboolean PshifterState::deviceUpdate(const ALCdevice *device) std::fill(std::begin(mCurrentGains), std::end(mCurrentGains), 0.0f); std::fill(std::begin(mTargetGains), std::end(mTargetGains), 0.0f); - return AL_TRUE; + return true; } void PshifterState::update(const ALCcontext*, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) diff --git a/alc/effects/reverb.cpp b/alc/effects/reverb.cpp index 727c8352..5edea965 100644 --- a/alc/effects/reverb.cpp +++ b/alc/effects/reverb.cpp @@ -482,7 +482,7 @@ struct ReverbState final : public EffectState { void lateFaded(const size_t offset, const size_t todo, const ALfloat fade, const ALfloat fadeStep); - ALboolean deviceUpdate(const ALCdevice *device) override; + bool deviceUpdate(const ALCdevice *device) override; void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) override; void process(const size_t samplesToDo, const al::span samplesIn, const al::span samplesOut) override; @@ -559,13 +559,13 @@ bool ReverbState::allocLines(const ALfloat frequency) return true; } -ALboolean ReverbState::deviceUpdate(const ALCdevice *device) +bool ReverbState::deviceUpdate(const ALCdevice *device) { const auto frequency = static_cast(device->Frequency); /* Allocate the delay lines. */ if(!allocLines(frequency)) - return AL_FALSE; + return false; const ALfloat multiplier{CalcDelayLengthMult(AL_EAXREVERB_MAX_DENSITY)}; @@ -625,7 +625,7 @@ ALboolean ReverbState::deviceUpdate(const ALCdevice *device) std::fill(mAmbiSplitter[0].begin()+1, mAmbiSplitter[0].end(), mAmbiSplitter[0][0]); std::fill(mAmbiSplitter[1].begin(), mAmbiSplitter[1].end(), mAmbiSplitter[0][0]); - return AL_TRUE; + return true; } /************************************** diff --git a/alc/effects/vmorpher.cpp b/alc/effects/vmorpher.cpp index b1b7cc06..7628461f 100644 --- a/alc/effects/vmorpher.cpp +++ b/alc/effects/vmorpher.cpp @@ -135,7 +135,7 @@ struct VmorpherState final : public EffectState { ALfloat mSampleBufferA[MAX_UPDATE_SAMPLES]{}; ALfloat mSampleBufferB[MAX_UPDATE_SAMPLES]{}; - ALboolean deviceUpdate(const ALCdevice *device) override; + bool deviceUpdate(const ALCdevice *device) override; void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) override; void process(const size_t samplesToDo, const al::span samplesIn, const al::span samplesOut) override; @@ -193,7 +193,7 @@ std::array VmorpherState::getFiltersByPhoneme(ALenum phoneme, A } -ALboolean VmorpherState::deviceUpdate(const ALCdevice* /*device*/) +bool VmorpherState::deviceUpdate(const ALCdevice* /*device*/) { for(auto &e : mChans) { @@ -204,7 +204,7 @@ ALboolean VmorpherState::deviceUpdate(const ALCdevice* /*device*/) std::fill(std::begin(e.CurrentGains), std::end(e.CurrentGains), 0.0f); } - return AL_TRUE; + return true; } void VmorpherState::update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) -- cgit v1.2.3