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/compressor.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/compressor.cpp')
-rw-r--r-- | al/effects/compressor.cpp | 66 |
1 files changed, 15 insertions, 51 deletions
diff --git a/al/effects/compressor.cpp b/al/effects/compressor.cpp index cd284383..bb5dfa3e 100644 --- a/al/effects/compressor.cpp +++ b/al/effects/compressor.cpp @@ -98,9 +98,7 @@ public: EaxCompressorEffect(); - // [[nodiscard]] - bool dispatch( - const EaxEaxCall& eax_call) override; + void dispatch(const EaxEaxCall& eax_call) override; // [[nodiscard]] bool apply_deferred() override; @@ -113,41 +111,21 @@ private: void set_eax_defaults(); - void set_efx_on_off(); - void set_efx_defaults(); + void get(const EaxEaxCall& eax_call); - // [[nodiscard]] - bool get( - const EaxEaxCall& eax_call); - - - void validate_on_off( - unsigned long ulOnOff); - - void validate_all( - const EAXAGCCOMPRESSORPROPERTIES& eax_all); - - - void defer_on_off( - unsigned long ulOnOff); - - void defer_all( - const EAXAGCCOMPRESSORPROPERTIES& eax_all); - - - void defer_on_off( - const EaxEaxCall& eax_call); + void validate_on_off(unsigned long ulOnOff); + void validate_all(const EAXAGCCOMPRESSORPROPERTIES& eax_all); - void defer_all( - const EaxEaxCall& eax_call); + void defer_on_off(unsigned long ulOnOff); + void defer_all(const EAXAGCCOMPRESSORPROPERTIES& eax_all); + void defer_on_off(const EaxEaxCall& eax_call); + void defer_all(const EaxEaxCall& eax_call); - // [[nodiscard]] - bool set( - const EaxEaxCall& eax_call); + void set(const EaxEaxCall& eax_call); }; // EaxCompressorEffect @@ -172,10 +150,9 @@ EaxCompressorEffect::EaxCompressorEffect() } // [[nodiscard]] -bool EaxCompressorEffect::dispatch( - const EaxEaxCall& eax_call) +void EaxCompressorEffect::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 EaxCompressorEffect::set_eax_defaults() @@ -200,11 +177,9 @@ void EaxCompressorEffect::set_efx_defaults() set_efx_on_off(); } -// [[nodiscard]] -bool EaxCompressorEffect::get( - const EaxEaxCall& eax_call) +void EaxCompressorEffect::get(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXAGCCOMPRESSOR_NONE: break; @@ -220,8 +195,6 @@ bool EaxCompressorEffect::get( default: throw EaxCompressorEffectException{"Unsupported property id."}; } - - return false; } void EaxCompressorEffect::validate_on_off( @@ -293,11 +266,9 @@ bool EaxCompressorEffect::apply_deferred() return true; } -// [[nodiscard]] -bool EaxCompressorEffect::set( - const EaxEaxCall& eax_call) +void EaxCompressorEffect::set(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXAGCCOMPRESSOR_NONE: break; @@ -313,13 +284,6 @@ bool EaxCompressorEffect::set( default: throw EaxCompressorEffectException{"Unsupported property id."}; } - - if (!eax_call.is_deferred()) - { - return apply_deferred(); - } - - return false; } } // namespace |