Allow adding of content.
[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 Film;
34 class AudioDialog;
35
36 /** @class FilmEditor
37  *  @brief A wx widget to edit a film's metadata, and perform various functions.
38  */
39 class FilmEditor : public wxPanel
40 {
41 public:
42         FilmEditor (boost::shared_ptr<Film>, wxWindow *);
43
44         void set_film (boost::shared_ptr<Film>);
45
46         boost::signals2::signal<void (std::string)> FileChanged;
47
48 private:
49         void make_film_panel ();
50         void make_content_panel ();
51         void make_video_panel ();
52         void make_audio_panel ();
53         void make_subtitle_panel ();
54         void connect_to_widgets ();
55         
56         /* Handle changes to the view */
57         void name_changed (wxCommandEvent &);
58         void use_dci_name_toggled (wxCommandEvent &);
59         void edit_dci_button_clicked (wxCommandEvent &);
60         void left_crop_changed (wxCommandEvent &);
61         void right_crop_changed (wxCommandEvent &);
62         void top_crop_changed (wxCommandEvent &);
63         void bottom_crop_changed (wxCommandEvent &);
64         void trust_content_header_changed (wxCommandEvent &);
65         void content_add_clicked (wxCommandEvent &);
66         void content_remove_clicked (wxCommandEvent &);
67         void content_earlier_clicked (wxCommandEvent &);
68         void content_later_clicked (wxCommandEvent &);
69         void format_changed (wxCommandEvent &);
70         void trim_start_changed (wxCommandEvent &);
71         void trim_end_changed (wxCommandEvent &);
72         void dcp_content_type_changed (wxCommandEvent &);
73         void dcp_ab_toggled (wxCommandEvent &);
74         void scaler_changed (wxCommandEvent &);
75         void audio_gain_changed (wxCommandEvent &);
76         void audio_gain_calculate_button_clicked (wxCommandEvent &);
77         void show_audio_clicked (wxCommandEvent &);
78         void audio_delay_changed (wxCommandEvent &);
79         void with_subtitles_toggled (wxCommandEvent &);
80         void subtitle_offset_changed (wxCommandEvent &);
81         void subtitle_scale_changed (wxCommandEvent &);
82         void colour_lut_changed (wxCommandEvent &);
83         void j2k_bandwidth_changed (wxCommandEvent &);
84         void ffmpeg_audio_stream_changed (wxCommandEvent &);
85         void ffmpeg_subtitle_stream_changed (wxCommandEvent &);
86         void dcp_frame_rate_changed (wxCommandEvent &);
87         void best_dcp_frame_rate_clicked (wxCommandEvent &);
88
89         /* Handle changes to the model */
90         void film_changed (Film::Property);
91
92         /* Button clicks */
93         void edit_filters_clicked (wxCommandEvent &);
94
95         void set_things_sensitive (bool);
96         void setup_formats ();
97         void setup_subtitle_control_sensitivity ();
98         void setup_streams ();
99         void setup_audio_details ();
100         void setup_dcp_name ();
101         void setup_show_audio_sensitivity ();
102         void setup_content ();
103         
104         void active_jobs_changed (bool);
105
106         wxNotebook* _notebook;
107         wxPanel* _film_panel;
108         wxSizer* _film_sizer;
109         wxPanel* _content_panel;
110         wxSizer* _content_sizer;
111         wxPanel* _video_panel;
112         wxSizer* _video_sizer;
113         wxPanel* _audio_panel;
114         wxSizer* _audio_sizer;
115         wxPanel* _subtitle_panel;
116         wxSizer* _subtitle_sizer;
117
118         /** The film we are editing */
119         boost::shared_ptr<Film> _film;
120         /** The Film's name */
121         wxTextCtrl* _name;
122         wxStaticText* _dcp_name;
123         wxCheckBox* _use_dci_name;
124         wxListCtrl* _content;
125         wxButton* _content_add;
126         wxButton* _content_remove;
127         wxButton* _content_earlier;
128         wxButton* _content_later;
129         wxButton* _edit_dci_button;
130         wxChoice* _format;
131         wxStaticText* _format_description;
132         wxCheckBox* _trust_content_header;
133         wxSpinCtrl* _left_crop;
134         wxSpinCtrl* _right_crop;
135         wxSpinCtrl* _top_crop;
136         wxSpinCtrl* _bottom_crop;
137         wxStaticText* _filters;
138         wxButton* _filters_button;
139         wxChoice* _scaler;
140         wxSpinCtrl* _audio_gain;
141         wxButton* _audio_gain_calculate_button;
142         wxButton* _show_audio;
143         wxSpinCtrl* _audio_delay;
144         wxCheckBox* _with_subtitles;
145         wxChoice* _ffmpeg_subtitle_stream;
146         wxSpinCtrl* _subtitle_offset;
147         wxSpinCtrl* _subtitle_scale;
148         wxChoice* _colour_lut;
149         wxSpinCtrl* _j2k_bandwidth;
150         wxChoice* _dcp_content_type;
151         wxStaticText* _source_frame_rate;
152         wxChoice* _dcp_frame_rate;
153         wxButton* _best_dcp_frame_rate;
154         wxStaticText* _frame_rate_description;
155         wxStaticText* _original_size;
156         wxStaticText* _length;
157         /** The Film's audio details */
158         wxStaticText* _audio;
159
160         wxSpinCtrl* _trim_start;
161         wxSpinCtrl* _trim_end;
162         /** Selector to generate an A/B comparison DCP */
163         wxCheckBox* _dcp_ab;
164
165         std::vector<Format const *> _formats;
166
167         bool _generally_sensitive;
168         AudioDialog* _audio_dialog;
169 };