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