7 #include "alc/effects/base.h"
11 #include "al/eax/effect.h"
12 #include "al/eax/exception.h"
18 constexpr EffectProps
genDefaultProps() noexcept
20 return std::monostate
{};
25 const EffectProps NullEffectProps
{genDefaultProps()};
27 void NullEffectHandler::SetParami(std::monostate
& /*props*/, ALenum param
, int /*val*/)
32 throw effect_exception
{AL_INVALID_ENUM
, "Invalid null effect integer property 0x%04x",
36 void NullEffectHandler::SetParamiv(std::monostate
&props
, ALenum param
, const int *vals
)
41 SetParami(props
, param
, *vals
);
44 void NullEffectHandler::SetParamf(std::monostate
& /*props*/, ALenum param
, float /*val*/)
49 throw effect_exception
{AL_INVALID_ENUM
, "Invalid null effect float property 0x%04x",
53 void NullEffectHandler::SetParamfv(std::monostate
&props
, ALenum param
, const float *vals
)
58 SetParamf(props
, param
, *vals
);
62 void NullEffectHandler::GetParami(const std::monostate
& /*props*/, ALenum param
, int* /*val*/)
67 throw effect_exception
{AL_INVALID_ENUM
, "Invalid null effect integer property 0x%04x",
71 void NullEffectHandler::GetParamiv(const std::monostate
&props
, ALenum param
, int *vals
)
76 GetParami(props
, param
, vals
);
79 void NullEffectHandler::GetParamf(const std::monostate
& /*props*/, ALenum param
, float* /*val*/)
84 throw effect_exception
{AL_INVALID_ENUM
, "Invalid null effect float property 0x%04x",
88 void NullEffectHandler::GetParamfv(const std::monostate
&props
, ALenum param
, float *vals
)
93 GetParamf(props
, param
, vals
);
101 using NullCommitter
= EaxCommitter
<EaxNullCommitter
>;
106 struct NullCommitter::Exception
: public EaxException
108 explicit Exception(const char *message
) : EaxException
{"EAX_NULL_EFFECT", message
}
113 [[noreturn
]] void NullCommitter::fail(const char *message
)
115 throw Exception
{message
};
118 bool EaxNullCommitter::commit(const std::monostate
&props
)
120 const bool ret
{std::holds_alternative
<std::monostate
>(mEaxProps
)};
122 mAlProps
= std::monostate
{};
126 void EaxNullCommitter::SetDefaults(EaxEffectProps
&props
)
128 props
= std::monostate
{};
131 void EaxNullCommitter::Get(const EaxCall
&call
, const std::monostate
&)
133 if(call
.get_property_id() != 0)
134 fail_unknown_property_id();
137 void EaxNullCommitter::Set(const EaxCall
&call
, std::monostate
&)
139 if(call
.get_property_id() != 0)
140 fail_unknown_property_id();