Open Ephys GUI
 All Classes Functions Variables Pages
FilterNode.h
1 /*
2  ------------------------------------------------------------------
3 
4  This file is part of the Open Ephys GUI
5  Copyright (C) 2012 Open Ephys
6 
7  ------------------------------------------------------------------
8 
9  This program is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program. If not, see <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #ifndef __FILTERNODE_H_CED428E__
25 #define __FILTERNODE_H_CED428E__
26 
27 #include "../../JuceLibraryCode/JuceHeader.h"
28 #include "../Dsp/Dsp.h"
29 #include "GenericProcessor.h"
30 
31 /**
32 
33  Filters data using a filter from the DSP library.
34 
35  The user can select the low- and high-frequency cutoffs.
36 
37  @see GenericProcessor, FilterEditor
38 
39 */
40 
42 
43 {
44 public:
45 
46  FilterNode();
47  ~FilterNode();
48 
49  void process (AudioSampleBuffer &buffer, MidiBuffer &midiMessages, int& nSamples);
50  void setParameter (int parameterIndex, float newValue);
51 
52  AudioProcessorEditor* createEditor();
53 
54  bool hasEditor() const {return true;}
55 
56  void updateSettings();
57 
58 private:
59 
60  Array<double> lowCuts, highCuts;
61  OwnedArray<Dsp::Filter> filters;
62 
63  void setFilterParameters(double, double, int);
64 
65  JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FilterNode);
66 
67 };
68 
69 #endif // __FILTERNODE_H_CED428E__