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