20 static __inline ALfloat
lpFilter4P(FILTER
*iir
, ALuint offset
, ALfloat input
)
22 ALfloat
*history
= &iir
->history
[offset
];
23 ALfloat a
= iir
->coeff
;
24 ALfloat output
= input
;
26 output
= output
+ (history
[0]-output
)*a
;
28 output
= output
+ (history
[1]-output
)*a
;
30 output
= output
+ (history
[2]-output
)*a
;
32 output
= output
+ (history
[3]-output
)*a
;
38 static __inline ALfloat
lpFilter2P(FILTER
*iir
, ALuint offset
, ALfloat input
)
40 ALfloat
*history
= &iir
->history
[offset
];
41 ALfloat a
= iir
->coeff
;
42 ALfloat output
= input
;
44 output
= output
+ (history
[0]-output
)*a
;
46 output
= output
+ (history
[1]-output
)*a
;
53 #define AL_FILTER_TYPE 0x8001
55 #define AL_FILTER_NULL 0x0000
56 #define AL_FILTER_LOWPASS 0x0001
57 #define AL_FILTER_HIGHPASS 0x0002
58 #define AL_FILTER_BANDPASS 0x0003
60 #define AL_LOWPASS_GAIN 0x0001
61 #define AL_LOWPASS_GAINHF 0x0002
64 typedef struct ALfilter_struct
66 // Filter type (AL_FILTER_NULL, ...)
75 struct ALfilter_struct
*next
;
78 ALvoid AL_APIENTRY
alGenFilters(ALsizei n
, ALuint
*filters
);
79 ALvoid AL_APIENTRY
alDeleteFilters(ALsizei n
, ALuint
*filters
);
80 ALboolean AL_APIENTRY
alIsFilter(ALuint filter
);
82 ALvoid AL_APIENTRY
alFilteri(ALuint filter
, ALenum param
, ALint iValue
);
83 ALvoid AL_APIENTRY
alFilteriv(ALuint filter
, ALenum param
, ALint
*piValues
);
84 ALvoid AL_APIENTRY
alFilterf(ALuint filter
, ALenum param
, ALfloat flValue
);
85 ALvoid AL_APIENTRY
alFilterfv(ALuint filter
, ALenum param
, ALfloat
*pflValues
);
87 ALvoid AL_APIENTRY
alGetFilteri(ALuint filter
, ALenum param
, ALint
*piValue
);
88 ALvoid AL_APIENTRY
alGetFilteriv(ALuint filter
, ALenum param
, ALint
*piValues
);
89 ALvoid AL_APIENTRY
alGetFilterf(ALuint filter
, ALenum param
, ALfloat
*pflValue
);
90 ALvoid AL_APIENTRY
alGetFilterfv(ALuint filter
, ALenum param
, ALfloat
*pflValues
);
92 ALvoid
ReleaseALFilters(ALvoid
);