2 Copyright (C) 2012-2013 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>
30 #include "content_menu.h"
38 class AudioMappingView;
44 * @brief A wx widget to edit a film's metadata, and perform various functions.
46 class FilmEditor : public wxPanel
49 FilmEditor (boost::shared_ptr<Film>, wxWindow *);
51 void set_film (boost::shared_ptr<Film>);
52 void set_selection (boost::weak_ptr<Content>);
54 boost::signals2::signal<void (std::string)> FileChanged;
56 /* Stuff for panels */
58 wxNotebook* content_notebook () const {
59 return _content_notebook;
62 boost::shared_ptr<Film> film () const {
66 boost::shared_ptr<Content> selected_content ();
69 void make_dcp_panel ();
70 void make_content_panel ();
71 void make_video_panel ();
72 void make_audio_panel ();
73 void make_subtitle_panel ();
74 void connect_to_widgets ();
76 /* Handle changes to the view */
77 void name_changed (wxCommandEvent &);
78 void use_dci_name_toggled (wxCommandEvent &);
79 void edit_dci_button_clicked (wxCommandEvent &);
80 void left_crop_changed (wxCommandEvent &);
81 void right_crop_changed (wxCommandEvent &);
82 void top_crop_changed (wxCommandEvent &);
83 void bottom_crop_changed (wxCommandEvent &);
84 void trust_content_headers_changed (wxCommandEvent &);
85 void content_selection_changed (wxListEvent &);
86 void content_add_clicked (wxCommandEvent &);
87 void content_remove_clicked (wxCommandEvent &);
88 void imagemagick_video_length_changed (wxCommandEvent &);
89 void container_changed (wxCommandEvent &);
90 void dcp_content_type_changed (wxCommandEvent &);
91 void scaler_changed (wxCommandEvent &);
92 void audio_gain_changed (wxCommandEvent &);
93 void audio_gain_calculate_button_clicked (wxCommandEvent &);
94 void show_audio_clicked (wxCommandEvent &);
95 void audio_delay_changed (wxCommandEvent &);
96 void with_subtitles_toggled (wxCommandEvent &);
97 void subtitle_offset_changed (wxCommandEvent &);
98 void subtitle_scale_changed (wxCommandEvent &);
99 void j2k_bandwidth_changed (wxCommandEvent &);
100 void dcp_frame_rate_changed (wxCommandEvent &);
101 void best_dcp_frame_rate_clicked (wxCommandEvent &);
102 void edit_filters_clicked (wxCommandEvent &);
103 void content_timeline_clicked (wxCommandEvent &);
104 void audio_stream_changed (wxCommandEvent &);
105 void subtitle_stream_changed (wxCommandEvent &);
106 void audio_mapping_changed (AudioMapping);
107 void start_changed ();
108 void length_changed ();
109 void ratio_changed (wxCommandEvent &);
110 void dcp_audio_channels_changed (wxCommandEvent &);
111 void dcp_resolution_changed (wxCommandEvent &);
112 void sequence_video_changed (wxCommandEvent &);
113 void content_right_click (wxListEvent &);
115 /* Handle changes to the model */
116 void film_changed (Film::Property);
117 void film_content_changed (boost::weak_ptr<Content>, int);
119 void set_things_sensitive (bool);
120 void setup_ratios ();
121 void setup_subtitle_control_sensitivity ();
122 void setup_dcp_name ();
123 void setup_show_audio_sensitivity ();
124 void setup_scaling_description ();
125 void setup_content ();
126 void setup_container ();
127 void setup_content_sensitivity ();
129 void active_jobs_changed (bool);
130 boost::shared_ptr<VideoContent> selected_video_content ();
131 boost::shared_ptr<AudioContent> selected_audio_content ();
132 boost::shared_ptr<SubtitleContent> selected_subtitle_content ();
134 TimingPanel* _timing_panel;
136 wxNotebook* _main_notebook;
137 wxNotebook* _content_notebook;
140 wxPanel* _content_panel;
141 wxSizer* _content_sizer;
142 wxPanel* _video_panel;
143 wxPanel* _audio_panel;
144 wxPanel* _subtitle_panel;
146 /** The film we are editing */
147 boost::shared_ptr<Film> _film;
149 wxStaticText* _dcp_name;
150 wxCheckBox* _use_dci_name;
151 wxChoice* _container;
152 wxListCtrl* _content;
153 wxButton* _content_add;
154 wxButton* _content_remove;
155 wxButton* _content_earlier;
156 wxButton* _content_later;
157 wxButton* _content_timeline;
158 wxCheckBox* _sequence_video;
159 wxButton* _edit_dci_button;
161 wxStaticText* _ratio_description;
162 wxStaticText* _scaling_description;
163 wxSpinCtrl* _left_crop;
164 wxSpinCtrl* _right_crop;
165 wxSpinCtrl* _top_crop;
166 wxSpinCtrl* _bottom_crop;
167 wxStaticText* _filters;
168 wxButton* _filters_button;
170 wxSpinCtrl* _audio_gain;
171 wxButton* _audio_gain_calculate_button;
172 wxButton* _show_audio;
173 wxSpinCtrl* _audio_delay;
174 wxCheckBox* _with_subtitles;
175 wxSpinCtrl* _subtitle_offset;
176 wxSpinCtrl* _subtitle_scale;
177 wxSpinCtrl* _j2k_bandwidth;
178 wxChoice* _dcp_content_type;
179 wxChoice* _dcp_frame_rate;
180 wxSpinCtrl* _dcp_audio_channels;
181 wxButton* _best_dcp_frame_rate;
182 wxChoice* _audio_stream;
183 wxStaticText* _audio_description;
184 wxChoice* _subtitle_stream;
185 AudioMappingView* _audio_mapping;
186 wxChoice* _dcp_resolution;
190 std::vector<Ratio const *> _ratios;
192 bool _generally_sensitive;
193 AudioDialog* _audio_dialog;
194 TimelineDialog* _timeline_dialog;