9 #include "alc/context.h"
10 #include "alnumeric.h"
16 constexpr EffectProps
genDefaultDialogProps() noexcept
18 DedicatedProps props
{};
19 props
.Target
= DedicatedProps::Dialog
;
24 constexpr EffectProps
genDefaultLfeProps() noexcept
26 DedicatedProps props
{};
27 props
.Target
= DedicatedProps::Lfe
;
34 const EffectProps DedicatedDialogEffectProps
{genDefaultDialogProps()};
36 void DedicatedDialogEffectHandler::SetParami(ALCcontext
*context
, DedicatedProps
&, ALenum param
, int)
37 { context
->throw_error(AL_INVALID_ENUM
, "Invalid dedicated integer property {:#04x}", as_unsigned(param
)); }
38 void DedicatedDialogEffectHandler::SetParamiv(ALCcontext
*context
, DedicatedProps
&, ALenum param
, const int*)
39 { context
->throw_error(AL_INVALID_ENUM
, "Invalid dedicated integer-vector property {:#04x}", as_unsigned(param
)); }
40 void DedicatedDialogEffectHandler::SetParamf(ALCcontext
*context
, DedicatedProps
&props
, ALenum param
, float val
)
44 case AL_DEDICATED_GAIN
:
45 if(!(val
>= 0.0f
&& std::isfinite(val
)))
46 context
->throw_error(AL_INVALID_VALUE
, "Dedicated gain out of range");
51 context
->throw_error(AL_INVALID_ENUM
, "Invalid dedicated float property {:#04x}",
54 void DedicatedDialogEffectHandler::SetParamfv(ALCcontext
*context
, DedicatedProps
&props
, ALenum param
, const float *vals
)
55 { SetParamf(context
, props
, param
, *vals
); }
57 void DedicatedDialogEffectHandler::GetParami(ALCcontext
*context
, const DedicatedProps
&, ALenum param
, int*)
58 { context
->throw_error(AL_INVALID_ENUM
, "Invalid dedicated integer property {:#04x}", as_unsigned(param
)); }
59 void DedicatedDialogEffectHandler::GetParamiv(ALCcontext
*context
, const DedicatedProps
&, ALenum param
, int*)
60 { context
->throw_error(AL_INVALID_ENUM
, "Invalid dedicated integer-vector property {:#04x}", as_unsigned(param
)); }
61 void DedicatedDialogEffectHandler::GetParamf(ALCcontext
*context
, const DedicatedProps
&props
, ALenum param
, float *val
)
65 case AL_DEDICATED_GAIN
: *val
= props
.Gain
; return;
68 context
->throw_error(AL_INVALID_ENUM
, "Invalid dedicated float property {:#04x}",
71 void DedicatedDialogEffectHandler::GetParamfv(ALCcontext
*context
, const DedicatedProps
&props
, ALenum param
, float *vals
)
72 { GetParamf(context
, props
, param
, vals
); }
75 const EffectProps DedicatedLfeEffectProps
{genDefaultLfeProps()};
77 void DedicatedLfeEffectHandler::SetParami(ALCcontext
*context
, DedicatedProps
&, ALenum param
, int)
78 { context
->throw_error(AL_INVALID_ENUM
, "Invalid dedicated integer property {:#04x}", as_unsigned(param
)); }
79 void DedicatedLfeEffectHandler::SetParamiv(ALCcontext
*context
, DedicatedProps
&, ALenum param
, const int*)
80 { context
->throw_error(AL_INVALID_ENUM
, "Invalid dedicated integer-vector property {:#04x}", as_unsigned(param
)); }
81 void DedicatedLfeEffectHandler::SetParamf(ALCcontext
*context
, DedicatedProps
&props
, ALenum param
, float val
)
85 case AL_DEDICATED_GAIN
:
86 if(!(val
>= 0.0f
&& std::isfinite(val
)))
87 context
->throw_error(AL_INVALID_VALUE
, "Dedicated gain out of range");
92 context
->throw_error(AL_INVALID_ENUM
, "Invalid dedicated float property {:#04x}",
95 void DedicatedLfeEffectHandler::SetParamfv(ALCcontext
*context
, DedicatedProps
&props
, ALenum param
, const float *vals
)
96 { SetParamf(context
, props
, param
, *vals
); }
98 void DedicatedLfeEffectHandler::GetParami(ALCcontext
*context
, const DedicatedProps
&, ALenum param
, int*)
99 { context
->throw_error(AL_INVALID_ENUM
, "Invalid dedicated integer property {:#04x}", as_unsigned(param
)); }
100 void DedicatedLfeEffectHandler::GetParamiv(ALCcontext
*context
, const DedicatedProps
&, ALenum param
, int*)
101 { context
->throw_error(AL_INVALID_ENUM
, "Invalid dedicated integer-vector property {:#04x}", as_unsigned(param
)); }
102 void DedicatedLfeEffectHandler::GetParamf(ALCcontext
*context
, const DedicatedProps
&props
, ALenum param
, float *val
)
106 case AL_DEDICATED_GAIN
: *val
= props
.Gain
; return;
109 context
->throw_error(AL_INVALID_ENUM
, "Invalid dedicated float property {:#04x}",
112 void DedicatedLfeEffectHandler::GetParamfv(ALCcontext
*context
, const DedicatedProps
&props
, ALenum param
, float *vals
)
113 { GetParamf(context
, props
, param
, vals
); }