No-op; fix GPL address and use the explicit-program-name version.
[dcpomatic.git] / src / wx / audio_plot.h
1 /*
2     Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
6     DCP-o-matic is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     DCP-o-matic is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18
19 */
20
21 #include <vector>
22 #include <boost/shared_ptr.hpp>
23 #include <wx/wx.h>
24 #include "lib/util.h"
25 #include "lib/audio_analysis.h"
26
27 struct Metrics;
28
29 class AudioPlot : public wxPanel
30 {
31 public:
32         AudioPlot (wxWindow *);
33
34         void set_analysis (boost::shared_ptr<AudioAnalysis>);
35         void set_channel_visible (int c, bool v);
36         void set_type_visible (int t, bool v);
37         void set_smoothing (int);
38         void set_message (wxString);
39         void set_gain_correction (double gain);
40
41         static const int max_smoothing;
42
43 private:
44         void paint ();
45         void plot_peak (wxGraphicsPath &, int, Metrics const &) const;
46         void plot_rms (wxGraphicsPath &, int, Metrics const &) const;
47         float y_for_linear (float, Metrics const &) const;
48         AudioPoint get_point (int channel, int point) const;
49
50         boost::shared_ptr<AudioAnalysis> _analysis;
51         bool _channel_visible[MAX_DCP_AUDIO_CHANNELS];
52         bool _type_visible[AudioPoint::COUNT];
53         int _smoothing;
54         std::vector<wxColour> _colours;
55         wxString _message;
56         float _gain_correction;
57
58         static const int _minimum;
59 };