7 #include "alc/effects/base.h"
11 #include "al/eax/exception.h"
17 void Null_setParami(EffectProps
* /*props*/, ALenum param
, int /*val*/)
22 throw effect_exception
{AL_INVALID_ENUM
, "Invalid null effect integer property 0x%04x",
26 void Null_setParamiv(EffectProps
*props
, ALenum param
, const int *vals
)
31 Null_setParami(props
, param
, vals
[0]);
34 void Null_setParamf(EffectProps
* /*props*/, ALenum param
, float /*val*/)
39 throw effect_exception
{AL_INVALID_ENUM
, "Invalid null effect float property 0x%04x",
43 void Null_setParamfv(EffectProps
*props
, ALenum param
, const float *vals
)
48 Null_setParamf(props
, param
, vals
[0]);
52 void Null_getParami(const EffectProps
* /*props*/, ALenum param
, int* /*val*/)
57 throw effect_exception
{AL_INVALID_ENUM
, "Invalid null effect integer property 0x%04x",
61 void Null_getParamiv(const EffectProps
*props
, ALenum param
, int *vals
)
66 Null_getParami(props
, param
, vals
);
69 void Null_getParamf(const EffectProps
* /*props*/, ALenum param
, float* /*val*/)
74 throw effect_exception
{AL_INVALID_ENUM
, "Invalid null effect float property 0x%04x",
78 void Null_getParamfv(const EffectProps
*props
, ALenum param
, float *vals
)
83 Null_getParamf(props
, param
, vals
);
87 EffectProps
genDefaultProps() noexcept
95 DEFINE_ALEFFECT_VTABLE(Null
);
97 const EffectProps NullEffectProps
{genDefaultProps()};
103 class EaxNullEffect final
: public EaxEffect
{
105 EaxNullEffect() noexcept
;
107 void dispatch(const EaxCall
& call
) override
;
108 /*[[nodiscard]]*/ bool commit() override
;
112 class EaxNullEffectException
: public EaxException
115 explicit EaxNullEffectException(const char* message
)
116 : EaxException
{"EAX_NULL_EFFECT", message
}
118 }; // EaxNullEffectException
120 EaxNullEffect::EaxNullEffect() noexcept
121 : EaxEffect
{AL_EFFECT_NULL
}
124 void EaxNullEffect::dispatch(const EaxCall
& call
)
126 if(call
.get_property_id() != 0)
127 throw EaxNullEffectException
{"Unsupported property id."};
130 bool EaxNullEffect::commit()
137 EaxEffectUPtr
eax_create_eax_null_effect()
139 return std::make_unique
<EaxNullEffect
>();