diff options
-rw-r--r-- | al/auxeffectslot.cpp | 28 | ||||
-rw-r--r-- | al/eax_eax_call.cpp | 22 | ||||
-rw-r--r-- | al/eax_eax_call.h | 2 | ||||
-rw-r--r-- | al/eax_effect.h | 6 | ||||
-rw-r--r-- | al/effects/autowah.cpp | 34 | ||||
-rw-r--r-- | al/effects/chorus.cpp | 282 | ||||
-rw-r--r-- | al/effects/compressor.cpp | 66 | ||||
-rw-r--r-- | al/effects/distortion.cpp | 129 | ||||
-rw-r--r-- | al/effects/echo.cpp | 127 | ||||
-rw-r--r-- | al/effects/equalizer.cpp | 194 | ||||
-rw-r--r-- | al/effects/fshifter.cpp | 95 | ||||
-rw-r--r-- | al/effects/modulator.cpp | 93 | ||||
-rw-r--r-- | al/effects/null.cpp | 14 | ||||
-rw-r--r-- | al/effects/pshifter.cpp | 81 | ||||
-rw-r--r-- | al/effects/reverb.cpp | 51 | ||||
-rw-r--r-- | al/effects/vmorpher.cpp | 147 | ||||
-rw-r--r-- | al/source.cpp | 6 | ||||
-rw-r--r-- | alc/context.cpp | 23 |
18 files changed, 328 insertions, 1072 deletions
diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp index bb279c88..a83c39f7 100644 --- a/al/auxeffectslot.cpp +++ b/al/auxeffectslot.cpp @@ -1677,16 +1677,12 @@ bool ALeffectslot::eax_set_fx_slot( } // [[nodiscard]] -bool ALeffectslot::eax_set( - const EaxEaxCall& eax_call) +bool ALeffectslot::eax_set(const EaxEaxCall& eax_call) { - bool ret{false}; - - switch (eax_call.get_property_set_id()) + switch(eax_call.get_property_set_id()) { case EaxEaxCallPropertySetId::fx_slot: - ret = eax_set_fx_slot(eax_call); - break; + return eax_set_fx_slot(eax_call); case EaxEaxCallPropertySetId::fx_slot_effect: eax_dispatch_effect(eax_call); @@ -1696,23 +1692,11 @@ bool ALeffectslot::eax_set( eax_fail("Unsupported property id."); } - if(!eax_call.is_deferred()) - { - eax_apply_deferred(); - } - - return ret; + return false; } -void ALeffectslot::eax_dispatch_effect( - const EaxEaxCall& eax_call) -{ - auto is_changed = false; - if(eax_effect_) - is_changed = eax_effect_->dispatch(eax_call); - if(is_changed) - eax_set_effect_slot_effect(*eax_effect_); -} +void ALeffectslot::eax_dispatch_effect(const EaxEaxCall& eax_call) +{ if(eax_effect_) eax_effect_->dispatch(eax_call); } void ALeffectslot::eax_apply_deferred() { diff --git a/al/eax_eax_call.cpp b/al/eax_eax_call.cpp index dfd7f7f7..914d2fbf 100644 --- a/al/eax_eax_call.cpp +++ b/al/eax_eax_call.cpp @@ -31,10 +31,9 @@ EaxEaxCall::EaxEaxCall( ALuint property_source_id, ALvoid* property_buffer, ALuint property_size) - : is_get_{is_get}, is_deferred_{(property_id&deferred_flag) != 0}, version_{0} - , property_set_id_{EaxEaxCallPropertySetId::none}, property_id_{property_id & ~deferred_flag} - , property_source_id_{property_source_id}, property_buffer_{property_buffer} - , property_size_{property_size} + : is_get_{is_get}, version_{0}, property_set_id_{EaxEaxCallPropertySetId::none} + , property_id_{property_id & ~deferred_flag}, property_source_id_{property_source_id} + , property_buffer_{property_buffer}, property_size_{property_size} { if (false) { @@ -152,17 +151,9 @@ EaxEaxCall::EaxEaxCall( fail("EAX version out of range."); } - if (is_deferred_) + if(!(property_id&deferred_flag)) { - if (version_ == 1) - { - fail("EAX1 does not support deferring."); - } - } - else - { - if (property_set_id_ != EaxEaxCallPropertySetId::fx_slot && - property_id_ != 0) + if(property_set_id_ != EaxEaxCallPropertySetId::fx_slot && property_id_ != 0) { if (!property_buffer) { @@ -176,8 +167,7 @@ EaxEaxCall::EaxEaxCall( } } - if (property_set_id_ == EaxEaxCallPropertySetId::source && - property_source_id_ == 0) + if(property_set_id_ == EaxEaxCallPropertySetId::source && property_source_id_ == 0) { fail("Null AL source id."); } diff --git a/al/eax_eax_call.h b/al/eax_eax_call.h index dd89795a..7b990d87 100644 --- a/al/eax_eax_call.h +++ b/al/eax_eax_call.h @@ -33,7 +33,6 @@ public: ALuint property_size); bool is_get() const noexcept { return is_get_; } - bool is_deferred() const noexcept { return is_deferred_; } int get_version() const noexcept { return version_; } EaxEaxCallPropertySetId get_property_set_id() const noexcept { return property_set_id_; } ALuint get_property_id() const noexcept { return property_id_; } @@ -83,7 +82,6 @@ public: private: const bool is_get_; - const bool is_deferred_; int version_; EaxFxSlotIndex fx_slot_index_; EaxEaxCallPropertySetId property_set_id_; diff --git a/al/eax_effect.h b/al/eax_effect.h index 6de9afcc..45315ca6 100644 --- a/al/eax_effect.h +++ b/al/eax_effect.h @@ -17,11 +17,9 @@ public: const ALenum al_effect_type_; EffectProps al_effect_props_{}; - // Returns "true" if any immediated property was changed. - // [[nodiscard]] - virtual bool dispatch( - const EaxEaxCall& eax_call) = 0; + virtual void dispatch(const EaxEaxCall& eax_call) = 0; + // Returns "true" if any immediated property was changed. // [[nodiscard]] virtual bool apply_deferred() = 0; }; // EaxEffect 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 diff --git a/al/effects/chorus.cpp b/al/effects/chorus.cpp index 397b338a..56318095 100644 --- a/al/effects/chorus.cpp +++ b/al/effects/chorus.cpp @@ -359,10 +359,7 @@ class EaxChorusEffect final : public: EaxChorusEffect(); - - // [[nodiscard]] - bool dispatch( - const EaxEaxCall& eax_call) override; + void dispatch(const EaxEaxCall& eax_call) override; // [[nodiscard]] bool apply_deferred() override; @@ -372,99 +369,43 @@ private: EAXCHORUSPROPERTIES eax_d_{}; EaxChorusEffectDirtyFlags eax_dirty_flags_{}; - void set_eax_defaults() noexcept; - void set_efx_waveform(); - void set_efx_phase(); - void set_efx_rate(); - void set_efx_depth(); - void set_efx_feedback(); - void set_efx_delay(); - void set_efx_defaults(); - - // [[nodiscard]] - bool get( - const EaxEaxCall& eax_call); - - - void validate_waveform( - unsigned long ulWaveform); - - void validate_phase( - long lPhase); - - void validate_rate( - float flRate); - - void validate_depth( - float flDepth); - - void validate_feedback( - float flFeedback); - - void validate_delay( - float flDelay); - - void validate_all( - const EAXCHORUSPROPERTIES& eax_all); - - - void defer_waveform( - unsigned long ulWaveform); - - void defer_phase( - long lPhase); - - void defer_rate( - float flRate); - - void defer_depth( - float flDepth); - - void defer_feedback( - float flFeedback); - - void defer_delay( - float flDelay); - - void defer_all( - const EAXCHORUSPROPERTIES& eax_all); - - - void defer_waveform( - const EaxEaxCall& eax_call); - - void defer_phase( - const EaxEaxCall& eax_call); - - void defer_rate( - const EaxEaxCall& eax_call); - - void defer_depth( - const EaxEaxCall& eax_call); - - void defer_feedback( - const EaxEaxCall& eax_call); - - void defer_delay( - const EaxEaxCall& eax_call); - - void defer_all( - const EaxEaxCall& eax_call); - - - // [[nodiscard]] - bool set( - const EaxEaxCall& eax_call); + void get(const EaxEaxCall& eax_call); + + void validate_waveform(unsigned long ulWaveform); + void validate_phase(long lPhase); + void validate_rate(float flRate); + void validate_depth(float flDepth); + void validate_feedback(float flFeedback); + void validate_delay(float flDelay); + void validate_all(const EAXCHORUSPROPERTIES& eax_all); + + void defer_waveform(unsigned long ulWaveform); + void defer_phase(long lPhase); + void defer_rate(float flRate); + void defer_depth(float flDepth); + void defer_feedback(float flFeedback); + void defer_delay(float flDelay); + void defer_all(const EAXCHORUSPROPERTIES& eax_all); + + void defer_waveform(const EaxEaxCall& eax_call); + void defer_phase(const EaxEaxCall& eax_call); + void defer_rate(const EaxEaxCall& eax_call); + void defer_depth(const EaxEaxCall& eax_call); + void defer_feedback(const EaxEaxCall& eax_call); + void defer_delay(const EaxEaxCall& eax_call); + void defer_all(const EaxEaxCall& eax_call); + + void set(const EaxEaxCall& eax_call); }; // EaxChorusEffect @@ -488,11 +429,9 @@ EaxChorusEffect::EaxChorusEffect() set_efx_defaults(); } -// [[nodiscard]] -bool EaxChorusEffect::dispatch( - const EaxEaxCall& eax_call) +void EaxChorusEffect::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 EaxChorusEffect::set_eax_defaults() noexcept @@ -577,10 +516,9 @@ void EaxChorusEffect::set_efx_defaults() set_efx_delay(); } -bool EaxChorusEffect::get( - const EaxEaxCall& eax_call) +void EaxChorusEffect::get(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXCHORUS_NONE: break; @@ -616,8 +554,6 @@ bool EaxChorusEffect::get( default: throw EaxChorusEffectException{"Unsupported property id."}; } - - return false; } void EaxChorusEffect::validate_waveform( @@ -859,11 +795,9 @@ bool EaxChorusEffect::apply_deferred() return true; } -// [[nodiscard]] -bool EaxChorusEffect::set( - const EaxEaxCall& eax_call) +void EaxChorusEffect::set(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXCHORUS_NONE: break; @@ -899,13 +833,6 @@ bool EaxChorusEffect::set( default: throw EaxChorusEffectException{"Unsupported property id."}; } - - if (!eax_call.is_deferred()) - { - return apply_deferred(); - } - - return false; } @@ -944,9 +871,7 @@ public: EaxFlangerEffect(); - // [[nodiscard]] - bool dispatch( - const EaxEaxCall& eax_call) override; + void dispatch(const EaxEaxCall& eax_call) override; // [[nodiscard]] bool apply_deferred() override; @@ -956,99 +881,43 @@ private: EAXFLANGERPROPERTIES eax_d_{}; EaxFlangerEffectDirtyFlags eax_dirty_flags_{}; - void set_eax_defaults(); - void set_efx_waveform(); - void set_efx_phase(); - void set_efx_rate(); - void set_efx_depth(); - void set_efx_feedback(); - void set_efx_delay(); - void set_efx_defaults(); - - // [[nodiscard]] - bool get( - const EaxEaxCall& eax_call); - - - void validate_waveform( - unsigned long ulWaveform); - - void validate_phase( - long lPhase); - - void validate_rate( - float flRate); - - void validate_depth( - float flDepth); - - void validate_feedback( - float flFeedback); - - void validate_delay( - float flDelay); - - void validate_all( - const EAXFLANGERPROPERTIES& all); - - - void defer_waveform( - unsigned long ulWaveform); - - void defer_phase( - long lPhase); - - void defer_rate( - float flRate); - - void defer_depth( - float flDepth); - - void defer_feedback( - float flFeedback); - - void defer_delay( - float flDelay); - - void defer_all( - const EAXFLANGERPROPERTIES& all); - - - void defer_waveform( - const EaxEaxCall& eax_call); - - void defer_phase( - const EaxEaxCall& eax_call); - - void defer_rate( - const EaxEaxCall& eax_call); - - void defer_depth( - const EaxEaxCall& eax_call); - - void defer_feedback( - const EaxEaxCall& eax_call); - - void defer_delay( - const EaxEaxCall& eax_call); - - void defer_all( - const EaxEaxCall& eax_call); - - - // [[nodiscard]] - bool set( - const EaxEaxCall& eax_call); + void get(const EaxEaxCall& eax_call); + + void validate_waveform(unsigned long ulWaveform); + void validate_phase(long lPhase); + void validate_rate(float flRate); + void validate_depth(float flDepth); + void validate_feedback(float flFeedback); + void validate_delay(float flDelay); + void validate_all(const EAXFLANGERPROPERTIES& all); + + void defer_waveform(unsigned long ulWaveform); + void defer_phase(long lPhase); + void defer_rate(float flRate); + void defer_depth(float flDepth); + void defer_feedback(float flFeedback); + void defer_delay(float flDelay); + void defer_all(const EAXFLANGERPROPERTIES& all); + + void defer_waveform(const EaxEaxCall& eax_call); + void defer_phase(const EaxEaxCall& eax_call); + void defer_rate(const EaxEaxCall& eax_call); + void defer_depth(const EaxEaxCall& eax_call); + void defer_feedback(const EaxEaxCall& eax_call); + void defer_delay(const EaxEaxCall& eax_call); + void defer_all(const EaxEaxCall& eax_call); + + void set(const EaxEaxCall& eax_call); }; // EaxFlangerEffect @@ -1072,11 +941,9 @@ EaxFlangerEffect::EaxFlangerEffect() set_efx_defaults(); } -// [[nodiscard]] -bool EaxFlangerEffect::dispatch( - const EaxEaxCall& eax_call) +void EaxFlangerEffect::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 EaxFlangerEffect::set_eax_defaults() @@ -1161,11 +1028,9 @@ void EaxFlangerEffect::set_efx_defaults() set_efx_delay(); } -// [[nodiscard]] -bool EaxFlangerEffect::get( - const EaxEaxCall& eax_call) +void EaxFlangerEffect::get(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXFLANGER_NONE: break; @@ -1201,8 +1066,6 @@ bool EaxFlangerEffect::get( default: throw EaxFlangerEffectException{"Unsupported property id."}; } - - return false; } void EaxFlangerEffect::validate_waveform( @@ -1444,11 +1307,9 @@ bool EaxFlangerEffect::apply_deferred() return true; } -// [[nodiscard]] -bool EaxFlangerEffect::set( - const EaxEaxCall& eax_call) +void EaxFlangerEffect::set(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXFLANGER_NONE: break; @@ -1484,13 +1345,6 @@ bool EaxFlangerEffect::set( default: throw EaxFlangerEffectException{"Unsupported property id."}; } - - if (!eax_call.is_deferred()) - { - return apply_deferred(); - } - - return false; } } // namespace 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 diff --git a/al/effects/distortion.cpp b/al/effects/distortion.cpp index 0f4b6ed5..13b1f23d 100644 --- a/al/effects/distortion.cpp +++ b/al/effects/distortion.cpp @@ -143,10 +143,7 @@ class EaxDistortionEffect final : public: EaxDistortionEffect(); - - // [[nodiscard]] - bool dispatch( - const EaxEaxCall& eax_call) override; + void dispatch(const EaxEaxCall& eax_call) override; // [[nodiscard]] bool apply_deferred() override; @@ -156,88 +153,39 @@ private: EAXDISTORTIONPROPERTIES eax_d_{}; EaxDistortionEffectDirtyFlags eax_dirty_flags_{}; - void set_eax_defaults(); - void set_efx_edge(); - void set_efx_gain(); - void set_efx_lowpass_cutoff(); - void set_efx_eq_center(); - void set_efx_eq_bandwidth(); - void set_efx_defaults(); - - // [[nodiscard]] - bool get( - const EaxEaxCall& eax_call); - - - void validate_edge( - float flEdge); - - void validate_gain( - long lGain); - - void validate_lowpass_cutoff( - float flLowPassCutOff); - - void validate_eq_center( - float flEQCenter); - - void validate_eq_bandwidth( - float flEQBandwidth); - - void validate_all( - const EAXDISTORTIONPROPERTIES& eax_all); - - - void defer_edge( - float flEdge); - - void defer_gain( - long lGain); - - void defer_low_pass_cutoff( - float flLowPassCutOff); - - void defer_eq_center( - float flEQCenter); - - void defer_eq_bandwidth( - float flEQBandwidth); - - void defer_all( - const EAXDISTORTIONPROPERTIES& eax_all); - - - void defer_edge( - const EaxEaxCall& eax_call); - - void defer_gain( - const EaxEaxCall& eax_call); - - void defer_low_pass_cutoff( - const EaxEaxCall& eax_call); - - void defer_eq_center( - const EaxEaxCall& eax_call); - - void defer_eq_bandwidth( - const EaxEaxCall& eax_call); - - void defer_all( - const EaxEaxCall& eax_call); - - - // [[nodiscard]] - bool set( - const EaxEaxCall& eax_call); + void get(const EaxEaxCall& eax_call); + + void validate_edge(float flEdge); + void validate_gain(long lGain); + void validate_lowpass_cutoff(float flLowPassCutOff); + void validate_eq_center(float flEQCenter); + void validate_eq_bandwidth(float flEQBandwidth); + void validate_all(const EAXDISTORTIONPROPERTIES& eax_all); + + void defer_edge(float flEdge); + void defer_gain(long lGain); + void defer_low_pass_cutoff(float flLowPassCutOff); + void defer_eq_center(float flEQCenter); + void defer_eq_bandwidth(float flEQBandwidth); + void defer_all(const EAXDISTORTIONPROPERTIES& eax_all); + + void defer_edge(const EaxEaxCall& eax_call); + void defer_gain(const EaxEaxCall& eax_call); + void defer_low_pass_cutoff(const EaxEaxCall& eax_call); + void defer_eq_center(const EaxEaxCall& eax_call); + void defer_eq_bandwidth(const EaxEaxCall& eax_call); + void defer_all(const EaxEaxCall& eax_call); + + void set(const EaxEaxCall& eax_call); }; // EaxDistortionEffect @@ -261,11 +209,9 @@ EaxDistortionEffect::EaxDistortionEffect() set_efx_defaults(); } -// [[nodiscard]] -bool EaxDistortionEffect::dispatch( - const EaxEaxCall& eax_call) +void EaxDistortionEffect::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 EaxDistortionEffect::set_eax_defaults() @@ -338,11 +284,9 @@ void EaxDistortionEffect::set_efx_defaults() set_efx_eq_bandwidth(); } -// [[nodiscard]] -bool EaxDistortionEffect::get( - const EaxEaxCall& eax_call) +void EaxDistortionEffect::get(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXDISTORTION_NONE: break; @@ -374,8 +318,6 @@ bool EaxDistortionEffect::get( default: throw EaxDistortionEffectException{"Unsupported property id."}; } - - return false; } void EaxDistortionEffect::validate_edge( @@ -583,11 +525,9 @@ bool EaxDistortionEffect::apply_deferred() return true; } -// [[nodiscard]] -bool EaxDistortionEffect::set( - const EaxEaxCall& eax_call) +void EaxDistortionEffect::set(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXDISTORTION_NONE: break; @@ -619,13 +559,6 @@ bool EaxDistortionEffect::set( default: throw EaxDistortionEffectException{"Unsupported property id."}; } - - if (!eax_call.is_deferred()) - { - return apply_deferred(); - } - - return false; } } // namespace diff --git a/al/effects/echo.cpp b/al/effects/echo.cpp index b2e45091..61adad7f 100644 --- a/al/effects/echo.cpp +++ b/al/effects/echo.cpp @@ -140,10 +140,7 @@ class EaxEchoEffect final : public: EaxEchoEffect(); - - // [[nodiscard]] - bool dispatch( - const EaxEaxCall& eax_call) override; + void dispatch(const EaxEaxCall& eax_call) override; // [[nodiscard]] bool apply_deferred() override; @@ -153,87 +150,39 @@ private: EAXECHOPROPERTIES eax_d_{}; EaxEchoEffectDirtyFlags eax_dirty_flags_{}; - void set_eax_defaults(); - void set_efx_delay(); - void set_efx_lr_delay(); - void set_efx_damping(); - void set_efx_feedback(); - void set_efx_spread(); - void set_efx_defaults(); - - // [[nodiscard]] - bool get( - const EaxEaxCall& eax_call); - - - void validate_delay( - float flDelay); - - void validate_lr_delay( - float flLRDelay); - - void validate_damping( - float flDamping); - - void validate_feedback( - float flFeedback); - - void validate_spread( - float flSpread); - - void validate_all( - const EAXECHOPROPERTIES& all); - - - void defer_delay( - float flDelay); - - void defer_lr_delay( - float flLRDelay); - - void defer_damping( - float flDamping); - - void defer_feedback( - float flFeedback); - - void defer_spread( - float flSpread); - - void defer_all( - const EAXECHOPROPERTIES& all); - - - void defer_delay( - const EaxEaxCall& eax_call); - - void defer_lr_delay( - const EaxEaxCall& eax_call); - - void defer_damping( - const EaxEaxCall& eax_call); - - void defer_feedback( - const EaxEaxCall& eax_call); - - void defer_spread( - const EaxEaxCall& eax_call); - - void defer_all( - const EaxEaxCall& eax_call); - - - bool set( - const EaxEaxCall& eax_call); + void get(const EaxEaxCall& eax_call); + + void validate_delay(float flDelay); + void validate_lr_delay(float flLRDelay); + void validate_damping(float flDamping); + void validate_feedback(float flFeedback); + void validate_spread(float flSpread); + void validate_all(const EAXECHOPROPERTIES& all); + + void defer_delay(float flDelay); + void defer_lr_delay(float flLRDelay); + void defer_damping(float flDamping); + void defer_feedback(float flFeedback); + void defer_spread(float flSpread); + void defer_all(const EAXECHOPROPERTIES& all); + + void defer_delay(const EaxEaxCall& eax_call); + void defer_lr_delay(const EaxEaxCall& eax_call); + void defer_damping(const EaxEaxCall& eax_call); + void defer_feedback(const EaxEaxCall& eax_call); + void defer_spread(const EaxEaxCall& eax_call); + void defer_all(const EaxEaxCall& eax_call); + + void set(const EaxEaxCall& eax_call); }; // EaxEchoEffect @@ -257,11 +206,10 @@ EaxEchoEffect::EaxEchoEffect() set_efx_defaults(); } -// [[nodiscard]] -bool EaxEchoEffect::dispatch( +void EaxEchoEffect::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 EaxEchoEffect::set_eax_defaults() @@ -334,11 +282,9 @@ void EaxEchoEffect::set_efx_defaults() set_efx_spread(); } -// [[nodiscard]] -bool EaxEchoEffect::get( - const EaxEaxCall& eax_call) +void EaxEchoEffect::get(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXECHO_NONE: break; @@ -370,8 +316,6 @@ bool EaxEchoEffect::get( default: throw EaxEchoEffectException{"Unsupported property id."}; } - - return false; } void EaxEchoEffect::validate_delay( @@ -579,11 +523,9 @@ bool EaxEchoEffect::apply_deferred() return true; } -// [[nodiscard]] -bool EaxEchoEffect::set( - const EaxEaxCall& eax_call) +void EaxEchoEffect::set(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXECHO_NONE: break; @@ -615,13 +557,6 @@ bool EaxEchoEffect::set( default: throw EaxEchoEffectException{"Unsupported property id."}; } - - if (!eax_call.is_deferred()) - { - return apply_deferred(); - } - - return false; } } // namespace diff --git a/al/effects/equalizer.cpp b/al/effects/equalizer.cpp index 8cd59cd1..f829328c 100644 --- a/al/effects/equalizer.cpp +++ b/al/effects/equalizer.cpp @@ -203,10 +203,7 @@ class EaxEqualizerEffect final : public: EaxEqualizerEffect(); - - // [[nodiscard]] - bool dispatch( - const EaxEaxCall& eax_call) override; + void dispatch(const EaxEaxCall& eax_call) override; // [[nodiscard]] bool apply_deferred() override; @@ -216,143 +213,59 @@ private: EAXEQUALIZERPROPERTIES eax_d_{}; EaxEqualizerEffectDirtyFlags eax_dirty_flags_{}; - void set_eax_defaults(); - void set_efx_low_gain(); - void set_efx_low_cutoff(); - void set_efx_mid1_gain(); - void set_efx_mid1_center(); - void set_efx_mid1_width(); - void set_efx_mid2_gain(); - void set_efx_mid2_center(); - void set_efx_mid2_width(); - void set_efx_high_gain(); - void set_efx_high_cutoff(); - void set_efx_defaults(); - - // [[nodiscard]] - bool get( - const EaxEaxCall& eax_call); - - - void validate_low_gain( - long lLowGain); - - void validate_low_cutoff( - float flLowCutOff); - - void validate_mid1_gain( - long lMid1Gain); - - void validate_mid1_center( - float flMid1Center); - - void validate_mid1_width( - float flMid1Width); - - void validate_mid2_gain( - long lMid2Gain); - - void validate_mid2_center( - float flMid2Center); - - void validate_mid2_width( - float flMid2Width); - - void validate_high_gain( - long lHighGain); - - void validate_high_cutoff( - float flHighCutOff); - - void validate_all( - const EAXEQUALIZERPROPERTIES& all); - - - void defer_low_gain( - long lLowGain); - - void defer_low_cutoff( - float flLowCutOff); - - void defer_mid1_gain( - long lMid1Gain); - - void defer_mid1_center( - float flMid1Center); - - void defer_mid1_width( - float flMid1Width); - - void defer_mid2_gain( - long lMid2Gain); - - void defer_mid2_center( - float flMid2Center); - - void defer_mid2_width( - float flMid2Width); - - void defer_high_gain( - long lHighGain); - - void defer_high_cutoff( - float flHighCutOff); - - void defer_all( - const EAXEQUALIZERPROPERTIES& all); - - - void defer_low_gain( - const EaxEaxCall& eax_call); - - void defer_low_cutoff( - const EaxEaxCall& eax_call); - - void defer_mid1_gain( - const EaxEaxCall& eax_call); - - void defer_mid1_center( - const EaxEaxCall& eax_call); - - void defer_mid1_width( - const EaxEaxCall& eax_call); - - void defer_mid2_gain( - const EaxEaxCall& eax_call); - - void defer_mid2_center( - const EaxEaxCall& eax_call); - - void defer_mid2_width( - const EaxEaxCall& eax_call); - - void defer_high_gain( - const EaxEaxCall& eax_call); - - void defer_high_cutoff( - const EaxEaxCall& eax_call); - - void defer_all( - const EaxEaxCall& eax_call); - - - // [[nodiscard]] - bool set( - const EaxEaxCall& eax_call); + void get(const EaxEaxCall& eax_call); + + void validate_low_gain(long lLowGain); + void validate_low_cutoff(float flLowCutOff); + void validate_mid1_gain(long lMid1Gain); + void validate_mid1_center(float flMid1Center); + void validate_mid1_width(float flMid1Width); + void validate_mid2_gain(long lMid2Gain); + void validate_mid2_center(float flMid2Center); + void validate_mid2_width(float flMid2Width); + void validate_high_gain(long lHighGain); + void validate_high_cutoff(float flHighCutOff); + void validate_all(const EAXEQUALIZERPROPERTIES& all); + + void defer_low_gain(long lLowGain); + void defer_low_cutoff(float flLowCutOff); + void defer_mid1_gain(long lMid1Gain); + void defer_mid1_center(float flMid1Center); + void defer_mid1_width(float flMid1Width); + void defer_mid2_gain(long lMid2Gain); + void defer_mid2_center(float flMid2Center); + void defer_mid2_width(float flMid2Width); + void defer_high_gain(long lHighGain); + void defer_high_cutoff(float flHighCutOff); + void defer_all(const EAXEQUALIZERPROPERTIES& all); + + void defer_low_gain(const EaxEaxCall& eax_call); + void defer_low_cutoff(const EaxEaxCall& eax_call); + void defer_mid1_gain(const EaxEaxCall& eax_call); + void defer_mid1_center(const EaxEaxCall& eax_call); + void defer_mid1_width(const EaxEaxCall& eax_call); + void defer_mid2_gain(const EaxEaxCall& eax_call); + void defer_mid2_center(const EaxEaxCall& eax_call); + void defer_mid2_width(const EaxEaxCall& eax_call); + void defer_high_gain(const EaxEaxCall& eax_call); + void defer_high_cutoff(const EaxEaxCall& eax_call); + void defer_all(const EaxEaxCall& eax_call); + + void set(const EaxEaxCall& eax_call); }; // EaxEqualizerEffect @@ -376,11 +289,9 @@ EaxEqualizerEffect::EaxEqualizerEffect() set_efx_defaults(); } -// [[nodiscard]] -bool EaxEqualizerEffect::dispatch( - const EaxEaxCall& eax_call) +void EaxEqualizerEffect::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 EaxEqualizerEffect::set_eax_defaults() @@ -513,11 +424,9 @@ void EaxEqualizerEffect::set_efx_defaults() set_efx_high_cutoff(); } -// [[nodiscard]] -bool EaxEqualizerEffect::get( - const EaxEaxCall& eax_call) +void EaxEqualizerEffect::get(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXEQUALIZER_NONE: break; @@ -569,8 +478,6 @@ bool EaxEqualizerEffect::get( default: throw EaxEqualizerEffectException{"Unsupported property id."}; } - - return false; } void EaxEqualizerEffect::validate_low_gain( @@ -948,11 +855,9 @@ bool EaxEqualizerEffect::apply_deferred() return true; } -// [[nodiscard]] -bool EaxEqualizerEffect::set( - const EaxEaxCall& eax_call) +void EaxEqualizerEffect::set(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXEQUALIZER_NONE: break; @@ -1004,13 +909,6 @@ bool EaxEqualizerEffect::set( default: throw EaxEqualizerEffectException{"Unsupported property id."}; } - - if (!eax_call.is_deferred()) - { - return apply_deferred(); - } - - return false; } } // namespace diff --git a/al/effects/fshifter.cpp b/al/effects/fshifter.cpp index 8ad48ab3..d334890b 100644 --- a/al/effects/fshifter.cpp +++ b/al/effects/fshifter.cpp @@ -159,10 +159,7 @@ class EaxFrequencyShifterEffect final : public: EaxFrequencyShifterEffect(); - - // [[nodiscard]] - bool dispatch( - const EaxEaxCall& eax_call) override; + void dispatch(const EaxEaxCall& eax_call) override; // [[nodiscard]] bool apply_deferred() override; @@ -172,66 +169,31 @@ private: EAXFREQUENCYSHIFTERPROPERTIES eax_d_{}; EaxFrequencyShifterEffectDirtyFlags eax_dirty_flags_{}; - void set_eax_defaults(); - void set_efx_frequency(); - void set_efx_left_direction(); - void set_efx_right_direction(); - void set_efx_defaults(); + void get(const EaxEaxCall& eax_call); - // [[nodiscard]] - bool get( - const EaxEaxCall& eax_call); - - - void validate_frequency( - float flFrequency); - - void validate_left_direction( - unsigned long ulLeftDirection); - - void validate_right_direction( - unsigned long ulRightDirection); - - void validate_all( - const EAXFREQUENCYSHIFTERPROPERTIES& all); - - - void defer_frequency( - float flFrequency); - - void defer_left_direction( - unsigned long ulLeftDirection); - - void defer_right_direction( - unsigned long ulRightDirection); + void validate_frequency(float flFrequency); + void validate_left_direction(unsigned long ulLeftDirection); + void validate_right_direction(unsigned long ulRightDirection); + void validate_all(const EAXFREQUENCYSHIFTERPROPERTIES& all); - void defer_all( - const EAXFREQUENCYSHIFTERPROPERTIES& all); + void defer_frequency(float flFrequency); + void defer_left_direction(unsigned long ulLeftDirection); + void defer_right_direction(unsigned long ulRightDirection); + void defer_all(const EAXFREQUENCYSHIFTERPROPERTIES& all); + void defer_frequency(const EaxEaxCall& eax_call); + void defer_left_direction(const EaxEaxCall& eax_call); + void defer_right_direction(const EaxEaxCall& eax_call); + void defer_all(const EaxEaxCall& eax_call); - void defer_frequency( - const EaxEaxCall& eax_call); - - void defer_left_direction( - const EaxEaxCall& eax_call); - - void defer_right_direction( - const EaxEaxCall& eax_call); - - void defer_all( - const EaxEaxCall& eax_call); - - - // [[nodiscard]] - bool set( - const EaxEaxCall& eax_call); + void set(const EaxEaxCall& eax_call); }; // EaxFrequencyShifterEffect @@ -255,11 +217,9 @@ EaxFrequencyShifterEffect::EaxFrequencyShifterEffect() set_efx_defaults(); } -// [[nodiscard]] -bool EaxFrequencyShifterEffect::dispatch( - const EaxEaxCall& eax_call) +void EaxFrequencyShifterEffect::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 EaxFrequencyShifterEffect::set_eax_defaults() @@ -312,11 +272,9 @@ void EaxFrequencyShifterEffect::set_efx_defaults() set_efx_right_direction(); } -// [[nodiscard]] -bool EaxFrequencyShifterEffect::get( - const EaxEaxCall& eax_call) +void EaxFrequencyShifterEffect::get(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXFREQUENCYSHIFTER_NONE: break; @@ -340,8 +298,6 @@ bool EaxFrequencyShifterEffect::get( default: throw EaxFrequencyShifterEffectException{"Unsupported property id."}; } - - return false; } void EaxFrequencyShifterEffect::validate_frequency( @@ -485,11 +441,9 @@ bool EaxFrequencyShifterEffect::apply_deferred() return true; } -// [[nodiscard]] -bool EaxFrequencyShifterEffect::set( - const EaxEaxCall& eax_call) +void EaxFrequencyShifterEffect::set(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXFREQUENCYSHIFTER_NONE: break; @@ -513,13 +467,6 @@ bool EaxFrequencyShifterEffect::set( default: throw EaxFrequencyShifterEffectException{"Unsupported property id."}; } - - if (!eax_call.is_deferred()) - { - return apply_deferred(); - } - - return false; } } // namespace diff --git a/al/effects/modulator.cpp b/al/effects/modulator.cpp index a1521d26..800b892d 100644 --- a/al/effects/modulator.cpp +++ b/al/effects/modulator.cpp @@ -165,10 +165,7 @@ class EaxRingModulatorEffect final : public: EaxRingModulatorEffect(); - - // [[nodiscard]] - bool dispatch( - const EaxEaxCall& eax_call) override; + void dispatch(const EaxEaxCall& eax_call) override; // [[nodiscard]] bool apply_deferred() override; @@ -178,66 +175,31 @@ private: EAXRINGMODULATORPROPERTIES eax_d_{}; EaxRingModulatorEffectDirtyFlags eax_dirty_flags_{}; - void set_eax_defaults(); - void set_efx_frequency(); - void set_efx_high_pass_cutoff(); - void set_efx_waveform(); - void set_efx_defaults(); + void get(const EaxEaxCall& eax_call); - // [[nodiscard]] - bool get( - const EaxEaxCall& eax_call); - - - void validate_frequency( - float flFrequency); - - void validate_high_pass_cutoff( - float flHighPassCutOff); - - void validate_waveform( - unsigned long ulWaveform); - - void validate_all( - const EAXRINGMODULATORPROPERTIES& all); - - - void defer_frequency( - float flFrequency); - - void defer_high_pass_cutoff( - float flHighPassCutOff); - - void defer_waveform( - unsigned long ulWaveform); - - void defer_all( - const EAXRINGMODULATORPROPERTIES& all); + void validate_frequency(float flFrequency); + void validate_high_pass_cutoff(float flHighPassCutOff); + void validate_waveform(unsigned long ulWaveform); + void validate_all(const EAXRINGMODULATORPROPERTIES& all); + void defer_frequency(float flFrequency); + void defer_high_pass_cutoff(float flHighPassCutOff); + void defer_waveform(unsigned long ulWaveform); + void defer_all(const EAXRINGMODULATORPROPERTIES& all); - void defer_frequency( - const EaxEaxCall& eax_call); + void defer_frequency(const EaxEaxCall& eax_call); + void defer_high_pass_cutoff(const EaxEaxCall& eax_call); + void defer_waveform(const EaxEaxCall& eax_call); + void defer_all(const EaxEaxCall& eax_call); - void defer_high_pass_cutoff( - const EaxEaxCall& eax_call); - - void defer_waveform( - const EaxEaxCall& eax_call); - - void defer_all( - const EaxEaxCall& eax_call); - - - // [[nodiscard]] - bool set( - const EaxEaxCall& eax_call); + void set(const EaxEaxCall& eax_call); }; // EaxRingModulatorEffect @@ -261,11 +223,9 @@ EaxRingModulatorEffect::EaxRingModulatorEffect() set_efx_defaults(); } -// [[nodiscard]] -bool EaxRingModulatorEffect::dispatch( - const EaxEaxCall& eax_call) +void EaxRingModulatorEffect::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 EaxRingModulatorEffect::set_eax_defaults() @@ -316,11 +276,9 @@ void EaxRingModulatorEffect::set_efx_defaults() set_efx_waveform(); } -// [[nodiscard]] -bool EaxRingModulatorEffect::get( - const EaxEaxCall& eax_call) +void EaxRingModulatorEffect::get(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXRINGMODULATOR_NONE: break; @@ -344,8 +302,6 @@ bool EaxRingModulatorEffect::get( default: throw EaxRingModulatorEffectException{"Unsupported property id."}; } - - return false; } void EaxRingModulatorEffect::validate_frequency( @@ -488,9 +444,7 @@ bool EaxRingModulatorEffect::apply_deferred() return true; } -// [[nodiscard]] -bool EaxRingModulatorEffect::set( - const EaxEaxCall& eax_call) +void EaxRingModulatorEffect::set(const EaxEaxCall& eax_call) { switch (eax_call.get_property_id()) { @@ -516,13 +470,6 @@ bool EaxRingModulatorEffect::set( default: throw EaxRingModulatorEffectException{"Unsupported property id."}; } - - if (!eax_call.is_deferred()) - { - return apply_deferred(); - } - - return false; } } // namespace diff --git a/al/effects/null.cpp b/al/effects/null.cpp index 5602280b..a0eb2247 100644 --- a/al/effects/null.cpp +++ b/al/effects/null.cpp @@ -106,9 +106,7 @@ class EaxNullEffect final : public: EaxNullEffect(); - // [[nodiscard]] - bool dispatch( - const EaxEaxCall& eax_call) override; + void dispatch(const EaxEaxCall& eax_call) override; // [[nodiscard]] bool apply_deferred() override; @@ -133,16 +131,10 @@ EaxNullEffect::EaxNullEffect() { } -// [[nodiscard]] -bool EaxNullEffect::dispatch( - const EaxEaxCall& eax_call) +void EaxNullEffect::dispatch(const EaxEaxCall& eax_call) { - if (eax_call.get_property_id() != 0) - { + if(eax_call.get_property_id() != 0) throw EaxNullEffectException{"Unsupported property id."}; - } - - return false; } bool EaxNullEffect::apply_deferred() diff --git a/al/effects/pshifter.cpp b/al/effects/pshifter.cpp index a2b06078..1b2dcff0 100644 --- a/al/effects/pshifter.cpp +++ b/al/effects/pshifter.cpp @@ -110,9 +110,7 @@ class EaxPitchShifterEffect final : public: EaxPitchShifterEffect(); - // [[nodiscard]] - bool dispatch( - const EaxEaxCall& eax_call) override; + void dispatch(const EaxEaxCall& eax_call) override; // [[nodiscard]] bool apply_deferred() override; @@ -122,55 +120,27 @@ private: EAXPITCHSHIFTERPROPERTIES eax_d_{}; EaxPitchShifterEffectDirtyFlags eax_dirty_flags_{}; - void set_eax_defaults(); - void set_efx_coarse_tune(); - void set_efx_fine_tune(); - void set_efx_defaults(); + void get(const EaxEaxCall& eax_call); - // [[nodiscard]] - bool get( - const EaxEaxCall& eax_call); - - - void validate_coarse_tune( - long lCoarseTune); - - void validate_fine_tune( - long lFineTune); - - void validate_all( - const EAXPITCHSHIFTERPROPERTIES& all); - - - void defer_coarse_tune( - long lCoarseTune); - - void defer_fine_tune( - long lFineTune); - - void defer_all( - const EAXPITCHSHIFTERPROPERTIES& all); - + void validate_coarse_tune(long lCoarseTune); + void validate_fine_tune(long lFineTune); + void validate_all(const EAXPITCHSHIFTERPROPERTIES& all); - void defer_coarse_tune( - const EaxEaxCall& eax_call); + void defer_coarse_tune(long lCoarseTune); + void defer_fine_tune(long lFineTune); + void defer_all(const EAXPITCHSHIFTERPROPERTIES& all); - void defer_fine_tune( - const EaxEaxCall& eax_call); + void defer_coarse_tune(const EaxEaxCall& eax_call); + void defer_fine_tune(const EaxEaxCall& eax_call); + void defer_all(const EaxEaxCall& eax_call); - void defer_all( - const EaxEaxCall& eax_call); - - - // [[nodiscard]] - bool set( - const EaxEaxCall& eax_call); + void set(const EaxEaxCall& eax_call); }; // EaxPitchShifterEffect @@ -194,11 +164,9 @@ EaxPitchShifterEffect::EaxPitchShifterEffect() set_efx_defaults(); } -// [[nodiscard]] -bool EaxPitchShifterEffect::dispatch( - const EaxEaxCall& eax_call) +void EaxPitchShifterEffect::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 EaxPitchShifterEffect::set_eax_defaults() @@ -235,11 +203,9 @@ void EaxPitchShifterEffect::set_efx_defaults() set_efx_fine_tune(); } -// [[nodiscard]] -bool EaxPitchShifterEffect::get( - const EaxEaxCall& eax_call) +void EaxPitchShifterEffect::get(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXPITCHSHIFTER_NONE: break; @@ -259,8 +225,6 @@ bool EaxPitchShifterEffect::get( default: throw EaxPitchShifterEffectException{"Unsupported property id."}; } - - return false; } void EaxPitchShifterEffect::validate_coarse_tune( @@ -366,11 +330,9 @@ bool EaxPitchShifterEffect::apply_deferred() return true; } -// [[nodiscard]] -bool EaxPitchShifterEffect::set( - const EaxEaxCall& eax_call) +void EaxPitchShifterEffect::set(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXPITCHSHIFTER_NONE: break; @@ -390,13 +352,6 @@ bool EaxPitchShifterEffect::set( default: throw EaxPitchShifterEffectException{"Unsupported property id."}; } - - if (!eax_call.is_deferred()) - { - return apply_deferred(); - } - - return false; } } // namespace diff --git a/al/effects/reverb.cpp b/al/effects/reverb.cpp index 1d8e9183..81990686 100644 --- a/al/effects/reverb.cpp +++ b/al/effects/reverb.cpp @@ -616,9 +616,7 @@ class EaxReverbEffect final : public: EaxReverbEffect(); - // [[nodiscard]] - bool dispatch( - const EaxEaxCall& eax_call) override; + void dispatch(const EaxEaxCall& eax_call) override; // [[nodiscard]] bool apply_deferred() override; @@ -635,7 +633,6 @@ private: void set_eax_defaults(); - void set_efx_density_from_environment_size(); void set_efx_diffusion(); void set_efx_gain(); @@ -661,13 +658,11 @@ private: void set_efx_flags(); void set_efx_defaults(); - bool v1_get(const EaxEaxCall& eax_call) const; + void v1_get(const EaxEaxCall& eax_call) const; void get_all(const EaxEaxCall& eax_call) const; - // [[nodiscard]] - bool get(const EaxEaxCall& eax_call) const; - + void get(const EaxEaxCall& eax_call) const; static void v1_validate_environment(unsigned long environment); static void v1_validate_volume(float volume); @@ -770,8 +765,7 @@ private: void defer_flags(const EaxEaxCall& eax_call); void defer_all(const EaxEaxCall& eax_call); - // [[nodiscard]] - bool set(const EaxEaxCall& eax_call); + void set(const EaxEaxCall& eax_call); }; // EaxReverbEffect @@ -795,11 +789,9 @@ EaxReverbEffect::EaxReverbEffect() set_efx_defaults(); } -// [[nodiscard]] -bool EaxReverbEffect::dispatch( - const EaxEaxCall& eax_call) +void EaxReverbEffect::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); } [[noreturn]] void EaxReverbEffect::eax_fail(const char* message) @@ -1063,9 +1055,9 @@ void EaxReverbEffect::set_efx_defaults() set_efx_flags(); } -bool EaxReverbEffect::v1_get(const EaxEaxCall& eax_call) const +void EaxReverbEffect::v1_get(const EaxEaxCall& eax_call) const { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case DSPROPERTY_EAX_ALL: eax_call.set_value<EaxReverbEffectException>(eax1_); @@ -1090,8 +1082,6 @@ bool EaxReverbEffect::v1_get(const EaxEaxCall& eax_call) const default: eax_fail("Unsupported property id."); } - - return false; } void EaxReverbEffect::get_all( @@ -1121,14 +1111,11 @@ void EaxReverbEffect::get_all( } } -// [[nodiscard]] -bool EaxReverbEffect::get( - const EaxEaxCall& eax_call) const +void EaxReverbEffect::get(const EaxEaxCall& eax_call) const { - if (eax_call.get_version() == 1) - return v1_get(eax_call); - - switch (eax_call.get_property_id()) + if(eax_call.get_version() == 1) + v1_get(eax_call); + else switch(eax_call.get_property_id()) { case EAXREVERB_NONE: break; @@ -1236,8 +1223,6 @@ bool EaxReverbEffect::get( default: eax_fail("Unsupported property id."); } - - return false; } void EaxReverbEffect::v1_validate_environment(unsigned long environment) @@ -1844,7 +1829,6 @@ void EaxReverbEffect::v1_defer_environment(const EaxEaxCall& eax_call) validate_environment(environment, 1, true); const auto& reverb_preset = EAX1REVERB_PRESETS[environment]; - v1_defer_all(reverb_preset); } @@ -2398,9 +2382,7 @@ bool EaxReverbEffect::apply_deferred() return true; } -// [[nodiscard]] -bool EaxReverbEffect::set( - const EaxEaxCall& eax_call) +void EaxReverbEffect::set(const EaxEaxCall& eax_call) { if(eax_call.get_version() == 1) v1_defer(eax_call); @@ -2512,13 +2494,6 @@ bool EaxReverbEffect::set( default: eax_fail("Unsupported property id."); } - - if (!eax_call.is_deferred()) - { - return apply_deferred(); - } - - return false; } const EFXEAXREVERBPROPERTIES eax_efx_reverb_presets[EAX1_ENVIRONMENT_COUNT] = diff --git a/al/effects/vmorpher.cpp b/al/effects/vmorpher.cpp index 15f099b1..8c0b3adb 100644 --- a/al/effects/vmorpher.cpp +++ b/al/effects/vmorpher.cpp @@ -281,9 +281,7 @@ class EaxVocalMorpherEffect final : public: EaxVocalMorpherEffect(); - // [[nodiscard]] - bool dispatch( - const EaxEaxCall& eax_call) override; + void dispatch(const EaxEaxCall& eax_call) override; // [[nodiscard]] bool apply_deferred() override; @@ -293,99 +291,43 @@ private: EAXVOCALMORPHERPROPERTIES eax_d_{}; EaxVocalMorpherEffectDirtyFlags eax_dirty_flags_{}; - void set_eax_defaults(); - void set_efx_phoneme_a(); - void set_efx_phoneme_a_coarse_tuning(); - void set_efx_phoneme_b(); - void set_efx_phoneme_b_coarse_tuning(); - void set_efx_waveform(); - void set_efx_rate(); - void set_efx_defaults(); - - // [[nodiscard]] - bool get( - const EaxEaxCall& eax_call); - - - void validate_phoneme_a( - unsigned long ulPhonemeA); - - void validate_phoneme_a_coarse_tuning( - long lPhonemeACoarseTuning); - - void validate_phoneme_b( - unsigned long ulPhonemeB); - - void validate_phoneme_b_coarse_tuning( - long lPhonemeBCoarseTuning); - - void validate_waveform( - unsigned long ulWaveform); - - void validate_rate( - float flRate); - - void validate_all( - const EAXVOCALMORPHERPROPERTIES& all); - - - void defer_phoneme_a( - unsigned long ulPhonemeA); - - void defer_phoneme_a_coarse_tuning( - long lPhonemeACoarseTuning); - - void defer_phoneme_b( - unsigned long ulPhonemeB); - - void defer_phoneme_b_coarse_tuning( - long lPhonemeBCoarseTuning); - - void defer_waveform( - unsigned long ulWaveform); - - void defer_rate( - float flRate); - - void defer_all( - const EAXVOCALMORPHERPROPERTIES& all); - - - void defer_phoneme_a( - const EaxEaxCall& eax_call); - - void defer_phoneme_a_coarse_tuning( - const EaxEaxCall& eax_call); - - void defer_phoneme_b( - const EaxEaxCall& eax_call); - - void defer_phoneme_b_coarse_tuning( - const EaxEaxCall& eax_call); - - void defer_waveform( - const EaxEaxCall& eax_call); - - void defer_rate( - const EaxEaxCall& eax_call); - - void defer_all( - const EaxEaxCall& eax_call); - - - // [[nodiscard]] - bool set( - const EaxEaxCall& eax_call); + void get(const EaxEaxCall& eax_call); + + void validate_phoneme_a(unsigned long ulPhonemeA); + void validate_phoneme_a_coarse_tuning(long lPhonemeACoarseTuning); + void validate_phoneme_b(unsigned long ulPhonemeB); + void validate_phoneme_b_coarse_tuning(long lPhonemeBCoarseTuning); + void validate_waveform(unsigned long ulWaveform); + void validate_rate(float flRate); + void validate_all(const EAXVOCALMORPHERPROPERTIES& all); + + void defer_phoneme_a(unsigned long ulPhonemeA); + void defer_phoneme_a_coarse_tuning(long lPhonemeACoarseTuning); + void defer_phoneme_b(unsigned long ulPhonemeB); + void defer_phoneme_b_coarse_tuning(long lPhonemeBCoarseTuning); + void defer_waveform(unsigned long ulWaveform); + void defer_rate(float flRate); + void defer_all(const EAXVOCALMORPHERPROPERTIES& all); + + void defer_phoneme_a(const EaxEaxCall& eax_call); + void defer_phoneme_a_coarse_tuning(const EaxEaxCall& eax_call); + void defer_phoneme_b(const EaxEaxCall& eax_call); + void defer_phoneme_b_coarse_tuning(const EaxEaxCall& eax_call); + void defer_waveform(const EaxEaxCall& eax_call); + void defer_rate(const EaxEaxCall& eax_call); + void defer_all(const EaxEaxCall& eax_call); + + void set(const EaxEaxCall& eax_call); }; // EaxVocalMorpherEffect @@ -409,11 +351,9 @@ EaxVocalMorpherEffect::EaxVocalMorpherEffect() set_efx_defaults(); } -// [[nodiscard]] -bool EaxVocalMorpherEffect::dispatch( - const EaxEaxCall& eax_call) +void EaxVocalMorpherEffect::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 EaxVocalMorpherEffect::set_eax_defaults() @@ -504,11 +444,9 @@ void EaxVocalMorpherEffect::set_efx_defaults() set_efx_rate(); } -// [[nodiscard]] -bool EaxVocalMorpherEffect::get( - const EaxEaxCall& eax_call) +void EaxVocalMorpherEffect::get(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXVOCALMORPHER_NONE: break; @@ -544,8 +482,6 @@ bool EaxVocalMorpherEffect::get( default: throw EaxVocalMorpherEffectException{"Unsupported property id."}; } - - return false; } void EaxVocalMorpherEffect::validate_phoneme_a( @@ -675,10 +611,8 @@ void EaxVocalMorpherEffect::defer_all( void EaxVocalMorpherEffect::defer_phoneme_a( const EaxEaxCall& eax_call) { - const auto& phoneme_a = eax_call.get_value< - EaxVocalMorpherEffectException, - const decltype(EAXVOCALMORPHERPROPERTIES::ulPhonemeA) - >(); + const auto& phoneme_a = eax_call.get_value<EaxVocalMorpherEffectException, + const decltype(EAXVOCALMORPHERPROPERTIES::ulPhonemeA)>(); validate_phoneme_a(phoneme_a); defer_phoneme_a(phoneme_a); @@ -801,11 +735,9 @@ bool EaxVocalMorpherEffect::apply_deferred() return true; } -// [[nodiscard]] -bool EaxVocalMorpherEffect::set( - const EaxEaxCall& eax_call) +void EaxVocalMorpherEffect::set(const EaxEaxCall& eax_call) { - switch (eax_call.get_property_id()) + switch(eax_call.get_property_id()) { case EAXVOCALMORPHER_NONE: break; @@ -841,13 +773,6 @@ bool EaxVocalMorpherEffect::set( default: throw EaxVocalMorpherEffectException{"Unsupported property id."}; } - - if (!eax_call.is_deferred()) - { - return apply_deferred(); - } - - return false; } } // namespace diff --git a/al/source.cpp b/al/source.cpp index 3009edd8..3f416151 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -5681,12 +5681,6 @@ void ALsource::eax_set( default: eax_fail("Unsupported property id."); } - - if(!eax_call.is_deferred()) - { - eax_apply_deferred(); - EaxUpdateSourceVoice(this, eax_al_context_); - } } const GUID& ALsource::eax_get_send_fx_slot_guid( diff --git a/alc/context.cpp b/alc/context.cpp index 5a24a311..4b1c2a4c 100644 --- a/alc/context.cpp +++ b/alc/context.cpp @@ -332,11 +332,10 @@ ALenum ALCcontext::eax_eax_set( { eax_initialize(); - constexpr auto deferred_flag = 0x80000000u; const auto eax_call = create_eax_call( false, property_set_id, - property_id | (mDeferUpdates ? deferred_flag : 0u), + property_id, property_source_id, property_value, property_value_size @@ -363,6 +362,10 @@ ALenum ALCcontext::eax_eax_set( eax_fail("Unsupported property set id."); } + static constexpr auto deferred_flag = 0x80000000u; + if(!(property_id&deferred_flag) && !mDeferUpdates) + applyAllUpdates(); + return AL_NO_ERROR; } @@ -1136,22 +1139,6 @@ void ALCcontext::eax_set( default: eax_fail("Unsupported property id."); } - - if(!eax_call.is_deferred()) - { - eax_apply_deferred(); - - mHoldUpdates.store(true, std::memory_order_release); - while((mUpdateCount.load(std::memory_order_acquire)&1) != 0) { - /* busy-wait */ - } - - if(std::exchange(mPropsDirty, false)) - UpdateContextProps(this); - UpdateAllSourceProps(this); - - mHoldUpdates.store(false, std::memory_order_release); - } } void ALCcontext::eax_apply_deferred() |