Supporters update.
[dcpomatic.git] / src / wx / audio_panel.h
1 /*
2     Copyright (C) 2012-2022 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 "content_sub_panel.h"
23 #include "content_widget.h"
24 #include "timecode.h"
25 #include "lib/audio_mapping.h"
26
27
28 class AudioDialog;
29 class AudioMappingView;
30 class CheckBox;
31 class LanguageTagWidget;
32 class wxButton;
33 class wxChoice;
34 class wxSpinCtrlDouble;
35 class wxStaticText;
36
37
38 class AudioPanel : public ContentSubPanel
39 {
40 public:
41         explicit AudioPanel (ContentPanel *);
42         ~AudioPanel ();
43
44         void create () override;
45         void film_changed (Film::Property) override;
46         void film_content_changed (int) override;
47         void content_selection_changed () override;
48         void set_film (std::shared_ptr<Film>);
49
50 private:
51         void show_clicked ();
52         void gain_calculate_button_clicked ();
53         void mapping_changed (AudioMapping);
54         void setup_description ();
55         void setup_peak ();
56         void active_jobs_changed (boost::optional<std::string>, boost::optional<std::string>);
57         void setup_sensitivity ();
58         void reference_clicked ();
59         void add_to_grid () override;
60         boost::optional<float> peak () const;
61         void fade_in_changed ();
62         void fade_out_changed ();
63         void use_same_fades_as_video_changed ();
64
65         CheckBox* _reference;
66         wxStaticText* _reference_note;
67         wxButton* _show;
68         wxStaticText* _gain_label;
69         wxStaticText* _gain_db_label;
70         ContentSpinCtrlDouble<AudioContent>* _gain;
71         wxButton* _gain_calculate_button;
72         wxStaticText* _peak;
73         wxStaticText* _delay_label;
74         wxStaticText* _delay_ms_label;
75         ContentSpinCtrl<AudioContent>* _delay;
76         wxStaticText* _fade_in_label;
77         Timecode<dcpomatic::ContentTime>* _fade_in;
78         wxStaticText* _fade_out_label;
79         Timecode<dcpomatic::ContentTime>* _fade_out;
80         CheckBox* _use_same_fades_as_video;
81         AudioMappingView* _mapping;
82         wxStaticText* _description;
83         AudioDialog* _audio_dialog = nullptr;
84
85         boost::signals2::scoped_connection _mapping_connection;
86         boost::signals2::scoped_connection _active_jobs_connection;
87
88         static std::map<boost::filesystem::path, float> _peak_cache;
89 };