3030#include " eax/utils.h"
3131#endif // ALSOFT_EAX
3232
33- namespace al {
34- struct Context ;
35- struct Buffer ;
36- } // namespace al
3733
3834#if ALSOFT_EAX
3935/* NOLINTNEXTLINE(clazy-copyable-polymorphic) Exceptions must be copyable. */
@@ -49,11 +45,16 @@ enum class SlotState : bool {
4945 Initial, Playing,
5046};
5147
52- struct ALeffectslot {
48+ namespace al {
49+
50+ struct Context ;
51+ struct Buffer ;
52+
53+ struct EffectSlot {
5354 u32 mEffectId {};
5455 f32 mGain {1 .0f };
5556 bool mAuxSendAuto {true };
56- al::intrusive_ptr<ALeffectslot > mTarget ;
57+ al::intrusive_ptr<EffectSlot > mTarget ;
5758 al::intrusive_ptr<al::Buffer> mBuffer ;
5859
5960 struct EffectData {
@@ -75,10 +76,10 @@ struct ALeffectslot {
7576 /* Self ID */
7677 u32 mId {};
7778
78- explicit ALeffectslot (gsl::not_null<al::Context*> context);
79- ALeffectslot (const ALeffectslot &) = delete ;
80- ALeffectslot& operator =(const ALeffectslot&) = delete ;
81- ~ALeffectslot ();
79+ explicit EffectSlot (gsl::not_null<al::Context*> context);
80+ EffectSlot (const EffectSlot &) = delete ;
81+ auto operator =(const EffectSlot&) -> EffectSlot& = delete ;
82+ ~EffectSlot ();
8283
8384 auto inc_ref () noexcept { return mRef .fetch_add (1 , std::memory_order_acq_rel)+1 ; }
8485 auto dec_ref () noexcept { return mRef .fetch_sub (1 , std::memory_order_acq_rel)-1 ; }
@@ -89,14 +90,12 @@ struct ALeffectslot {
8990 }
9091
9192 auto initEffect (u32 effectId, ALenum effectType, const EffectProps &effectProps,
92- gsl::not_null<al::Context*> context) -> void;
93- void updateProps (gsl::not_null<al::Context*> context) const ;
94-
95- static void SetName (gsl::not_null<al::Context*> context, u32 id, std::string_view name);
93+ gsl::not_null<Context*> context) -> void;
94+ void updateProps (gsl::not_null<Context*> context) const ;
9695
96+ static void SetName (gsl::not_null<Context*> context, u32 id, std::string_view name);
9797
9898#if ALSOFT_EAX
99- public:
10099 void eax_initialize (EaxFxSlotIndexValue index);
101100
102101 [[nodiscard]]
@@ -250,7 +249,7 @@ struct ALeffectslot {
250249 }
251250 };
252251
253- gsl::not_null<al:: Context*> const mEaxALContext ;
252+ gsl::not_null<Context*> const mEaxALContext ;
254253 EaxFxSlotIndexValue mEaxFXSlotIndex {};
255254 int mEaxVersion {}; // Current EAX version.
256255 std::bitset<eax_dirty_bit_count> mEaxDf ; // Dirty flags for the current EAX version.
@@ -345,33 +344,35 @@ struct ALeffectslot {
345344 void eax5_fx_slot_commit (Eax5State& state, std::bitset<eax_dirty_bit_count>& dst_df);
346345
347346 // `alAuxiliaryEffectSloti(effect_slot, AL_EFFECTSLOT_EFFECT, effect)`
348- void eax_set_efx_slot_effect (EaxEffect &effect);
347+ void eax_set_efx_slot_effect (EaxEffect const &effect);
349348
350349 // `alAuxiliaryEffectSloti(effect_slot, AL_EFFECTSLOT_AUXILIARY_SEND_AUTO, value)`
351350 void eax_set_efx_slot_send_auto (bool is_send_auto);
352351
353352 // `alAuxiliaryEffectSlotf(effect_slot, AL_EFFECTSLOT_GAIN, gain)`
354- void eax_set_efx_slot_gain (ALfloat gain);
353+ void eax_set_efx_slot_gain (f32 gain);
355354
356355public:
357356 class EaxDeleter {
358357 public:
359- void operator ()(gsl::not_null<ALeffectslot *> effect_slot) const ;
358+ void operator ()(gsl::not_null<EffectSlot *> effect_slot) const ;
360359 };
361360#endif // ALSOFT_EAX
362361};
363362
363+ } /* namespace al */
364+
364365void UpdateAllEffectSlotProps (gsl::not_null<al::Context*> context);
365366
366367#if ALSOFT_EAX
367- using EaxAlEffectSlotUPtr = std::unique_ptr<ALeffectslot, ALeffectslot ::EaxDeleter>;
368+ using EaxAlEffectSlotUPtr = std::unique_ptr<al::EffectSlot, al::EffectSlot ::EaxDeleter>;
368369
369370auto eax_create_al_effect_slot (gsl::not_null<al::Context*> context) -> EaxAlEffectSlotUPtr;
370371#endif // ALSOFT_EAX
371372
372373struct EffectSlotSubList {
373374 uint64_t mFreeMask {~0_u64};
374- gsl::owner<std::array<ALeffectslot ,64 >*> mEffectSlots {nullptr };
375+ gsl::owner<std::array<al::EffectSlot ,64 >*> mEffectSlots {nullptr };
375376
376377 EffectSlotSubList () noexcept = default ;
377378 EffectSlotSubList (const EffectSlotSubList&) = delete ;
0 commit comments