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