2 Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
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.
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.
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.
20 /** @file src/film_editor.h
21 * @brief A wx widget to edit a film's metadata, and perform various functions.
25 #include <wx/spinctrl.h>
26 #include <wx/filepicker.h>
27 #include <wx/collpane.h>
28 #include <boost/signals2.hpp>
36 class AudioMappingView;
40 * @brief A wx widget to edit a film's metadata, and perform various functions.
42 class FilmEditor : public wxPanel
45 FilmEditor (boost::shared_ptr<Film>, wxWindow *);
47 void set_film (boost::shared_ptr<Film>);
49 boost::signals2::signal<void (std::string)> FileChanged;
52 void make_film_panel ();
53 void make_content_panel ();
54 void make_video_panel ();
55 void make_audio_panel ();
56 void make_subtitle_panel ();
57 void connect_to_widgets ();
59 /* Handle changes to the view */
60 void name_changed (wxCommandEvent &);
61 void use_dci_name_toggled (wxCommandEvent &);
62 void edit_dci_button_clicked (wxCommandEvent &);
63 void left_crop_changed (wxCommandEvent &);
64 void right_crop_changed (wxCommandEvent &);
65 void top_crop_changed (wxCommandEvent &);
66 void bottom_crop_changed (wxCommandEvent &);
67 void trust_content_headers_changed (wxCommandEvent &);
68 void content_selection_changed (wxListEvent &);
69 void content_activated (wxListEvent &);
70 void content_add_clicked (wxCommandEvent &);
71 void content_remove_clicked (wxCommandEvent &);
72 void content_edit_clicked (wxCommandEvent &);
73 void content_earlier_clicked (wxCommandEvent &);
74 void content_later_clicked (wxCommandEvent &);
75 void imagemagick_video_length_changed (wxCommandEvent &);
76 void format_changed (wxCommandEvent &);
77 void trim_start_changed (wxCommandEvent &);
78 void trim_end_changed (wxCommandEvent &);
79 void trim_type_changed (wxCommandEvent &);
80 void dcp_content_type_changed (wxCommandEvent &);
81 void ab_toggled (wxCommandEvent &);
82 void scaler_changed (wxCommandEvent &);
83 void audio_gain_changed (wxCommandEvent &);
84 void audio_gain_calculate_button_clicked (wxCommandEvent &);
85 void show_audio_clicked (wxCommandEvent &);
86 void audio_delay_changed (wxCommandEvent &);
87 void with_subtitles_toggled (wxCommandEvent &);
88 void subtitle_offset_changed (wxCommandEvent &);
89 void subtitle_scale_changed (wxCommandEvent &);
90 void colour_lut_changed (wxCommandEvent &);
91 void j2k_bandwidth_changed (wxCommandEvent &);
92 void dcp_frame_rate_changed (wxCommandEvent &);
93 void best_dcp_frame_rate_clicked (wxCommandEvent &);
94 void edit_filters_clicked (wxCommandEvent &);
95 void loop_content_toggled (wxCommandEvent &);
96 void loop_count_changed (wxCommandEvent &);
97 void timeline_clicked (wxCommandEvent &);
99 /* Handle changes to the model */
100 void film_changed (Film::Property);
101 void film_content_changed (boost::weak_ptr<Content>, int);
103 void set_things_sensitive (bool);
104 void setup_formats ();
105 void setup_subtitle_control_sensitivity ();
106 void setup_dcp_name ();
107 void setup_show_audio_sensitivity ();
108 void setup_scaling_description ();
109 void setup_notebook_size ();
110 void setup_frame_rate_description ();
111 void setup_content ();
112 void setup_format ();
113 void setup_length ();
114 void setup_content_information ();
115 void setup_content_button_sensitivity ();
116 void setup_loop_sensitivity ();
118 void active_jobs_changed (bool);
119 boost::shared_ptr<Content> selected_content ();
120 void edit_content (boost::shared_ptr<Content>);
122 wxNotebook* _notebook;
123 wxPanel* _film_panel;
124 wxSizer* _film_sizer;
125 wxPanel* _content_panel;
126 wxSizer* _content_sizer;
127 wxPanel* _video_panel;
128 wxSizer* _video_sizer;
129 wxPanel* _audio_panel;
130 wxSizer* _audio_sizer;
131 wxPanel* _subtitle_panel;
132 wxSizer* _subtitle_sizer;
134 /** The film we are editing */
135 boost::shared_ptr<Film> _film;
136 /** The Film's name */
138 wxStaticText* _dcp_name;
139 wxCheckBox* _use_dci_name;
140 wxListCtrl* _content;
141 wxButton* _content_add;
142 wxButton* _content_remove;
143 wxButton* _content_edit;
144 wxButton* _content_earlier;
145 wxButton* _content_later;
146 wxTextCtrl* _content_information;
147 wxCheckBox* _loop_content;
148 wxSpinCtrl* _loop_count;
149 wxButton* _timeline_button;
150 wxButton* _edit_dci_button;
152 wxStaticText* _format_description;
153 wxCheckBox* _trust_content_headers;
154 wxStaticText* _scaling_description;
155 wxSpinCtrl* _left_crop;
156 wxSpinCtrl* _right_crop;
157 wxSpinCtrl* _top_crop;
158 wxSpinCtrl* _bottom_crop;
159 wxStaticText* _filters;
160 wxButton* _filters_button;
162 wxSpinCtrl* _audio_gain;
163 wxButton* _audio_gain_calculate_button;
164 wxButton* _show_audio;
165 wxSpinCtrl* _audio_delay;
166 AudioMappingView* _audio_mapping;
167 wxCheckBox* _with_subtitles;
168 wxSpinCtrl* _subtitle_offset;
169 wxSpinCtrl* _subtitle_scale;
170 wxChoice* _colour_lut;
171 wxSpinCtrl* _j2k_bandwidth;
172 wxChoice* _dcp_content_type;
173 wxChoice* _dcp_frame_rate;
174 wxButton* _best_dcp_frame_rate;
175 wxStaticText* _frame_rate_description;
176 wxStaticText* _length;
177 /** The Film's audio details */
178 wxStaticText* _audio;
180 wxSpinCtrl* _trim_start;
181 wxSpinCtrl* _trim_end;
182 wxChoice* _trim_type;
183 /** Selector to generate an A/B comparison DCP */
186 std::vector<Format const *> _formats;
188 bool _generally_sensitive;
189 AudioDialog* _audio_dialog;
190 TimelineDialog* _timeline_dialog;