diff options
author | Chris Robinson <[email protected]> | 2023-03-09 21:37:13 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-03-09 21:37:13 -0800 |
commit | f7d051fb7843ea70818b34cfba53a851f551e261 (patch) | |
tree | ec55efc1f705faace3d01d6dd813cffe7c0df86a /al | |
parent | 1ea8f7a9a1f1ec74bb162a704283f8e3c3ede96d (diff) |
Have the null effect inherit from EaxEffect4
Diffstat (limited to 'al')
-rw-r--r-- | al/effects/null.cpp | 49 |
1 files changed, 35 insertions, 14 deletions
diff --git a/al/effects/null.cpp b/al/effects/null.cpp index 5bbcdd62..8b11f20c 100644 --- a/al/effects/null.cpp +++ b/al/effects/null.cpp @@ -100,15 +100,6 @@ const EffectProps NullEffectProps{genDefaultProps()}; #ifdef ALSOFT_EAX namespace { -class EaxNullEffect final : public EaxEffect { -public: - EaxNullEffect(int eax_version) noexcept; - - void dispatch(const EaxCall& call) override; - /*[[nodiscard]]*/ bool commit() override; -}; // EaxNullEffect - - class EaxNullEffectException : public EaxException { public: @@ -117,17 +108,47 @@ public: {} }; // EaxNullEffectException -EaxNullEffect::EaxNullEffect(int eax_version) noexcept - : EaxEffect{AL_EFFECT_NULL, eax_version} +class EaxNullEffect final : public EaxEffect4<EaxNullEffectException> +{ +public: + EaxNullEffect(int eax_version); + +private: + void set_defaults(Props4& props) override; + + void set_efx_defaults() override; + + void get(const EaxCall& call, const Props4& props) override; + void set(const EaxCall& call, Props4& props) override; + bool commit_props(const Props4& props) override; +}; // EaxCompressorEffect + +EaxNullEffect::EaxNullEffect(int eax_version) + : EaxEffect4{AL_EFFECT_NULL, eax_version} {} -void EaxNullEffect::dispatch(const EaxCall& call) +void EaxNullEffect::set_defaults(Props4& props) +{ + props.mType = EaxEffectType::None; +} + +void EaxNullEffect::set_efx_defaults() +{ +} + +void EaxNullEffect::get(const EaxCall& call, const Props4&) +{ + if(call.get_property_id() != 0) + fail_unknown_property_id(); +} + +void EaxNullEffect::set(const EaxCall& call, Props4&) { if(call.get_property_id() != 0) - throw EaxNullEffectException{"Unsupported property id."}; + fail_unknown_property_id(); } -bool EaxNullEffect::commit() +bool EaxNullEffect::commit_props(const Props4&) { return false; } |