ardour
fft_result.h
Go to the documentation of this file.
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 
64  int _dataSize;
65 
66  float _minimum;
67  float _maximum;
68 
70 
71  Gdk::Color _color;
72  std::string _trackname;
73 
74  friend class FFTGraph;
75 };
76 
77 #endif /* __ardour_fft_result_h */
int length() const
Definition: fft_result.h:41
float maxAt(int x)
Definition: fft_result.cc:152
float _minimum
Definition: fft_result.h:66
void finalize()
Definition: fft_result.cc:91
float minimum() const
Definition: fft_result.h:47
float avgAt(int x)
Definition: fft_result.cc:134
float * _data_min
Definition: fft_result.h:59
Gdk::Color get_color() const
Definition: fft_result.h:50
float _maximum
Definition: fft_result.h:67
float maximum() const
Definition: fft_result.h:48
int _averages
Definition: fft_result.h:55
float * _data_avg
Definition: fft_result.h:57
float * _data_max
Definition: fft_result.h:58
MultiplicationGraph graph
void analyzeWindow(float *window)
Definition: fft_result.cc:57
float * _work
Definition: fft_result.h:61
int _windowSize
Definition: fft_result.h:63
int _dataSize
Definition: fft_result.h:64
float minAt(int x)
Definition: fft_result.cc:143
Gdk::Color _color
Definition: fft_result.h:71
std::string _trackname
Definition: fft_result.h:72
FFTGraph * _graph
Definition: fft_result.h:69
FFTResult(FFTGraph *graph, Gdk::Color color, std::string trackname)
Definition: fft_result.cc:32
LIBARDOUR_API PBD::PropertyDescriptor< bool > color
Definition: route_group.cc:50