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