Async  1.5.0
AsyncAudioFilter.h
Go to the documentation of this file.
1 
28 #ifndef ASYNC_AUDIO_FILTER_INCLUDED
29 #define ASYNC_AUDIO_FILTER_INCLUDED
30 
31 
32 /****************************************************************************
33  *
34  * System Includes
35  *
36  ****************************************************************************/
37 
38 #include <string>
39 
40 
41 /****************************************************************************
42  *
43  * Project Includes
44  *
45  ****************************************************************************/
46 
47 
48 
49 /****************************************************************************
50  *
51  * Local Includes
52  *
53  ****************************************************************************/
54 
55 #include <AsyncAudioProcessor.h>
56 
57 
58 
59 /****************************************************************************
60  *
61  * Forward declarations
62  *
63  ****************************************************************************/
64 
65 
66 
67 /****************************************************************************
68  *
69  * Namespace
70  *
71  ****************************************************************************/
72 
73 namespace Async
74 {
75 
76 
77 /****************************************************************************
78  *
79  * Forward declarations of classes inside of the declared namespace
80  *
81  ****************************************************************************/
82 
83 class FidVars;
84 
85 
86 /****************************************************************************
87  *
88  * Defines & typedefs
89  *
90  ****************************************************************************/
91 
92 
93 
94 /****************************************************************************
95  *
96  * Exported Global Variables
97  *
98  ****************************************************************************/
99 
100 
101 
102 /****************************************************************************
103  *
104  * Class definitions
105  *
106  ****************************************************************************/
107 
114 {
115  public:
120  explicit AudioFilter(int sample_rate = INTERNAL_SAMPLE_RATE);
121 
131  explicit AudioFilter(const std::string &filter_spec,
132  int sample_rate = INTERNAL_SAMPLE_RATE);
133 
137  ~AudioFilter(void);
138 
149  bool parseFilterSpec(const std::string &filter_spec);
150 
158  std::string errorString(void) const { return error_str; }
159 
168  void setOutputGain(float gain_db);
169 
173  void reset(void);
174 
175 
176  protected:
188  void processSamples(float *dest, const float *src, int count);
189 
190 
191  private:
192  int sample_rate;
193  FidVars *fv;
194  float output_gain;
195  std::string error_str;
196 
197  AudioFilter(const AudioFilter&);
198  AudioFilter& operator=(const AudioFilter&);
199  void deleteFilter(void);
200 
201 }; /* class AudioFilter */
202 
203 
204 } /* namespace */
205 
206 #endif /* ASYNC_AUDIO_FILTER_INCLUDED */
207 
208 
209 
210 /*
211  * This file has not been truncated
212  */
213 
The base class for an audio processor.
void setOutputGain(float gain_db)
Set the output gain of the filter.
bool parseFilterSpec(const std::string &filter_spec)
Create the filter from the given filter specification.
AudioFilter(int sample_rate=INTERNAL_SAMPLE_RATE)
Constuctor.
~AudioFilter(void)
Destructor.
Namespace for the asynchronous programming classes.
void processSamples(float *dest, const float *src, int count)
Process incoming samples and put them into the output buffer.
std::string errorString(void) const
Get the latest filter creation error.
The base class for an audio processor class.
void reset(void)
Reset the filter state.
A class for creating a wide range of audio filters.