aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-05-17 07:54:25 -0700
committerChris Robinson <[email protected]>2014-05-17 07:54:25 -0700
commit82dd2d875e9b7549eaa63f9d1a3e08635aafa524 (patch)
tree7991685c891870e54f4dff7629f7e609bb23d7cd /Alc/mixer.c
parent3a26ebef0bbe62f3143c5cb3de0e108f0bcb8b91 (diff)
Apply high-pass source filters as needed
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r--Alc/mixer.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index ac433e35..32d4d308 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -84,7 +84,8 @@ static void SilenceData(ALfloat *dst, ALuint samples)
}
-static void DoFilters(ALfilterState *lpfilter, ALfloat *restrict dst, const ALfloat *restrict src,
+static void DoFilters(ALfilterState *lpfilter, ALfilterState *hpfilter,
+ ALfloat *restrict dst, const ALfloat *restrict src,
ALuint numsamples, enum ActiveFilters type)
{
ALuint i;
@@ -98,6 +99,18 @@ static void DoFilters(ALfilterState *lpfilter, ALfloat *restrict dst, const ALfl
for(i = 0;i < numsamples;i++)
dst[i] = ALfilterState_processSingle(lpfilter, src[i]);
break;
+
+ case AF_HighPass:
+ for(i = 0;i < numsamples;i++)
+ dst[i] = ALfilterState_processSingle(hpfilter, src[i]);
+ break;
+
+ case AF_BandPass:
+ for(i = 0;i < numsamples;i++)
+ dst[i] = ALfilterState_processSingle(hpfilter,
+ ALfilterState_processSingle(lpfilter, src[i])
+ );
+ break;
}
}
@@ -332,8 +345,9 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
{
DirectParams *directparms = &src->Direct;
- DoFilters(&directparms->LpFilter[chan], SrcData, ResampledData,
- DstBufferSize, directparms->Filters[chan]);
+ DoFilters(&directparms->LpFilter[chan], &directparms->HpFilter[chan],
+ SrcData, ResampledData, DstBufferSize,
+ directparms->Filters[chan]);
src->DryMix(directparms, SrcData, chan, OutPos, DstBufferSize);
}
@@ -343,8 +357,9 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
if(!sendparms->OutBuffer)
continue;
- DoFilters(&sendparms->LpFilter[chan], SrcData, ResampledData,
- DstBufferSize, sendparms->Filters[chan]);
+ DoFilters(&sendparms->LpFilter[chan], &sendparms->HpFilter[chan],
+ SrcData, ResampledData, DstBufferSize,
+ sendparms->Filters[chan]);
src->WetMix(sendparms, SrcData, OutPos, DstBufferSize);
}
}