Fix a few more things.
[dcpomatic.git] / src / wx / film_editor.h
1 /*
2     Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 /** @file src/film_editor.h
21  *  @brief A wx widget to edit a film's metadata, and perform various functions.
22  */
23
24 #include <wx/wx.h>
25 #include <wx/spinctrl.h>
26 #include <wx/filepicker.h>
27 #include <wx/collpane.h>
28 #include <boost/signals2.hpp>
29 #include "lib/film.h"
30
31 class wxNotebook;
32 class wxListCtrl;
33 class wxListEvent;
34 class Film;
35 class AudioDialog;
36
37 /** @class FilmEditor
38  *  @brief A wx widget to edit a film's metadata, and perform various functions.
39  */
40 class FilmEditor : public wxPanel
41 {
42 public:
43         FilmEditor (boost::shared_ptr<Film>, wxWindow *);
44
45         void set_film (boost::shared_ptr<Film>);
46
47         boost::signals2::signal<void (std::string)> FileChanged;
48
49 private:
50         void make_film_panel ();
51         void make_content_panel ();
52         void make_video_panel ();
53         void make_audio_panel ();
54         void make_subtitle_panel ();
55         void connect_to_widgets ();
56         
57         /* Handle changes to the view */
58         void name_changed (wxCommandEvent &);
59         void use_dci_name_toggled (wxCommandEvent &);
60         void edit_dci_button_clicked (wxCommandEvent &);
61         void left_crop_changed (wxCommandEvent &);
62         void right_crop_changed (wxCommandEvent &);
63         void top_crop_changed (wxCommandEvent &);
64         void bottom_crop_changed (wxCommandEvent &);
65         void trust_content_headers_changed (wxCommandEvent &);
66         void content_item_selected (wxListEvent &);
67         void content_add_clicked (wxCommandEvent &);
68         void content_remove_clicked (wxCommandEvent &);
69         void content_earlier_clicked (wxCommandEvent &);
70         void content_later_clicked (wxCommandEvent &);
71         void format_changed (wxCommandEvent &);
72         void trim_start_changed (wxCommandEvent &);
73         void trim_end_changed (wxCommandEvent &);
74         void dcp_content_type_changed (wxCommandEvent &);
75         void ab_toggled (wxCommandEvent &);
76         void scaler_changed (wxCommandEvent &);
77         void audio_gain_changed (wxCommandEvent &);
78         void audio_gain_calculate_button_clicked (wxCommandEvent &);
79         void show_audio_clicked (wxCommandEvent &);
80         void audio_delay_changed (wxCommandEvent &);
81         void with_subtitles_toggled (wxCommandEvent &);
82         void subtitle_offset_changed (wxCommandEvent &);
83         void subtitle_scale_changed (wxCommandEvent &);
84         void colour_lut_changed (wxCommandEvent &);
85         void j2k_bandwidth_changed (wxCommandEvent &);
86         void ffmpeg_audio_stream_changed (wxCommandEvent &);
87         void ffmpeg_subtitle_stream_changed (wxCommandEvent &);
88         void dcp_frame_rate_changed (wxCommandEvent &);
89         void best_dcp_frame_rate_clicked (wxCommandEvent &);
90
91         /* Handle changes to the model */
92         void film_changed (Film::Property);
93         void film_content_changed (int);
94
95         /* Button clicks */
96         void edit_filters_clicked (wxCommandEvent &);
97
98         void set_things_sensitive (bool);
99         void setup_formats ();
100         void setup_subtitle_control_sensitivity ();
101         void setup_streams ();
102         void setup_audio_details ();
103         void setup_dcp_name ();
104         void setup_show_audio_sensitivity ();
105         void setup_content ();
106         void setup_content_button_sensitivity ();
107         
108         void active_jobs_changed (bool);
109
110         wxNotebook* _notebook;
111         wxPanel* _film_panel;
112         wxSizer* _film_sizer;
113         wxPanel* _content_panel;
114         wxSizer* _content_sizer;
115         wxPanel* _video_panel;
116         wxSizer* _video_sizer;
117         wxPanel* _audio_panel;
118         wxSizer* _audio_sizer;
119         wxPanel* _subtitle_panel;
120         wxSizer* _subtitle_sizer;
121
122         /** The film we are editing */
123         boost::shared_ptr<Film> _film;
124         /** The Film's name */
125         wxTextCtrl* _name;
126         wxStaticText* _dcp_name;
127         wxCheckBox* _use_dci_name;
128         wxListCtrl* _content;
129         wxButton* _content_add;
130         wxButton* _content_remove;
131         wxButton* _content_earlier;
132         wxButton* _content_later;
133         wxButton* _edit_dci_button;
134         wxChoice* _format;
135         wxStaticText* _format_description;
136         wxCheckBox* _trust_content_headers;
137         wxSpinCtrl* _left_crop;
138         wxSpinCtrl* _right_crop;
139         wxSpinCtrl* _top_crop;
140         wxSpinCtrl* _bottom_crop;
141         wxStaticText* _filters;
142         wxButton* _filters_button;
143         wxChoice* _scaler;
144         wxSpinCtrl* _audio_gain;
145         wxButton* _audio_gain_calculate_button;
146         wxButton* _show_audio;
147         wxSpinCtrl* _audio_delay;
148         wxCheckBox* _with_subtitles;
149         wxChoice* _ffmpeg_subtitle_stream;
150         wxSpinCtrl* _subtitle_offset;
151         wxSpinCtrl* _subtitle_scale;
152         wxChoice* _colour_lut;
153         wxSpinCtrl* _j2k_bandwidth;
154         wxChoice* _dcp_content_type;
155         wxChoice* _dcp_frame_rate;
156         wxButton* _best_dcp_frame_rate;
157         wxStaticText* _frame_rate_description;
158         wxStaticText* _original_size;
159         wxStaticText* _length;
160         /** The Film's audio details */
161         wxStaticText* _audio;
162
163         wxSpinCtrl* _trim_start;
164         wxSpinCtrl* _trim_end;
165         /** Selector to generate an A/B comparison DCP */
166         wxCheckBox* _ab;
167
168         std::vector<Format const *> _formats;
169
170         bool _generally_sensitive;
171         AudioDialog* _audio_dialog;
172 };