15 #include "alnumeric.h"
16 #include "core/effects/base.h"
17 #include "effects/effects.h"
39 inline std::bitset
<MAX_EFFECTS
> DisabledEffects
;
42 const char name
[16]; /* NOLINT(*-avoid-c-arrays) */
46 extern const std::array
<EffectList
,16> gEffectList
;
48 using EffectHandlerVariant
= std::variant
<NullEffectHandler
,ReverbEffectHandler
,
49 StdReverbEffectHandler
,AutowahEffectHandler
,ChorusEffectHandler
,CompressorEffectHandler
,
50 DistortionEffectHandler
,EchoEffectHandler
,EqualizerEffectHandler
,FlangerEffectHandler
,
51 FshifterEffectHandler
,ModulatorEffectHandler
,PshifterEffectHandler
,VmorpherEffectHandler
,
52 DedicatedDialogEffectHandler
,DedicatedLfeEffectHandler
,ConvolutionEffectHandler
>;
55 // Effect type (AL_EFFECT_NULL, ...)
56 ALenum type
{AL_EFFECT_NULL
};
58 EffectHandlerVariant PropsVariant
;
64 static void SetName(ALCcontext
*context
, ALuint id
, std::string_view name
);
69 void InitEffect(ALeffect
*effect
);
71 void LoadReverbPreset(const std::string_view name
, ALeffect
*effect
);
73 bool IsValidEffectType(ALenum type
) noexcept
;
75 struct EffectSubList
{
76 uint64_t FreeMask
{~0_u64
};
77 gsl::owner
<std::array
<ALeffect
,64>*> Effects
{nullptr}; /* 64 */
79 EffectSubList() noexcept
= default;
80 EffectSubList(const EffectSubList
&) = delete;
81 EffectSubList(EffectSubList
&& rhs
) noexcept
: FreeMask
{rhs
.FreeMask
}, Effects
{rhs
.Effects
}
82 { rhs
.FreeMask
= ~0_u64
; rhs
.Effects
= nullptr; }
85 EffectSubList
& operator=(const EffectSubList
&) = delete;
86 EffectSubList
& operator=(EffectSubList
&& rhs
) noexcept
87 { std::swap(FreeMask
, rhs
.FreeMask
); std::swap(Effects
, rhs
.Effects
); return *this; }