auxeffectslot.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef AL_AUXEFFECTSLOT_H
  2. #define AL_AUXEFFECTSLOT_H
  3. #include <atomic>
  4. #include <cstddef>
  5. #include "AL/al.h"
  6. #include "AL/alc.h"
  7. #include "AL/efx.h"
  8. #include "alcmain.h"
  9. #include "almalloc.h"
  10. #include "atomic.h"
  11. #include "effectslot.h"
  12. #include "effects/base.h"
  13. #include "intrusive_ptr.h"
  14. #include "vector.h"
  15. struct ALbuffer;
  16. struct ALeffect;
  17. struct WetBuffer;
  18. enum class SlotState : ALenum {
  19. Initial = AL_INITIAL,
  20. Playing = AL_PLAYING,
  21. Stopped = AL_STOPPED,
  22. };
  23. struct ALeffectslot {
  24. float Gain{1.0f};
  25. bool AuxSendAuto{true};
  26. ALeffectslot *Target{nullptr};
  27. ALbuffer *Buffer{nullptr};
  28. struct {
  29. EffectSlotType Type{EffectSlotType::None};
  30. EffectProps Props{};
  31. al::intrusive_ptr<EffectState> State;
  32. } Effect;
  33. std::atomic_flag PropsClean;
  34. SlotState mState{SlotState::Initial};
  35. RefCount ref{0u};
  36. EffectSlot mSlot;
  37. /* Self ID */
  38. ALuint id{};
  39. ALeffectslot();
  40. ALeffectslot(const ALeffectslot&) = delete;
  41. ALeffectslot& operator=(const ALeffectslot&) = delete;
  42. ~ALeffectslot();
  43. ALenum initEffect(ALeffect *effect, ALCcontext *context);
  44. void updateProps(ALCcontext *context);
  45. /* This can be new'd for the context's default effect slot. */
  46. DEF_NEWDEL(ALeffectslot)
  47. };
  48. void UpdateAllEffectSlotProps(ALCcontext *context);
  49. #endif