Add HF Reference as a filter property
This commit is contained in:
@@ -58,6 +58,7 @@ typedef struct ALfilter {
|
||||
|
||||
ALfloat Gain;
|
||||
ALfloat GainHF;
|
||||
ALfloat HFReference;
|
||||
|
||||
void (*SetParami)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALint val);
|
||||
void (*SetParamiv)(struct ALfilter *filter, ALCcontext *context, ALenum param, const ALint *vals);
|
||||
|
||||
@@ -532,6 +532,7 @@ static void InitFilterParams(ALfilter *filter, ALenum type)
|
||||
{
|
||||
filter->Gain = AL_LOWPASS_DEFAULT_GAIN;
|
||||
filter->GainHF = AL_LOWPASS_DEFAULT_GAINHF;
|
||||
filter->HFReference = LOWPASSFREQREF;
|
||||
|
||||
filter->SetParami = lp_SetParami;
|
||||
filter->SetParamiv = lp_SetParamiv;
|
||||
|
||||
@@ -665,11 +665,13 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SrcIntProp p
|
||||
{
|
||||
Source->Direct.Gain = 1.0f;
|
||||
Source->Direct.GainHF = 1.0f;
|
||||
Source->Direct.HFReference = LOWPASSFREQREF;
|
||||
}
|
||||
else
|
||||
{
|
||||
Source->Direct.Gain = filter->Gain;
|
||||
Source->Direct.GainHF = filter->GainHF;
|
||||
Source->Direct.HFReference = filter->HFReference;
|
||||
}
|
||||
UnlockContext(Context);
|
||||
Source->NeedsUpdate = AL_TRUE;
|
||||
@@ -738,11 +740,13 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SrcIntProp p
|
||||
/* Disable filter */
|
||||
Source->Send[values[1]].Gain = 1.0f;
|
||||
Source->Send[values[1]].GainHF = 1.0f;
|
||||
Source->Send[values[1]].HFReference = LOWPASSFREQREF;
|
||||
}
|
||||
else
|
||||
{
|
||||
Source->Send[values[1]].Gain = filter->Gain;
|
||||
Source->Send[values[1]].GainHF = filter->GainHF;
|
||||
Source->Send[values[1]].HFReference = filter->HFReference;
|
||||
}
|
||||
Source->NeedsUpdate = AL_TRUE;
|
||||
UnlockContext(Context);
|
||||
|
||||
Reference in New Issue
Block a user