diff options
author | Boris I. Bendovsky <[email protected]> | 2022-01-30 14:47:32 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-01-30 04:47:32 -0800 |
commit | 19ed994dc30ed84ea7cbbb5152577669fc25caf6 (patch) | |
tree | f68933bf8f778806618bd6c0b1bf9ced1b0ccf08 /al/effect.h | |
parent | 619249371a40f03cf988d1f5750d643df797c485 (diff) |
Add EAX extensions (EAX 2.0-5.0, X-RAM) (#632)
* Add EAX extensions (EAX 2.0-5.0, X-RAM)
* Comment out C++17 leftovers
* Remove everything related to patching
* Update alsoftrc.sample
* Rewrite integration
* Fix GCC compilation under Linux
* Always reset EAX effect properties when loading it into FX slot
Diffstat (limited to 'al/effect.h')
-rw-r--r-- | al/effect.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/al/effect.h b/al/effect.h index 10a692c9..5b5e4b03 100644 --- a/al/effect.h +++ b/al/effect.h @@ -7,6 +7,12 @@ #include "al/effects/effects.h" #include "alc/effects/base.h" +#if ALSOFT_EAX +#include <memory> + +#include "eax_effect.h" +#endif // ALSOFT_EAX + enum { EAXREVERB_EFFECT = 0, @@ -51,10 +57,57 @@ struct ALeffect { ALuint id{0u}; DISABLE_ALLOC() + + +#if ALSOFT_EAX +public: + EaxEffectUPtr eax_effect{}; + + + void eax_initialize(); + + void eax_al_set_effect( + ALenum al_effect_type); + + +private: + [[noreturn]] + static void eax_fail( + const char* message); +#endif // ALSOFT_EAX }; void InitEffect(ALeffect *effect); void LoadReverbPreset(const char *name, ALeffect *effect); +#if ALSOFT_EAX +class EaxAlEffectDeleter +{ +public: + EaxAlEffectDeleter() noexcept = default; + + EaxAlEffectDeleter( + ALCcontext& context) noexcept; + + void operator()( + ALeffect* effect) const; + + +private: + ALCcontext* context_{}; +}; // EaxAlEffectDeleter + +using EaxAlEffectUPtr = std::unique_ptr<ALeffect, EaxAlEffectDeleter>; + + +EaxAlEffectUPtr eax_create_al_effect( + ALCcontext& context, + ALenum effect_type); + +void eax_al_delete_effect( + ALCcontext& context, + ALeffect& effect); +#endif // ALSOFT_EAX + #endif |