diff options
author | Chris Robinson <[email protected]> | 2020-12-28 08:04:23 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-12-28 08:04:23 -0800 |
commit | aae115c35a2b1899cfcaf443aa9a6da9b7647258 (patch) | |
tree | 66c551b2523c69ff1206978467d3887c803054ea /alc | |
parent | 15e05fcef882e3d50104db39d38019165c7995f9 (diff) |
Return an intrusive_ptr from EffectStateFactory::create
Diffstat (limited to 'alc')
-rw-r--r-- | alc/effects/autowah.cpp | 3 | ||||
-rw-r--r-- | alc/effects/base.h | 2 | ||||
-rw-r--r-- | alc/effects/chorus.cpp | 6 | ||||
-rw-r--r-- | alc/effects/compressor.cpp | 3 | ||||
-rw-r--r-- | alc/effects/convolution.cpp | 3 | ||||
-rw-r--r-- | alc/effects/dedicated.cpp | 3 | ||||
-rw-r--r-- | alc/effects/distortion.cpp | 3 | ||||
-rw-r--r-- | alc/effects/echo.cpp | 3 | ||||
-rw-r--r-- | alc/effects/equalizer.cpp | 3 | ||||
-rw-r--r-- | alc/effects/fshifter.cpp | 3 | ||||
-rw-r--r-- | alc/effects/modulator.cpp | 3 | ||||
-rw-r--r-- | alc/effects/null.cpp | 6 | ||||
-rw-r--r-- | alc/effects/pshifter.cpp | 3 | ||||
-rw-r--r-- | alc/effects/reverb.cpp | 6 | ||||
-rw-r--r-- | alc/effects/vmorpher.cpp | 3 |
15 files changed, 34 insertions, 19 deletions
diff --git a/alc/effects/autowah.cpp b/alc/effects/autowah.cpp index 154c33ff..403a23e3 100644 --- a/alc/effects/autowah.cpp +++ b/alc/effects/autowah.cpp @@ -199,7 +199,8 @@ void AutowahState::process(const size_t samplesToDo, struct AutowahStateFactory final : public EffectStateFactory { - EffectState *create() override { return new AutowahState{}; } + al::intrusive_ptr<EffectState> create() override + { return al::intrusive_ptr<EffectState>{new AutowahState{}}; } }; } // namespace diff --git a/alc/effects/base.h b/alc/effects/base.h index 8fa22bb5..32d7fc86 100644 --- a/alc/effects/base.h +++ b/alc/effects/base.h @@ -180,7 +180,7 @@ struct EffectState : public al::intrusive_ref<EffectState> { struct EffectStateFactory { virtual ~EffectStateFactory() = default; - virtual EffectState *create() = 0; + virtual al::intrusive_ptr<EffectState> create() = 0; }; diff --git a/alc/effects/chorus.cpp b/alc/effects/chorus.cpp index 091f6b40..92d57c18 100644 --- a/alc/effects/chorus.cpp +++ b/alc/effects/chorus.cpp @@ -259,7 +259,8 @@ void ChorusState::process(const size_t samplesToDo, const al::span<const FloatBu struct ChorusStateFactory final : public EffectStateFactory { - EffectState *create() override { return new ChorusState{}; } + al::intrusive_ptr<EffectState> create() override + { return al::intrusive_ptr<EffectState>{new ChorusState{}}; } }; @@ -267,7 +268,8 @@ struct ChorusStateFactory final : public EffectStateFactory { * the same processing functions, so piggyback flanger on the chorus functions. */ struct FlangerStateFactory final : public EffectStateFactory { - EffectState *create() override { return new ChorusState{}; } + al::intrusive_ptr<EffectState> create() override + { return al::intrusive_ptr<EffectState>{new ChorusState{}}; } }; } // namespace diff --git a/alc/effects/compressor.cpp b/alc/effects/compressor.cpp index 8d65eedb..4e2f2098 100644 --- a/alc/effects/compressor.cpp +++ b/alc/effects/compressor.cpp @@ -155,7 +155,8 @@ void CompressorState::process(const size_t samplesToDo, struct CompressorStateFactory final : public EffectStateFactory { - EffectState *create() override { return new CompressorState{}; } + al::intrusive_ptr<EffectState> create() override + { return al::intrusive_ptr<EffectState>{new CompressorState{}}; } }; } // namespace diff --git a/alc/effects/convolution.cpp b/alc/effects/convolution.cpp index 716830a9..64c05172 100644 --- a/alc/effects/convolution.cpp +++ b/alc/effects/convolution.cpp @@ -539,7 +539,8 @@ void ConvolutionState::process(const size_t samplesToDo, struct ConvolutionStateFactory final : public EffectStateFactory { - EffectState *create() override { return new ConvolutionState{}; } + al::intrusive_ptr<EffectState> create() override + { return al::intrusive_ptr<EffectState>{new ConvolutionState{}}; } }; } // namespace diff --git a/alc/effects/dedicated.cpp b/alc/effects/dedicated.cpp index cf435357..876b14ef 100644 --- a/alc/effects/dedicated.cpp +++ b/alc/effects/dedicated.cpp @@ -97,7 +97,8 @@ void DedicatedState::process(const size_t samplesToDo, const al::span<const Floa struct DedicatedStateFactory final : public EffectStateFactory { - EffectState *create() override { return new DedicatedState{}; } + al::intrusive_ptr<EffectState> create() override + { return al::intrusive_ptr<EffectState>{new DedicatedState{}}; } }; } // namespace diff --git a/alc/effects/distortion.cpp b/alc/effects/distortion.cpp index 8123f92f..46ca03d8 100644 --- a/alc/effects/distortion.cpp +++ b/alc/effects/distortion.cpp @@ -154,7 +154,8 @@ void DistortionState::process(const size_t samplesToDo, const al::span<const Flo struct DistortionStateFactory final : public EffectStateFactory { - EffectState *create() override { return new DistortionState{}; } + al::intrusive_ptr<EffectState> create() override + { return al::intrusive_ptr<EffectState>{new DistortionState{}}; } }; } // namespace diff --git a/alc/effects/echo.cpp b/alc/effects/echo.cpp index fc33c853..b84e501a 100644 --- a/alc/effects/echo.cpp +++ b/alc/effects/echo.cpp @@ -155,7 +155,8 @@ void EchoState::process(const size_t samplesToDo, const al::span<const FloatBuff struct EchoStateFactory final : public EffectStateFactory { - EffectState *create() override { return new EchoState{}; } + al::intrusive_ptr<EffectState> create() override + { return al::intrusive_ptr<EffectState>{new EchoState{}}; } }; } // namespace diff --git a/alc/effects/equalizer.cpp b/alc/effects/equalizer.cpp index 66db207a..133ab319 100644 --- a/alc/effects/equalizer.cpp +++ b/alc/effects/equalizer.cpp @@ -171,7 +171,8 @@ void EqualizerState::process(const size_t samplesToDo, const al::span<const Floa struct EqualizerStateFactory final : public EffectStateFactory { - EffectState *create() override { return new EqualizerState{}; } + al::intrusive_ptr<EffectState> create() override + { return al::intrusive_ptr<EffectState>{new EqualizerState{}}; } }; } // namespace diff --git a/alc/effects/fshifter.cpp b/alc/effects/fshifter.cpp index 9fe3b77e..1f202fc3 100644 --- a/alc/effects/fshifter.cpp +++ b/alc/effects/fshifter.cpp @@ -219,7 +219,8 @@ void FshifterState::process(const size_t samplesToDo, const al::span<const Float struct FshifterStateFactory final : public EffectStateFactory { - EffectState *create() override { return new FshifterState{}; } + al::intrusive_ptr<EffectState> create() override + { return al::intrusive_ptr<EffectState>{new FshifterState{}}; } }; } // namespace diff --git a/alc/effects/modulator.cpp b/alc/effects/modulator.cpp index 2c8bbb94..eeb41635 100644 --- a/alc/effects/modulator.cpp +++ b/alc/effects/modulator.cpp @@ -160,7 +160,8 @@ void ModulatorState::process(const size_t samplesToDo, const al::span<const Floa struct ModulatorStateFactory final : public EffectStateFactory { - EffectState *create() override { return new ModulatorState{}; } + al::intrusive_ptr<EffectState> create() override + { return al::intrusive_ptr<EffectState>{new ModulatorState{}}; } }; } // namespace diff --git a/alc/effects/null.cpp b/alc/effects/null.cpp index 2d141e4e..9608f48a 100644 --- a/alc/effects/null.cpp +++ b/alc/effects/null.cpp @@ -63,12 +63,12 @@ void NullState::process(const size_t/*samplesToDo*/, struct NullStateFactory final : public EffectStateFactory { - EffectState *create() override; + al::intrusive_ptr<EffectState> create() override; }; /* Creates EffectState objects of the appropriate type. */ -EffectState *NullStateFactory::create() -{ return new NullState{}; } +al::intrusive_ptr<EffectState> NullStateFactory::create() +{ return al::intrusive_ptr<EffectState>{new NullState{}}; } } // namespace diff --git a/alc/effects/pshifter.cpp b/alc/effects/pshifter.cpp index ac00bac1..3a577ce7 100644 --- a/alc/effects/pshifter.cpp +++ b/alc/effects/pshifter.cpp @@ -247,7 +247,8 @@ void PshifterState::process(const size_t samplesToDo, const al::span<const Float struct PshifterStateFactory final : public EffectStateFactory { - EffectState *create() override { return new PshifterState{}; } + al::intrusive_ptr<EffectState> create() override + { return al::intrusive_ptr<EffectState>{new PshifterState{}}; } }; } // namespace diff --git a/alc/effects/reverb.cpp b/alc/effects/reverb.cpp index 220c3bee..1aaad4a6 100644 --- a/alc/effects/reverb.cpp +++ b/alc/effects/reverb.cpp @@ -1680,11 +1680,13 @@ void ReverbState::process(const size_t samplesToDo, const al::span<const FloatBu struct ReverbStateFactory final : public EffectStateFactory { - EffectState *create() override { return new ReverbState{}; } + al::intrusive_ptr<EffectState> create() override + { return al::intrusive_ptr<EffectState>{new ReverbState{}}; } }; struct StdReverbStateFactory final : public EffectStateFactory { - EffectState *create() override { return new ReverbState{}; } + al::intrusive_ptr<EffectState> create() override + { return al::intrusive_ptr<EffectState>{new ReverbState{}}; } }; } // namespace diff --git a/alc/effects/vmorpher.cpp b/alc/effects/vmorpher.cpp index 3bd4430c..f1c46b8c 100644 --- a/alc/effects/vmorpher.cpp +++ b/alc/effects/vmorpher.cpp @@ -301,7 +301,8 @@ void VmorpherState::process(const size_t samplesToDo, const al::span<const Float struct VmorpherStateFactory final : public EffectStateFactory { - EffectState *create() override { return new VmorpherState{}; } + al::intrusive_ptr<EffectState> create() override + { return al::intrusive_ptr<EffectState>{new VmorpherState{}}; } }; } // namespace |