diff options
author | Chris Robinson <[email protected]> | 2022-03-05 01:14:26 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-03-05 01:14:26 -0800 |
commit | 2dc9cf170c08f0b7f35ec46cb17c829888e7392c (patch) | |
tree | 76865c75ba9cd0dce3452988ff28ac7636a82872 /al/effects/autowah.cpp | |
parent | 7bec22abb61fa1b87e157dd6b577ba174d3273d3 (diff) |
Simplify committing EAX properties
Based on DirectSound's EAX behavior, committing any EAX property commits *all*
deferred property changes, not just the object being changed. So applying EAX
changes can be handled in one place.
Diffstat (limited to 'al/effects/autowah.cpp')
-rw-r--r-- | al/effects/autowah.cpp | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/al/effects/autowah.cpp b/al/effects/autowah.cpp index 6fa859ba..273ec7ae 100644 --- a/al/effects/autowah.cpp +++ b/al/effects/autowah.cpp @@ -139,9 +139,7 @@ public: EaxAutoWahEffect(); - // [[nodiscard]] - bool dispatch( - const EaxEaxCall& eax_call) override; + void dispatch(const EaxEaxCall& eax_call) override; // [[nodiscard]] bool apply_deferred() override; @@ -166,9 +164,7 @@ private: void set_efx_defaults(); - // [[nodiscard]] - bool get( - const EaxEaxCall& eax_call); + void get(const EaxEaxCall& eax_call); void validate_attack_time( @@ -218,9 +214,7 @@ private: void defer_all( const EaxEaxCall& eax_call); - // [[nodiscard]] - bool set( - const EaxEaxCall& eax_call); + void set(const EaxEaxCall& eax_call); }; // EaxAutoWahEffect @@ -244,11 +238,9 @@ EaxAutoWahEffect::EaxAutoWahEffect() set_efx_defaults(); } -// [[nodiscard]] -bool EaxAutoWahEffect::dispatch( - const EaxEaxCall& eax_call) +void EaxAutoWahEffect::dispatch(const EaxEaxCall& eax_call) { - return eax_call.is_get() ? get(eax_call) : set(eax_call); + eax_call.is_get() ? get(eax_call) : set(eax_call); } void EaxAutoWahEffect::set_eax_defaults() @@ -309,8 +301,7 @@ void EaxAutoWahEffect::set_efx_defaults() set_efx_peak_gain(); } -bool EaxAutoWahEffect::get( - const EaxEaxCall& eax_call) +void EaxAutoWahEffect::get(const EaxEaxCall& eax_call) { switch (eax_call.get_property_id()) { @@ -340,8 +331,6 @@ bool EaxAutoWahEffect::get( default: throw EaxAutoWahEffectException{"Unsupported property id."}; } - - return false; } void EaxAutoWahEffect::validate_attack_time( @@ -517,9 +506,7 @@ bool EaxAutoWahEffect::apply_deferred() return true; } -// [[nodiscard]] -bool EaxAutoWahEffect::set( - const EaxEaxCall& eax_call) +void EaxAutoWahEffect::set(const EaxEaxCall& eax_call) { switch (eax_call.get_property_id()) { @@ -549,13 +536,6 @@ bool EaxAutoWahEffect::set( default: throw EaxAutoWahEffectException{"Unsupported property id."}; } - - if (!eax_call.is_deferred()) - { - return apply_deferred(); - } - - return false; } } // namespace |