2007-12-18 01:20:11 +00:00
|
|
|
/**
|
|
|
|
* OpenAL cross platform audio library
|
|
|
|
* Copyright (C) 1999-2007 by authors.
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
* Or go to http://www.gnu.org/copyleft/lgpl.html
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2008-01-16 22:09:04 +00:00
|
|
|
#include <stdlib.h>
|
2009-05-31 18:34:07 +00:00
|
|
|
#include <math.h>
|
2008-01-16 22:09:04 +00:00
|
|
|
|
2007-12-18 01:20:11 +00:00
|
|
|
#include "AL/al.h"
|
|
|
|
#include "AL/alc.h"
|
|
|
|
#include "alMain.h"
|
|
|
|
#include "alEffect.h"
|
2008-01-01 03:34:52 +00:00
|
|
|
#include "alThunk.h"
|
|
|
|
#include "alError.h"
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2008-11-14 15:13:59 +00:00
|
|
|
|
|
|
|
ALboolean DisabledEffects[MAX_EFFECTS];
|
|
|
|
|
|
|
|
|
2007-12-18 01:20:11 +00:00
|
|
|
static void InitEffectParams(ALeffect *effect, ALenum type);
|
|
|
|
|
|
|
|
|
2010-03-24 00:44:01 +00:00
|
|
|
AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
|
|
|
ALCcontext *Context;
|
2011-08-31 08:26:55 +00:00
|
|
|
ALsizei i;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2011-08-31 08:26:55 +00:00
|
|
|
Context = GetContextRef();
|
2009-09-13 03:22:03 +00:00
|
|
|
if(!Context) return;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2010-09-21 22:12:08 +00:00
|
|
|
if(n < 0 || IsBadWritePtr((void*)effects, n * sizeof(ALuint)))
|
|
|
|
alSetError(Context, AL_INVALID_VALUE);
|
|
|
|
else
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2009-08-15 16:39:18 +00:00
|
|
|
ALCdevice *device = Context->Device;
|
2010-09-21 22:12:08 +00:00
|
|
|
ALenum err;
|
2009-08-15 16:39:18 +00:00
|
|
|
|
2011-08-31 08:26:55 +00:00
|
|
|
for(i = 0;i < n;i++)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2010-09-21 22:12:08 +00:00
|
|
|
ALeffect *effect = calloc(1, sizeof(ALeffect));
|
2012-01-21 00:23:15 +00:00
|
|
|
if(!effect || InitEffect(effect) != AL_NO_ERROR)
|
2010-09-21 22:12:08 +00:00
|
|
|
{
|
2012-01-21 00:23:15 +00:00
|
|
|
free(effect);
|
2010-09-21 22:12:08 +00:00
|
|
|
alSetError(Context, AL_OUT_OF_MEMORY);
|
|
|
|
alDeleteEffects(i, effects);
|
|
|
|
break;
|
|
|
|
}
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2011-08-22 14:40:14 +00:00
|
|
|
err = NewThunkEntry(&effect->effect);
|
2011-06-18 06:59:25 +00:00
|
|
|
if(err == AL_NO_ERROR)
|
|
|
|
err = InsertUIntMapEntry(&device->EffectMap, effect->effect, effect);
|
2010-09-21 22:12:08 +00:00
|
|
|
if(err != AL_NO_ERROR)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2011-08-22 14:40:14 +00:00
|
|
|
FreeThunkEntry(effect->effect);
|
2010-09-21 22:12:08 +00:00
|
|
|
memset(effect, 0, sizeof(ALeffect));
|
|
|
|
free(effect);
|
|
|
|
|
|
|
|
alSetError(Context, err);
|
|
|
|
alDeleteEffects(i, effects);
|
|
|
|
break;
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
2010-09-21 22:12:08 +00:00
|
|
|
|
2011-08-31 08:26:55 +00:00
|
|
|
effects[i] = effect->effect;
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-31 08:26:55 +00:00
|
|
|
ALCcontext_DecRef(Context);
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
|
|
|
|
2011-09-22 07:31:42 +00:00
|
|
|
AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
|
|
|
ALCcontext *Context;
|
2010-09-21 23:54:33 +00:00
|
|
|
ALCdevice *device;
|
2007-12-18 01:20:11 +00:00
|
|
|
ALeffect *ALEffect;
|
|
|
|
ALsizei i;
|
|
|
|
|
2011-08-31 08:26:55 +00:00
|
|
|
Context = GetContextRef();
|
2009-09-13 03:22:03 +00:00
|
|
|
if(!Context) return;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2010-09-21 23:54:33 +00:00
|
|
|
device = Context->Device;
|
|
|
|
if(n < 0)
|
|
|
|
alSetError(Context, AL_INVALID_VALUE);
|
|
|
|
else
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
|
|
|
// Check that all effects are valid
|
2010-09-21 23:54:33 +00:00
|
|
|
for(i = 0;i < n;i++)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2010-03-17 03:29:01 +00:00
|
|
|
if(!effects[i])
|
|
|
|
continue;
|
|
|
|
|
2011-09-25 01:34:45 +00:00
|
|
|
if(LookupEffect(device, effects[i]) == NULL)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2010-03-17 00:35:51 +00:00
|
|
|
alSetError(Context, AL_INVALID_NAME);
|
2011-08-31 08:26:55 +00:00
|
|
|
n = 0;
|
2007-12-18 01:20:11 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-21 23:54:33 +00:00
|
|
|
for(i = 0;i < n;i++)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2010-09-21 23:54:33 +00:00
|
|
|
// Recheck that the effect is valid, because there could be duplicated names
|
2011-09-25 01:34:45 +00:00
|
|
|
if((ALEffect=RemoveEffect(device, effects[i])) == NULL)
|
2010-09-21 23:54:33 +00:00
|
|
|
continue;
|
2011-08-22 14:40:14 +00:00
|
|
|
FreeThunkEntry(ALEffect->effect);
|
2010-09-21 23:54:33 +00:00
|
|
|
|
|
|
|
memset(ALEffect, 0, sizeof(ALeffect));
|
|
|
|
free(ALEffect);
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-31 08:26:55 +00:00
|
|
|
ALCcontext_DecRef(Context);
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
|
|
|
|
2010-03-24 00:44:01 +00:00
|
|
|
AL_API ALboolean AL_APIENTRY alIsEffect(ALuint effect)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
|
|
|
ALCcontext *Context;
|
2010-05-19 00:41:06 +00:00
|
|
|
ALboolean result;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2011-08-31 06:28:38 +00:00
|
|
|
Context = GetContextRef();
|
2009-09-13 03:22:03 +00:00
|
|
|
if(!Context) return AL_FALSE;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2011-09-25 01:34:45 +00:00
|
|
|
result = ((!effect || LookupEffect(Context->Device, effect)) ?
|
2010-05-19 00:41:06 +00:00
|
|
|
AL_TRUE : AL_FALSE);
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2011-08-30 07:04:02 +00:00
|
|
|
ALCcontext_DecRef(Context);
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2010-03-17 01:54:36 +00:00
|
|
|
return result;
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
|
|
|
|
2010-03-24 00:44:01 +00:00
|
|
|
AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
|
|
|
ALCcontext *Context;
|
2010-03-17 01:54:36 +00:00
|
|
|
ALCdevice *Device;
|
|
|
|
ALeffect *ALEffect;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2011-09-11 16:13:01 +00:00
|
|
|
Context = GetContextRef();
|
2009-09-13 03:22:03 +00:00
|
|
|
if(!Context) return;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2010-03-17 01:54:36 +00:00
|
|
|
Device = Context->Device;
|
2011-09-25 01:34:45 +00:00
|
|
|
if((ALEffect=LookupEffect(Device, effect)) != NULL)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2008-01-16 07:32:28 +00:00
|
|
|
if(param == AL_EFFECT_TYPE)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2011-03-13 04:54:49 +00:00
|
|
|
ALboolean isOk = (iValue == AL_EFFECT_NULL);
|
|
|
|
ALint i;
|
|
|
|
for(i = 0;!isOk && EffectList[i].val;i++)
|
|
|
|
{
|
|
|
|
if(iValue == EffectList[i].val &&
|
|
|
|
!DisabledEffects[EffectList[i].type])
|
|
|
|
isOk = AL_TRUE;
|
|
|
|
}
|
2008-11-14 15:13:59 +00:00
|
|
|
|
|
|
|
if(isOk)
|
2007-12-19 02:15:52 +00:00
|
|
|
InitEffectParams(ALEffect, iValue);
|
|
|
|
else
|
2010-03-17 00:35:51 +00:00
|
|
|
alSetError(Context, AL_INVALID_VALUE);
|
2008-01-16 07:32:28 +00:00
|
|
|
}
|
2011-09-11 15:59:47 +00:00
|
|
|
else
|
2009-05-29 08:32:54 +00:00
|
|
|
{
|
2011-09-11 15:59:47 +00:00
|
|
|
/* Call the appropriate handler */
|
|
|
|
ALeffect_SetParami(ALEffect, Context, param, iValue);
|
2009-05-29 08:32:54 +00:00
|
|
|
}
|
2011-09-11 15:59:47 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
alSetError(Context, AL_INVALID_NAME);
|
2007-12-19 02:15:52 +00:00
|
|
|
|
2011-09-11 16:13:01 +00:00
|
|
|
ALCcontext_DecRef(Context);
|
2011-09-11 15:59:47 +00:00
|
|
|
}
|
2011-06-17 20:07:47 +00:00
|
|
|
|
2011-09-22 07:31:42 +00:00
|
|
|
AL_API ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, const ALint *piValues)
|
2011-09-11 15:59:47 +00:00
|
|
|
{
|
|
|
|
ALCcontext *Context;
|
|
|
|
ALCdevice *Device;
|
|
|
|
ALeffect *ALEffect;
|
2010-04-08 15:54:28 +00:00
|
|
|
|
2011-09-11 16:13:01 +00:00
|
|
|
Context = GetContextRef();
|
2011-09-11 15:59:47 +00:00
|
|
|
if(!Context) return;
|
2010-04-08 15:54:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
Device = Context->Device;
|
2011-09-25 01:34:45 +00:00
|
|
|
if((ALEffect=LookupEffect(Device, effect)) != NULL)
|
2011-09-11 15:59:47 +00:00
|
|
|
{
|
|
|
|
/* Call the appropriate handler */
|
|
|
|
ALeffect_SetParamiv(ALEffect, Context, param, piValues);
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
|
|
|
else
|
2010-03-17 00:35:51 +00:00
|
|
|
alSetError(Context, AL_INVALID_NAME);
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2011-09-11 16:13:01 +00:00
|
|
|
ALCcontext_DecRef(Context);
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2011-09-11 15:59:47 +00:00
|
|
|
ALCcontext *Context;
|
|
|
|
ALCdevice *Device;
|
|
|
|
ALeffect *ALEffect;
|
|
|
|
|
2011-09-11 16:13:01 +00:00
|
|
|
Context = GetContextRef();
|
2011-09-11 15:59:47 +00:00
|
|
|
if(!Context) return;
|
|
|
|
|
|
|
|
Device = Context->Device;
|
2011-09-25 01:34:45 +00:00
|
|
|
if((ALEffect=LookupEffect(Device, effect)) != NULL)
|
2011-09-11 15:59:47 +00:00
|
|
|
{
|
|
|
|
/* Call the appropriate handler */
|
|
|
|
ALeffect_SetParamf(ALEffect, Context, param, flValue);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
alSetError(Context, AL_INVALID_NAME);
|
|
|
|
|
2011-09-11 16:13:01 +00:00
|
|
|
ALCcontext_DecRef(Context);
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
|
|
|
|
2011-09-22 07:31:42 +00:00
|
|
|
AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, const ALfloat *pflValues)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
|
|
|
ALCcontext *Context;
|
2010-03-17 01:54:36 +00:00
|
|
|
ALCdevice *Device;
|
|
|
|
ALeffect *ALEffect;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2011-09-11 16:13:01 +00:00
|
|
|
Context = GetContextRef();
|
2009-09-13 03:22:03 +00:00
|
|
|
if(!Context) return;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2010-03-17 01:54:36 +00:00
|
|
|
Device = Context->Device;
|
2011-09-25 01:34:45 +00:00
|
|
|
if((ALEffect=LookupEffect(Device, effect)) != NULL)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2011-09-11 15:59:47 +00:00
|
|
|
/* Call the appropriate handler */
|
|
|
|
ALeffect_SetParamfv(ALEffect, Context, param, pflValues);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
alSetError(Context, AL_INVALID_NAME);
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 16:13:01 +00:00
|
|
|
ALCcontext_DecRef(Context);
|
2011-09-11 15:59:47 +00:00
|
|
|
}
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue)
|
|
|
|
{
|
|
|
|
ALCcontext *Context;
|
|
|
|
ALCdevice *Device;
|
|
|
|
ALeffect *ALEffect;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 16:13:01 +00:00
|
|
|
Context = GetContextRef();
|
2011-09-11 15:59:47 +00:00
|
|
|
if(!Context) return;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
Device = Context->Device;
|
2011-09-25 01:34:45 +00:00
|
|
|
if((ALEffect=LookupEffect(Device, effect)) != NULL)
|
2011-09-11 15:59:47 +00:00
|
|
|
{
|
|
|
|
if(param == AL_EFFECT_TYPE)
|
|
|
|
{
|
|
|
|
*piValue = ALEffect->type;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Call the appropriate handler */
|
|
|
|
ALeffect_GetParamiv(ALEffect, Context, param, piValue);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
alSetError(Context, AL_INVALID_NAME);
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 16:13:01 +00:00
|
|
|
ALCcontext_DecRef(Context);
|
2011-09-11 15:59:47 +00:00
|
|
|
}
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
AL_API ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues)
|
|
|
|
{
|
|
|
|
ALCcontext *Context;
|
|
|
|
ALCdevice *Device;
|
|
|
|
ALeffect *ALEffect;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 16:13:01 +00:00
|
|
|
Context = GetContextRef();
|
2011-09-11 15:59:47 +00:00
|
|
|
if(!Context) return;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
Device = Context->Device;
|
2011-09-25 01:34:45 +00:00
|
|
|
if((ALEffect=LookupEffect(Device, effect)) != NULL)
|
2011-09-11 15:59:47 +00:00
|
|
|
{
|
|
|
|
/* Call the appropriate handler */
|
|
|
|
ALeffect_GetParamiv(ALEffect, Context, param, piValues);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
alSetError(Context, AL_INVALID_NAME);
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 16:13:01 +00:00
|
|
|
ALCcontext_DecRef(Context);
|
2011-09-11 15:59:47 +00:00
|
|
|
}
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue)
|
|
|
|
{
|
|
|
|
ALCcontext *Context;
|
|
|
|
ALCdevice *Device;
|
|
|
|
ALeffect *ALEffect;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 16:13:01 +00:00
|
|
|
Context = GetContextRef();
|
2011-09-11 15:59:47 +00:00
|
|
|
if(!Context) return;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
Device = Context->Device;
|
2011-09-25 01:34:45 +00:00
|
|
|
if((ALEffect=LookupEffect(Device, effect)) != NULL)
|
2011-09-11 15:59:47 +00:00
|
|
|
{
|
|
|
|
/* Call the appropriate handler */
|
|
|
|
ALeffect_GetParamf(ALEffect, Context, param, pflValue);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
alSetError(Context, AL_INVALID_NAME);
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 16:13:01 +00:00
|
|
|
ALCcontext_DecRef(Context);
|
2011-09-11 15:59:47 +00:00
|
|
|
}
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues)
|
|
|
|
{
|
|
|
|
ALCcontext *Context;
|
|
|
|
ALCdevice *Device;
|
|
|
|
ALeffect *ALEffect;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 16:13:01 +00:00
|
|
|
Context = GetContextRef();
|
2011-09-11 15:59:47 +00:00
|
|
|
if(!Context) return;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
Device = Context->Device;
|
2011-09-25 01:34:45 +00:00
|
|
|
if((ALEffect=LookupEffect(Device, effect)) != NULL)
|
2011-09-11 15:59:47 +00:00
|
|
|
{
|
|
|
|
/* Call the appropriate handler */
|
|
|
|
ALeffect_GetParamfv(ALEffect, Context, param, pflValues);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
alSetError(Context, AL_INVALID_NAME);
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 16:13:01 +00:00
|
|
|
ALCcontext_DecRef(Context);
|
2011-09-11 15:59:47 +00:00
|
|
|
}
|
2009-05-29 08:32:54 +00:00
|
|
|
|
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
static void eaxreverb_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
|
|
|
|
{
|
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_EAXREVERB_DECAY_HFLIMIT:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_DECAY_HFLIMIT && val <= AL_EAXREVERB_MAX_DECAY_HFLIMIT)
|
|
|
|
effect->Reverb.DecayHFLimit = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
default:
|
|
|
|
alSetError(context, AL_INVALID_ENUM);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static void eaxreverb_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
|
|
|
|
{
|
|
|
|
eaxreverb_SetParami(effect, context, param, vals[0]);
|
|
|
|
}
|
|
|
|
static void eaxreverb_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
|
|
|
|
{
|
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_EAXREVERB_DENSITY:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_DENSITY &&
|
|
|
|
val <= AL_EAXREVERB_MAX_DENSITY)
|
|
|
|
effect->Reverb.Density = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_DIFFUSION:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_DIFFUSION &&
|
|
|
|
val <= AL_EAXREVERB_MAX_DIFFUSION)
|
|
|
|
effect->Reverb.Diffusion = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_GAIN:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_GAIN &&
|
|
|
|
val <= AL_EAXREVERB_MAX_GAIN)
|
|
|
|
effect->Reverb.Gain = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_GAINHF:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_GAINHF &&
|
|
|
|
val <= AL_EAXREVERB_MAX_GAINHF)
|
|
|
|
effect->Reverb.GainHF = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_GAINLF:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_GAINLF &&
|
|
|
|
val <= AL_EAXREVERB_MAX_GAINLF)
|
|
|
|
effect->Reverb.GainLF = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_DECAY_TIME:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_DECAY_TIME &&
|
|
|
|
val <= AL_EAXREVERB_MAX_DECAY_TIME)
|
|
|
|
effect->Reverb.DecayTime = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_DECAY_HFRATIO:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_DECAY_HFRATIO &&
|
|
|
|
val <= AL_EAXREVERB_MAX_DECAY_HFRATIO)
|
|
|
|
effect->Reverb.DecayHFRatio = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_DECAY_LFRATIO:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_DECAY_LFRATIO &&
|
|
|
|
val <= AL_EAXREVERB_MAX_DECAY_LFRATIO)
|
|
|
|
effect->Reverb.DecayLFRatio = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_REFLECTIONS_GAIN:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_REFLECTIONS_GAIN &&
|
|
|
|
val <= AL_EAXREVERB_MAX_REFLECTIONS_GAIN)
|
|
|
|
effect->Reverb.ReflectionsGain = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_REFLECTIONS_DELAY:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_REFLECTIONS_DELAY &&
|
|
|
|
val <= AL_EAXREVERB_MAX_REFLECTIONS_DELAY)
|
|
|
|
effect->Reverb.ReflectionsDelay = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_LATE_REVERB_GAIN:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_LATE_REVERB_GAIN &&
|
|
|
|
val <= AL_EAXREVERB_MAX_LATE_REVERB_GAIN)
|
|
|
|
effect->Reverb.LateReverbGain = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_LATE_REVERB_DELAY:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_LATE_REVERB_DELAY &&
|
|
|
|
val <= AL_EAXREVERB_MAX_LATE_REVERB_DELAY)
|
|
|
|
effect->Reverb.LateReverbDelay = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_AIR_ABSORPTION_GAINHF:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_AIR_ABSORPTION_GAINHF &&
|
|
|
|
val <= AL_EAXREVERB_MAX_AIR_ABSORPTION_GAINHF)
|
|
|
|
effect->Reverb.AirAbsorptionGainHF = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2009-04-12 23:01:10 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_ECHO_TIME:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_ECHO_TIME &&
|
|
|
|
val <= AL_EAXREVERB_MAX_ECHO_TIME)
|
|
|
|
effect->Reverb.EchoTime = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2009-04-12 23:01:10 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_ECHO_DEPTH:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_ECHO_DEPTH &&
|
|
|
|
val <= AL_EAXREVERB_MAX_ECHO_DEPTH)
|
|
|
|
effect->Reverb.EchoDepth = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2009-04-12 23:01:10 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_MODULATION_TIME:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_MODULATION_TIME &&
|
|
|
|
val <= AL_EAXREVERB_MAX_MODULATION_TIME)
|
|
|
|
effect->Reverb.ModulationTime = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2009-04-12 23:01:10 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_MODULATION_DEPTH:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_MODULATION_DEPTH &&
|
|
|
|
val <= AL_EAXREVERB_MAX_MODULATION_DEPTH)
|
|
|
|
effect->Reverb.ModulationDepth = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2009-04-12 23:01:10 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_HFREFERENCE:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_HFREFERENCE &&
|
|
|
|
val <= AL_EAXREVERB_MAX_HFREFERENCE)
|
|
|
|
effect->Reverb.HFReference = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2010-04-08 15:54:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_LFREFERENCE:
|
|
|
|
if(val >= AL_EAXREVERB_MIN_LFREFERENCE &&
|
|
|
|
val <= AL_EAXREVERB_MAX_LFREFERENCE)
|
|
|
|
effect->Reverb.LFReference = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2010-04-08 15:54:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_ROOM_ROLLOFF_FACTOR:
|
|
|
|
if(val >= 0.0f && val <= 10.0f)
|
|
|
|
effect->Reverb.RoomRolloffFactor = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
alSetError(context, AL_INVALID_ENUM);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static void eaxreverb_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
|
|
|
|
{
|
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_EAXREVERB_REFLECTIONS_PAN:
|
|
|
|
if(isfinite(vals[0]) && isfinite(vals[1]) && isfinite(vals[2]))
|
|
|
|
{
|
2011-09-11 16:13:01 +00:00
|
|
|
LockContext(context);
|
2011-09-11 15:59:47 +00:00
|
|
|
effect->Reverb.ReflectionsPan[0] = vals[0];
|
|
|
|
effect->Reverb.ReflectionsPan[1] = vals[1];
|
|
|
|
effect->Reverb.ReflectionsPan[2] = vals[2];
|
2011-09-11 16:13:01 +00:00
|
|
|
UnlockContext(context);
|
2010-04-08 15:54:28 +00:00
|
|
|
}
|
2011-09-11 15:59:47 +00:00
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
|
|
|
case AL_EAXREVERB_LATE_REVERB_PAN:
|
|
|
|
if(isfinite(vals[0]) && isfinite(vals[1]) && isfinite(vals[2]))
|
2011-03-13 04:11:25 +00:00
|
|
|
{
|
2011-09-11 16:13:01 +00:00
|
|
|
LockContext(context);
|
2011-09-11 15:59:47 +00:00
|
|
|
effect->Reverb.LateReverbPan[0] = vals[0];
|
|
|
|
effect->Reverb.LateReverbPan[1] = vals[1];
|
|
|
|
effect->Reverb.LateReverbPan[2] = vals[2];
|
2011-09-11 16:13:01 +00:00
|
|
|
UnlockContext(context);
|
2011-03-13 04:11:25 +00:00
|
|
|
}
|
2011-09-11 15:59:47 +00:00
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
default:
|
|
|
|
eaxreverb_SetParamf(effect, context, param, vals[0]);
|
|
|
|
break;
|
|
|
|
}
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
static void eaxreverb_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2011-09-11 15:59:47 +00:00
|
|
|
switch(param)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_DECAY_HFLIMIT:
|
|
|
|
*val = effect->Reverb.DecayHFLimit;
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
default:
|
|
|
|
alSetError(context, AL_INVALID_ENUM);
|
|
|
|
break;
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
2011-09-11 15:59:47 +00:00
|
|
|
}
|
|
|
|
static void eaxreverb_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
|
|
|
|
{
|
|
|
|
eaxreverb_GetParami(effect, context, param, vals);
|
|
|
|
}
|
|
|
|
static void eaxreverb_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
|
|
|
|
{
|
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_EAXREVERB_DENSITY:
|
|
|
|
*val = effect->Reverb.Density;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_EAXREVERB_DIFFUSION:
|
|
|
|
*val = effect->Reverb.Diffusion;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_EAXREVERB_GAIN:
|
|
|
|
*val = effect->Reverb.Gain;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_EAXREVERB_GAINHF:
|
|
|
|
*val = effect->Reverb.GainHF;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_EAXREVERB_GAINLF:
|
|
|
|
*val = effect->Reverb.GainLF;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_EAXREVERB_DECAY_TIME:
|
|
|
|
*val = effect->Reverb.DecayTime;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_EAXREVERB_DECAY_HFRATIO:
|
|
|
|
*val = effect->Reverb.DecayHFRatio;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_EAXREVERB_DECAY_LFRATIO:
|
|
|
|
*val = effect->Reverb.DecayLFRatio;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_EAXREVERB_REFLECTIONS_GAIN:
|
|
|
|
*val = effect->Reverb.ReflectionsGain;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_EAXREVERB_REFLECTIONS_DELAY:
|
|
|
|
*val = effect->Reverb.ReflectionsDelay;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_EAXREVERB_LATE_REVERB_GAIN:
|
|
|
|
*val = effect->Reverb.LateReverbGain;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_EAXREVERB_LATE_REVERB_DELAY:
|
|
|
|
*val = effect->Reverb.LateReverbDelay;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_EAXREVERB_AIR_ABSORPTION_GAINHF:
|
|
|
|
*val = effect->Reverb.AirAbsorptionGainHF;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_EAXREVERB_ECHO_TIME:
|
|
|
|
*val = effect->Reverb.EchoTime;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_EAXREVERB_ECHO_DEPTH:
|
|
|
|
*val = effect->Reverb.EchoDepth;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_EAXREVERB_MODULATION_TIME:
|
|
|
|
*val = effect->Reverb.ModulationTime;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_EAXREVERB_MODULATION_DEPTH:
|
|
|
|
*val = effect->Reverb.ModulationDepth;
|
|
|
|
break;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_HFREFERENCE:
|
|
|
|
*val = effect->Reverb.HFReference;
|
|
|
|
break;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_LFREFERENCE:
|
|
|
|
*val = effect->Reverb.LFReference;
|
|
|
|
break;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_ROOM_ROLLOFF_FACTOR:
|
|
|
|
*val = effect->Reverb.RoomRolloffFactor;
|
|
|
|
break;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
default:
|
|
|
|
alSetError(context, AL_INVALID_ENUM);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static void eaxreverb_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
|
|
|
|
{
|
|
|
|
switch(param)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_EAXREVERB_REFLECTIONS_PAN:
|
2011-09-11 16:13:01 +00:00
|
|
|
LockContext(context);
|
2011-09-11 15:59:47 +00:00
|
|
|
vals[0] = effect->Reverb.ReflectionsPan[0];
|
|
|
|
vals[1] = effect->Reverb.ReflectionsPan[1];
|
|
|
|
vals[2] = effect->Reverb.ReflectionsPan[2];
|
2011-09-11 16:13:01 +00:00
|
|
|
UnlockContext(context);
|
2011-09-11 15:59:47 +00:00
|
|
|
break;
|
|
|
|
case AL_EAXREVERB_LATE_REVERB_PAN:
|
2011-09-11 16:13:01 +00:00
|
|
|
LockContext(context);
|
2011-09-11 15:59:47 +00:00
|
|
|
vals[0] = effect->Reverb.LateReverbPan[0];
|
|
|
|
vals[1] = effect->Reverb.LateReverbPan[1];
|
|
|
|
vals[2] = effect->Reverb.LateReverbPan[2];
|
2011-09-11 16:13:01 +00:00
|
|
|
UnlockContext(context);
|
2011-09-11 15:59:47 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
eaxreverb_GetParamf(effect, context, param, vals);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2007-12-19 02:15:52 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
static void reverb_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
|
|
|
|
{
|
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_REVERB_DECAY_HFLIMIT:
|
|
|
|
if(val >= AL_REVERB_MIN_DECAY_HFLIMIT &&
|
|
|
|
val <= AL_REVERB_MAX_DECAY_HFLIMIT)
|
|
|
|
effect->Reverb.DecayHFLimit = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2010-04-08 15:54:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
default:
|
|
|
|
alSetError(context, AL_INVALID_ENUM);
|
|
|
|
break;
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
|
|
|
}
|
2011-09-11 15:59:47 +00:00
|
|
|
static void reverb_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2011-09-11 15:59:47 +00:00
|
|
|
reverb_SetParami(effect, context, param, vals[0]);
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
2011-09-11 15:59:47 +00:00
|
|
|
static void reverb_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2011-09-11 15:59:47 +00:00
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_REVERB_DENSITY:
|
|
|
|
if(val >= AL_REVERB_MIN_DENSITY &&
|
|
|
|
val <= AL_REVERB_MAX_DENSITY)
|
|
|
|
effect->Reverb.Density = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_DIFFUSION:
|
|
|
|
if(val >= AL_REVERB_MIN_DIFFUSION &&
|
|
|
|
val <= AL_REVERB_MAX_DIFFUSION)
|
|
|
|
effect->Reverb.Diffusion = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_GAIN:
|
|
|
|
if(val >= AL_REVERB_MIN_GAIN &&
|
|
|
|
val <= AL_REVERB_MAX_GAIN)
|
|
|
|
effect->Reverb.Gain = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_GAINHF:
|
|
|
|
if(val >= AL_REVERB_MIN_GAINHF &&
|
|
|
|
val <= AL_REVERB_MAX_GAINHF)
|
|
|
|
effect->Reverb.GainHF = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_DECAY_TIME:
|
|
|
|
if(val >= AL_REVERB_MIN_DECAY_TIME &&
|
|
|
|
val <= AL_REVERB_MAX_DECAY_TIME)
|
|
|
|
effect->Reverb.DecayTime = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_DECAY_HFRATIO:
|
|
|
|
if(val >= AL_REVERB_MIN_DECAY_HFRATIO &&
|
|
|
|
val <= AL_REVERB_MAX_DECAY_HFRATIO)
|
|
|
|
effect->Reverb.DecayHFRatio = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_REFLECTIONS_GAIN:
|
|
|
|
if(val >= AL_REVERB_MIN_REFLECTIONS_GAIN &&
|
|
|
|
val <= AL_REVERB_MAX_REFLECTIONS_GAIN)
|
|
|
|
effect->Reverb.ReflectionsGain = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_REFLECTIONS_DELAY:
|
|
|
|
if(val >= AL_REVERB_MIN_REFLECTIONS_DELAY &&
|
|
|
|
val <= AL_REVERB_MAX_REFLECTIONS_DELAY)
|
|
|
|
effect->Reverb.ReflectionsDelay = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_LATE_REVERB_GAIN:
|
|
|
|
if(val >= AL_REVERB_MIN_LATE_REVERB_GAIN &&
|
|
|
|
val <= AL_REVERB_MAX_LATE_REVERB_GAIN)
|
|
|
|
effect->Reverb.LateReverbGain = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_LATE_REVERB_DELAY:
|
|
|
|
if(val >= AL_REVERB_MIN_LATE_REVERB_DELAY &&
|
|
|
|
val <= AL_REVERB_MAX_LATE_REVERB_DELAY)
|
|
|
|
effect->Reverb.LateReverbDelay = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_AIR_ABSORPTION_GAINHF:
|
|
|
|
if(val >= AL_REVERB_MIN_AIR_ABSORPTION_GAINHF &&
|
|
|
|
val <= AL_REVERB_MAX_AIR_ABSORPTION_GAINHF)
|
|
|
|
effect->Reverb.AirAbsorptionGainHF = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_ROOM_ROLLOFF_FACTOR:
|
|
|
|
if(val >= AL_REVERB_MIN_ROOM_ROLLOFF_FACTOR &&
|
|
|
|
val <= AL_REVERB_MAX_ROOM_ROLLOFF_FACTOR)
|
|
|
|
effect->Reverb.RoomRolloffFactor = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
default:
|
|
|
|
alSetError(context, AL_INVALID_ENUM);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static void reverb_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
|
|
|
|
{
|
|
|
|
reverb_SetParamf(effect, context, param, vals[0]);
|
|
|
|
}
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
static void reverb_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
|
|
|
|
{
|
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_REVERB_DECAY_HFLIMIT:
|
|
|
|
*val = effect->Reverb.DecayHFLimit;
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
default:
|
|
|
|
alSetError(context, AL_INVALID_ENUM);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static void reverb_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
|
|
|
|
{
|
|
|
|
reverb_GetParami(effect, context, param, vals);
|
|
|
|
}
|
|
|
|
static void reverb_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
|
|
|
|
{
|
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_REVERB_DENSITY:
|
|
|
|
*val = effect->Reverb.Density;
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_DIFFUSION:
|
|
|
|
*val = effect->Reverb.Diffusion;
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_GAIN:
|
|
|
|
*val = effect->Reverb.Gain;
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_GAINHF:
|
|
|
|
*val = effect->Reverb.GainHF;
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_DECAY_TIME:
|
|
|
|
*val = effect->Reverb.DecayTime;
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_DECAY_HFRATIO:
|
|
|
|
*val = effect->Reverb.DecayHFRatio;
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_REFLECTIONS_GAIN:
|
|
|
|
*val = effect->Reverb.ReflectionsGain;
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_REFLECTIONS_DELAY:
|
|
|
|
*val = effect->Reverb.ReflectionsDelay;
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_LATE_REVERB_GAIN:
|
|
|
|
*val = effect->Reverb.LateReverbGain;
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_LATE_REVERB_DELAY:
|
|
|
|
*val = effect->Reverb.LateReverbDelay;
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_AIR_ABSORPTION_GAINHF:
|
|
|
|
*val = effect->Reverb.AirAbsorptionGainHF;
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_REVERB_ROOM_ROLLOFF_FACTOR:
|
|
|
|
*val = effect->Reverb.RoomRolloffFactor;
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
default:
|
|
|
|
alSetError(context, AL_INVALID_ENUM);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static void reverb_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
|
|
|
|
{
|
|
|
|
reverb_GetParamf(effect, context, param, vals);
|
|
|
|
}
|
2008-01-16 07:32:28 +00:00
|
|
|
|
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
static void echo_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
|
|
|
|
{ (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
|
|
|
|
static void echo_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
|
|
|
|
{
|
|
|
|
echo_SetParami(effect, context, param, vals[0]);
|
|
|
|
}
|
|
|
|
static void echo_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
|
|
|
|
{
|
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_ECHO_DELAY:
|
|
|
|
if(val >= AL_ECHO_MIN_DELAY && val <= AL_ECHO_MAX_DELAY)
|
|
|
|
effect->Echo.Delay = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_ECHO_LRDELAY:
|
|
|
|
if(val >= AL_ECHO_MIN_LRDELAY && val <= AL_ECHO_MAX_LRDELAY)
|
|
|
|
effect->Echo.LRDelay = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_ECHO_DAMPING:
|
|
|
|
if(val >= AL_ECHO_MIN_DAMPING && val <= AL_ECHO_MAX_DAMPING)
|
|
|
|
effect->Echo.Damping = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_ECHO_FEEDBACK:
|
|
|
|
if(val >= AL_ECHO_MIN_FEEDBACK && val <= AL_ECHO_MAX_FEEDBACK)
|
|
|
|
effect->Echo.Feedback = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_ECHO_SPREAD:
|
|
|
|
if(val >= AL_ECHO_MIN_SPREAD && val <= AL_ECHO_MAX_SPREAD)
|
|
|
|
effect->Echo.Spread = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
default:
|
|
|
|
alSetError(context, AL_INVALID_ENUM);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static void echo_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
|
|
|
|
{
|
|
|
|
echo_SetParamf(effect, context, param, vals[0]);
|
|
|
|
}
|
2008-01-16 07:32:28 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
static void echo_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
|
|
|
|
{ (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
|
|
|
|
static void echo_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
|
|
|
|
{
|
|
|
|
echo_GetParami(effect, context, param, vals);
|
|
|
|
}
|
|
|
|
static void echo_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
|
|
|
|
{
|
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_ECHO_DELAY:
|
|
|
|
*val = effect->Echo.Delay;
|
|
|
|
break;
|
2009-04-12 23:01:10 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_ECHO_LRDELAY:
|
|
|
|
*val = effect->Echo.LRDelay;
|
|
|
|
break;
|
2009-04-12 23:01:10 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_ECHO_DAMPING:
|
|
|
|
*val = effect->Echo.Damping;
|
|
|
|
break;
|
2009-04-12 23:01:10 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_ECHO_FEEDBACK:
|
|
|
|
*val = effect->Echo.Feedback;
|
|
|
|
break;
|
2009-04-12 23:01:10 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_ECHO_SPREAD:
|
|
|
|
*val = effect->Echo.Spread;
|
|
|
|
break;
|
2009-04-12 23:01:10 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
default:
|
|
|
|
alSetError(context, AL_INVALID_ENUM);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static void echo_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
|
|
|
|
{
|
|
|
|
echo_GetParamf(effect, context, param, vals);
|
|
|
|
}
|
2010-04-08 15:54:28 +00:00
|
|
|
|
2011-03-13 04:11:25 +00:00
|
|
|
|
2011-09-22 07:35:08 +00:00
|
|
|
static void mod_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
|
2011-09-11 15:59:47 +00:00
|
|
|
{
|
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_RING_MODULATOR_FREQUENCY:
|
|
|
|
if(val >= AL_RING_MODULATOR_MIN_FREQUENCY &&
|
|
|
|
val <= AL_RING_MODULATOR_MAX_FREQUENCY)
|
|
|
|
effect->Modulator.Frequency = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
|
|
|
|
if(val >= AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF &&
|
|
|
|
val <= AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF)
|
|
|
|
effect->Modulator.HighPassCutoff = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
alSetError(context, AL_INVALID_ENUM);
|
|
|
|
break;
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
2011-09-11 15:59:47 +00:00
|
|
|
}
|
2011-09-22 07:35:08 +00:00
|
|
|
static void mod_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
|
2011-09-11 15:59:47 +00:00
|
|
|
{
|
2011-09-22 07:35:08 +00:00
|
|
|
mod_SetParamf(effect, context, param, vals[0]);
|
2011-09-11 15:59:47 +00:00
|
|
|
}
|
2011-09-22 07:35:08 +00:00
|
|
|
static void mod_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
|
2011-09-11 15:59:47 +00:00
|
|
|
{
|
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_RING_MODULATOR_FREQUENCY:
|
2011-09-22 07:35:08 +00:00
|
|
|
case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
|
|
|
|
mod_SetParamf(effect, context, param, (ALfloat)val);
|
2011-09-11 15:59:47 +00:00
|
|
|
break;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2011-09-22 07:35:08 +00:00
|
|
|
case AL_RING_MODULATOR_WAVEFORM:
|
|
|
|
if(val >= AL_RING_MODULATOR_MIN_WAVEFORM &&
|
|
|
|
val <= AL_RING_MODULATOR_MAX_WAVEFORM)
|
|
|
|
effect->Modulator.Waveform = val;
|
2011-09-11 15:59:47 +00:00
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
alSetError(context, AL_INVALID_ENUM);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2011-09-22 07:35:08 +00:00
|
|
|
static void mod_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
|
2011-09-11 15:59:47 +00:00
|
|
|
{
|
2011-09-22 07:35:08 +00:00
|
|
|
mod_SetParami(effect, context, param, vals[0]);
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
static void mod_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2011-09-11 15:59:47 +00:00
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_RING_MODULATOR_FREQUENCY:
|
|
|
|
*val = (ALint)effect->Modulator.Frequency;
|
|
|
|
break;
|
|
|
|
case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
|
|
|
|
*val = (ALint)effect->Modulator.HighPassCutoff;
|
|
|
|
break;
|
|
|
|
case AL_RING_MODULATOR_WAVEFORM:
|
|
|
|
*val = effect->Modulator.Waveform;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
alSetError(context, AL_INVALID_ENUM);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static void mod_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
|
|
|
|
{
|
|
|
|
mod_GetParami(effect, context, param, vals);
|
|
|
|
}
|
|
|
|
static void mod_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
|
|
|
|
{
|
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_RING_MODULATOR_FREQUENCY:
|
|
|
|
*val = effect->Modulator.Frequency;
|
|
|
|
break;
|
|
|
|
case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
|
|
|
|
*val = effect->Modulator.HighPassCutoff;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
alSetError(context, AL_INVALID_ENUM);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static void mod_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
|
|
|
|
{
|
|
|
|
mod_GetParamf(effect, context, param, vals);
|
|
|
|
}
|
2007-12-18 01:20:11 +00:00
|
|
|
|
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
static void ded_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
|
|
|
|
{ (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
|
|
|
|
static void ded_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
|
|
|
|
{
|
|
|
|
ded_SetParami(effect, context, param, vals[0]);
|
|
|
|
}
|
|
|
|
static void ded_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
|
|
|
|
{
|
|
|
|
switch(param)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2011-09-11 15:59:47 +00:00
|
|
|
case AL_DEDICATED_GAIN:
|
|
|
|
if(val >= 0.0f && isfinite(val))
|
|
|
|
effect->Dedicated.Gain = val;
|
|
|
|
else
|
|
|
|
alSetError(context, AL_INVALID_VALUE);
|
|
|
|
break;
|
2009-05-29 08:32:54 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
default:
|
|
|
|
alSetError(context, AL_INVALID_ENUM);
|
|
|
|
break;
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
2011-09-11 15:59:47 +00:00
|
|
|
}
|
|
|
|
static void ded_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
|
|
|
|
{
|
|
|
|
ded_SetParamf(effect, context, param, vals[0]);
|
|
|
|
}
|
2007-12-18 01:20:11 +00:00
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
static void ded_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
|
|
|
|
{ (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
|
|
|
|
static void ded_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
|
|
|
|
{
|
|
|
|
ded_GetParami(effect, context, param, vals);
|
|
|
|
}
|
|
|
|
static void ded_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
|
|
|
|
{
|
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_DEDICATED_GAIN:
|
|
|
|
*val = effect->Dedicated.Gain;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
alSetError(context, AL_INVALID_ENUM);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static void ded_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
|
|
|
|
{
|
|
|
|
ded_GetParamf(effect, context, param, vals);
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-09-11 15:59:47 +00:00
|
|
|
static void null_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
|
|
|
|
{ (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
|
|
|
|
static void null_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
|
|
|
|
{ (void)effect;(void)param;(void)vals; alSetError(context, AL_INVALID_ENUM); }
|
|
|
|
static void null_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
|
|
|
|
{ (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
|
|
|
|
static void null_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
|
|
|
|
{ (void)effect;(void)param;(void)vals; alSetError(context, AL_INVALID_ENUM); }
|
|
|
|
|
|
|
|
static void null_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
|
|
|
|
{ (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
|
|
|
|
static void null_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
|
|
|
|
{ (void)effect;(void)param;(void)vals; alSetError(context, AL_INVALID_ENUM); }
|
|
|
|
static void null_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
|
|
|
|
{ (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
|
|
|
|
static void null_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
|
|
|
|
{ (void)effect;(void)param;(void)vals; alSetError(context, AL_INVALID_ENUM); }
|
|
|
|
|
|
|
|
|
2012-01-21 00:23:15 +00:00
|
|
|
ALenum InitEffect(ALeffect *effect)
|
|
|
|
{
|
|
|
|
InitEffectParams(effect, AL_EFFECT_NULL);
|
|
|
|
return AL_NO_ERROR;
|
|
|
|
}
|
|
|
|
|
2009-08-15 16:39:18 +00:00
|
|
|
ALvoid ReleaseALEffects(ALCdevice *device)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2010-05-19 00:41:06 +00:00
|
|
|
ALsizei i;
|
|
|
|
for(i = 0;i < device->EffectMap.size;i++)
|
2007-12-18 01:20:11 +00:00
|
|
|
{
|
2010-05-19 00:41:06 +00:00
|
|
|
ALeffect *temp = device->EffectMap.array[i].value;
|
|
|
|
device->EffectMap.array[i].value = NULL;
|
2007-12-18 01:20:11 +00:00
|
|
|
|
|
|
|
// Release effect structure
|
2011-08-22 14:40:14 +00:00
|
|
|
FreeThunkEntry(temp->effect);
|
2007-12-18 01:20:11 +00:00
|
|
|
memset(temp, 0, sizeof(ALeffect));
|
|
|
|
free(temp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void InitEffectParams(ALeffect *effect, ALenum type)
|
|
|
|
{
|
2008-01-16 07:32:28 +00:00
|
|
|
switch(type)
|
|
|
|
{
|
2009-05-29 08:32:54 +00:00
|
|
|
case AL_EFFECT_EAXREVERB:
|
2011-09-11 14:42:23 +00:00
|
|
|
effect->Reverb.Density = AL_EAXREVERB_DEFAULT_DENSITY;
|
|
|
|
effect->Reverb.Diffusion = AL_EAXREVERB_DEFAULT_DIFFUSION;
|
|
|
|
effect->Reverb.Gain = AL_EAXREVERB_DEFAULT_GAIN;
|
|
|
|
effect->Reverb.GainHF = AL_EAXREVERB_DEFAULT_GAINHF;
|
|
|
|
effect->Reverb.GainLF = AL_EAXREVERB_DEFAULT_GAINLF;
|
|
|
|
effect->Reverb.DecayTime = AL_EAXREVERB_DEFAULT_DECAY_TIME;
|
|
|
|
effect->Reverb.DecayHFRatio = AL_EAXREVERB_DEFAULT_DECAY_HFRATIO;
|
|
|
|
effect->Reverb.DecayLFRatio = AL_EAXREVERB_DEFAULT_DECAY_LFRATIO;
|
|
|
|
effect->Reverb.ReflectionsGain = AL_EAXREVERB_DEFAULT_REFLECTIONS_GAIN;
|
|
|
|
effect->Reverb.ReflectionsDelay = AL_EAXREVERB_DEFAULT_REFLECTIONS_DELAY;
|
|
|
|
effect->Reverb.ReflectionsPan[0] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ;
|
|
|
|
effect->Reverb.ReflectionsPan[1] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ;
|
|
|
|
effect->Reverb.ReflectionsPan[2] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ;
|
|
|
|
effect->Reverb.LateReverbGain = AL_EAXREVERB_DEFAULT_LATE_REVERB_GAIN;
|
|
|
|
effect->Reverb.LateReverbDelay = AL_EAXREVERB_DEFAULT_LATE_REVERB_DELAY;
|
|
|
|
effect->Reverb.LateReverbPan[0] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ;
|
|
|
|
effect->Reverb.LateReverbPan[1] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ;
|
|
|
|
effect->Reverb.LateReverbPan[2] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ;
|
|
|
|
effect->Reverb.EchoTime = AL_EAXREVERB_DEFAULT_ECHO_TIME;
|
|
|
|
effect->Reverb.EchoDepth = AL_EAXREVERB_DEFAULT_ECHO_DEPTH;
|
|
|
|
effect->Reverb.ModulationTime = AL_EAXREVERB_DEFAULT_MODULATION_TIME;
|
|
|
|
effect->Reverb.ModulationDepth = AL_EAXREVERB_DEFAULT_MODULATION_DEPTH;
|
|
|
|
effect->Reverb.AirAbsorptionGainHF = AL_EAXREVERB_DEFAULT_AIR_ABSORPTION_GAINHF;
|
|
|
|
effect->Reverb.HFReference = AL_EAXREVERB_DEFAULT_HFREFERENCE;
|
|
|
|
effect->Reverb.LFReference = AL_EAXREVERB_DEFAULT_LFREFERENCE;
|
|
|
|
effect->Reverb.RoomRolloffFactor = AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR;
|
|
|
|
effect->Reverb.DecayHFLimit = AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT;
|
2011-09-11 15:59:47 +00:00
|
|
|
effect->SetParami = eaxreverb_SetParami;
|
|
|
|
effect->SetParamiv = eaxreverb_SetParamiv;
|
|
|
|
effect->SetParamf = eaxreverb_SetParamf;
|
|
|
|
effect->SetParamfv = eaxreverb_SetParamfv;
|
|
|
|
effect->GetParami = eaxreverb_GetParami;
|
|
|
|
effect->GetParamiv = eaxreverb_GetParamiv;
|
|
|
|
effect->GetParamf = eaxreverb_GetParamf;
|
|
|
|
effect->GetParamfv = eaxreverb_GetParamfv;
|
|
|
|
break;
|
|
|
|
case AL_EFFECT_REVERB:
|
|
|
|
effect->Reverb.Density = AL_REVERB_DEFAULT_DENSITY;
|
|
|
|
effect->Reverb.Diffusion = AL_REVERB_DEFAULT_DIFFUSION;
|
|
|
|
effect->Reverb.Gain = AL_REVERB_DEFAULT_GAIN;
|
|
|
|
effect->Reverb.GainHF = AL_REVERB_DEFAULT_GAINHF;
|
|
|
|
effect->Reverb.DecayTime = AL_REVERB_DEFAULT_DECAY_TIME;
|
|
|
|
effect->Reverb.DecayHFRatio = AL_REVERB_DEFAULT_DECAY_HFRATIO;
|
|
|
|
effect->Reverb.ReflectionsGain = AL_REVERB_DEFAULT_REFLECTIONS_GAIN;
|
|
|
|
effect->Reverb.ReflectionsDelay = AL_REVERB_DEFAULT_REFLECTIONS_DELAY;
|
|
|
|
effect->Reverb.LateReverbGain = AL_REVERB_DEFAULT_LATE_REVERB_GAIN;
|
|
|
|
effect->Reverb.LateReverbDelay = AL_REVERB_DEFAULT_LATE_REVERB_DELAY;
|
|
|
|
effect->Reverb.AirAbsorptionGainHF = AL_REVERB_DEFAULT_AIR_ABSORPTION_GAINHF;
|
|
|
|
effect->Reverb.RoomRolloffFactor = AL_REVERB_DEFAULT_ROOM_ROLLOFF_FACTOR;
|
|
|
|
effect->Reverb.DecayHFLimit = AL_REVERB_DEFAULT_DECAY_HFLIMIT;
|
|
|
|
effect->SetParami = reverb_SetParami;
|
|
|
|
effect->SetParamiv = reverb_SetParamiv;
|
|
|
|
effect->SetParamf = reverb_SetParamf;
|
|
|
|
effect->SetParamfv = reverb_SetParamfv;
|
|
|
|
effect->GetParami = reverb_GetParami;
|
|
|
|
effect->GetParamiv = reverb_GetParamiv;
|
|
|
|
effect->GetParamf = reverb_GetParamf;
|
|
|
|
effect->GetParamfv = reverb_GetParamfv;
|
2008-01-16 07:32:28 +00:00
|
|
|
break;
|
2009-04-12 23:01:10 +00:00
|
|
|
case AL_EFFECT_ECHO:
|
2011-09-11 14:42:23 +00:00
|
|
|
effect->Echo.Delay = AL_ECHO_DEFAULT_DELAY;
|
|
|
|
effect->Echo.LRDelay = AL_ECHO_DEFAULT_LRDELAY;
|
|
|
|
effect->Echo.Damping = AL_ECHO_DEFAULT_DAMPING;
|
|
|
|
effect->Echo.Feedback = AL_ECHO_DEFAULT_FEEDBACK;
|
|
|
|
effect->Echo.Spread = AL_ECHO_DEFAULT_SPREAD;
|
2011-09-11 15:59:47 +00:00
|
|
|
effect->SetParami = echo_SetParami;
|
|
|
|
effect->SetParamiv = echo_SetParamiv;
|
|
|
|
effect->SetParamf = echo_SetParamf;
|
|
|
|
effect->SetParamfv = echo_SetParamfv;
|
|
|
|
effect->GetParami = echo_GetParami;
|
|
|
|
effect->GetParamiv = echo_GetParamiv;
|
|
|
|
effect->GetParamf = echo_GetParamf;
|
|
|
|
effect->GetParamfv = echo_GetParamfv;
|
2009-04-12 23:01:10 +00:00
|
|
|
break;
|
2010-04-08 15:54:28 +00:00
|
|
|
case AL_EFFECT_RING_MODULATOR:
|
2011-09-11 14:42:23 +00:00
|
|
|
effect->Modulator.Frequency = AL_RING_MODULATOR_DEFAULT_FREQUENCY;
|
|
|
|
effect->Modulator.HighPassCutoff = AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF;
|
|
|
|
effect->Modulator.Waveform = AL_RING_MODULATOR_DEFAULT_WAVEFORM;
|
2011-09-11 15:59:47 +00:00
|
|
|
effect->SetParami = mod_SetParami;
|
|
|
|
effect->SetParamiv = mod_SetParamiv;
|
|
|
|
effect->SetParamf = mod_SetParamf;
|
|
|
|
effect->SetParamfv = mod_SetParamfv;
|
|
|
|
effect->GetParami = mod_GetParami;
|
|
|
|
effect->GetParamiv = mod_GetParamiv;
|
|
|
|
effect->GetParamf = mod_GetParamf;
|
|
|
|
effect->GetParamfv = mod_GetParamfv;
|
2010-04-08 15:54:28 +00:00
|
|
|
break;
|
2011-03-13 04:11:25 +00:00
|
|
|
case AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT:
|
|
|
|
case AL_EFFECT_DEDICATED_DIALOGUE:
|
2011-09-11 14:42:23 +00:00
|
|
|
effect->Dedicated.Gain = 1.0f;
|
2011-09-11 15:59:47 +00:00
|
|
|
effect->SetParami = ded_SetParami;
|
|
|
|
effect->SetParamiv = ded_SetParamiv;
|
|
|
|
effect->SetParamf = ded_SetParamf;
|
|
|
|
effect->SetParamfv = ded_SetParamfv;
|
|
|
|
effect->GetParami = ded_GetParami;
|
|
|
|
effect->GetParamiv = ded_GetParamiv;
|
|
|
|
effect->GetParamf = ded_GetParamf;
|
|
|
|
effect->GetParamfv = ded_GetParamfv;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
effect->SetParami = null_SetParami;
|
|
|
|
effect->SetParamiv = null_SetParamiv;
|
|
|
|
effect->SetParamf = null_SetParamf;
|
|
|
|
effect->SetParamfv = null_SetParamfv;
|
|
|
|
effect->GetParami = null_GetParami;
|
|
|
|
effect->GetParamiv = null_GetParamiv;
|
|
|
|
effect->GetParamf = null_GetParamf;
|
|
|
|
effect->GetParamfv = null_GetParamfv;
|
2011-03-13 04:11:25 +00:00
|
|
|
break;
|
2008-01-16 07:32:28 +00:00
|
|
|
}
|
2011-09-11 16:13:01 +00:00
|
|
|
effect->type = type;
|
2007-12-18 01:20:11 +00:00
|
|
|
}
|
2012-01-20 03:30:03 +00:00
|
|
|
|
|
|
|
|
2012-01-20 04:02:57 +00:00
|
|
|
#include "AL/efx-presets.h"
|
|
|
|
|
|
|
|
#define DECL(x) { #x, EFX_REVERB_PRESET_##x }
|
|
|
|
static const struct {
|
|
|
|
const char name[32];
|
|
|
|
EFXEAXREVERBPROPERTIES props;
|
|
|
|
} reverblist[] = {
|
|
|
|
DECL(GENERIC),
|
|
|
|
DECL(PADDEDCELL),
|
|
|
|
DECL(ROOM),
|
|
|
|
DECL(BATHROOM),
|
|
|
|
DECL(LIVINGROOM),
|
|
|
|
DECL(STONEROOM),
|
|
|
|
DECL(AUDITORIUM),
|
|
|
|
DECL(CONCERTHALL),
|
|
|
|
DECL(CAVE),
|
|
|
|
DECL(ARENA),
|
|
|
|
DECL(HANGAR),
|
|
|
|
DECL(CARPETTEDHALLWAY),
|
|
|
|
DECL(HALLWAY),
|
|
|
|
DECL(STONECORRIDOR),
|
|
|
|
DECL(ALLEY),
|
|
|
|
DECL(FOREST),
|
|
|
|
DECL(CITY),
|
|
|
|
DECL(MOUNTAINS),
|
|
|
|
DECL(QUARRY),
|
|
|
|
DECL(PLAIN),
|
|
|
|
DECL(PARKINGLOT),
|
|
|
|
DECL(SEWERPIPE),
|
|
|
|
DECL(UNDERWATER),
|
|
|
|
DECL(DRUGGED),
|
|
|
|
DECL(DIZZY),
|
|
|
|
DECL(PSYCHOTIC),
|
2012-01-28 07:15:16 +00:00
|
|
|
|
|
|
|
DECL(CASTLE_SMALLROOM),
|
|
|
|
DECL(CASTLE_SHORTPASSAGE),
|
|
|
|
DECL(CASTLE_MEDIUMROOM),
|
|
|
|
DECL(CASTLE_LARGEROOM),
|
|
|
|
DECL(CASTLE_LONGPASSAGE),
|
|
|
|
DECL(CASTLE_HALL),
|
|
|
|
DECL(CASTLE_CUPBOARD),
|
|
|
|
DECL(CASTLE_COURTYARD),
|
|
|
|
DECL(CASTLE_ALCOVE),
|
|
|
|
|
|
|
|
DECL(FACTORY_SMALLROOM),
|
|
|
|
DECL(FACTORY_SHORTPASSAGE),
|
|
|
|
DECL(FACTORY_MEDIUMROOM),
|
|
|
|
DECL(FACTORY_LARGEROOM),
|
|
|
|
DECL(FACTORY_LONGPASSAGE),
|
|
|
|
DECL(FACTORY_HALL),
|
|
|
|
DECL(FACTORY_CUPBOARD),
|
|
|
|
DECL(FACTORY_COURTYARD),
|
|
|
|
DECL(FACTORY_ALCOVE),
|
|
|
|
|
|
|
|
DECL(ICEPALACE_SMALLROOM),
|
|
|
|
DECL(ICEPALACE_SHORTPASSAGE),
|
|
|
|
DECL(ICEPALACE_MEDIUMROOM),
|
|
|
|
DECL(ICEPALACE_LARGEROOM),
|
|
|
|
DECL(ICEPALACE_LONGPASSAGE),
|
|
|
|
DECL(ICEPALACE_HALL),
|
|
|
|
DECL(ICEPALACE_CUPBOARD),
|
|
|
|
DECL(ICEPALACE_COURTYARD),
|
|
|
|
DECL(ICEPALACE_ALCOVE),
|
|
|
|
|
|
|
|
DECL(SPACESTATION_SMALLROOM),
|
|
|
|
DECL(SPACESTATION_SHORTPASSAGE),
|
|
|
|
DECL(SPACESTATION_MEDIUMROOM),
|
|
|
|
DECL(SPACESTATION_LARGEROOM),
|
|
|
|
DECL(SPACESTATION_LONGPASSAGE),
|
|
|
|
DECL(SPACESTATION_HALL),
|
|
|
|
DECL(SPACESTATION_CUPBOARD),
|
|
|
|
DECL(SPACESTATION_ALCOVE),
|
|
|
|
|
|
|
|
DECL(WOODEN_SMALLROOM),
|
|
|
|
DECL(WOODEN_SHORTPASSAGE),
|
|
|
|
DECL(WOODEN_MEDIUMROOM),
|
|
|
|
DECL(WOODEN_LARGEROOM),
|
|
|
|
DECL(WOODEN_LONGPASSAGE),
|
|
|
|
DECL(WOODEN_HALL),
|
|
|
|
DECL(WOODEN_CUPBOARD),
|
|
|
|
DECL(WOODEN_COURTYARD),
|
2012-01-30 06:16:39 +00:00
|
|
|
DECL(WOODEN_ALCOVE),
|
2012-01-28 07:15:16 +00:00
|
|
|
|
|
|
|
DECL(SPORT_EMPTYSTADIUM),
|
|
|
|
DECL(SPORT_SQUASHCOURT),
|
|
|
|
DECL(SPORT_SMALLSWIMMINGPOOL),
|
|
|
|
DECL(SPORT_LARGESWIMMINGPOOL),
|
|
|
|
DECL(SPORT_GYMNASIUM),
|
|
|
|
DECL(SPORT_FULLSTADIUM),
|
|
|
|
DECL(SPORT_STADIUMTANNOY),
|
|
|
|
|
|
|
|
DECL(PREFAB_WORKSHOP),
|
|
|
|
DECL(PREFAB_SCHOOLROOM),
|
|
|
|
DECL(PREFAB_PRACTISEROOM),
|
|
|
|
DECL(PREFAB_OUTHOUSE),
|
|
|
|
DECL(PREFAB_CARAVAN),
|
|
|
|
|
|
|
|
DECL(DOME_TOMB),
|
|
|
|
DECL(PIPE_SMALL),
|
|
|
|
DECL(DOME_SAINTPAULS),
|
|
|
|
DECL(PIPE_LONGTHIN),
|
|
|
|
DECL(PIPE_LARGE),
|
|
|
|
DECL(PIPE_RESONANT),
|
|
|
|
|
|
|
|
DECL(OUTDOORS_BACKYARD),
|
|
|
|
DECL(OUTDOORS_ROLLINGPLAINS),
|
|
|
|
DECL(OUTDOORS_DEEPCANYON),
|
|
|
|
DECL(OUTDOORS_CREEK),
|
|
|
|
DECL(OUTDOORS_VALLEY),
|
|
|
|
|
|
|
|
DECL(MOOD_HEAVEN),
|
|
|
|
DECL(MOOD_HELL),
|
|
|
|
DECL(MOOD_MEMORY),
|
|
|
|
|
|
|
|
DECL(DRIVING_COMMENTATOR),
|
|
|
|
DECL(DRIVING_PITGARAGE),
|
|
|
|
DECL(DRIVING_INCAR_RACER),
|
|
|
|
DECL(DRIVING_INCAR_SPORTS),
|
|
|
|
DECL(DRIVING_INCAR_LUXURY),
|
|
|
|
DECL(DRIVING_FULLGRANDSTAND),
|
|
|
|
DECL(DRIVING_EMPTYGRANDSTAND),
|
|
|
|
DECL(DRIVING_TUNNEL),
|
|
|
|
|
|
|
|
DECL(CITY_STREETS),
|
|
|
|
DECL(CITY_SUBWAY),
|
|
|
|
DECL(CITY_MUSEUM),
|
|
|
|
DECL(CITY_LIBRARY),
|
|
|
|
DECL(CITY_UNDERPASS),
|
|
|
|
DECL(CITY_ABANDONED),
|
|
|
|
|
|
|
|
DECL(DUSTYROOM),
|
|
|
|
DECL(CHAPEL),
|
|
|
|
DECL(SMALLWATERROOM),
|
2012-01-20 04:02:57 +00:00
|
|
|
};
|
2012-01-24 21:29:33 +00:00
|
|
|
#undef DECL
|
|
|
|
static const ALsizei reverblistsize = sizeof(reverblist)/sizeof(reverblist[0]);
|
2012-01-20 04:02:57 +00:00
|
|
|
|
|
|
|
ALvoid GetReverbEffect(const char *name, ALeffect *effect)
|
2012-01-20 03:30:03 +00:00
|
|
|
{
|
2012-01-20 04:02:57 +00:00
|
|
|
int i;
|
|
|
|
|
2012-01-20 23:56:32 +00:00
|
|
|
if(!DisabledEffects[EAXREVERB])
|
|
|
|
InitEffectParams(effect, AL_EFFECT_EAXREVERB);
|
|
|
|
else if(!DisabledEffects[REVERB])
|
|
|
|
InitEffectParams(effect, AL_EFFECT_REVERB);
|
|
|
|
else
|
|
|
|
InitEffectParams(effect, AL_EFFECT_NULL);
|
2012-01-24 21:29:33 +00:00
|
|
|
for(i = 0;i < reverblistsize;i++)
|
2012-01-20 04:02:57 +00:00
|
|
|
{
|
|
|
|
const EFXEAXREVERBPROPERTIES *props;
|
|
|
|
|
|
|
|
if(strcasecmp(name, reverblist[i].name) != 0)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
TRACE("Loading reverb '%s'\n", reverblist[i].name);
|
|
|
|
props = &reverblist[i].props;
|
|
|
|
effect->Reverb.Density = props->flDensity;
|
|
|
|
effect->Reverb.Diffusion = props->flDiffusion;
|
|
|
|
effect->Reverb.Gain = props->flGain;
|
|
|
|
effect->Reverb.GainHF = props->flGainHF;
|
|
|
|
effect->Reverb.GainLF = props->flGainLF;
|
|
|
|
effect->Reverb.DecayTime = props->flDecayTime;
|
|
|
|
effect->Reverb.DecayHFRatio = props->flDecayHFRatio;
|
|
|
|
effect->Reverb.DecayLFRatio = props->flDecayLFRatio;
|
|
|
|
effect->Reverb.ReflectionsGain = props->flReflectionsGain;
|
|
|
|
effect->Reverb.ReflectionsDelay = props->flReflectionsDelay;
|
|
|
|
effect->Reverb.ReflectionsPan[0] = props->flReflectionsPan[0];
|
|
|
|
effect->Reverb.ReflectionsPan[1] = props->flReflectionsPan[1];
|
|
|
|
effect->Reverb.ReflectionsPan[2] = props->flReflectionsPan[2];
|
|
|
|
effect->Reverb.LateReverbGain = props->flLateReverbGain;
|
|
|
|
effect->Reverb.LateReverbDelay = props->flLateReverbDelay;
|
|
|
|
effect->Reverb.LateReverbPan[0] = props->flLateReverbPan[0];
|
|
|
|
effect->Reverb.LateReverbPan[1] = props->flLateReverbPan[1];
|
|
|
|
effect->Reverb.LateReverbPan[2] = props->flLateReverbPan[2];
|
|
|
|
effect->Reverb.EchoTime = props->flEchoTime;
|
|
|
|
effect->Reverb.EchoDepth = props->flEchoDepth;
|
|
|
|
effect->Reverb.ModulationTime = props->flModulationTime;
|
|
|
|
effect->Reverb.ModulationDepth = props->flModulationDepth;
|
|
|
|
effect->Reverb.AirAbsorptionGainHF = props->flAirAbsorptionGainHF;
|
|
|
|
effect->Reverb.HFReference = props->flHFReference;
|
|
|
|
effect->Reverb.LFReference = props->flLFReference;
|
|
|
|
effect->Reverb.RoomRolloffFactor = props->flRoomRolloffFactor;
|
|
|
|
effect->Reverb.DecayHFLimit = props->iDecayHFLimit;
|
|
|
|
break;
|
|
|
|
}
|
2012-01-24 21:29:33 +00:00
|
|
|
if(i == reverblistsize)
|
2012-01-20 04:02:57 +00:00
|
|
|
WARN("Reverb preset '%s' not found\n", name);
|
2012-01-20 03:30:03 +00:00
|
|
|
}
|