diff options
author | Chris Robinson <[email protected]> | 2020-11-07 08:36:49 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-11-07 08:36:49 -0800 |
commit | 4e760bbecc6ac4031dca45b4882c6faa71842e90 (patch) | |
tree | e639b40d42ef8f2c3511e93a965cddb31245a729 /al/auxeffectslot.h | |
parent | 120776bec5f908104f0e76453402ff45a0762846 (diff) |
Use a separate structure for the active effect slot properties
Diffstat (limited to 'al/auxeffectslot.h')
-rw-r--r-- | al/auxeffectslot.h | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/al/auxeffectslot.h b/al/auxeffectslot.h index 03ba034a..c2967c93 100644 --- a/al/auxeffectslot.h +++ b/al/auxeffectslot.h @@ -11,35 +11,16 @@ #include "alcmain.h" #include "almalloc.h" #include "atomic.h" +#include "effectslot.h" #include "effects/base.h" #include "intrusive_ptr.h" #include "vector.h" struct ALbuffer; struct ALeffect; -struct ALeffectslot; struct WetBuffer; -using ALeffectslotArray = al::FlexArray<ALeffectslot*>; - - -struct ALeffectslotProps { - float Gain; - bool AuxSendAuto; - ALeffectslot *Target; - - ALenum Type; - EffectProps Props; - - al::intrusive_ptr<EffectState> State; - - std::atomic<ALeffectslotProps*> next; - - DEF_NEWDEL(ALeffectslotProps) -}; - - enum class SlotState : ALenum { Initial = AL_INITIAL, Playing = AL_PLAYING, @@ -65,24 +46,7 @@ struct ALeffectslot { RefCount ref{0u}; - struct { - std::atomic<ALeffectslotProps*> Update{nullptr}; - - float Gain{1.0f}; - bool AuxSendAuto{true}; - ALeffectslot *Target{nullptr}; - - ALenum EffectType{AL_EFFECT_NULL}; - EffectProps mEffectProps{}; - EffectState *mEffectState{nullptr}; - - float RoomRolloff{0.0f}; /* Added to the source's room rolloff, not multiplied. */ - float DecayTime{0.0f}; - float DecayLFRatio{0.0f}; - float DecayHFRatio{0.0f}; - bool DecayHFLimit{false}; - float AirAbsorptionGainHF{1.0f}; - } Params; + EffectSlot mSlot; /* Self ID */ ALuint id{}; @@ -90,13 +54,6 @@ struct ALeffectslot { /* Mixing buffer used by the Wet mix. */ WetBuffer *mWetBuffer{nullptr}; - /* Wet buffer configuration is ACN channel order with N3D scaling. - * Consequently, effects that only want to work with mono input can use - * channel 0 by itself. Effects that want multichannel can process the - * ambisonics signal and make a B-Format source pan. - */ - MixParams Wet; - ALeffectslot() { PropsClean.test_and_set(std::memory_order_relaxed); } ALeffectslot(const ALeffectslot&) = delete; ALeffectslot& operator=(const ALeffectslot&) = delete; @@ -106,8 +63,6 @@ struct ALeffectslot { ALenum initEffect(ALeffect *effect, ALCcontext *context); void updateProps(ALCcontext *context); - static ALeffectslotArray *CreatePtrArray(size_t count) noexcept; - /* This can be new'd for the context's default effect slot. */ DEF_NEWDEL(ALeffectslot) }; |