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