Remove some unused members
[openal-soft.git] / al / effects / null.cpp
blob2243dfe1ee70df1a93e1e80f18d24c8f4c2e0055
2 #include "config.h"
4 #include "AL/al.h"
5 #include "AL/efx.h"
7 #include "alc/effects/base.h"
8 #include "effects.h"
10 #ifdef ALSOFT_EAX
11 #include "al/eax/exception.h"
12 #endif // ALSOFT_EAX
15 namespace {
17 void Null_setParami(EffectProps* /*props*/, ALenum param, int /*val*/)
19 switch(param)
21 default:
22 throw effect_exception{AL_INVALID_ENUM, "Invalid null effect integer property 0x%04x",
23 param};
26 void Null_setParamiv(EffectProps *props, ALenum param, const int *vals)
28 switch(param)
30 default:
31 Null_setParami(props, param, vals[0]);
34 void Null_setParamf(EffectProps* /*props*/, ALenum param, float /*val*/)
36 switch(param)
38 default:
39 throw effect_exception{AL_INVALID_ENUM, "Invalid null effect float property 0x%04x",
40 param};
43 void Null_setParamfv(EffectProps *props, ALenum param, const float *vals)
45 switch(param)
47 default:
48 Null_setParamf(props, param, vals[0]);
52 void Null_getParami(const EffectProps* /*props*/, ALenum param, int* /*val*/)
54 switch(param)
56 default:
57 throw effect_exception{AL_INVALID_ENUM, "Invalid null effect integer property 0x%04x",
58 param};
61 void Null_getParamiv(const EffectProps *props, ALenum param, int *vals)
63 switch(param)
65 default:
66 Null_getParami(props, param, vals);
69 void Null_getParamf(const EffectProps* /*props*/, ALenum param, float* /*val*/)
71 switch(param)
73 default:
74 throw effect_exception{AL_INVALID_ENUM, "Invalid null effect float property 0x%04x",
75 param};
78 void Null_getParamfv(const EffectProps *props, ALenum param, float *vals)
80 switch(param)
82 default:
83 Null_getParamf(props, param, vals);
87 EffectProps genDefaultProps() noexcept
89 EffectProps props{};
90 return props;
93 } // namespace
95 DEFINE_ALEFFECT_VTABLE(Null);
97 const EffectProps NullEffectProps{genDefaultProps()};
100 #ifdef ALSOFT_EAX
101 namespace {
103 class EaxNullEffect final : public EaxEffect {
104 public:
105 EaxNullEffect() noexcept;
107 void dispatch(const EaxCall& call) override;
108 /*[[nodiscard]]*/ bool commit() override;
109 }; // EaxNullEffect
112 class EaxNullEffectException : public EaxException
114 public:
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()
132 return false;
135 } // namespace
137 EaxEffectUPtr eax_create_eax_null_effect()
139 return std::make_unique<EaxNullEffect>();
142 #endif // ALSOFT_EAX