OSC: Changed gainVCA to gainfader as VCA is already used.
[ardour.git] / gtk2_ardour / fft_result.h
1 /*
2     Copyright (C) 2006 Paul Davis
3         Written by Sampo Savolainen
4
5     This program is free software; you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation; either version 2 of the License, or
8     (at your option) any later version.
9
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14
15     You should have received a copy of the GNU General Public License
16     along with this program; if not, write to the Free Software
17     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19 */
20
21 #ifndef __ardour_fft_result_h
22 #define __ardour_fft_result_h
23
24 #include <fftw3.h>
25
26 #include <gdkmm/color.h>
27
28 #include <string>
29
30 class FFTGraph;
31
32 class FFTResult
33 {
34         public:
35
36                 ~FFTResult();
37
38                 void analyzeWindow(float *window);
39                 void finalize();
40
41                 int length() const { return _dataSize; }
42
43                 float avgAt(int x);
44                 float maxAt(int x);
45                 float minAt(int x);
46
47                 float minimum() const { return _minimum; }
48                 float maximum() const { return _maximum; }
49
50                 Gdk::Color get_color() const { return _color; }
51
52         private:
53                 FFTResult(FFTGraph *graph, Gdk::Color color, std::string trackname);
54
55                 int     _averages;
56
57                 float*  _data_avg;
58                 float*  _data_max;
59                 float*  _data_min;
60
61                 float*  _work;
62
63                 int     _windowSize;
64                 int     _dataSize;
65
66                 float   _minimum;
67                 float   _maximum;
68
69                 FFTGraph *_graph;
70
71                 Gdk::Color _color;
72                 std::string _trackname;
73
74         friend class FFTGraph;
75 };
76
77 #endif /* __ardour_fft_result_h */