fx_slots.h 773 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef EAX_FX_SLOTS_INCLUDED
  2. #define EAX_FX_SLOTS_INCLUDED
  3. #include <array>
  4. #include "al/auxeffectslot.h"
  5. #include "fx_slot_index.h"
  6. class EaxFxSlots {
  7. public:
  8. void initialize(ALCcontext& al_context);
  9. void uninitialize() noexcept;
  10. void commit()
  11. {
  12. for(auto& fx_slot : fx_slots_)
  13. fx_slot->eax_commit();
  14. }
  15. [[nodiscard]] auto get(EaxFxSlotIndex index) const -> const ALeffectslot&;
  16. [[nodiscard]] auto get(EaxFxSlotIndex index) -> ALeffectslot&;
  17. private:
  18. using Items = std::array<EaxAlEffectSlotUPtr, EAX_MAX_FXSLOTS>;
  19. Items fx_slots_{};
  20. [[noreturn]]
  21. static void fail(const char* message);
  22. void initialize_fx_slots(ALCcontext& al_context);
  23. }; // EaxFxSlots
  24. #endif // !EAX_FX_SLOTS_INCLUDED