Hide warnings triggered by Ubuntu 20.04's gcc.
[dcpomatic.git] / src / wx / audio_dialog.h
1 /*
2     Copyright (C) 2013-2019 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 "lib/film.h"
22 #include "lib/audio_analysis.h"
23 #include "lib/playlist.h"
24 #include "lib/warnings.h"
25 DCPOMATIC_DISABLE_WARNINGS
26 #include <wx/wx.h>
27 DCPOMATIC_ENABLE_WARNINGS
28 #include <boost/shared_ptr.hpp>
29 #include <boost/signals2.hpp>
30
31 class AudioPlot;
32 class FilmViewer;
33 class Film;
34
35 class AudioDialog : public wxDialog
36 {
37 public:
38         AudioDialog (wxWindow* parent, boost::shared_ptr<Film> film, boost::weak_ptr<FilmViewer> viewer, boost::shared_ptr<Content> content = boost::shared_ptr<Content>());
39
40         bool Show (bool show = true);
41
42         void set_cursor (boost::optional<dcpomatic::DCPTime> time, boost::optional<float> db);
43
44 private:
45         void film_change (ChangeType, int);
46         void content_change (ChangeType, int);
47         void channel_clicked (wxCommandEvent &);
48         void type_clicked (wxCommandEvent &);
49         void smoothing_changed ();
50         void try_to_load_analysis ();
51         void analysis_finished ();
52         void setup_statistics ();
53
54         boost::shared_ptr<AudioAnalysis> _analysis;
55         boost::weak_ptr<Film> _film;
56         boost::weak_ptr<FilmViewer> _viewer;
57         /** content to analyse, or 0 to analyse all the film's content */
58         boost::weak_ptr<Content> _content;
59         int _channels;
60         boost::shared_ptr<const Playlist> _playlist;
61         wxStaticText* _cursor;
62         AudioPlot* _plot;
63         wxStaticText* _sample_peak;
64         wxStaticText* _true_peak;
65         wxStaticText* _integrated_loudness;
66         wxStaticText* _loudness_range;
67         wxStaticText* _leqm;
68         wxCheckBox* _channel_checkbox[MAX_DCP_AUDIO_CHANNELS];
69         wxCheckBox* _type_checkbox[AudioPoint::COUNT];
70         wxSlider* _smoothing;
71         boost::signals2::scoped_connection _film_connection;
72         boost::signals2::scoped_connection _film_content_connection;
73         boost::signals2::scoped_connection _analysis_finished_connection;
74 };