Fix some unaligned images.
[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
33 class Film;
34
35 /** @class FilmEditor
36  *  @brief A wx widget to edit a film's metadata, and perform various functions.
37  */
38 class FilmEditor : public wxPanel
39 {
40 public:
41         FilmEditor (boost::shared_ptr<Film>, wxWindow *);
42
43         void set_film (boost::shared_ptr<Film>);
44         void setup_visibility ();
45
46         boost::signals2::signal<void (std::string)> FileChanged;
47
48 private:
49         void make_film_panel ();
50         void make_video_panel ();
51         void make_audio_panel ();
52         void make_subtitle_panel ();
53         void connect_to_widgets ();
54         
55         /* Handle changes to the view */
56         void name_changed (wxCommandEvent &);
57         void use_dci_name_toggled (wxCommandEvent &);
58         void edit_dci_button_clicked (wxCommandEvent &);
59         void left_crop_changed (wxCommandEvent &);
60         void right_crop_changed (wxCommandEvent &);
61         void top_crop_changed (wxCommandEvent &);
62         void bottom_crop_changed (wxCommandEvent &);
63         void content_changed (wxCommandEvent &);
64         void trust_content_header_changed (wxCommandEvent &);
65         void format_changed (wxCommandEvent &);
66         void trim_start_changed (wxCommandEvent &);
67         void trim_end_changed (wxCommandEvent &);
68         void multiple_reels_toggled (wxCommandEvent &);
69         void reel_size_changed (wxCommandEvent &);
70         void dcp_content_type_changed (wxCommandEvent &);
71         void dcp_ab_toggled (wxCommandEvent &);
72         void scaler_changed (wxCommandEvent &);
73         void audio_gain_changed (wxCommandEvent &);
74         void audio_gain_calculate_button_clicked (wxCommandEvent &);
75         void audio_delay_changed (wxCommandEvent &);
76         void with_subtitles_toggled (wxCommandEvent &);
77         void subtitle_offset_changed (wxCommandEvent &);
78         void subtitle_scale_changed (wxCommandEvent &);
79         void colour_lut_changed (wxCommandEvent &);
80         void j2k_bandwidth_changed (wxCommandEvent &);
81         void still_duration_changed (wxCommandEvent &);
82         void audio_stream_changed (wxCommandEvent &);
83         void subtitle_stream_changed (wxCommandEvent &);
84         void use_audio_changed (wxCommandEvent &);
85         void external_audio_changed (wxCommandEvent &);
86
87         /* Handle changes to the model */
88         void film_changed (Film::Property);
89
90         /* Button clicks */
91         void edit_filters_clicked (wxCommandEvent &);
92
93         void set_things_sensitive (bool);
94         void setup_formats ();
95         void setup_subtitle_control_sensitivity ();
96         void setup_audio_control_sensitivity ();
97         void setup_reel_control_sensitivity ();
98         void setup_streams ();
99         void setup_audio_details ();
100         
101         wxControl* video_control (wxControl *);
102         wxControl* still_control (wxControl *);
103
104         void active_jobs_changed (bool);
105
106         wxNotebook* _notebook;
107         wxPanel* _film_panel;
108         wxSizer* _film_sizer;
109         wxPanel* _video_panel;
110         wxSizer* _video_sizer;
111         wxPanel* _audio_panel;
112         wxSizer* _audio_sizer;
113         wxPanel* _subtitle_panel;
114         wxSizer* _subtitle_sizer;
115
116         /** The film we are editing */
117         boost::shared_ptr<Film> _film;
118         /** The Film's name */
119         wxTextCtrl* _name;
120         wxStaticText* _dcp_name;
121         wxCheckBox* _use_dci_name;
122         wxButton* _edit_dci_button;
123         /** The Film's format */
124         wxComboBox* _format;
125         /** The Film's content file */
126         wxFilePickerCtrl* _content;
127         wxCheckBox* _trust_content_header;
128         /** The Film's left crop */
129         wxSpinCtrl* _left_crop;
130         /** The Film's right crop */
131         wxSpinCtrl* _right_crop;
132         /** The Film's top crop */
133         wxSpinCtrl* _top_crop;
134         /** The Film's bottom crop */
135         wxSpinCtrl* _bottom_crop;
136         /** Currently-applied filters */
137         wxStaticText* _filters;
138         /** Button to open the filters dialogue */
139         wxButton* _filters_button;
140         /** The Film's scaler */
141         wxComboBox* _scaler;
142         wxRadioButton* _use_content_audio;
143         wxComboBox* _audio_stream;
144         wxRadioButton* _use_external_audio;
145         wxFilePickerCtrl* _external_audio[MAX_AUDIO_CHANNELS];
146         /** The Film's audio gain */
147         wxSpinCtrl* _audio_gain;
148         /** A button to open the gain calculation dialogue */
149         wxButton* _audio_gain_calculate_button;
150         /** The Film's audio delay */
151         wxSpinCtrl* _audio_delay;
152         wxCheckBox* _with_subtitles;
153         wxComboBox* _subtitle_stream;
154         wxSpinCtrl* _subtitle_offset;
155         wxSpinCtrl* _subtitle_scale;
156         wxComboBox* _colour_lut;
157         wxSpinCtrl* _j2k_bandwidth;
158         /** The Film's DCP content type */
159         wxComboBox* _dcp_content_type;
160         /** The Film's frames per second */
161         wxStaticText* _frames_per_second;
162         /** The Film's original size */
163         wxStaticText* _original_size;
164         /** The Film's length */
165         wxStaticText* _length;
166         /** The Film's audio details */
167         wxStaticText* _audio;
168         /** The Film's duration for still sources */
169         wxSpinCtrl* _still_duration;
170
171         wxSpinCtrl* _trim_start;
172         wxSpinCtrl* _trim_end;
173         wxCheckBox* _multiple_reels;
174         wxSpinCtrl* _reel_size;
175         /** Selector to generate an A/B comparison DCP */
176         wxCheckBox* _dcp_ab;
177
178         std::list<wxControl*> _video_controls;
179         std::list<wxControl*> _still_controls;
180
181         std::vector<Format const *> _formats;
182
183         bool _generally_sensitive;
184 };