]> git.sesse.net Git - vlc/blob - modules/audio_filter/spatializer/comb.cpp
c05f5069c84f0cc57ca757ec84ed1feafd332ea3
[vlc] / modules / audio_filter / spatializer / comb.cpp
1 // Comb filter implementation
2 //
3 // Written by Jezar at Dreampoint, June 2000
4 // http://www.dreampoint.co.uk
5 // This code is public domain
6
7 #include "comb.hpp"
8
9 comb::comb()
10 {
11         filterstore = 0;
12         bufidx = 0;
13 }
14
15 void comb::setbuffer(float *buf, int size) 
16 {
17         buffer = buf; 
18         bufsize = size;
19 }
20
21 void comb::mute()
22 {
23         for (int i=0; i<bufsize; i++)
24                 buffer[i]=0;
25 }
26
27 void comb::setdamp(float val) 
28 {
29         damp1 = val; 
30         damp2 = 1-val;
31 }
32
33 float comb::getdamp() 
34 {
35         return damp1;
36 }
37
38 void comb::setfeedback(float val) 
39 {
40         feedback = val;
41 }
42
43 float comb::getfeedback() 
44 {
45         return feedback;
46 }
47
48 // ends