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.cc
21 * @brief A wx widget to edit a film's metadata, and perform various functions.
27 #include <wx/notebook.h>
28 #include <wx/listctrl.h>
29 #include <boost/thread.hpp>
30 #include <boost/filesystem.hpp>
31 #include <boost/lexical_cast.hpp>
32 #include "lib/format.h"
34 #include "lib/transcode_job.h"
35 #include "lib/exceptions.h"
36 #include "lib/ab_transcode_job.h"
37 #include "lib/job_manager.h"
38 #include "lib/filter.h"
39 #include "lib/config.h"
40 #include "lib/ffmpeg_decoder.h"
41 #include "lib/imagemagick_content.h"
42 #include "lib/sndfile_content.h"
43 #include "lib/dcp_content_type.h"
44 #include "filter_dialog.h"
46 #include "film_editor.h"
47 #include "gain_calculator_dialog.h"
48 #include "sound_processor.h"
49 #include "dci_metadata_dialog.h"
51 #include "audio_dialog.h"
52 #include "imagemagick_content_dialog.h"
53 #include "ffmpeg_content_dialog.h"
54 #include "audio_mapping_view.h"
55 #include "timeline_dialog.h"
59 using std::stringstream;
62 using std::setprecision;
66 using boost::shared_ptr;
67 using boost::weak_ptr;
68 using boost::dynamic_pointer_cast;
69 using boost::lexical_cast;
71 /** @param f Film to edit */
72 FilmEditor::FilmEditor (shared_ptr<Film> f, wxWindow* parent)
74 , _generally_sensitive (true)
76 , _timeline_dialog (0)
78 wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
79 _notebook = new wxNotebook (this, wxID_ANY);
80 s->Add (_notebook, 1);
83 _notebook->AddPage (_film_panel, _("Film"), true);
84 make_content_panel ();
85 _notebook->AddPage (_content_panel, _("Content"), false);
87 _notebook->AddPage (_video_panel, _("Video"), false);
89 _notebook->AddPage (_audio_panel, _("Audio"), false);
90 make_subtitle_panel ();
91 _notebook->AddPage (_subtitle_panel, _("Subtitles"), false);
96 connect_to_widgets ();
98 JobManager::instance()->ActiveJobsChanged.connect (
99 bind (&FilmEditor::active_jobs_changed, this, _1)
106 FilmEditor::make_film_panel ()
108 _film_panel = new wxPanel (_notebook);
109 _film_sizer = new wxBoxSizer (wxVERTICAL);
110 _film_panel->SetSizer (_film_sizer);
112 wxGridBagSizer* grid = new wxGridBagSizer (4, 4);
113 _film_sizer->Add (grid, 0, wxALL, 8);
117 add_label_to_grid_bag_sizer (grid, _film_panel, _("Name"), wxGBPosition (r, 0));
118 _name = new wxTextCtrl (_film_panel, wxID_ANY);
119 grid->Add (_name, wxGBPosition(r, 1), wxDefaultSpan, wxEXPAND);
122 add_label_to_grid_bag_sizer (grid, _film_panel, _("DCP Name"), wxGBPosition (r, 0));
123 _dcp_name = new wxStaticText (_film_panel, wxID_ANY, wxT (""));
124 grid->Add (_dcp_name, wxGBPosition(r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
127 _use_dci_name = new wxCheckBox (_film_panel, wxID_ANY, _("Use DCI name"));
128 grid->Add (_use_dci_name, wxGBPosition (r, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
129 _edit_dci_button = new wxButton (_film_panel, wxID_ANY, _("Details..."));
130 grid->Add (_edit_dci_button, wxGBPosition (r, 1), wxDefaultSpan);
133 _trust_content_headers = new wxCheckBox (_film_panel, wxID_ANY, _("Trust content's header"));
134 grid->Add (_trust_content_headers, wxGBPosition (r, 0), wxGBSpan(1, 2));
137 add_label_to_grid_bag_sizer (grid, _film_panel, _("Content Type"), wxGBPosition (r, 0));
138 _dcp_content_type = new wxChoice (_film_panel, wxID_ANY);
139 grid->Add (_dcp_content_type, wxGBPosition (r, 1));
143 add_label_to_grid_bag_sizer (grid, _film_panel, _("DCP Frame Rate"), wxGBPosition (r, 0));
144 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
145 _dcp_frame_rate = new wxChoice (_film_panel, wxID_ANY);
146 s->Add (_dcp_frame_rate, 1, wxALIGN_CENTER_VERTICAL);
147 _best_dcp_frame_rate = new wxButton (_film_panel, wxID_ANY, _("Use best"));
148 s->Add (_best_dcp_frame_rate, 1, wxALIGN_CENTER_VERTICAL | wxALL | wxEXPAND, 6);
149 grid->Add (s, wxGBPosition (r, 1));
153 _frame_rate_description = new wxStaticText (_film_panel, wxID_ANY, wxT ("\n \n "), wxDefaultPosition, wxDefaultSize);
154 grid->Add (_frame_rate_description, wxGBPosition (r, 0), wxGBSpan (1, 2), wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6);
155 wxFont font = _frame_rate_description->GetFont();
156 font.SetStyle(wxFONTSTYLE_ITALIC);
157 font.SetPointSize(font.GetPointSize() - 1);
158 _frame_rate_description->SetFont(font);
161 add_label_to_grid_bag_sizer (grid, _film_panel, _("Length"), wxGBPosition (r, 0));
162 _length = new wxStaticText (_film_panel, wxID_ANY, wxT (""));
163 grid->Add (_length, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
168 add_label_to_grid_bag_sizer (grid, _film_panel, _("Trim frames"), wxGBPosition (r, 0));
169 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
170 add_label_to_sizer (s, _film_panel, _("Start"));
171 _trim_start = new wxSpinCtrl (_film_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1));
172 s->Add (_trim_start);
173 add_label_to_sizer (s, _film_panel, _("End"));
174 _trim_end = new wxSpinCtrl (_film_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1));
177 grid->Add (s, wxGBPosition (r, 1));
181 add_label_to_grid_bag_sizer (grid, _film_panel, _("Trim method"), wxGBPosition (r, 0));
182 _trim_type = new wxChoice (_film_panel, wxID_ANY);
183 grid->Add (_trim_type, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
186 _ab = new wxCheckBox (_film_panel, wxID_ANY, _("A/B"));
187 grid->Add (_ab, wxGBPosition (r, 0));
190 vector<DCPContentType const *> const ct = DCPContentType::all ();
191 for (vector<DCPContentType const *>::const_iterator i = ct.begin(); i != ct.end(); ++i) {
192 _dcp_content_type->Append (std_to_wx ((*i)->pretty_name ()));
195 list<int> const dfr = Config::instance()->allowed_dcp_frame_rates ();
196 for (list<int>::const_iterator i = dfr.begin(); i != dfr.end(); ++i) {
197 _dcp_frame_rate->Append (std_to_wx (boost::lexical_cast<string> (*i)));
200 _trim_type->Append (_("encode all frames and play the subset"));
201 _trim_type->Append (_("encode only the subset"));
205 FilmEditor::connect_to_widgets ()
207 _name->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (FilmEditor::name_changed), 0, this);
208 _use_dci_name->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::use_dci_name_toggled), 0, this);
209 _edit_dci_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::edit_dci_button_clicked), 0, this);
210 _format->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::format_changed), 0, this);
211 _trust_content_headers->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::trust_content_headers_changed), 0, this);
212 _content->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler (FilmEditor::content_selection_changed), 0, this);
213 _content->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler (FilmEditor::content_selection_changed), 0, this);
214 _content->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler (FilmEditor::content_activated), 0, this);
215 _content_add->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_add_clicked), 0, this);
216 _content_remove->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_remove_clicked), 0, this);
217 _content_edit->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_edit_clicked), 0, this);
218 _content_earlier->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_earlier_clicked), 0, this);
219 _content_later->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_later_clicked), 0, this);
220 _timeline_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::timeline_clicked), 0, this);
221 _loop_content->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::loop_content_toggled), 0, this);
222 _loop_count->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::loop_count_changed), 0, this);
223 _left_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::left_crop_changed), 0, this);
224 _right_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::right_crop_changed), 0, this);
225 _top_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::top_crop_changed), 0, this);
226 _bottom_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::bottom_crop_changed), 0, this);
227 _filters_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::edit_filters_clicked), 0, this);
228 _scaler->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::scaler_changed), 0, this);
229 _dcp_content_type->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::dcp_content_type_changed), 0, this);
230 _dcp_frame_rate->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::dcp_frame_rate_changed), 0, this);
231 _best_dcp_frame_rate->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::best_dcp_frame_rate_clicked), 0, this);
232 _ab->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::ab_toggled), 0, this);
233 _trim_start->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::trim_start_changed), 0, this);
234 _trim_end->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::trim_end_changed), 0, this);
235 _trim_type->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::trim_type_changed), 0, this);
236 _with_subtitles->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::with_subtitles_toggled), 0, this);
237 _subtitle_offset->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::subtitle_offset_changed), 0, this);
238 _subtitle_scale->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::subtitle_scale_changed), 0, this);
239 _colour_lut->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::colour_lut_changed), 0, this);
240 _j2k_bandwidth->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::j2k_bandwidth_changed), 0, this);
241 _audio_gain->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::audio_gain_changed), 0, this);
242 _audio_gain_calculate_button->Connect (
243 wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::audio_gain_calculate_button_clicked), 0, this
245 _show_audio->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::show_audio_clicked), 0, this);
246 _audio_delay->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::audio_delay_changed), 0, this);
250 FilmEditor::make_video_panel ()
252 _video_panel = new wxPanel (_notebook);
253 _video_sizer = new wxBoxSizer (wxVERTICAL);
254 _video_panel->SetSizer (_video_sizer);
256 wxGridBagSizer* grid = new wxGridBagSizer (4, 4);
257 _video_sizer->Add (grid, 0, wxALL, 8);
260 add_label_to_grid_bag_sizer (grid, _video_panel, _("Format"), wxGBPosition (r, 0));
261 _format = new wxChoice (_video_panel, wxID_ANY);
262 grid->Add (_format, wxGBPosition (r, 1));
265 add_label_to_grid_bag_sizer (grid, _video_panel, _("Left crop"), wxGBPosition (r, 0));
266 _left_crop = new wxSpinCtrl (_video_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1));
267 grid->Add (_left_crop, wxGBPosition (r, 1));
270 add_label_to_grid_bag_sizer (grid, _video_panel, _("Right crop"), wxGBPosition (r, 0));
271 _right_crop = new wxSpinCtrl (_video_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1));
272 grid->Add (_right_crop, wxGBPosition (r, 1));
275 add_label_to_grid_bag_sizer (grid, _video_panel, _("Top crop"), wxGBPosition (r, 0));
276 _top_crop = new wxSpinCtrl (_video_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1));
277 grid->Add (_top_crop, wxGBPosition (r, 1));
280 add_label_to_grid_bag_sizer (grid, _video_panel, _("Bottom crop"), wxGBPosition (r, 0));
281 _bottom_crop = new wxSpinCtrl (_video_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1));
282 grid->Add (_bottom_crop, wxGBPosition (r, 1));
285 _scaling_description = new wxStaticText (_video_panel, wxID_ANY, wxT ("\n \n \n \n"), wxDefaultPosition, wxDefaultSize);
286 grid->Add (_scaling_description, wxGBPosition (r, 0), wxGBSpan (1, 2), wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6);
287 wxFont font = _scaling_description->GetFont();
288 font.SetStyle(wxFONTSTYLE_ITALIC);
289 font.SetPointSize(font.GetPointSize() - 1);
290 _scaling_description->SetFont(font);
293 /* VIDEO-only stuff */
295 add_label_to_grid_bag_sizer (grid, _video_panel, _("Filters"), wxGBPosition (r, 0));
296 wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
297 _filters = new wxStaticText (_video_panel, wxID_ANY, _("None"));
298 s->Add (_filters, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxRIGHT, 6);
299 _filters_button = new wxButton (_video_panel, wxID_ANY, _("Edit..."));
300 s->Add (_filters_button, 0);
301 grid->Add (s, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
305 add_label_to_grid_bag_sizer (grid, _video_panel, _("Scaler"), wxGBPosition (r, 0));
306 _scaler = new wxChoice (_video_panel, wxID_ANY);
307 grid->Add (_scaler, wxGBPosition (r, 1));
310 vector<Scaler const *> const sc = Scaler::all ();
311 for (vector<Scaler const *>::const_iterator i = sc.begin(); i != sc.end(); ++i) {
312 _scaler->Append (std_to_wx ((*i)->name()));
315 add_label_to_grid_bag_sizer (grid, _video_panel, _("Colour look-up table"), wxGBPosition (r, 0));
316 _colour_lut = new wxChoice (_video_panel, wxID_ANY);
317 for (int i = 0; i < 2; ++i) {
318 _colour_lut->Append (std_to_wx (colour_lut_index_to_name (i)));
320 _colour_lut->SetSelection (0);
321 grid->Add (_colour_lut, wxGBPosition (r, 1), wxDefaultSpan, wxEXPAND);
325 add_label_to_grid_bag_sizer (grid, _video_panel, _("JPEG2000 bandwidth"), wxGBPosition (r, 0));
326 wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
327 _j2k_bandwidth = new wxSpinCtrl (_video_panel, wxID_ANY);
328 s->Add (_j2k_bandwidth, 1);
329 add_label_to_sizer (s, _video_panel, _("MBps"));
330 grid->Add (s, wxGBPosition (r, 1));
334 _left_crop->SetRange (0, 1024);
335 _top_crop->SetRange (0, 1024);
336 _right_crop->SetRange (0, 1024);
337 _bottom_crop->SetRange (0, 1024);
338 _trim_start->SetRange (0, 100);
339 _trim_end->SetRange (0, 100);
340 _j2k_bandwidth->SetRange (50, 250);
344 FilmEditor::make_content_panel ()
346 _content_panel = new wxPanel (_notebook);
347 _content_sizer = new wxBoxSizer (wxVERTICAL);
348 _content_panel->SetSizer (_content_sizer);
351 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
353 _content = new wxListCtrl (_content_panel, wxID_ANY, wxDefaultPosition, wxSize (320, 160), wxLC_REPORT | wxLC_NO_HEADER | wxLC_SINGLE_SEL);
354 s->Add (_content, 1, wxEXPAND | wxTOP | wxBOTTOM, 6);
356 _content->InsertColumn (0, wxT(""));
357 _content->SetColumnWidth (0, 512);
359 wxBoxSizer* b = new wxBoxSizer (wxVERTICAL);
360 _content_add = new wxButton (_content_panel, wxID_ANY, _("Add..."));
361 b->Add (_content_add);
362 _content_remove = new wxButton (_content_panel, wxID_ANY, _("Remove"));
363 b->Add (_content_remove);
364 _content_edit = new wxButton (_content_panel, wxID_ANY, _("Edit..."));
365 b->Add (_content_edit);
366 _content_earlier = new wxButton (_content_panel, wxID_ANY, _("Earlier"));
367 b->Add (_content_earlier);
368 _content_later = new wxButton (_content_panel, wxID_ANY, _("Later"));
369 b->Add (_content_later);
371 s->Add (b, 0, wxALL, 4);
373 _content_sizer->Add (s, 0.75, wxEXPAND | wxALL, 6);
376 _content_information = new wxTextCtrl (_content_panel, wxID_ANY, wxT ("\n \n "), wxDefaultPosition, wxDefaultSize, wxTE_READONLY | wxTE_MULTILINE);
377 _content_sizer->Add (_content_information, 1, wxEXPAND | wxALL, 6);
379 wxBoxSizer* h = new wxBoxSizer (wxHORIZONTAL);
380 _loop_content = new wxCheckBox (_content_panel, wxID_ANY, _("Loop everything"));
381 h->Add (_loop_content, 0, wxALL, 6);
382 _loop_count = new wxSpinCtrl (_content_panel, wxID_ANY);
383 h->Add (_loop_count, 0, wxALL, 6);
384 add_label_to_sizer (h, _content_panel, _("times"));
385 _content_sizer->Add (h, 0, wxALL, 6);
387 _playlist_description = new wxStaticText (_content_panel, wxID_ANY, wxT ("\n \n \n \n "));
388 _content_sizer->Add (_playlist_description, 0.25, wxEXPAND | wxALL, 6);
389 wxFont font = _playlist_description->GetFont();
390 font.SetStyle(wxFONTSTYLE_ITALIC);
391 font.SetPointSize(font.GetPointSize() - 1);
392 _playlist_description->SetFont(font);
394 _timeline_button = new wxButton (_content_panel, wxID_ANY, _("Timeline..."));
395 _content_sizer->Add (_timeline_button, 0, wxALL, 6);
397 _loop_count->SetRange (2, 1024);
401 FilmEditor::make_audio_panel ()
403 _audio_panel = new wxPanel (_notebook);
404 _audio_sizer = new wxBoxSizer (wxVERTICAL);
405 _audio_panel->SetSizer (_audio_sizer);
407 wxFlexGridSizer* grid = new wxFlexGridSizer (2, 4, 4);
408 _audio_sizer->Add (grid, 0, wxALL, 8);
410 _show_audio = new wxButton (_audio_panel, wxID_ANY, _("Show Audio..."));
411 grid->Add (_show_audio, 1);
415 add_label_to_sizer (grid, _audio_panel, _("Audio Gain"));
416 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
417 _audio_gain = new wxSpinCtrl (_audio_panel);
418 s->Add (_audio_gain, 1);
419 add_label_to_sizer (s, _audio_panel, _("dB"));
420 _audio_gain_calculate_button = new wxButton (_audio_panel, wxID_ANY, _("Calculate..."));
421 s->Add (_audio_gain_calculate_button, 1, wxEXPAND);
426 add_label_to_sizer (grid, _audio_panel, _("Audio Delay"));
427 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
428 _audio_delay = new wxSpinCtrl (_audio_panel);
429 s->Add (_audio_delay, 1);
430 /// TRANSLATORS: this is an abbreviation for milliseconds, the unit of time
431 add_label_to_sizer (s, _audio_panel, _("ms"));
435 _audio_mapping = new AudioMappingView (_audio_panel);
436 _audio_sizer->Add (_audio_mapping, 1, wxEXPAND | wxALL, 6);
438 _audio_gain->SetRange (-60, 60);
439 _audio_delay->SetRange (-1000, 1000);
443 FilmEditor::make_subtitle_panel ()
445 _subtitle_panel = new wxPanel (_notebook);
446 _subtitle_sizer = new wxBoxSizer (wxVERTICAL);
447 _subtitle_panel->SetSizer (_subtitle_sizer);
448 wxFlexGridSizer* grid = new wxFlexGridSizer (2, 4, 4);
449 _subtitle_sizer->Add (grid, 0, wxALL, 8);
451 _with_subtitles = new wxCheckBox (_subtitle_panel, wxID_ANY, _("With Subtitles"));
452 grid->Add (_with_subtitles, 1);
456 add_label_to_sizer (grid, _subtitle_panel, _("Subtitle Offset"));
457 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
458 _subtitle_offset = new wxSpinCtrl (_subtitle_panel);
459 s->Add (_subtitle_offset);
460 add_label_to_sizer (s, _subtitle_panel, _("pixels"));
465 add_label_to_sizer (grid, _subtitle_panel, _("Subtitle Scale"));
466 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
467 _subtitle_scale = new wxSpinCtrl (_subtitle_panel);
468 s->Add (_subtitle_scale);
469 add_label_to_sizer (s, _subtitle_panel, _("%"));
473 _subtitle_offset->SetRange (-1024, 1024);
474 _subtitle_scale->SetRange (1, 1000);
477 /** Called when the left crop widget has been changed */
479 FilmEditor::left_crop_changed (wxCommandEvent &)
485 _film->set_left_crop (_left_crop->GetValue ());
488 /** Called when the right crop widget has been changed */
490 FilmEditor::right_crop_changed (wxCommandEvent &)
496 _film->set_right_crop (_right_crop->GetValue ());
499 /** Called when the top crop widget has been changed */
501 FilmEditor::top_crop_changed (wxCommandEvent &)
507 _film->set_top_crop (_top_crop->GetValue ());
510 /** Called when the bottom crop value has been changed */
512 FilmEditor::bottom_crop_changed (wxCommandEvent &)
518 _film->set_bottom_crop (_bottom_crop->GetValue ());
522 FilmEditor::trust_content_headers_changed (wxCommandEvent &)
528 _film->set_trust_content_headers (_trust_content_headers->GetValue ());
531 /** Called when the DCP A/B switch has been toggled */
533 FilmEditor::ab_toggled (wxCommandEvent &)
539 _film->set_ab (_ab->GetValue ());
542 /** Called when the name widget has been changed */
544 FilmEditor::name_changed (wxCommandEvent &)
550 _film->set_name (string (_name->GetValue().mb_str()));
554 FilmEditor::subtitle_offset_changed (wxCommandEvent &)
560 _film->set_subtitle_offset (_subtitle_offset->GetValue ());
564 FilmEditor::subtitle_scale_changed (wxCommandEvent &)
570 _film->set_subtitle_scale (_subtitle_scale->GetValue() / 100.0);
574 FilmEditor::colour_lut_changed (wxCommandEvent &)
580 _film->set_colour_lut (_colour_lut->GetSelection ());
584 FilmEditor::j2k_bandwidth_changed (wxCommandEvent &)
590 _film->set_j2k_bandwidth (_j2k_bandwidth->GetValue() * 1e6);
594 FilmEditor::dcp_frame_rate_changed (wxCommandEvent &)
600 _film->set_dcp_frame_rate (
601 boost::lexical_cast<int> (
602 wx_to_std (_dcp_frame_rate->GetString (_dcp_frame_rate->GetSelection ()))
608 /** Called when the metadata stored in the Film object has changed;
609 * so that we can update the GUI.
610 * @param p Property of the Film that has changed.
613 FilmEditor::film_changed (Film::Property p)
630 setup_subtitle_control_sensitivity ();
631 setup_show_audio_sensitivity ();
635 checked_set (_loop_content, _film->loop() > 1);
636 checked_set (_loop_count, _film->loop());
637 setup_loop_sensitivity ();
639 case Film::TRUST_CONTENT_HEADERS:
640 checked_set (_trust_content_headers, _film->trust_content_headers ());
646 checked_set (_left_crop, _film->crop().left);
647 checked_set (_right_crop, _film->crop().right);
648 checked_set (_top_crop, _film->crop().top);
649 checked_set (_bottom_crop, _film->crop().bottom);
650 setup_scaling_description ();
654 pair<string, string> p = Filter::ffmpeg_strings (_film->filters ());
655 if (p.first.empty () && p.second.empty ()) {
656 _filters->SetLabel (_("None"));
658 string const b = p.first + " " + p.second;
659 _filters->SetLabel (std_to_wx (b));
661 _film_sizer->Layout ();
665 checked_set (_name, _film->name());
668 case Film::DCP_CONTENT_TYPE:
669 checked_set (_dcp_content_type, DCPContentType::as_index (_film->dcp_content_type ()));
673 checked_set (_ab, _film->ab ());
676 checked_set (_scaler, Scaler::as_index (_film->scaler ()));
678 case Film::TRIM_START:
679 checked_set (_trim_start, _film->trim_start());
682 checked_set (_trim_end, _film->trim_end());
684 case Film::TRIM_TYPE:
685 checked_set (_trim_type, _film->trim_type() == Film::CPL ? 0 : 1);
687 case Film::AUDIO_GAIN:
688 checked_set (_audio_gain, _film->audio_gain ());
690 case Film::AUDIO_DELAY:
691 checked_set (_audio_delay, _film->audio_delay ());
693 case Film::WITH_SUBTITLES:
694 checked_set (_with_subtitles, _film->with_subtitles ());
695 setup_subtitle_control_sensitivity ();
698 case Film::SUBTITLE_OFFSET:
699 checked_set (_subtitle_offset, _film->subtitle_offset ());
701 case Film::SUBTITLE_SCALE:
702 checked_set (_subtitle_scale, _film->subtitle_scale() * 100);
704 case Film::COLOUR_LUT:
705 checked_set (_colour_lut, _film->colour_lut ());
707 case Film::J2K_BANDWIDTH:
708 checked_set (_j2k_bandwidth, double (_film->j2k_bandwidth()) / 1e6);
710 case Film::USE_DCI_NAME:
711 checked_set (_use_dci_name, _film->use_dci_name ());
714 case Film::DCI_METADATA:
717 case Film::DCP_FRAME_RATE:
720 for (unsigned int i = 0; i < _dcp_frame_rate->GetCount(); ++i) {
721 if (wx_to_std (_dcp_frame_rate->GetString(i)) == boost::lexical_cast<string> (_film->dcp_frame_rate())) {
722 checked_set (_dcp_frame_rate, i);
729 checked_set (_dcp_frame_rate, -1);
732 if (_film->video_frame_rate()) {
733 _best_dcp_frame_rate->Enable (best_dcp_frame_rate (_film->video_frame_rate ()) != _film->dcp_frame_rate ());
735 _best_dcp_frame_rate->Disable ();
737 setup_frame_rate_description ();
740 case Film::AUDIO_MAPPING:
741 _audio_mapping->set_mapping (_film->audio_mapping ());
747 FilmEditor::film_content_changed (weak_ptr<Content> content, int property)
750 /* We call this method ourselves (as well as using it as a signal handler)
756 if (property == FFmpegContentProperty::SUBTITLE_STREAMS) {
757 setup_subtitle_control_sensitivity ();
758 } else if (property == FFmpegContentProperty::AUDIO_STREAMS) {
759 setup_show_audio_sensitivity ();
760 } else if (property == VideoContentProperty::VIDEO_LENGTH || property == AudioContentProperty::AUDIO_LENGTH) {
762 boost::shared_ptr<Content> c = content.lock ();
763 if (c && c == selected_content()) {
764 setup_content_information ();
766 } else if (property == FFmpegContentProperty::AUDIO_STREAM) {
768 setup_show_audio_sensitivity ();
773 FilmEditor::setup_format ()
776 vector<Format const *>::iterator i = _formats.begin ();
777 while (i != _formats.end() && *i != _film->format ()) {
782 if (i == _formats.end()) {
783 checked_set (_format, -1);
785 checked_set (_format, n);
789 setup_scaling_description ();
793 FilmEditor::setup_length ()
796 ContentVideoFrame const frames = _film->content_length ();
798 if (frames && _film->video_frame_rate()) {
799 s << frames << " " << wx_to_std (_("frames")) << "; " << seconds_to_hms (frames / _film->video_frame_rate());
801 s << frames << " " << wx_to_std (_("frames"));
804 _length->SetLabel (std_to_wx (s.str ()));
807 _trim_start->SetRange (0, frames);
808 _trim_end->SetRange (0, frames);
813 FilmEditor::setup_frame_rate_description ()
818 if (_film->video_frame_rate()) {
819 d << std_to_wx (FrameRateConversion (_film->video_frame_rate(), _film->dcp_frame_rate()).description);
821 #ifdef HAVE_SWRESAMPLE
822 if (_film->audio_frame_rate() && _film->audio_frame_rate() != _film->target_audio_sample_rate ()) {
823 d << wxString::Format (
824 _("Audio will be resampled from %dHz to %dHz\n"),
825 _film->audio_frame_rate(),
826 _film->target_audio_sample_rate()
833 for (int i = lines; i < 2; ++i) {
837 _frame_rate_description->SetLabel (d);
840 /** Called when the format widget has been changed */
842 FilmEditor::format_changed (wxCommandEvent &)
848 int const n = _format->GetSelection ();
850 assert (n < int (_formats.size()));
851 _film->set_format (_formats[n]);
855 /** Called when the DCP content type widget has been changed */
857 FilmEditor::dcp_content_type_changed (wxCommandEvent &)
863 int const n = _dcp_content_type->GetSelection ();
864 if (n != wxNOT_FOUND) {
865 _film->set_dcp_content_type (DCPContentType::from_index (n));
869 /** Sets the Film that we are editing */
871 FilmEditor::set_film (shared_ptr<Film> f)
873 set_things_sensitive (f != 0);
882 _film->Changed.connect (bind (&FilmEditor::film_changed, this, _1));
883 _film->ContentChanged.connect (bind (&FilmEditor::film_content_changed, this, _1, _2));
887 FileChanged (_film->directory ());
893 _audio_dialog->set_film (_film);
896 film_changed (Film::NAME);
897 film_changed (Film::USE_DCI_NAME);
898 film_changed (Film::CONTENT);
899 film_changed (Film::LOOP);
900 film_changed (Film::TRUST_CONTENT_HEADERS);
901 film_changed (Film::DCP_CONTENT_TYPE);
902 film_changed (Film::FORMAT);
903 film_changed (Film::CROP);
904 film_changed (Film::FILTERS);
905 film_changed (Film::SCALER);
906 film_changed (Film::TRIM_START);
907 film_changed (Film::TRIM_END);
908 film_changed (Film::AB);
909 film_changed (Film::TRIM_TYPE);
910 film_changed (Film::AUDIO_GAIN);
911 film_changed (Film::AUDIO_DELAY);
912 film_changed (Film::WITH_SUBTITLES);
913 film_changed (Film::SUBTITLE_OFFSET);
914 film_changed (Film::SUBTITLE_SCALE);
915 film_changed (Film::COLOUR_LUT);
916 film_changed (Film::J2K_BANDWIDTH);
917 film_changed (Film::DCI_METADATA);
918 film_changed (Film::DCP_FRAME_RATE);
919 film_changed (Film::AUDIO_MAPPING);
921 film_content_changed (boost::shared_ptr<Content> (), FFmpegContentProperty::SUBTITLE_STREAMS);
922 film_content_changed (boost::shared_ptr<Content> (), FFmpegContentProperty::SUBTITLE_STREAM);
923 film_content_changed (boost::shared_ptr<Content> (), FFmpegContentProperty::AUDIO_STREAMS);
924 film_content_changed (boost::shared_ptr<Content> (), FFmpegContentProperty::AUDIO_STREAM);
926 setup_content_information ();
929 /** Updates the sensitivity of lots of widgets to a given value.
930 * @param s true to make sensitive, false to make insensitive.
933 FilmEditor::set_things_sensitive (bool s)
935 _generally_sensitive = s;
938 _use_dci_name->Enable (s);
939 _edit_dci_button->Enable (s);
941 _content->Enable (s);
942 _trust_content_headers->Enable (s);
943 _content->Enable (s);
944 _left_crop->Enable (s);
945 _right_crop->Enable (s);
946 _top_crop->Enable (s);
947 _bottom_crop->Enable (s);
948 _filters_button->Enable (s);
950 _dcp_content_type->Enable (s);
951 _best_dcp_frame_rate->Enable (s);
952 _dcp_frame_rate->Enable (s);
953 _trim_start->Enable (s);
954 _trim_end->Enable (s);
956 _trim_type->Enable (s);
957 _colour_lut->Enable (s);
958 _j2k_bandwidth->Enable (s);
959 _audio_gain->Enable (s);
960 _audio_gain_calculate_button->Enable (s);
961 _show_audio->Enable (s);
962 _audio_delay->Enable (s);
964 setup_subtitle_control_sensitivity ();
965 setup_show_audio_sensitivity ();
966 setup_content_button_sensitivity ();
969 /** Called when the `Edit filters' button has been clicked */
971 FilmEditor::edit_filters_clicked (wxCommandEvent &)
973 FilterDialog* d = new FilterDialog (this, _film->filters());
974 d->ActiveChanged.connect (bind (&Film::set_filters, _film, _1));
979 /** Called when the scaler widget has been changed */
981 FilmEditor::scaler_changed (wxCommandEvent &)
987 int const n = _scaler->GetSelection ();
989 _film->set_scaler (Scaler::from_index (n));
994 FilmEditor::audio_gain_changed (wxCommandEvent &)
1000 _film->set_audio_gain (_audio_gain->GetValue ());
1004 FilmEditor::audio_delay_changed (wxCommandEvent &)
1010 _film->set_audio_delay (_audio_delay->GetValue ());
1014 FilmEditor::setup_notebook_size ()
1016 _notebook->InvalidateBestSize ();
1018 _film_sizer->Layout ();
1019 _film_sizer->SetSizeHints (_film_panel);
1020 _video_sizer->Layout ();
1021 _video_sizer->SetSizeHints (_video_panel);
1022 _audio_sizer->Layout ();
1023 _audio_sizer->SetSizeHints (_audio_panel);
1024 _subtitle_sizer->Layout ();
1025 _subtitle_sizer->SetSizeHints (_subtitle_panel);
1032 FilmEditor::trim_start_changed (wxCommandEvent &)
1038 _film->set_trim_start (_trim_start->GetValue ());
1042 FilmEditor::trim_end_changed (wxCommandEvent &)
1048 _film->set_trim_end (_trim_end->GetValue ());
1052 FilmEditor::audio_gain_calculate_button_clicked (wxCommandEvent &)
1054 GainCalculatorDialog* d = new GainCalculatorDialog (this);
1057 if (d->wanted_fader() == 0 || d->actual_fader() == 0) {
1062 _audio_gain->SetValue (
1063 Config::instance()->sound_processor()->db_for_fader_change (
1069 /* This appears to be necessary, as the change is not signalled,
1072 wxCommandEvent dummy;
1073 audio_gain_changed (dummy);
1079 FilmEditor::setup_formats ()
1081 _formats = Format::all ();
1084 for (vector<Format const *>::iterator i = _formats.begin(); i != _formats.end(); ++i) {
1085 _format->Append (std_to_wx ((*i)->name ()));
1088 _film_sizer->Layout ();
1092 FilmEditor::with_subtitles_toggled (wxCommandEvent &)
1098 _film->set_with_subtitles (_with_subtitles->GetValue ());
1102 FilmEditor::setup_subtitle_control_sensitivity ()
1105 if (_generally_sensitive && _film) {
1106 h = !_film->has_subtitles ();
1109 _with_subtitles->Enable (h);
1113 j = _film->with_subtitles ();
1116 _subtitle_offset->Enable (j);
1117 _subtitle_scale->Enable (j);
1121 FilmEditor::use_dci_name_toggled (wxCommandEvent &)
1127 _film->set_use_dci_name (_use_dci_name->GetValue ());
1131 FilmEditor::edit_dci_button_clicked (wxCommandEvent &)
1137 DCIMetadataDialog* d = new DCIMetadataDialog (this, _film->dci_metadata ());
1139 _film->set_dci_metadata (d->dci_metadata ());
1144 FilmEditor::active_jobs_changed (bool a)
1146 set_things_sensitive (!a);
1150 FilmEditor::setup_dcp_name ()
1152 string s = _film->dcp_name (true);
1153 if (s.length() > 28) {
1154 _dcp_name->SetLabel (std_to_wx (s.substr (0, 28)) + N_("..."));
1155 _dcp_name->SetToolTip (std_to_wx (s));
1157 _dcp_name->SetLabel (std_to_wx (s));
1162 FilmEditor::show_audio_clicked (wxCommandEvent &)
1164 if (_audio_dialog) {
1165 _audio_dialog->Destroy ();
1169 _audio_dialog = new AudioDialog (this);
1170 _audio_dialog->Show ();
1171 _audio_dialog->set_film (_film);
1175 FilmEditor::best_dcp_frame_rate_clicked (wxCommandEvent &)
1181 _film->set_dcp_frame_rate (best_dcp_frame_rate (_film->video_frame_rate ()));
1185 FilmEditor::setup_show_audio_sensitivity ()
1187 _show_audio->Enable (_film && _film->has_audio ());
1191 FilmEditor::setup_content ()
1193 string selected_summary;
1194 int const s = _content->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
1196 selected_summary = wx_to_std (_content->GetItemText (s));
1199 _content->DeleteAllItems ();
1201 ContentList content = _film->content ();
1202 for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
1203 int const t = _content->GetItemCount ();
1204 _content->InsertItem (t, std_to_wx ((*i)->summary ()));
1205 if ((*i)->summary() == selected_summary) {
1206 _content->SetItemState (t, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
1210 if (selected_summary.empty () && !content.empty ()) {
1211 /* Select the first item of content if non was selected before */
1212 _content->SetItemState (0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
1215 setup_playlist_description ();
1219 FilmEditor::content_add_clicked (wxCommandEvent &)
1221 wxFileDialog* d = new wxFileDialog (this, _("Choose a file or files"), wxT (""), wxT (""), wxT ("*.*"), wxFD_MULTIPLE);
1222 int const r = d->ShowModal ();
1229 wxArrayString paths;
1230 d->GetPaths (paths);
1232 for (unsigned int i = 0; i < paths.GetCount(); ++i) {
1233 boost::filesystem::path p (wx_to_std (paths[i]));
1235 if (ImageMagickContent::valid_file (p)) {
1236 _film->add_content (shared_ptr<ImageMagickContent> (new ImageMagickContent (p)));
1237 } else if (SndfileContent::valid_file (p)) {
1238 _film->add_content (shared_ptr<SndfileContent> (new SndfileContent (p)));
1240 _film->add_content (shared_ptr<FFmpegContent> (new FFmpegContent (p)));
1246 FilmEditor::content_remove_clicked (wxCommandEvent &)
1248 shared_ptr<Content> c = selected_content ();
1250 _film->remove_content (c);
1255 FilmEditor::content_activated (wxListEvent& ev)
1257 ContentList c = _film->content ();
1258 assert (ev.GetIndex() >= 0 && size_t (ev.GetIndex()) < c.size ());
1260 edit_content (c[ev.GetIndex()]);
1264 FilmEditor::content_edit_clicked (wxCommandEvent &)
1266 shared_ptr<Content> c = selected_content ();
1275 FilmEditor::edit_content (shared_ptr<Content> c)
1277 shared_ptr<ImageMagickContent> im = dynamic_pointer_cast<ImageMagickContent> (c);
1279 ImageMagickContentDialog* d = new ImageMagickContentDialog (this, im);
1284 shared_ptr<FFmpegContent> ff = dynamic_pointer_cast<FFmpegContent> (c);
1286 FFmpegContentDialog* d = new FFmpegContentDialog (this, ff);
1293 FilmEditor::content_earlier_clicked (wxCommandEvent &)
1295 shared_ptr<Content> c = selected_content ();
1297 _film->move_content_earlier (c);
1302 FilmEditor::content_later_clicked (wxCommandEvent &)
1304 shared_ptr<Content> c = selected_content ();
1306 _film->move_content_later (c);
1311 FilmEditor::content_selection_changed (wxListEvent &)
1313 setup_content_button_sensitivity ();
1314 setup_content_information ();
1318 FilmEditor::setup_content_information ()
1320 shared_ptr<Content> c = selected_content ();
1322 _content_information->SetValue (wxT (""));
1326 _content_information->SetValue (std_to_wx (c->information ()));
1330 FilmEditor::setup_content_button_sensitivity ()
1332 _content_add->Enable (_generally_sensitive);
1334 shared_ptr<Content> selection = selected_content ();
1336 _content_edit->Enable (
1337 selection && _generally_sensitive &&
1338 (dynamic_pointer_cast<ImageMagickContent> (selection) || dynamic_pointer_cast<FFmpegContent> (selection))
1341 _content_remove->Enable (selection && _generally_sensitive);
1342 _content_earlier->Enable (selection && _generally_sensitive);
1343 _content_later->Enable (selection && _generally_sensitive);
1347 FilmEditor::selected_content ()
1349 int const s = _content->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
1351 return shared_ptr<Content> ();
1354 ContentList c = _film->content ();
1355 if (s < 0 || size_t (s) >= c.size ()) {
1356 return shared_ptr<Content> ();
1363 FilmEditor::setup_scaling_description ()
1369 if (_film->video_size().width && _film->video_size().height) {
1370 d << wxString::Format (
1371 _("Original video is %dx%d (%.2f:1)\n"),
1372 _film->video_size().width, _film->video_size().height,
1373 float (_film->video_size().width) / _film->video_size().height
1378 Crop const crop = _film->crop ();
1379 if (crop.left || crop.right || crop.top || crop.bottom) {
1380 libdcp::Size const cropped = _film->cropped_size (_film->video_size ());
1381 d << wxString::Format (
1382 _("Cropped to %dx%d (%.2f:1)\n"),
1383 cropped.width, cropped.height,
1384 float (cropped.width) / cropped.height
1389 Format const * format = _film->format ();
1391 int const padding = format->dcp_padding (_film);
1392 libdcp::Size scaled = format->dcp_size ();
1393 scaled.width -= padding * 2;
1394 d << wxString::Format (
1395 _("Scaled to %dx%d (%.2f:1)\n"),
1396 scaled.width, scaled.height,
1397 float (scaled.width) / scaled.height
1402 d << wxString::Format (
1403 _("Padded with black to %dx%d (%.2f:1)\n"),
1404 format->dcp_size().width, format->dcp_size().height,
1405 float (format->dcp_size().width) / format->dcp_size().height
1411 for (int i = lines; i < 4; ++i) {
1415 _scaling_description->SetLabel (d);
1419 FilmEditor::trim_type_changed (wxCommandEvent &)
1421 _film->set_trim_type (_trim_type->GetSelection () == 0 ? Film::CPL : Film::ENCODE);
1425 FilmEditor::loop_content_toggled (wxCommandEvent &)
1427 if (_loop_content->GetValue ()) {
1428 _film->set_loop (_loop_count->GetValue ());
1430 _film->set_loop (1);
1433 setup_loop_sensitivity ();
1437 FilmEditor::loop_count_changed (wxCommandEvent &)
1439 _film->set_loop (_loop_count->GetValue ());
1443 FilmEditor::setup_loop_sensitivity ()
1445 _loop_count->Enable (_loop_content->GetValue ());
1449 FilmEditor::setup_playlist_description ()
1452 _playlist_description->SetLabel (wxT (""));
1456 _playlist_description->SetLabel (std_to_wx (_film->playlist_description ()));
1460 FilmEditor::timeline_clicked (wxCommandEvent &)
1462 if (_timeline_dialog) {
1463 _timeline_dialog->Destroy ();
1464 _timeline_dialog = 0;
1467 _timeline_dialog = new TimelineDialog (this, _film->playlist ());
1468 _timeline_dialog->Show ();