Merging r44140 through r44226 from trunk into soc-2011-tomato
[blender.git] / intern / audaspace / FX / AUD_ButterworthFactory.h
1 /*
2  * ***** BEGIN GPL LICENSE BLOCK *****
3  *
4  * Copyright 2009-2011 Jörg Hermann Müller
5  *
6  * This file is part of AudaSpace.
7  *
8  * Audaspace is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * AudaSpace is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with Audaspace; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  * ***** END GPL LICENSE BLOCK *****
23  */
24
25 /** \file audaspace/FX/AUD_ButterworthFactory.h
26  *  \ingroup audfx
27  */
28
29
30 #ifndef __AUD_BUTTERWORTHFACTORY_H__
31 #define __AUD_BUTTERWORTHFACTORY_H__
32
33 #include "AUD_DynamicIIRFilterFactory.h"
34
35 /**
36  * This factory creates a butterworth lowpass filter reader.
37  */
38 class AUD_ButterworthFactory : public AUD_DynamicIIRFilterFactory
39 {
40 private:
41         /**
42          * The attack value in seconds.
43          */
44         const float m_frequency;
45
46         // hide copy constructor and operator=
47         AUD_ButterworthFactory(const AUD_ButterworthFactory&);
48         AUD_ButterworthFactory& operator=(const AUD_ButterworthFactory&);
49
50 public:
51         /**
52          * Creates a new butterworth factory.
53          * \param factory The input factory.
54          * \param frequency The cutoff frequency.
55          */
56         AUD_ButterworthFactory(AUD_Reference<AUD_IFactory> factory, float frequency);
57
58         virtual void recalculateCoefficients(AUD_SampleRate rate,
59                                                                                  std::vector<float>& b,
60                                                                                  std::vector<float>& a);
61 };
62
63 #endif //__AUD_BUTTERWORTHFACTORY_H__