summaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-07-25 19:31:12 -0700
committerChris Robinson <[email protected]>2008-07-25 19:31:12 -0700
commitc7e49c9f5735df52d4e847529ae9cb23027547e7 (patch)
tree91f78fed57422925b198ed2f20e2ba44b4dbf242 /OpenAL32/Include
parente2ed8ff2bfd1521f849038c400c054b0b6e8a5b0 (diff)
Implement yet another low-pass filter
This one using the Butterworth IIR filter design
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r--OpenAL32/Include/alAuxEffectSlot.h6
-rw-r--r--OpenAL32/Include/alFilter.h8
-rw-r--r--OpenAL32/Include/alSource.h2
3 files changed, 14 insertions, 2 deletions
diff --git a/OpenAL32/Include/alAuxEffectSlot.h b/OpenAL32/Include/alAuxEffectSlot.h
index d4cb0d11..9bae788d 100644
--- a/OpenAL32/Include/alAuxEffectSlot.h
+++ b/OpenAL32/Include/alAuxEffectSlot.h
@@ -1,8 +1,9 @@
#ifndef _AL_AUXEFFECTSLOT_H_
#define _AL_AUXEFFECTSLOT_H_
-#include "alEffect.h"
#include "AL/al.h"
+#include "alEffect.h"
+#include "alFilter.h"
#ifdef __cplusplus
extern "C" {
@@ -28,7 +29,8 @@ typedef struct ALeffectslot
ALuint ReverbReflectPos;
ALuint ReverbLatePos;
ALfloat ReverbDecayGain;
- ALfloat LastDecaySample;
+
+ FILTER iirFilter;
ALuint refcount;
diff --git a/OpenAL32/Include/alFilter.h b/OpenAL32/Include/alFilter.h
index 038304e8..f1d24d0f 100644
--- a/OpenAL32/Include/alFilter.h
+++ b/OpenAL32/Include/alFilter.h
@@ -7,6 +7,11 @@
extern "C" {
#endif
+typedef struct {
+ float *history; /* pointer to history in filter */
+ float *coef; /* pointer to coefficients of filter */
+} FILTER;
+
#define AL_FILTER_TYPE 0x8001
#define AL_FILTER_NULL 0x0000
@@ -48,6 +53,9 @@ AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pf
ALvoid ReleaseALFilters(ALvoid);
+float lpFilter(FILTER *iir, float input);
+int InitLowPassFilter(ALCcontext *Context, FILTER *iir);
+
#ifdef __cplusplus
}
#endif
diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h
index 1d3fc57c..73b02609 100644
--- a/OpenAL32/Include/alSource.h
+++ b/OpenAL32/Include/alSource.h
@@ -75,6 +75,8 @@ typedef struct ALsource
ALboolean WetGainHFAuto;
ALfloat OuterGainHF;
+ FILTER iirFilter;
+
ALfloat AirAbsorptionFactor;
ALfloat RoomRolloffFactor;