~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to arts/modules/freeverb/comb.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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