diff options
author | Chris Robinson <[email protected]> | 2019-08-01 19:44:09 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-08-01 19:44:09 -0700 |
commit | 33bcced82a1e97811d4212195b6e6ca9cf2242b1 (patch) | |
tree | 9431019a2288668260e92cc1522ba686c04f6e0f /alc/effects | |
parent | 4917024c9485d5ed3362ddcb1a0d0f8ee45dfedc (diff) |
Use a smart pointer for holding the context's device
Diffstat (limited to 'alc/effects')
-rw-r--r-- | alc/effects/autowah.cpp | 2 | ||||
-rw-r--r-- | alc/effects/chorus.cpp | 2 | ||||
-rw-r--r-- | alc/effects/distortion.cpp | 2 | ||||
-rw-r--r-- | alc/effects/echo.cpp | 2 | ||||
-rw-r--r-- | alc/effects/equalizer.cpp | 2 | ||||
-rw-r--r-- | alc/effects/fshifter.cpp | 2 | ||||
-rw-r--r-- | alc/effects/modulator.cpp | 2 | ||||
-rw-r--r-- | alc/effects/reverb.cpp | 2 | ||||
-rw-r--r-- | alc/effects/vmorpher.cpp | 2 |
9 files changed, 9 insertions, 9 deletions
diff --git a/alc/effects/autowah.cpp b/alc/effects/autowah.cpp index 1aac749e..f16c5ba5 100644 --- a/alc/effects/autowah.cpp +++ b/alc/effects/autowah.cpp @@ -106,7 +106,7 @@ ALboolean ALautowahState::deviceUpdate(const ALCdevice*) void ALautowahState::update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) { - const ALCdevice *device{context->mDevice}; + const ALCdevice *device{context->mDevice.get()}; const ALfloat ReleaseTime{clampf(props->Autowah.ReleaseTime, 0.001f, 1.0f)}; diff --git a/alc/effects/chorus.cpp b/alc/effects/chorus.cpp index 31f10c81..5966d3bd 100644 --- a/alc/effects/chorus.cpp +++ b/alc/effects/chorus.cpp @@ -157,7 +157,7 @@ void ChorusState::update(const ALCcontext *Context, const ALeffectslot *Slot, co /* The LFO depth is scaled to be relative to the sample delay. Clamp the * delay and depth to allow enough padding for resampling. */ - const ALCdevice *device{Context->mDevice}; + const ALCdevice *device{Context->mDevice.get()}; const auto frequency = static_cast<ALfloat>(device->Frequency); mDelay = maxi(float2int(props->Chorus.Delay*frequency*FRACTIONONE + 0.5f), mindelay); mDepth = minf(props->Chorus.Depth * mDelay, static_cast<ALfloat>(mDelay - mindelay)); diff --git a/alc/effects/distortion.cpp b/alc/effects/distortion.cpp index 3fd08229..ec1550f5 100644 --- a/alc/effects/distortion.cpp +++ b/alc/effects/distortion.cpp @@ -63,7 +63,7 @@ ALboolean DistortionState::deviceUpdate(const ALCdevice*) void DistortionState::update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) { - const ALCdevice *device{context->mDevice}; + const ALCdevice *device{context->mDevice.get()}; /* Store waveshaper edge settings. */ const ALfloat edge{ diff --git a/alc/effects/echo.cpp b/alc/effects/echo.cpp index d14db80c..d41c4f67 100644 --- a/alc/effects/echo.cpp +++ b/alc/effects/echo.cpp @@ -93,7 +93,7 @@ ALboolean EchoState::deviceUpdate(const ALCdevice *Device) void EchoState::update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) { - const ALCdevice *device = context->mDevice; + const ALCdevice *device{context->mDevice.get()}; const auto frequency = static_cast<ALfloat>(device->Frequency); mTap[0].delay = maxi(float2int(props->Echo.Delay*frequency + 0.5f), 1); diff --git a/alc/effects/equalizer.cpp b/alc/effects/equalizer.cpp index 4b900bcf..a8e81b37 100644 --- a/alc/effects/equalizer.cpp +++ b/alc/effects/equalizer.cpp @@ -111,7 +111,7 @@ ALboolean EqualizerState::deviceUpdate(const ALCdevice*) void EqualizerState::update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) { - const ALCdevice *device = context->mDevice; + const ALCdevice *device{context->mDevice.get()}; auto frequency = static_cast<ALfloat>(device->Frequency); ALfloat gain, f0norm; diff --git a/alc/effects/fshifter.cpp b/alc/effects/fshifter.cpp index bca29bba..a6c2c747 100644 --- a/alc/effects/fshifter.cpp +++ b/alc/effects/fshifter.cpp @@ -108,7 +108,7 @@ ALboolean FshifterState::deviceUpdate(const ALCdevice*) void FshifterState::update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) { - const ALCdevice *device{context->mDevice}; + const ALCdevice *device{context->mDevice.get()}; ALfloat step{props->Fshifter.Frequency / static_cast<ALfloat>(device->Frequency)}; mPhaseStep = fastf2i(minf(step, 0.5f) * FRACTIONONE); diff --git a/alc/effects/modulator.cpp b/alc/effects/modulator.cpp index d7118285..8a6378cd 100644 --- a/alc/effects/modulator.cpp +++ b/alc/effects/modulator.cpp @@ -109,7 +109,7 @@ ALboolean ModulatorState::deviceUpdate(const ALCdevice*) void ModulatorState::update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) { - const ALCdevice *device{context->mDevice}; + const ALCdevice *device{context->mDevice.get()}; const float step{props->Modulator.Frequency / static_cast<ALfloat>(device->Frequency)}; mStep = fastf2i(clampf(step*WAVEFORM_FRACONE, 0.0f, ALfloat{WAVEFORM_FRACONE-1})); diff --git a/alc/effects/reverb.cpp b/alc/effects/reverb.cpp index 6e6844e0..51a57360 100644 --- a/alc/effects/reverb.cpp +++ b/alc/effects/reverb.cpp @@ -905,7 +905,7 @@ void ReverbState::update3DPanning(const ALfloat *ReflectionsPan, const ALfloat * void ReverbState::update(const ALCcontext *Context, const ALeffectslot *Slot, const EffectProps *props, const EffectTarget target) { - const ALCdevice *Device{Context->mDevice}; + const ALCdevice *Device{Context->mDevice.get()}; const ALlistener &Listener = Context->mListener; const auto frequency = static_cast<ALfloat>(Device->Frequency); diff --git a/alc/effects/vmorpher.cpp b/alc/effects/vmorpher.cpp index 95016105..ad0f026b 100644 --- a/alc/effects/vmorpher.cpp +++ b/alc/effects/vmorpher.cpp @@ -209,7 +209,7 @@ ALboolean VmorpherState::deviceUpdate(const ALCdevice* /*device*/) void VmorpherState::update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) { - const ALCdevice *device{context->mDevice}; + const ALCdevice *device{context->mDevice.get()}; const ALfloat frequency{static_cast<ALfloat>(device->Frequency)}; const ALfloat step{props->Vmorpher.Rate / static_cast<ALfloat>(device->Frequency)}; mStep = fastf2i(clampf(step*WAVEFORM_FRACONE, 0.0f, ALfloat{WAVEFORM_FRACONE-1})); |