Hide audio sample rate option in DCP panel unless the advanced option is enabled.
[dcpomatic.git] / src / wx / dcp_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/config.h"
23 #include "lib/film.h"
24
25
26 class Button;
27 class wxNotebook;
28 class wxPanel;
29 class wxBoxSizer;
30 class wxTextCtrl;
31 class wxStaticText;
32 class wxCheckBox;
33 class wxChoice;
34 class wxButton;
35 class wxSpinCtrl;
36 class wxSizer;
37 class wxGridBagSizer;
38
39 class AudioDialog;
40 class MarkersDialog;
41 class InteropMetadataDialog;
42 class SMPTEMetadataDialog;
43 class Film;
44 class FilmViewer;
45 class Ratio;
46
47
48 class DCPPanel
49 {
50 public:
51         DCPPanel (wxNotebook *, std::shared_ptr<Film>, std::weak_ptr<FilmViewer> viewer);
52
53         DCPPanel (DCPPanel const&) = delete;
54         DCPPanel& operator= (DCPPanel const&) = delete;
55
56         void set_film (std::shared_ptr<Film>);
57         void set_general_sensitivity (bool);
58
59         void film_changed (Film::Property);
60         void film_content_changed (int);
61
62         wxPanel* panel () const {
63                 return _panel;
64         }
65
66 private:
67         void name_changed ();
68         void use_isdcf_name_toggled ();
69         void copy_isdcf_name_button_clicked ();
70         void container_changed ();
71         void dcp_content_type_changed ();
72         void j2k_bandwidth_changed ();
73         void frame_rate_choice_changed ();
74         void frame_rate_spin_changed ();
75         void best_frame_rate_clicked ();
76         void content_timeline_clicked ();
77         void audio_channels_changed ();
78         void resolution_changed ();
79         void three_d_changed ();
80         void standard_changed ();
81         void encrypted_toggled ();
82         void audio_processor_changed ();
83         void show_audio_clicked ();
84         void reel_type_changed ();
85         void reel_length_changed ();
86         void markers_clicked ();
87         void metadata_clicked ();
88         void reencode_j2k_changed ();
89         void enable_audio_language_toggled ();
90         void edit_audio_language_clicked ();
91         void audio_sample_rate_changed ();
92
93         void setup_frame_rate_widget ();
94         void setup_container ();
95         void setup_dcp_name ();
96         void add_to_grid ();
97         void add_video_panel_to_grid ();
98         void add_audio_panel_to_grid ();
99         void add_audio_processors ();
100
101         int minimum_allowed_audio_channels () const;
102
103         wxPanel* make_general_panel ();
104         wxPanel* make_video_panel ();
105         wxPanel* make_audio_panel ();
106
107         void config_changed (Config::Property p);
108
109         void setup_sensitivity ();
110
111         wxPanel* _panel;
112         wxNotebook* _notebook;
113         wxBoxSizer* _sizer;
114         wxGridBagSizer* _grid;
115         wxGridBagSizer* _video_grid;
116         wxGridBagSizer* _audio_grid;
117
118         wxStaticText* _name_label;
119         wxTextCtrl* _name;
120         wxStaticText* _dcp_name;
121         wxCheckBox* _use_isdcf_name;
122         wxCheckBox* _enable_audio_language = nullptr;
123         wxStaticText* _audio_language = nullptr;
124         Button* _edit_audio_language = nullptr;
125         wxStaticText* _container_label;
126         wxChoice* _container;
127         wxStaticText* _container_size;
128         wxButton* _copy_isdcf_name_button;
129         wxStaticText* _j2k_bandwidth_label;
130         wxStaticText* _mbits_label;
131         wxSpinCtrl* _j2k_bandwidth;
132         wxStaticText* _dcp_content_type_label;
133         wxChoice* _dcp_content_type;
134         wxStaticText* _frame_rate_label;
135         wxChoice* _frame_rate_choice;
136         wxSpinCtrl* _frame_rate_spin;
137         wxSizer* _frame_rate_sizer;
138         wxStaticText* _channels_label;
139         wxChoice* _audio_channels;
140         wxStaticText* _audio_sample_rate_label = nullptr;
141         wxChoice* _audio_sample_rate = nullptr;
142         wxStaticText* _processor_label;
143         wxChoice* _audio_processor;
144         wxButton* _show_audio;
145         wxButton* _best_frame_rate;
146         wxCheckBox* _three_d;
147         wxCheckBox* _reencode_j2k;
148         wxStaticText* _resolution_label;
149         wxChoice* _resolution;
150         wxStaticText* _standard_label;
151         wxChoice* _standard;
152         wxCheckBox* _encrypted;
153         wxStaticText* _reels_label;
154         wxChoice* _reel_type;
155         wxStaticText* _reel_length_label;
156         wxStaticText* _reel_length_gb_label;
157         wxSpinCtrl* _reel_length;
158         wxButton* _markers;
159         wxButton* _metadata;
160         wxSizer* _audio_panel_sizer;
161
162         AudioDialog* _audio_dialog = nullptr;
163         MarkersDialog* _markers_dialog = nullptr;
164         InteropMetadataDialog* _interop_metadata_dialog = nullptr;
165         SMPTEMetadataDialog* _smpte_metadata_dialog = nullptr;
166
167         std::shared_ptr<Film> _film;
168         std::weak_ptr<FilmViewer> _viewer;
169         bool _generally_sensitive;
170 };