Avoid using ALeffect to manage EaxEffect objects
Effect slots can just use its EaxEffect directly.
This commit is contained in:
parent
b09aab8426
commit
0c507b5c62
@ -1091,11 +1091,6 @@ void ALeffectslot::eax_initialize(
|
||||
eax_set_default_slots_defaults();
|
||||
}
|
||||
|
||||
void ALeffectslot::eax_uninitialize() noexcept
|
||||
{
|
||||
eax_al_effect_ = nullptr;
|
||||
}
|
||||
|
||||
const EAX50FXSLOTPROPERTIES& ALeffectslot::eax_get_eax_fx_slot() const noexcept
|
||||
{
|
||||
return eax_eax_fx_slot_;
|
||||
@ -1436,21 +1431,13 @@ bool ALeffectslot::eax_get(
|
||||
void ALeffectslot::eax_set_fx_slot_effect(
|
||||
ALenum al_effect_type)
|
||||
{
|
||||
if (!eax_al_effect_)
|
||||
{
|
||||
eax_al_effect_ = eax_create_al_effect(*eax_al_context_, al_effect_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto& device = eax_al_context_->mALDevice;
|
||||
std::lock_guard<std::mutex> effect_lock{device->EffectLock};
|
||||
if(!IsValidEffectType(al_effect_type))
|
||||
eax_fail("Unsupported effect.");
|
||||
|
||||
eax_al_effect_->eax_al_set_effect(al_effect_type);
|
||||
}
|
||||
eax_effect_ = nullptr;
|
||||
eax_effect_ = eax_create_eax_effect(al_effect_type);
|
||||
|
||||
eax_al_effect_->eax_initialize();
|
||||
|
||||
eax_set_effect_slot_effect(*eax_al_effect_);
|
||||
eax_set_effect_slot_effect(*eax_effect_);
|
||||
}
|
||||
|
||||
void ALeffectslot::eax_set_fx_slot_effect()
|
||||
@ -1704,35 +1691,17 @@ void ALeffectslot::eax_dispatch_effect(
|
||||
const EaxEaxCall& eax_call)
|
||||
{
|
||||
auto is_changed = false;
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> effect_lock{eax_al_context_->mALDevice->EffectLock};
|
||||
|
||||
if (!eax_al_effect_->eax_effect)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
is_changed = eax_al_effect_->eax_effect->dispatch(eax_call);
|
||||
}
|
||||
|
||||
if (is_changed)
|
||||
{
|
||||
eax_set_effect_slot_effect(*eax_al_effect_);
|
||||
}
|
||||
if(eax_effect_)
|
||||
is_changed = eax_effect_->dispatch(eax_call);
|
||||
if(is_changed)
|
||||
eax_set_effect_slot_effect(*eax_effect_);
|
||||
}
|
||||
|
||||
void ALeffectslot::eax_set_effect_slot_effect(
|
||||
ALeffect& effect)
|
||||
void ALeffectslot::eax_set_effect_slot_effect(EaxEffect &effect)
|
||||
{
|
||||
#define EAX_PREFIX "[EAX_SET_EFFECT_SLOT_EFFECT] "
|
||||
|
||||
auto& device = *eax_al_context_->mALDevice;
|
||||
|
||||
std::lock_guard<std::mutex> effect_slot_lock{eax_al_context_->mEffectSlotLock};
|
||||
std::lock_guard<std::mutex> effect_lock{device.EffectLock};
|
||||
|
||||
const auto error = initEffect(effect.type, effect.Props, eax_al_context_);
|
||||
const auto error = initEffect(effect.al_effect_type_, effect.al_effect_props_, eax_al_context_);
|
||||
if (error != AL_NO_ERROR)
|
||||
{
|
||||
ERR(EAX_PREFIX "%s\n", "Failed to initialize an effect.");
|
||||
|
@ -19,9 +19,8 @@
|
||||
#ifdef ALSOFT_EAX
|
||||
#include <memory>
|
||||
|
||||
#include "al/effect.h"
|
||||
|
||||
#include "eax_eax_call.h"
|
||||
#include "eax_effect.h"
|
||||
#include "eax_fx_slot_index.h"
|
||||
#endif // ALSOFT_EAX
|
||||
|
||||
@ -78,8 +77,6 @@ public:
|
||||
ALCcontext& al_context,
|
||||
EaxFxSlotIndexValue index);
|
||||
|
||||
void eax_uninitialize() noexcept;
|
||||
|
||||
|
||||
const EAX50FXSLOTPROPERTIES& eax_get_eax_fx_slot() const noexcept;
|
||||
|
||||
@ -96,7 +93,7 @@ private:
|
||||
|
||||
EAX50FXSLOTPROPERTIES eax_eax_fx_slot_{};
|
||||
|
||||
EaxAlEffectUPtr eax_al_effect_{};
|
||||
EaxEffectUPtr eax_effect_{};
|
||||
|
||||
|
||||
[[noreturn]]
|
||||
@ -243,16 +240,13 @@ private:
|
||||
|
||||
|
||||
// `alAuxiliaryEffectSloti(effect_slot, AL_EFFECTSLOT_EFFECT, effect)`
|
||||
void eax_set_effect_slot_effect(
|
||||
ALeffect& effect);
|
||||
void eax_set_effect_slot_effect(EaxEffect &effect);
|
||||
|
||||
// `alAuxiliaryEffectSloti(effect_slot, AL_EFFECTSLOT_AUXILIARY_SEND_AUTO, value)`
|
||||
void eax_set_effect_slot_send_auto(
|
||||
bool is_send_auto);
|
||||
void eax_set_effect_slot_send_auto(bool is_send_auto);
|
||||
|
||||
// `alAuxiliaryEffectSlotf(effect_slot, AL_EFFECTSLOT_GAIN, gain)`
|
||||
void eax_set_effect_slot_gain(
|
||||
ALfloat gain);
|
||||
void eax_set_effect_slot_gain(ALfloat gain);
|
||||
#endif // ALSOFT_EAX
|
||||
};
|
||||
|
||||
|
@ -4,16 +4,18 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "AL/al.h"
|
||||
#include "core/effects/base.h"
|
||||
#include "eax_eax_call.h"
|
||||
|
||||
|
||||
class EaxEffect
|
||||
{
|
||||
public:
|
||||
EaxEffect() = default;
|
||||
|
||||
EaxEffect(ALenum type) : al_effect_type_{type} { }
|
||||
virtual ~EaxEffect() = default;
|
||||
|
||||
const ALenum al_effect_type_;
|
||||
EffectProps al_effect_props_{};
|
||||
|
||||
// Returns "true" if any immediated property was changed.
|
||||
// [[nodiscard]]
|
||||
|
@ -39,7 +39,6 @@ void EaxFxSlots::uninitialize() noexcept
|
||||
{
|
||||
for (auto& fx_slot : fx_slots_)
|
||||
{
|
||||
fx_slot->eax_uninitialize();
|
||||
fx_slot = nullptr;
|
||||
}
|
||||
}
|
||||
|
140
al/effect.cpp
140
al/effect.cpp
@ -751,139 +751,15 @@ void LoadReverbPreset(const char *name, ALeffect *effect)
|
||||
WARN("Reverb preset '%s' not found\n", name);
|
||||
}
|
||||
|
||||
#ifdef ALSOFT_EAX
|
||||
namespace {
|
||||
|
||||
class EaxAlEffectException :
|
||||
public EaxException
|
||||
bool IsValidEffectType(ALenum type) noexcept
|
||||
{
|
||||
public:
|
||||
explicit EaxAlEffectException(
|
||||
const char* message)
|
||||
:
|
||||
EaxException{"[EAX_AL_EFFECT]", message}
|
||||
if(type == AL_EFFECT_NULL)
|
||||
return true;
|
||||
|
||||
for(const auto &effect_item : gEffectList)
|
||||
{
|
||||
if(type == effect_item.val && !DisabledEffects[effect_item.type])
|
||||
return true;
|
||||
}
|
||||
}; // EaxAlEffectException
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
void ALeffect::eax_initialize()
|
||||
{
|
||||
eax_effect = nullptr;
|
||||
eax_effect = eax_create_eax_effect(type, Props);
|
||||
return false;
|
||||
}
|
||||
|
||||
void ALeffect::eax_al_set_effect(
|
||||
ALenum al_effect_type)
|
||||
{
|
||||
if (al_effect_type != AL_EFFECT_NULL)
|
||||
{
|
||||
auto has_effect = false;
|
||||
|
||||
for (const auto &effect_item : gEffectList)
|
||||
{
|
||||
if (al_effect_type == effect_item.val && !DisabledEffects[effect_item.type])
|
||||
{
|
||||
has_effect = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!has_effect)
|
||||
{
|
||||
eax_fail("Effect not available.");
|
||||
}
|
||||
}
|
||||
|
||||
InitEffectParams(this, al_effect_type);
|
||||
}
|
||||
|
||||
[[noreturn]]
|
||||
void ALeffect::eax_fail(
|
||||
const char* message)
|
||||
{
|
||||
throw EaxAlEffectException{message};
|
||||
}
|
||||
|
||||
EaxAlEffectDeleter::EaxAlEffectDeleter(
|
||||
ALCcontext& context) noexcept
|
||||
:
|
||||
context_{&context}
|
||||
{
|
||||
}
|
||||
|
||||
void EaxAlEffectDeleter::operator()(
|
||||
ALeffect* effect) const
|
||||
{
|
||||
assert(effect);
|
||||
|
||||
eax_al_delete_effect(*context_, *effect);
|
||||
}
|
||||
|
||||
EaxAlEffectUPtr eax_create_al_effect(
|
||||
ALCcontext& context,
|
||||
ALenum effect_type)
|
||||
{
|
||||
#define EAX_PREFIX "[EAX_MAKE_EFFECT] "
|
||||
|
||||
auto& device = *context.mALDevice;
|
||||
std::lock_guard<std::mutex> effect_lock{device.EffectLock};
|
||||
|
||||
// Allocate.
|
||||
//
|
||||
if (!EnsureEffects(&device, 1))
|
||||
{
|
||||
ERR(EAX_PREFIX "%s\n", "Failed to ensure.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto effect = EaxAlEffectUPtr{AllocEffect(&device), EaxAlEffectDeleter{context}};
|
||||
|
||||
if (!effect)
|
||||
{
|
||||
ERR(EAX_PREFIX "%s\n", "Failed to allocate.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Set the type.
|
||||
//
|
||||
auto is_supported = (effect_type == AL_EFFECT_NULL);
|
||||
|
||||
if (!is_supported)
|
||||
{
|
||||
for (const auto& effect_item : gEffectList)
|
||||
{
|
||||
if(effect_type == effect_item.val && !DisabledEffects[effect_item.type])
|
||||
{
|
||||
is_supported = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_supported)
|
||||
{
|
||||
ERR(EAX_PREFIX "Effect type 0x%04x not supported.\n", effect_type);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
InitEffectParams(effect.get(), effect_type);
|
||||
|
||||
return effect;
|
||||
|
||||
#undef EAX_PREFIX
|
||||
}
|
||||
|
||||
void eax_al_delete_effect(
|
||||
ALCcontext& context,
|
||||
ALeffect& effect)
|
||||
{
|
||||
auto& device = *context.mALDevice;
|
||||
std::lock_guard<std::mutex> effect_lock{device.EffectLock};
|
||||
|
||||
FreeEffect(&device, &effect);
|
||||
}
|
||||
#endif // ALSOFT_EAX
|
||||
|
52
al/effect.h
52
al/effect.h
@ -7,12 +7,6 @@
|
||||
#include "al/effects/effects.h"
|
||||
#include "alc/effects/base.h"
|
||||
|
||||
#ifdef ALSOFT_EAX
|
||||
#include <memory>
|
||||
|
||||
#include "eax_effect.h"
|
||||
#endif // ALSOFT_EAX
|
||||
|
||||
|
||||
enum {
|
||||
EAXREVERB_EFFECT = 0,
|
||||
@ -57,56 +51,12 @@ struct ALeffect {
|
||||
ALuint id{0u};
|
||||
|
||||
DISABLE_ALLOC()
|
||||
|
||||
|
||||
#ifdef 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);
|
||||
|
||||
#ifdef 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
|
||||
bool IsValidEffectType(ALenum type) noexcept;
|
||||
|
||||
#endif
|
||||
|
@ -136,8 +136,7 @@ class EaxAutoWahEffect final :
|
||||
public EaxEffect
|
||||
{
|
||||
public:
|
||||
EaxAutoWahEffect(
|
||||
EffectProps& al_effect_props);
|
||||
EaxAutoWahEffect();
|
||||
|
||||
|
||||
// [[nodiscard]]
|
||||
@ -146,8 +145,6 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
EffectProps& al_effect_props_;
|
||||
|
||||
EAXAUTOWAHPROPERTIES eax_{};
|
||||
EAXAUTOWAHPROPERTIES eax_d_{};
|
||||
EaxAutoWahEffectDirtyFlags eax_dirty_flags_{};
|
||||
@ -241,10 +238,8 @@ public:
|
||||
}; // EaxAutoWahEffectException
|
||||
|
||||
|
||||
EaxAutoWahEffect::EaxAutoWahEffect(
|
||||
EffectProps& al_effect_props)
|
||||
:
|
||||
al_effect_props_{al_effect_props}
|
||||
EaxAutoWahEffect::EaxAutoWahEffect()
|
||||
: EaxEffect{AL_EFFECT_AUTOWAH}
|
||||
{
|
||||
set_eax_defaults();
|
||||
set_efx_defaults();
|
||||
@ -566,10 +561,9 @@ bool EaxAutoWahEffect::set(
|
||||
|
||||
} // namespace
|
||||
|
||||
EaxEffectUPtr eax_create_eax_auto_wah_effect(
|
||||
EffectProps& al_effect_props)
|
||||
EaxEffectUPtr eax_create_eax_auto_wah_effect()
|
||||
{
|
||||
return std::make_unique<::EaxAutoWahEffect>(al_effect_props);
|
||||
return std::make_unique<::EaxAutoWahEffect>();
|
||||
}
|
||||
|
||||
#endif // ALSOFT_EAX
|
||||
|
@ -357,8 +357,7 @@ class EaxChorusEffect final :
|
||||
public EaxEffect
|
||||
{
|
||||
public:
|
||||
EaxChorusEffect(
|
||||
EffectProps& al_effect_props);
|
||||
EaxChorusEffect();
|
||||
|
||||
|
||||
// [[nodiscard]]
|
||||
@ -367,7 +366,6 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
EffectProps& al_effect_props_;
|
||||
EAXCHORUSPROPERTIES eax_{};
|
||||
EAXCHORUSPROPERTIES eax_d_{};
|
||||
EaxChorusEffectDirtyFlags eax_dirty_flags_{};
|
||||
@ -484,10 +482,8 @@ public:
|
||||
}; // EaxChorusEffectException
|
||||
|
||||
|
||||
EaxChorusEffect::EaxChorusEffect(
|
||||
EffectProps& al_effect_props)
|
||||
:
|
||||
al_effect_props_{al_effect_props}
|
||||
EaxChorusEffect::EaxChorusEffect()
|
||||
: EaxEffect{AL_EFFECT_CHORUS}
|
||||
{
|
||||
set_eax_defaults();
|
||||
set_efx_defaults();
|
||||
@ -917,10 +913,9 @@ bool EaxChorusEffect::set(
|
||||
} // namespace
|
||||
|
||||
|
||||
EaxEffectUPtr eax_create_eax_chorus_effect(
|
||||
EffectProps& al_effect_props)
|
||||
EaxEffectUPtr eax_create_eax_chorus_effect()
|
||||
{
|
||||
return std::make_unique<::EaxChorusEffect>(al_effect_props);
|
||||
return std::make_unique<::EaxChorusEffect>();
|
||||
}
|
||||
|
||||
|
||||
@ -947,8 +942,7 @@ class EaxFlangerEffect final :
|
||||
public EaxEffect
|
||||
{
|
||||
public:
|
||||
EaxFlangerEffect(
|
||||
EffectProps& al_effect_props);
|
||||
EaxFlangerEffect();
|
||||
|
||||
|
||||
// [[nodiscard]]
|
||||
@ -957,8 +951,6 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
EffectProps& al_effect_props_;
|
||||
|
||||
EAXFLANGERPROPERTIES eax_{};
|
||||
EAXFLANGERPROPERTIES eax_d_{};
|
||||
EaxFlangerEffectDirtyFlags eax_dirty_flags_{};
|
||||
@ -1075,10 +1067,8 @@ public:
|
||||
}; // EaxFlangerEffectException
|
||||
|
||||
|
||||
EaxFlangerEffect::EaxFlangerEffect(
|
||||
EffectProps& al_effect_props)
|
||||
:
|
||||
al_effect_props_{al_effect_props}
|
||||
EaxFlangerEffect::EaxFlangerEffect()
|
||||
: EaxEffect{AL_EFFECT_FLANGER}
|
||||
{
|
||||
set_eax_defaults();
|
||||
set_efx_defaults();
|
||||
@ -1507,10 +1497,9 @@ bool EaxFlangerEffect::set(
|
||||
|
||||
} // namespace
|
||||
|
||||
EaxEffectUPtr eax_create_eax_flanger_effect(
|
||||
EffectProps& al_effect_props)
|
||||
EaxEffectUPtr eax_create_eax_flanger_effect()
|
||||
{
|
||||
return std::make_unique<EaxFlangerEffect>(al_effect_props);
|
||||
return std::make_unique<EaxFlangerEffect>();
|
||||
}
|
||||
|
||||
#endif // ALSOFT_EAX
|
||||
|
@ -95,8 +95,7 @@ class EaxCompressorEffect final :
|
||||
public EaxEffect
|
||||
{
|
||||
public:
|
||||
EaxCompressorEffect(
|
||||
EffectProps& al_effect_props);
|
||||
EaxCompressorEffect();
|
||||
|
||||
|
||||
// [[nodiscard]]
|
||||
@ -105,8 +104,6 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
EffectProps& al_effect_props_;
|
||||
|
||||
EAXAGCCOMPRESSORPROPERTIES eax_{};
|
||||
EAXAGCCOMPRESSORPROPERTIES eax_d_{};
|
||||
EaxCompressorEffectDirtyFlags eax_dirty_flags_{};
|
||||
@ -168,10 +165,8 @@ public:
|
||||
}; // EaxCompressorEffectException
|
||||
|
||||
|
||||
EaxCompressorEffect::EaxCompressorEffect(
|
||||
EffectProps& al_effect_props)
|
||||
:
|
||||
al_effect_props_{al_effect_props}
|
||||
EaxCompressorEffect::EaxCompressorEffect()
|
||||
: EaxEffect{AL_EFFECT_COMPRESSOR}
|
||||
{
|
||||
set_eax_defaults();
|
||||
set_efx_defaults();
|
||||
@ -330,10 +325,9 @@ bool EaxCompressorEffect::set(
|
||||
|
||||
} // namespace
|
||||
|
||||
EaxEffectUPtr eax_create_eax_compressor_effect(
|
||||
EffectProps& al_effect_props)
|
||||
EaxEffectUPtr eax_create_eax_compressor_effect()
|
||||
{
|
||||
return std::make_unique<EaxCompressorEffect>(al_effect_props);
|
||||
return std::make_unique<EaxCompressorEffect>();
|
||||
}
|
||||
|
||||
#endif // ALSOFT_EAX
|
||||
|
@ -141,8 +141,7 @@ class EaxDistortionEffect final :
|
||||
public EaxEffect
|
||||
{
|
||||
public:
|
||||
EaxDistortionEffect(
|
||||
EffectProps& al_effect_props);
|
||||
EaxDistortionEffect();
|
||||
|
||||
|
||||
// [[nodiscard]]
|
||||
@ -151,8 +150,6 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
EffectProps& al_effect_props_;
|
||||
|
||||
EAXDISTORTIONPROPERTIES eax_{};
|
||||
EAXDISTORTIONPROPERTIES eax_d_{};
|
||||
EaxDistortionEffectDirtyFlags eax_dirty_flags_{};
|
||||
@ -258,10 +255,8 @@ public:
|
||||
}; // EaxDistortionEffectException
|
||||
|
||||
|
||||
EaxDistortionEffect::EaxDistortionEffect(
|
||||
EffectProps& al_effect_props)
|
||||
:
|
||||
al_effect_props_{al_effect_props}
|
||||
EaxDistortionEffect::EaxDistortionEffect()
|
||||
: EaxEffect{AL_EFFECT_DISTORTION}
|
||||
{
|
||||
set_eax_defaults();
|
||||
set_efx_defaults();
|
||||
@ -636,10 +631,9 @@ bool EaxDistortionEffect::set(
|
||||
|
||||
} // namespace
|
||||
|
||||
EaxEffectUPtr eax_create_eax_distortion_effect(
|
||||
EffectProps& al_effect_props)
|
||||
EaxEffectUPtr eax_create_eax_distortion_effect()
|
||||
{
|
||||
return std::make_unique<EaxDistortionEffect>(al_effect_props);
|
||||
return std::make_unique<EaxDistortionEffect>();
|
||||
}
|
||||
|
||||
#endif // ALSOFT_EAX
|
||||
|
@ -138,8 +138,7 @@ class EaxEchoEffect final :
|
||||
public EaxEffect
|
||||
{
|
||||
public:
|
||||
EaxEchoEffect(
|
||||
EffectProps& al_effect_props);
|
||||
EaxEchoEffect();
|
||||
|
||||
|
||||
// [[nodiscard]]
|
||||
@ -148,8 +147,6 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
EffectProps& al_effect_props_;
|
||||
|
||||
EAXECHOPROPERTIES eax_{};
|
||||
EAXECHOPROPERTIES eax_d_{};
|
||||
EaxEchoEffectDirtyFlags eax_dirty_flags_{};
|
||||
@ -253,10 +250,8 @@ public:
|
||||
}; // EaxEchoEffectException
|
||||
|
||||
|
||||
EaxEchoEffect::EaxEchoEffect(
|
||||
EffectProps& al_effect_props)
|
||||
:
|
||||
al_effect_props_{al_effect_props}
|
||||
EaxEchoEffect::EaxEchoEffect()
|
||||
: EaxEffect{AL_EFFECT_ECHO}
|
||||
{
|
||||
set_eax_defaults();
|
||||
set_efx_defaults();
|
||||
@ -631,10 +626,9 @@ bool EaxEchoEffect::set(
|
||||
|
||||
} // namespace
|
||||
|
||||
EaxEffectUPtr eax_create_eax_echo_effect(
|
||||
EffectProps& al_effect_props)
|
||||
EaxEffectUPtr eax_create_eax_echo_effect()
|
||||
{
|
||||
return std::make_unique<EaxEchoEffect>(al_effect_props);
|
||||
return std::make_unique<EaxEchoEffect>();
|
||||
}
|
||||
|
||||
#endif // ALSOFT_EAX
|
||||
|
@ -11,47 +11,21 @@
|
||||
|
||||
|
||||
EaxEffectUPtr eax_create_eax_null_effect();
|
||||
|
||||
EaxEffectUPtr eax_create_eax_chorus_effect(
|
||||
EffectProps& al_effect_props);
|
||||
|
||||
EaxEffectUPtr eax_create_eax_distortion_effect(
|
||||
EffectProps& al_effect_props);
|
||||
|
||||
EaxEffectUPtr eax_create_eax_echo_effect(
|
||||
EffectProps& al_effect_props);
|
||||
|
||||
EaxEffectUPtr eax_create_eax_flanger_effect(
|
||||
EffectProps& al_effect_props);
|
||||
|
||||
EaxEffectUPtr eax_create_eax_frequency_shifter_effect(
|
||||
EffectProps& al_effect_props);
|
||||
|
||||
EaxEffectUPtr eax_create_eax_vocal_morpher_effect(
|
||||
EffectProps& al_effect_props);
|
||||
|
||||
EaxEffectUPtr eax_create_eax_pitch_shifter_effect(
|
||||
EffectProps& al_effect_props);
|
||||
|
||||
EaxEffectUPtr eax_create_eax_ring_modulator_effect(
|
||||
EffectProps& al_effect_props);
|
||||
|
||||
EaxEffectUPtr eax_create_eax_auto_wah_effect(
|
||||
EffectProps& al_effect_props);
|
||||
|
||||
EaxEffectUPtr eax_create_eax_compressor_effect(
|
||||
EffectProps& al_effect_props);
|
||||
|
||||
EaxEffectUPtr eax_create_eax_equalizer_effect(
|
||||
EffectProps& al_effect_props);
|
||||
|
||||
EaxEffectUPtr eax_create_eax_reverb_effect(
|
||||
EffectProps& al_effect_props);
|
||||
EaxEffectUPtr eax_create_eax_chorus_effect();
|
||||
EaxEffectUPtr eax_create_eax_distortion_effect();
|
||||
EaxEffectUPtr eax_create_eax_echo_effect();
|
||||
EaxEffectUPtr eax_create_eax_flanger_effect();
|
||||
EaxEffectUPtr eax_create_eax_frequency_shifter_effect();
|
||||
EaxEffectUPtr eax_create_eax_vocal_morpher_effect();
|
||||
EaxEffectUPtr eax_create_eax_pitch_shifter_effect();
|
||||
EaxEffectUPtr eax_create_eax_ring_modulator_effect();
|
||||
EaxEffectUPtr eax_create_eax_auto_wah_effect();
|
||||
EaxEffectUPtr eax_create_eax_compressor_effect();
|
||||
EaxEffectUPtr eax_create_eax_equalizer_effect();
|
||||
EaxEffectUPtr eax_create_eax_reverb_effect();
|
||||
|
||||
|
||||
EaxEffectUPtr eax_create_eax_effect(
|
||||
ALenum al_effect_type,
|
||||
EffectProps& al_effect_props)
|
||||
EaxEffectUPtr eax_create_eax_effect(ALenum al_effect_type)
|
||||
{
|
||||
#define EAX_PREFIX "[EAX_MAKE_EAX_EFFECT] "
|
||||
|
||||
@ -61,40 +35,40 @@ EaxEffectUPtr eax_create_eax_effect(
|
||||
return eax_create_eax_null_effect();
|
||||
|
||||
case AL_EFFECT_CHORUS:
|
||||
return eax_create_eax_chorus_effect(al_effect_props);
|
||||
return eax_create_eax_chorus_effect();
|
||||
|
||||
case AL_EFFECT_DISTORTION:
|
||||
return eax_create_eax_distortion_effect(al_effect_props);
|
||||
return eax_create_eax_distortion_effect();
|
||||
|
||||
case AL_EFFECT_ECHO:
|
||||
return eax_create_eax_echo_effect(al_effect_props);
|
||||
return eax_create_eax_echo_effect();
|
||||
|
||||
case AL_EFFECT_FLANGER:
|
||||
return eax_create_eax_flanger_effect(al_effect_props);
|
||||
return eax_create_eax_flanger_effect();
|
||||
|
||||
case AL_EFFECT_FREQUENCY_SHIFTER:
|
||||
return eax_create_eax_frequency_shifter_effect(al_effect_props);
|
||||
return eax_create_eax_frequency_shifter_effect();
|
||||
|
||||
case AL_EFFECT_VOCAL_MORPHER:
|
||||
return eax_create_eax_vocal_morpher_effect(al_effect_props);
|
||||
return eax_create_eax_vocal_morpher_effect();
|
||||
|
||||
case AL_EFFECT_PITCH_SHIFTER:
|
||||
return eax_create_eax_pitch_shifter_effect(al_effect_props);
|
||||
return eax_create_eax_pitch_shifter_effect();
|
||||
|
||||
case AL_EFFECT_RING_MODULATOR:
|
||||
return eax_create_eax_ring_modulator_effect(al_effect_props);
|
||||
return eax_create_eax_ring_modulator_effect();
|
||||
|
||||
case AL_EFFECT_AUTOWAH:
|
||||
return eax_create_eax_auto_wah_effect(al_effect_props);
|
||||
return eax_create_eax_auto_wah_effect();
|
||||
|
||||
case AL_EFFECT_COMPRESSOR:
|
||||
return eax_create_eax_compressor_effect(al_effect_props);
|
||||
return eax_create_eax_compressor_effect();
|
||||
|
||||
case AL_EFFECT_EQUALIZER:
|
||||
return eax_create_eax_equalizer_effect(al_effect_props);
|
||||
return eax_create_eax_equalizer_effect();
|
||||
|
||||
case AL_EFFECT_EAXREVERB:
|
||||
return eax_create_eax_reverb_effect(al_effect_props);
|
||||
return eax_create_eax_reverb_effect();
|
||||
|
||||
default:
|
||||
assert(false && "Unsupported AL effect type.");
|
||||
|
@ -86,9 +86,7 @@ extern const EffectVtable ConvolutionEffectVtable;
|
||||
|
||||
|
||||
#ifdef ALSOFT_EAX
|
||||
EaxEffectUPtr eax_create_eax_effect(
|
||||
ALenum al_effect_type,
|
||||
EffectProps& al_effect_props);
|
||||
EaxEffectUPtr eax_create_eax_effect(ALenum al_effect_type);
|
||||
#endif // ALSOFT_EAX
|
||||
|
||||
#endif /* AL_EFFECTS_EFFECTS_H */
|
||||
|
@ -201,8 +201,7 @@ class EaxEqualizerEffect final :
|
||||
public EaxEffect
|
||||
{
|
||||
public:
|
||||
EaxEqualizerEffect(
|
||||
EffectProps& al_effect_props);
|
||||
EaxEqualizerEffect();
|
||||
|
||||
|
||||
// [[nodiscard]]
|
||||
@ -211,8 +210,6 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
EffectProps& al_effect_props_;
|
||||
|
||||
EAXEQUALIZERPROPERTIES eax_{};
|
||||
EAXEQUALIZERPROPERTIES eax_d_{};
|
||||
EaxEqualizerEffectDirtyFlags eax_dirty_flags_{};
|
||||
@ -373,10 +370,8 @@ public:
|
||||
}; // EaxEqualizerEffectException
|
||||
|
||||
|
||||
EaxEqualizerEffect::EaxEqualizerEffect(
|
||||
EffectProps& al_effect_props)
|
||||
:
|
||||
al_effect_props_{al_effect_props}
|
||||
EaxEqualizerEffect::EaxEqualizerEffect()
|
||||
: EaxEffect{AL_EFFECT_EQUALIZER}
|
||||
{
|
||||
set_eax_defaults();
|
||||
set_efx_defaults();
|
||||
@ -1021,10 +1016,9 @@ bool EaxEqualizerEffect::set(
|
||||
|
||||
} // namespace
|
||||
|
||||
EaxEffectUPtr eax_create_eax_equalizer_effect(
|
||||
EffectProps& al_effect_props)
|
||||
EaxEffectUPtr eax_create_eax_equalizer_effect()
|
||||
{
|
||||
return std::make_unique<EaxEqualizerEffect>(al_effect_props);
|
||||
return std::make_unique<EaxEqualizerEffect>();
|
||||
}
|
||||
|
||||
#endif // ALSOFT_EAX
|
||||
|
@ -157,8 +157,7 @@ class EaxFrequencyShifterEffect final :
|
||||
public EaxEffect
|
||||
{
|
||||
public:
|
||||
EaxFrequencyShifterEffect(
|
||||
EffectProps& al_effect_props);
|
||||
EaxFrequencyShifterEffect();
|
||||
|
||||
|
||||
// [[nodiscard]]
|
||||
@ -167,8 +166,6 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
EffectProps& al_effect_props_;
|
||||
|
||||
EAXFREQUENCYSHIFTERPROPERTIES eax_{};
|
||||
EAXFREQUENCYSHIFTERPROPERTIES eax_d_{};
|
||||
EaxFrequencyShifterEffectDirtyFlags eax_dirty_flags_{};
|
||||
@ -252,10 +249,8 @@ public:
|
||||
}; // EaxFrequencyShifterEffectException
|
||||
|
||||
|
||||
EaxFrequencyShifterEffect::EaxFrequencyShifterEffect(
|
||||
EffectProps& al_effect_props)
|
||||
:
|
||||
al_effect_props_{al_effect_props}
|
||||
EaxFrequencyShifterEffect::EaxFrequencyShifterEffect()
|
||||
: EaxEffect{AL_EFFECT_FREQUENCY_SHIFTER}
|
||||
{
|
||||
set_eax_defaults();
|
||||
set_efx_defaults();
|
||||
@ -530,10 +525,9 @@ bool EaxFrequencyShifterEffect::set(
|
||||
|
||||
} // namespace
|
||||
|
||||
EaxEffectUPtr eax_create_eax_frequency_shifter_effect(
|
||||
EffectProps& al_effect_props)
|
||||
EaxEffectUPtr eax_create_eax_frequency_shifter_effect()
|
||||
{
|
||||
return std::make_unique<EaxFrequencyShifterEffect>(al_effect_props);
|
||||
return std::make_unique<EaxFrequencyShifterEffect>();
|
||||
}
|
||||
|
||||
#endif // ALSOFT_EAX
|
||||
|
@ -163,8 +163,7 @@ class EaxRingModulatorEffect final :
|
||||
public EaxEffect
|
||||
{
|
||||
public:
|
||||
EaxRingModulatorEffect(
|
||||
EffectProps& al_effect_props);
|
||||
EaxRingModulatorEffect();
|
||||
|
||||
|
||||
// [[nodiscard]]
|
||||
@ -173,8 +172,6 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
EffectProps& al_effect_props_;
|
||||
|
||||
EAXRINGMODULATORPROPERTIES eax_{};
|
||||
EAXRINGMODULATORPROPERTIES eax_d_{};
|
||||
EaxRingModulatorEffectDirtyFlags eax_dirty_flags_{};
|
||||
@ -258,10 +255,8 @@ public:
|
||||
}; // EaxRingModulatorEffectException
|
||||
|
||||
|
||||
EaxRingModulatorEffect::EaxRingModulatorEffect(
|
||||
EffectProps& al_effect_props)
|
||||
:
|
||||
al_effect_props_{al_effect_props}
|
||||
EaxRingModulatorEffect::EaxRingModulatorEffect()
|
||||
: EaxEffect{AL_EFFECT_RING_MODULATOR}
|
||||
{
|
||||
set_eax_defaults();
|
||||
set_efx_defaults();
|
||||
@ -533,10 +528,9 @@ bool EaxRingModulatorEffect::set(
|
||||
|
||||
} // namespace
|
||||
|
||||
EaxEffectUPtr eax_create_eax_ring_modulator_effect(
|
||||
EffectProps& al_effect_props)
|
||||
EaxEffectUPtr eax_create_eax_ring_modulator_effect()
|
||||
{
|
||||
return std::make_unique<EaxRingModulatorEffect>(al_effect_props);
|
||||
return std::make_unique<EaxRingModulatorEffect>();
|
||||
}
|
||||
|
||||
#endif // ALSOFT_EAX
|
||||
|
@ -104,6 +104,8 @@ class EaxNullEffect final :
|
||||
public EaxEffect
|
||||
{
|
||||
public:
|
||||
EaxNullEffect();
|
||||
|
||||
// [[nodiscard]]
|
||||
bool dispatch(
|
||||
const EaxEaxCall& eax_call) override;
|
||||
@ -123,6 +125,11 @@ public:
|
||||
}; // EaxNullEffectException
|
||||
|
||||
|
||||
EaxNullEffect::EaxNullEffect()
|
||||
: EaxEffect{AL_EFFECT_NULL}
|
||||
{
|
||||
}
|
||||
|
||||
// [[nodiscard]]
|
||||
bool EaxNullEffect::dispatch(
|
||||
const EaxEaxCall& eax_call)
|
||||
|
@ -108,18 +108,13 @@ class EaxPitchShifterEffect final :
|
||||
public EaxEffect
|
||||
{
|
||||
public:
|
||||
EaxPitchShifterEffect(
|
||||
EffectProps& al_effect_props);
|
||||
|
||||
EaxPitchShifterEffect();
|
||||
|
||||
// [[nodiscard]]
|
||||
bool dispatch(
|
||||
const EaxEaxCall& eax_call) override;
|
||||
|
||||
|
||||
private:
|
||||
EffectProps& al_effect_props_;
|
||||
|
||||
EAXPITCHSHIFTERPROPERTIES eax_{};
|
||||
EAXPITCHSHIFTERPROPERTIES eax_d_{};
|
||||
EaxPitchShifterEffectDirtyFlags eax_dirty_flags_{};
|
||||
@ -192,10 +187,8 @@ public:
|
||||
}; // EaxPitchShifterEffectException
|
||||
|
||||
|
||||
EaxPitchShifterEffect::EaxPitchShifterEffect(
|
||||
EffectProps& al_effect_props)
|
||||
:
|
||||
al_effect_props_{al_effect_props}
|
||||
EaxPitchShifterEffect::EaxPitchShifterEffect()
|
||||
: EaxEffect{AL_EFFECT_PITCH_SHIFTER}
|
||||
{
|
||||
set_eax_defaults();
|
||||
set_efx_defaults();
|
||||
@ -408,10 +401,9 @@ bool EaxPitchShifterEffect::set(
|
||||
|
||||
} // namespace
|
||||
|
||||
EaxEffectUPtr eax_create_eax_pitch_shifter_effect(
|
||||
EffectProps& al_effect_props)
|
||||
EaxEffectUPtr eax_create_eax_pitch_shifter_effect()
|
||||
{
|
||||
return std::make_unique<EaxPitchShifterEffect>(al_effect_props);
|
||||
return std::make_unique<EaxPitchShifterEffect>();
|
||||
}
|
||||
|
||||
#endif // ALSOFT_EAX
|
||||
|
@ -604,18 +604,13 @@ class EaxReverbEffect final :
|
||||
public EaxEffect
|
||||
{
|
||||
public:
|
||||
EaxReverbEffect(
|
||||
EffectProps& al_effect_props);
|
||||
|
||||
EaxReverbEffect();
|
||||
|
||||
// [[nodiscard]]
|
||||
bool dispatch(
|
||||
const EaxEaxCall& eax_call) override;
|
||||
|
||||
|
||||
private:
|
||||
EffectProps& al_effect_props_;
|
||||
|
||||
EAXREVERBPROPERTIES eax_{};
|
||||
EAXREVERBPROPERTIES eax_d_{};
|
||||
EaxReverbEffectDirtyFlags eax_dirty_flags_{};
|
||||
@ -941,10 +936,8 @@ public:
|
||||
}; // EaxReverbEffectException
|
||||
|
||||
|
||||
EaxReverbEffect::EaxReverbEffect(
|
||||
EffectProps& al_effect_props)
|
||||
:
|
||||
al_effect_props_{al_effect_props}
|
||||
EaxReverbEffect::EaxReverbEffect()
|
||||
: EaxEffect{AL_EFFECT_EAXREVERB}
|
||||
{
|
||||
set_eax_defaults();
|
||||
set_efx_defaults();
|
||||
@ -2464,10 +2457,9 @@ bool EaxReverbEffect::set(
|
||||
|
||||
} // namespace
|
||||
|
||||
EaxEffectUPtr eax_create_eax_reverb_effect(
|
||||
EffectProps& al_effect_props)
|
||||
EaxEffectUPtr eax_create_eax_reverb_effect()
|
||||
{
|
||||
return std::make_unique<EaxReverbEffect>(al_effect_props);
|
||||
return std::make_unique<EaxReverbEffect>();
|
||||
}
|
||||
|
||||
#endif // ALSOFT_EAX
|
||||
|
@ -279,18 +279,13 @@ class EaxVocalMorpherEffect final :
|
||||
public EaxEffect
|
||||
{
|
||||
public:
|
||||
EaxVocalMorpherEffect(
|
||||
EffectProps& al_effect_props);
|
||||
|
||||
EaxVocalMorpherEffect();
|
||||
|
||||
// [[nodiscard]]
|
||||
bool dispatch(
|
||||
const EaxEaxCall& eax_call) override;
|
||||
|
||||
|
||||
private:
|
||||
EffectProps& al_effect_props_;
|
||||
|
||||
EAXVOCALMORPHERPROPERTIES eax_{};
|
||||
EAXVOCALMORPHERPROPERTIES eax_d_{};
|
||||
EaxVocalMorpherEffectDirtyFlags eax_dirty_flags_{};
|
||||
@ -407,10 +402,8 @@ public:
|
||||
}; // EaxVocalMorpherEffectException
|
||||
|
||||
|
||||
EaxVocalMorpherEffect::EaxVocalMorpherEffect(
|
||||
EffectProps& al_effect_props)
|
||||
:
|
||||
al_effect_props_{al_effect_props}
|
||||
EaxVocalMorpherEffect::EaxVocalMorpherEffect()
|
||||
: EaxEffect{AL_EFFECT_VOCAL_MORPHER}
|
||||
{
|
||||
set_eax_defaults();
|
||||
set_efx_defaults();
|
||||
@ -860,10 +853,9 @@ bool EaxVocalMorpherEffect::set(
|
||||
} // namespace
|
||||
|
||||
|
||||
EaxEffectUPtr eax_create_eax_vocal_morpher_effect(
|
||||
EffectProps& al_effect_props)
|
||||
EaxEffectUPtr eax_create_eax_vocal_morpher_effect()
|
||||
{
|
||||
return std::make_unique<EaxVocalMorpherEffect>(al_effect_props);
|
||||
return std::make_unique<EaxVocalMorpherEffect>();
|
||||
}
|
||||
|
||||
#endif // ALSOFT_EAX
|
||||
|
Loading…
x
Reference in New Issue
Block a user