1 #ifndef AL_AUXEFFECTSLOT_H
2 #define AL_AUXEFFECTSLOT_H
14 #include "effects/base.h"
15 #include "intrusive_ptr.h"
23 using ALeffectslotArray
= al::FlexArray
<ALeffectslot
*>;
26 struct ALeffectslotProps
{
34 al::intrusive_ptr
<EffectState
> State
;
35 al::intrusive_ptr
<EffectBufferBase
> Buffer
;
37 std::atomic
<ALeffectslotProps
*> next
;
39 DEF_NEWDEL(ALeffectslotProps
)
45 bool AuxSendAuto
{true};
46 ALeffectslot
*Target
{nullptr};
47 ALbuffer
*Buffer
{nullptr};
50 ALenum Type
{AL_EFFECT_NULL
};
53 al::intrusive_ptr
<EffectState
> State
;
54 al::intrusive_ptr
<EffectBufferBase
> Buffer
;
57 std::atomic_flag PropsClean
;
62 std::atomic
<ALeffectslotProps
*> Update
{nullptr};
65 bool AuxSendAuto
{true};
66 ALeffectslot
*Target
{nullptr};
68 ALenum EffectType
{AL_EFFECT_NULL
};
69 EffectProps mEffectProps
{};
70 EffectState
*mEffectState
{nullptr};
71 EffectBufferBase
*mEffectBuffer
{nullptr};
73 float RoomRolloff
{0.0f
}; /* Added to the source's room rolloff, not multiplied. */
74 float DecayTime
{0.0f
};
75 float DecayLFRatio
{0.0f
};
76 float DecayHFRatio
{0.0f
};
77 bool DecayHFLimit
{false};
78 float AirAbsorptionGainHF
{1.0f
};
84 /* Mixing buffer used by the Wet mix. */
85 al::vector
<FloatBufferLine
, 16> MixBuffer
;
87 /* Wet buffer configuration is ACN channel order with N3D scaling.
88 * Consequently, effects that only want to work with mono input can use
89 * channel 0 by itself. Effects that want multichannel can process the
90 * ambisonics signal and make a B-Format source pan.
94 ALeffectslot() { PropsClean
.test_and_set(std::memory_order_relaxed
); }
95 ALeffectslot(const ALeffectslot
&) = delete;
96 ALeffectslot
& operator=(const ALeffectslot
&) = delete;
100 ALenum
initEffect(ALeffect
*effect
, ALCcontext
*context
);
101 void updateProps(ALCcontext
*context
);
103 static ALeffectslotArray
*CreatePtrArray(size_t count
) noexcept
;
105 /* This can be new'd for the context's default effect slot. */
106 DEF_NEWDEL(ALeffectslot
)
109 void UpdateAllEffectSlotProps(ALCcontext
*context
);