aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/echo.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-01-24 17:07:01 -0800
committerChris Robinson <[email protected]>2018-01-24 17:07:01 -0800
commit2ded5547ba431a0859bc08276ab720aea9ca92a8 (patch)
tree8f71cfb37a279805b162f9702839bad856f8dadf /Alc/effects/echo.c
parent395278fcdb2f83ba35b5fba9341bb868af4330b2 (diff)
Provide messages for the remaining AL errors
Diffstat (limited to 'Alc/effects/echo.c')
-rw-r--r--Alc/effects/echo.c42
1 files changed, 17 insertions, 25 deletions
diff --git a/Alc/effects/echo.c b/Alc/effects/echo.c
index cd556f1a..b59b06b0 100644
--- a/Alc/effects/echo.c
+++ b/Alc/effects/echo.c
@@ -230,12 +230,10 @@ ALeffectStateFactory *ALechoStateFactory_getFactory(void)
}
-void ALecho_setParami(ALeffect *UNUSED(effect), ALCcontext *context, ALenum UNUSED(param), ALint UNUSED(val))
-{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); }
-void ALecho_setParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
-{
- ALecho_setParami(effect, context, param, vals[0]);
-}
+void ALecho_setParami(ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALint UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid echo integer property"); }
+void ALecho_setParamiv(ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), const ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid echo integer-vector property"); }
void ALecho_setParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
{
ALeffectProps *props = &effect->Props;
@@ -243,49 +241,45 @@ void ALecho_setParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALflo
{
case AL_ECHO_DELAY:
if(!(val >= AL_ECHO_MIN_DELAY && val <= AL_ECHO_MAX_DELAY))
- SET_ERROR_AND_RETURN(context, AL_INVALID_VALUE);
+ SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Echo delay out of range",);
props->Echo.Delay = val;
break;
case AL_ECHO_LRDELAY:
if(!(val >= AL_ECHO_MIN_LRDELAY && val <= AL_ECHO_MAX_LRDELAY))
- SET_ERROR_AND_RETURN(context, AL_INVALID_VALUE);
+ SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Echo LR delay out of range",);
props->Echo.LRDelay = val;
break;
case AL_ECHO_DAMPING:
if(!(val >= AL_ECHO_MIN_DAMPING && val <= AL_ECHO_MAX_DAMPING))
- SET_ERROR_AND_RETURN(context, AL_INVALID_VALUE);
+ SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Echo damping out of range",);
props->Echo.Damping = val;
break;
case AL_ECHO_FEEDBACK:
if(!(val >= AL_ECHO_MIN_FEEDBACK && val <= AL_ECHO_MAX_FEEDBACK))
- SET_ERROR_AND_RETURN(context, AL_INVALID_VALUE);
+ SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Echo feedback out of range",);
props->Echo.Feedback = val;
break;
case AL_ECHO_SPREAD:
if(!(val >= AL_ECHO_MIN_SPREAD && val <= AL_ECHO_MAX_SPREAD))
- SET_ERROR_AND_RETURN(context, AL_INVALID_VALUE);
+ SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Echo spread out of range",);
props->Echo.Spread = val;
break;
default:
- SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM);
+ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid echo float property");
}
}
void ALecho_setParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
-{
- ALecho_setParamf(effect, context, param, vals[0]);
-}
+{ ALecho_setParamf(effect, context, param, vals[0]); }
-void ALecho_getParami(const ALeffect *UNUSED(effect), ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(val))
-{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); }
-void ALecho_getParamiv(const ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
-{
- ALecho_getParami(effect, context, param, vals);
-}
+void ALecho_getParami(const ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid echo integer property"); }
+void ALecho_getParamiv(const ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid echo integer-vector property"); }
void ALecho_getParamf(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
{
const ALeffectProps *props = &effect->Props;
@@ -312,12 +306,10 @@ void ALecho_getParamf(const ALeffect *effect, ALCcontext *context, ALenum param,
break;
default:
- SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM);
+ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid echo float property");
}
}
void ALecho_getParamfv(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
-{
- ALecho_getParamf(effect, context, param, vals);
-}
+{ ALecho_getParamf(effect, context, param, vals); }
DEFINE_ALEFFECT_VTABLE(ALecho);