diff options
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r-- | Alc/mixer.c | 25 |
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); } } |