Constify a parameter
This commit is contained in:
@@ -68,14 +68,14 @@ struct ALautowahState final : public EffectState {
|
||||
alignas(16) ALfloat mBufferOut[BUFFERSIZE];
|
||||
|
||||
|
||||
ALboolean deviceUpdate(ALCdevice *device) override;
|
||||
ALboolean deviceUpdate(const ALCdevice *device) override;
|
||||
void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) override;
|
||||
void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], ALsizei numChannels) override;
|
||||
|
||||
DEF_NEWDEL(ALautowahState)
|
||||
};
|
||||
|
||||
ALboolean ALautowahState::deviceUpdate(ALCdevice *UNUSED(device))
|
||||
ALboolean ALautowahState::deviceUpdate(const ALCdevice *UNUSED(device))
|
||||
{
|
||||
/* (Re-)initializing parameters and clear the buffers. */
|
||||
|
||||
|
||||
@@ -90,14 +90,14 @@ struct ChorusState final : public EffectState {
|
||||
ALfloat mFeedback{0.0f};
|
||||
|
||||
|
||||
ALboolean deviceUpdate(ALCdevice *device) override;
|
||||
ALboolean deviceUpdate(const ALCdevice *device) override;
|
||||
void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) override;
|
||||
void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], ALsizei numChannels) override;
|
||||
|
||||
DEF_NEWDEL(ChorusState)
|
||||
};
|
||||
|
||||
ALboolean ChorusState::deviceUpdate(ALCdevice *Device)
|
||||
ALboolean ChorusState::deviceUpdate(const ALCdevice *Device)
|
||||
{
|
||||
const ALfloat max_delay = maxf(AL_CHORUS_MAX_DELAY, AL_FLANGER_MAX_DELAY);
|
||||
size_t maxlen;
|
||||
|
||||
@@ -48,14 +48,14 @@ struct ALcompressorState final : public EffectState {
|
||||
ALfloat mEnvFollower{1.0f};
|
||||
|
||||
|
||||
ALboolean deviceUpdate(ALCdevice *device) override;
|
||||
ALboolean deviceUpdate(const ALCdevice *device) override;
|
||||
void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) override;
|
||||
void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], ALsizei numChannels) override;
|
||||
|
||||
DEF_NEWDEL(ALcompressorState)
|
||||
};
|
||||
|
||||
ALboolean ALcompressorState::deviceUpdate(ALCdevice *device)
|
||||
ALboolean ALcompressorState::deviceUpdate(const ALCdevice *device)
|
||||
{
|
||||
/* Number of samples to do a full attack and release (non-integer sample
|
||||
* counts are okay).
|
||||
|
||||
@@ -36,14 +36,14 @@ struct ALdedicatedState final : public EffectState {
|
||||
ALfloat mTargetGains[MAX_OUTPUT_CHANNELS];
|
||||
|
||||
|
||||
ALboolean deviceUpdate(ALCdevice *device) override;
|
||||
ALboolean deviceUpdate(const ALCdevice *device) override;
|
||||
void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) override;
|
||||
void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], ALsizei numChannels) override;
|
||||
|
||||
DEF_NEWDEL(ALdedicatedState)
|
||||
};
|
||||
|
||||
ALboolean ALdedicatedState::deviceUpdate(ALCdevice *UNUSED(device))
|
||||
ALboolean ALdedicatedState::deviceUpdate(const ALCdevice *UNUSED(device))
|
||||
{
|
||||
std::fill(std::begin(mCurrentGains), std::end(mCurrentGains), 0.0f);
|
||||
return AL_TRUE;
|
||||
|
||||
@@ -44,14 +44,14 @@ struct ALdistortionState final : public EffectState {
|
||||
ALfloat mBuffer[2][BUFFERSIZE]{};
|
||||
|
||||
|
||||
ALboolean deviceUpdate(ALCdevice *device) override;
|
||||
ALboolean deviceUpdate(const ALCdevice *device) override;
|
||||
void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) override;
|
||||
void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], ALsizei numChannels) override;
|
||||
|
||||
DEF_NEWDEL(ALdistortionState)
|
||||
};
|
||||
|
||||
ALboolean ALdistortionState::deviceUpdate(ALCdevice *UNUSED(device))
|
||||
ALboolean ALdistortionState::deviceUpdate(const ALCdevice *UNUSED(device))
|
||||
{
|
||||
mLowpass.clear();
|
||||
mBandpass.clear();
|
||||
|
||||
@@ -56,14 +56,14 @@ struct ALechoState final : public EffectState {
|
||||
BiquadFilter mFilter;
|
||||
|
||||
|
||||
ALboolean deviceUpdate(ALCdevice *device) override;
|
||||
ALboolean deviceUpdate(const ALCdevice *device) override;
|
||||
void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) override;
|
||||
void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], ALsizei numChannels) override;
|
||||
|
||||
DEF_NEWDEL(ALechoState)
|
||||
};
|
||||
|
||||
ALboolean ALechoState::deviceUpdate(ALCdevice *Device)
|
||||
ALboolean ALechoState::deviceUpdate(const ALCdevice *Device)
|
||||
{
|
||||
ALuint maxlen;
|
||||
|
||||
|
||||
@@ -90,14 +90,14 @@ struct ALequalizerState final : public EffectState {
|
||||
ALfloat mSampleBuffer[MAX_EFFECT_CHANNELS][BUFFERSIZE]{};
|
||||
|
||||
|
||||
ALboolean deviceUpdate(ALCdevice *device) override;
|
||||
ALboolean deviceUpdate(const ALCdevice *device) override;
|
||||
void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) override;
|
||||
void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], ALsizei numChannels) override;
|
||||
|
||||
DEF_NEWDEL(ALequalizerState)
|
||||
};
|
||||
|
||||
ALboolean ALequalizerState::deviceUpdate(ALCdevice *UNUSED(device))
|
||||
ALboolean ALequalizerState::deviceUpdate(const ALCdevice *UNUSED(device))
|
||||
{
|
||||
for(auto &e : mChans)
|
||||
{
|
||||
|
||||
@@ -81,14 +81,14 @@ struct ALfshifterState final : public EffectState {
|
||||
ALfloat mTargetGains[MAX_OUTPUT_CHANNELS]{};
|
||||
|
||||
|
||||
ALboolean deviceUpdate(ALCdevice *device) override;
|
||||
ALboolean deviceUpdate(const ALCdevice *device) override;
|
||||
void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) override;
|
||||
void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], ALsizei numChannels) override;
|
||||
|
||||
DEF_NEWDEL(ALfshifterState)
|
||||
};
|
||||
|
||||
ALboolean ALfshifterState::deviceUpdate(ALCdevice *UNUSED(device))
|
||||
ALboolean ALfshifterState::deviceUpdate(const ALCdevice *UNUSED(device))
|
||||
{
|
||||
/* (Re-)initializing parameters and clear the buffers. */
|
||||
mCount = FIFO_LATENCY;
|
||||
|
||||
@@ -88,14 +88,14 @@ struct ALmodulatorState final : public EffectState {
|
||||
} mChans[MAX_EFFECT_CHANNELS];
|
||||
|
||||
|
||||
ALboolean deviceUpdate(ALCdevice *device) override;
|
||||
ALboolean deviceUpdate(const ALCdevice *device) override;
|
||||
void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) override;
|
||||
void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], ALsizei numChannels) override;
|
||||
|
||||
DEF_NEWDEL(ALmodulatorState)
|
||||
};
|
||||
|
||||
ALboolean ALmodulatorState::deviceUpdate(ALCdevice *UNUSED(device))
|
||||
ALboolean ALmodulatorState::deviceUpdate(const ALCdevice *UNUSED(device))
|
||||
{
|
||||
for(auto &e : mChans)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ struct ALnullState final : public EffectState {
|
||||
ALnullState();
|
||||
~ALnullState() override;
|
||||
|
||||
ALboolean deviceUpdate(ALCdevice *device) override;
|
||||
ALboolean deviceUpdate(const ALCdevice *device) override;
|
||||
void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) override;
|
||||
void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], ALsizei numChannels) override;
|
||||
|
||||
@@ -40,7 +40,7 @@ ALnullState::~ALnullState()
|
||||
* initialization and any time the device parameters (eg. playback frequency,
|
||||
* format) have been changed.
|
||||
*/
|
||||
ALboolean ALnullState::deviceUpdate(ALCdevice* UNUSED(device))
|
||||
ALboolean ALnullState::deviceUpdate(const ALCdevice* UNUSED(device))
|
||||
{
|
||||
return AL_TRUE;
|
||||
}
|
||||
|
||||
@@ -143,14 +143,14 @@ struct ALpshifterState final : public EffectState {
|
||||
ALfloat mTargetGains[MAX_OUTPUT_CHANNELS];
|
||||
|
||||
|
||||
ALboolean deviceUpdate(ALCdevice *device) override;
|
||||
ALboolean deviceUpdate(const ALCdevice *device) override;
|
||||
void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) override;
|
||||
void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], ALsizei numChannels) override;
|
||||
|
||||
DEF_NEWDEL(ALpshifterState)
|
||||
};
|
||||
|
||||
ALboolean ALpshifterState::deviceUpdate(ALCdevice *device)
|
||||
ALboolean ALpshifterState::deviceUpdate(const ALCdevice *device)
|
||||
{
|
||||
/* (Re-)initializing parameters and clear the buffers. */
|
||||
mCount = FIFO_LATENCY;
|
||||
|
||||
@@ -338,7 +338,7 @@ struct ReverbState final : public EffectState {
|
||||
alignas(16) ALfloat mMixBuffer[NUM_LINES][MAX_UPDATE_SAMPLES]{};
|
||||
|
||||
|
||||
ALboolean deviceUpdate(ALCdevice *device) override;
|
||||
ALboolean deviceUpdate(const ALCdevice *device) override;
|
||||
void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) override;
|
||||
void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], ALsizei numChannels) override;
|
||||
|
||||
@@ -456,7 +456,7 @@ static ALboolean AllocLines(const ALuint frequency, ReverbState *State)
|
||||
return AL_TRUE;
|
||||
}
|
||||
|
||||
ALboolean ReverbState::deviceUpdate(ALCdevice *Device)
|
||||
ALboolean ReverbState::deviceUpdate(const ALCdevice *Device)
|
||||
{
|
||||
const ALuint frequency{Device->Frequency};
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ struct EffectState {
|
||||
|
||||
virtual ~EffectState() = default;
|
||||
|
||||
virtual ALboolean deviceUpdate(ALCdevice *device) = 0;
|
||||
virtual ALboolean deviceUpdate(const ALCdevice *device) = 0;
|
||||
virtual void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props) = 0;
|
||||
virtual void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], ALsizei numChannels) = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user