aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/modulator.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/modulator.c
parent395278fcdb2f83ba35b5fba9341bb868af4330b2 (diff)
Provide messages for the remaining AL errors
Diffstat (limited to 'Alc/effects/modulator.c')
-rw-r--r--Alc/effects/modulator.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/Alc/effects/modulator.c b/Alc/effects/modulator.c
index 431941ce..0fb03042 100644
--- a/Alc/effects/modulator.c
+++ b/Alc/effects/modulator.c
@@ -217,24 +217,22 @@ void ALmodulator_setParamf(ALeffect *effect, ALCcontext *context, ALenum param,
{
case AL_RING_MODULATOR_FREQUENCY:
if(!(val >= AL_RING_MODULATOR_MIN_FREQUENCY && val <= AL_RING_MODULATOR_MAX_FREQUENCY))
- SET_ERROR_AND_RETURN(context, AL_INVALID_VALUE);
+ SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Modulator frequency out of range",);
props->Modulator.Frequency = val;
break;
case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
if(!(val >= AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF && val <= AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF))
- SET_ERROR_AND_RETURN(context, AL_INVALID_VALUE);
+ SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Modulator high-pass cutoff out of range",);
props->Modulator.HighPassCutoff = val;
break;
default:
- SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM);
+ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid modulator float property");
}
}
void ALmodulator_setParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
-{
- ALmodulator_setParamf(effect, context, param, vals[0]);
-}
+{ ALmodulator_setParamf(effect, context, param, vals[0]); }
void ALmodulator_setParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
{
ALeffectProps *props = &effect->Props;
@@ -247,18 +245,16 @@ void ALmodulator_setParami(ALeffect *effect, ALCcontext *context, ALenum param,
case AL_RING_MODULATOR_WAVEFORM:
if(!(val >= AL_RING_MODULATOR_MIN_WAVEFORM && val <= AL_RING_MODULATOR_MAX_WAVEFORM))
- SET_ERROR_AND_RETURN(context, AL_INVALID_VALUE);
+ SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Invalid modulator waveform",);
props->Modulator.Waveform = val;
break;
default:
- SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM);
+ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid modulator integer property");
}
}
void ALmodulator_setParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
-{
- ALmodulator_setParami(effect, context, param, vals[0]);
-}
+{ ALmodulator_setParami(effect, context, param, vals[0]); }
void ALmodulator_getParami(const ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
{
@@ -276,13 +272,11 @@ void ALmodulator_getParami(const ALeffect *effect, ALCcontext *context, ALenum p
break;
default:
- SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM);
+ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid modulator integer property");
}
}
void ALmodulator_getParamiv(const ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
-{
- ALmodulator_getParami(effect, context, param, vals);
-}
+{ ALmodulator_getParami(effect, context, param, vals); }
void ALmodulator_getParamf(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
{
const ALeffectProps *props = &effect->Props;
@@ -296,12 +290,10 @@ void ALmodulator_getParamf(const ALeffect *effect, ALCcontext *context, ALenum p
break;
default:
- SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM);
+ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid modulator float property");
}
}
void ALmodulator_getParamfv(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
-{
- ALmodulator_getParamf(effect, context, param, vals);
-}
+{ ALmodulator_getParamf(effect, context, param, vals); }
DEFINE_ALEFFECT_VTABLE(ALmodulator);