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 using NullCommitter = EaxCommitter<EaxNullCommitter>;
108 struct NullCommitter::Exception : public EaxException
110 explicit Exception(const char *message) : EaxException{"EAX_NULL_EFFECT", message}
115 [[noreturn]] void NullCommitter::fail(const char *message)
117 throw Exception{message};
121 bool NullCommitter::commit(const EaxEffectProps &props)
123 const bool ret{props.mType != mEaxProps.mType};
129 void NullCommitter::SetDefaults(EaxEffectProps &props)
131 props = EaxEffectProps{};
132 props.mType = EaxEffectType::None;
136 void NullCommitter::Get(const EaxCall &call, const EaxEffectProps&)
138 if(call.get_property_id() != 0)
139 fail_unknown_property_id();
143 void NullCommitter::Set(const EaxCall &call, EaxEffectProps&)
145 if(call.get_property_id() != 0)
146 fail_unknown_property_id();