385bc411003f9aaadceac1dd82a00c82307051e4
[dcpomatic.git] / src / wx / film_editor.cc
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.cc
21  *  @brief A wx widget to edit a film's metadata, and perform various functions.
22  */
23
24 #include <iostream>
25 #include <iomanip>
26 #include <wx/wx.h>
27 #include <boost/thread.hpp>
28 #include <boost/filesystem.hpp>
29 #include <boost/lexical_cast.hpp>
30 #include "lib/format.h"
31 #include "lib/film.h"
32 #include "lib/transcode_job.h"
33 #include "lib/exceptions.h"
34 #include "lib/ab_transcode_job.h"
35 #include "lib/thumbs_job.h"
36 #include "lib/job_manager.h"
37 #include "lib/filter.h"
38 #include "lib/screen.h"
39 #include "lib/config.h"
40 //#include "filter_dialog.h"
41 #include "wx_util.h"
42 #include "film_editor.h"
43 //#include "dcp_range_dialog.h"
44
45 using namespace std;
46 using namespace boost;
47
48 /** @param f Film to edit */
49 FilmEditor::FilmEditor (Film* f, wxWindow* parent)
50         : wxPanel (parent)
51         , _ignore_changes (false)
52         , _film (f)
53 {
54         wxSizer* sizer = new wxFlexGridSizer (2, 6, 6);
55         SetSizer (sizer);
56
57         add_label_to_sizer (sizer, this, "Name");
58         _name = new wxTextCtrl (this, wxID_ANY);
59         sizer->Add (_name, 1, wxEXPAND);
60
61         add_label_to_sizer (sizer, this, "Content");
62         _content = new wxFilePickerCtrl (this, wxID_ANY, wxT (""), wxT ("Select Content File"), wxT("*.*"));
63         sizer->Add (_content, 1, wxEXPAND);
64
65         add_label_to_sizer (sizer, this, "Content Type");
66         _dcp_content_type = new wxComboBox (this, wxID_ANY);
67         sizer->Add (_dcp_content_type);
68
69         add_label_to_sizer (sizer, this, "Format");
70         _format = new wxComboBox (this, wxID_ANY);
71         sizer->Add (_format);
72
73         {
74                 add_label_to_sizer (sizer, this, "Crop");
75                 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
76
77                 add_label_to_sizer (s, this, "L");
78                 _left_crop = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1));
79                 s->Add (_left_crop, 0);
80                 add_label_to_sizer (s, this, "R");
81                 _right_crop = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1));
82                 s->Add (_right_crop, 0);
83                 add_label_to_sizer (s, this, "T");
84                 _top_crop = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1));
85                 s->Add (_top_crop, 0);
86                 add_label_to_sizer (s, this, "B");
87                 _bottom_crop = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1));
88                 s->Add (_bottom_crop, 0);
89
90                 sizer->Add (s);
91         }
92
93         /* VIDEO-only stuff */
94         {
95                 video_control (add_label_to_sizer (sizer, this, "Filters"));
96                 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
97                 _filters = new wxStaticText (this, wxID_ANY, wxT (""));
98                 s->Add (_filters, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6);
99                 _filters_button = new wxButton (this, wxID_ANY, wxT ("Edit..."));
100                 s->Add (_filters_button, 0);
101                 sizer->Add (s, 1);
102         }
103
104         video_control (add_label_to_sizer (sizer, this, "Scaler"));
105         _scaler = new wxComboBox (this, wxID_ANY);
106         sizer->Add (video_control (_scaler), 1);
107
108         {
109                 video_control (add_label_to_sizer (sizer, this, "Audio Gain"));
110                 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
111                 _audio_gain = new wxSpinCtrl (this);
112                 s->Add (video_control (_audio_gain), 1);
113                 video_control (add_label_to_sizer (s, this, "dB"));
114                 sizer->Add (s);
115         }
116
117         {
118                 video_control (add_label_to_sizer (sizer, this, "Audio Delay"));
119                 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
120                 _audio_delay = new wxSpinCtrl (this);
121                 s->Add (video_control (_audio_delay), 1);
122                 video_control (add_label_to_sizer (s, this, "ms"));
123                 sizer->Add (s);
124         }
125
126         video_control (add_label_to_sizer (sizer, this, "Frames Per Second"));
127         _frames_per_second = new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, wxTextValidator (wxFILTER_NUMERIC));
128         sizer->Add (video_control (_frames_per_second));
129         
130         video_control (add_label_to_sizer (sizer, this, "Original Size"));
131         _original_size = new wxStaticText (this, wxID_ANY, wxT (""));
132         sizer->Add (video_control (_original_size), 1, wxALIGN_CENTER_VERTICAL);
133         
134         video_control (add_label_to_sizer (sizer, this, "Length"));
135         _length = new wxStaticText (this, wxID_ANY, wxT (""));
136         sizer->Add (video_control (_length), 1, wxALIGN_CENTER_VERTICAL);
137
138         video_control (add_label_to_sizer (sizer, this, "Audio"));
139         _audio = new wxStaticText (this, wxID_ANY, wxT (""));
140         sizer->Add (video_control (_audio), 1, wxALIGN_CENTER_VERTICAL);
141
142         {
143                 video_control (add_label_to_sizer (sizer, this, "Range"));
144                 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
145                 _dcp_range = new wxStaticText (this, wxID_ANY, wxT (""));
146                 s->Add (video_control (_dcp_range), 1, wxALIGN_CENTER_VERTICAL);
147                 _change_dcp_range_button = new wxButton (this, wxID_ANY, wxT ("Edit..."));
148                 s->Add (video_control (_change_dcp_range_button));
149                 sizer->Add (s);
150         }
151
152         _dcp_ab = new wxCheckBox (this, wxID_ANY, wxT ("A/B"));
153         video_control (_dcp_ab);
154         sizer->Add (_dcp_ab, 1);
155         sizer->AddSpacer (0);
156
157         /* STILL-only stuff */
158         still_control (add_label_to_sizer (sizer, this, "Duration"));
159         _still_duration = new wxSpinCtrl (this);
160         sizer->Add (still_control (_still_duration));
161         still_control (add_label_to_sizer (sizer, this, "s"));
162
163         /* Set up our editing widgets */
164         
165         _left_crop->SetRange (0, 1024);
166         _top_crop->SetRange (0, 1024);
167         _right_crop->SetRange (0, 1024);
168         _bottom_crop->SetRange (0, 1024);
169         _audio_gain->SetRange (-60, 60);
170         _audio_delay->SetRange (-1000, 1000);
171         _still_duration->SetRange (0, 60 * 60);
172
173         vector<Format const *> fmt = Format::all ();
174         for (vector<Format const *>::iterator i = fmt.begin(); i != fmt.end(); ++i) {
175                 _format->Append (std_to_wx ((*i)->name ()));
176         }
177
178         vector<DCPContentType const *> const ct = DCPContentType::all ();
179         for (vector<DCPContentType const *>::const_iterator i = ct.begin(); i != ct.end(); ++i) {
180                 _dcp_content_type->Append (std_to_wx ((*i)->pretty_name ()));
181         }
182
183         vector<Scaler const *> const sc = Scaler::all ();
184         for (vector<Scaler const *>::const_iterator i = sc.begin(); i != sc.end(); ++i) {
185                 _scaler->Append (std_to_wx ((*i)->name()));
186         }
187
188         /* And set their values from the Film */
189         set_film (f);
190         
191         /* Now connect to them, since initial values are safely set */
192         _name->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (FilmEditor::name_changed), 0, this);
193         _frames_per_second->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (FilmEditor::frames_per_second_changed), 0, this);
194         _format->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (FilmEditor::format_changed), 0, this);
195         _content->Connect (wxID_ANY, wxEVT_COMMAND_FILEPICKER_CHANGED, wxCommandEventHandler (FilmEditor::content_changed), 0, this);
196         _left_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::left_crop_changed), 0, this);
197         _right_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::right_crop_changed), 0, this);
198         _top_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::top_crop_changed), 0, this);
199         _bottom_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::bottom_crop_changed), 0, this);
200         _filters_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::edit_filters_clicked), 0, this);
201         _scaler->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (FilmEditor::scaler_changed), 0, this);
202         _dcp_content_type->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (FilmEditor::dcp_content_type_changed), 0, this);
203         _dcp_ab->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::dcp_ab_toggled), 0, this);
204         _audio_gain->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::audio_gain_changed), 0, this);
205         _audio_delay->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::audio_delay_changed), 0, this);
206         _still_duration->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::still_duration_changed), 0, this);
207         _change_dcp_range_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::change_dcp_range_clicked), 0, this);
208
209         setup_visibility ();
210 }
211
212 /** Called when the left crop widget has been changed */
213 void
214 FilmEditor::left_crop_changed (wxCommandEvent &)
215 {
216         if (!_film) {
217                 return;
218         }
219
220         _ignore_changes = true;
221         _film->set_left_crop (_left_crop->GetValue ());
222         _ignore_changes = false;
223 }
224
225 /** Called when the right crop widget has been changed */
226 void
227 FilmEditor::right_crop_changed (wxCommandEvent &)
228 {
229         if (!_film) {
230                 return;
231         }
232
233         _ignore_changes = true;
234         _film->set_right_crop (_right_crop->GetValue ());
235         _ignore_changes = false;
236 }
237
238 /** Called when the top crop widget has been changed */
239 void
240 FilmEditor::top_crop_changed (wxCommandEvent &)
241 {
242         if (!_film) {
243                 return;
244         }
245
246         _ignore_changes = true;
247         _film->set_top_crop (_top_crop->GetValue ());
248         _ignore_changes = false;
249 }
250
251 /** Called when the bottom crop value has been changed */
252 void
253 FilmEditor::bottom_crop_changed (wxCommandEvent &)
254 {
255         if (!_film) {
256                 return;
257         }
258
259         _ignore_changes = true;
260         _film->set_bottom_crop (_bottom_crop->GetValue ());
261         _ignore_changes = false;
262 }
263
264 /** Called when the content filename has been changed */
265 void
266 FilmEditor::content_changed (wxCommandEvent &)
267 {
268         if (!_film) {
269                 return;
270         }
271
272         _ignore_changes = true;
273         
274         try {
275                 _film->set_content (wx_to_std (_content->GetPath ()));
276         } catch (std::exception& e) {
277                 _content->SetPath (std_to_wx (_film->directory ()));
278                 stringstream m;
279                 m << "Could not set content: " << e.what() << ".";
280                 error_dialog (this, m.str ());
281         }
282
283         _ignore_changes = false;
284 }
285
286 /** Called when the DCP A/B switch has been toggled */
287 void
288 FilmEditor::dcp_ab_toggled (wxCommandEvent &)
289 {
290         if (!_film) {
291                 return;
292         }
293         
294         _ignore_changes = true;
295         _film->set_dcp_ab (_dcp_ab->GetValue ());
296         _ignore_changes = false;
297 }
298
299 /** Called when the name widget has been changed */
300 void
301 FilmEditor::name_changed (wxCommandEvent &)
302 {
303         if (!_film) {
304                 return;
305         }
306
307         _ignore_changes = true;
308         _film->set_name (string (_name->GetValue().mb_str()));
309         _ignore_changes = false;
310 }
311
312 /** Called when the metadata stored in the Film object has changed;
313  *  so that we can update the GUI.
314  *  @param p Property of the Film that has changed.
315  */
316 void
317 FilmEditor::film_changed (Film::Property p)
318 {
319         if (!_film || _ignore_changes) {
320                 return;
321         }
322
323         stringstream s;
324                 
325         switch (p) {
326         case Film::CONTENT:
327                 _content->SetPath (std_to_wx (_film->content ()));
328                 setup_visibility ();
329                 break;
330         case Film::FORMAT:
331                 _format->SetSelection (Format::as_index (_film->format ()));
332                 break;
333         case Film::LEFT_CROP:
334                 _left_crop->SetValue (_film->left_crop ());
335                 break;
336         case Film::RIGHT_CROP:
337                 _right_crop->SetValue (_film->right_crop ());
338                 break;
339         case Film::TOP_CROP:
340                 _top_crop->SetValue (_film->top_crop ());
341                 break;
342         case Film::BOTTOM_CROP:
343                 _bottom_crop->SetValue (_film->bottom_crop ());
344                 break;
345         case Film::FILTERS:
346         {
347                 pair<string, string> p = Filter::ffmpeg_strings (_film->filters ());
348                 string const b = p.first + " " + p.second;
349                 _filters->SetLabel (std_to_wx (b));
350                 break;
351         }
352         case Film::NAME:
353                 _name->ChangeValue (std_to_wx (_film->name ()));
354                 break;
355         case Film::FRAMES_PER_SECOND:
356         {
357                 stringstream s;
358                 s << fixed << setprecision(2) << _film->frames_per_second();
359                 _frames_per_second->ChangeValue (std_to_wx (s.str ()));
360                 break;
361         }
362         case Film::AUDIO_CHANNELS:
363         case Film::AUDIO_SAMPLE_RATE:
364                 if (_film->audio_channels() == 0 && _film->audio_sample_rate() == 0) {
365                         _audio->SetLabel (wxT (""));
366                 } else {
367                         s << _film->audio_channels () << " channels, " << _film->audio_sample_rate() << "Hz";
368                         _audio->SetLabel (std_to_wx (s.str ()));
369                 }
370                 break;
371         case Film::SIZE:
372                 if (_film->size().width == 0 && _film->size().height == 0) {
373                         _original_size->SetLabel (wxT (""));
374                 } else {
375                         s << _film->size().width << " x " << _film->size().height;
376                         _original_size->SetLabel (std_to_wx (s.str ()));
377                 }
378                 break;
379         case Film::LENGTH:
380                 if (_film->frames_per_second() > 0 && _film->length() > 0) {
381                         s << _film->length() << " frames; " << seconds_to_hms (_film->length() / _film->frames_per_second());
382                 } else if (_film->length() > 0) {
383                         s << _film->length() << " frames";
384                 } 
385                 _length->SetLabel (std_to_wx (s.str ()));
386                 break;
387         case Film::DCP_CONTENT_TYPE:
388                 _dcp_content_type->SetSelection (DCPContentType::as_index (_film->dcp_content_type ()));
389                 break;
390         case Film::THUMBS:
391                 break;
392         case Film::DCP_FRAMES:
393                 if (_film->dcp_frames() == 0) {
394                         _dcp_range->SetLabel (wxT ("Whole film"));
395                 } else {
396                         stringstream s;
397                         s << "First " << _film->dcp_frames() << " frames";
398                         _dcp_range->SetLabel (std_to_wx (s.str ()));
399                 }
400                 break;
401         case Film::DCP_TRIM_ACTION:
402                 break;
403         case Film::DCP_AB:
404                 _dcp_ab->SetValue (_film->dcp_ab ());
405                 break;
406         case Film::SCALER:
407                 _scaler->SetSelection (Scaler::as_index (_film->scaler ()));
408                 break;
409         case Film::AUDIO_GAIN:
410                 _audio_gain->SetValue (_film->audio_gain ());
411                 break;
412         case Film::AUDIO_DELAY:
413                 _audio_delay->SetValue (_film->audio_delay ());
414                 break;
415         case Film::STILL_DURATION:
416                 _still_duration->SetValue (_film->still_duration ());
417                 break;
418         }
419 }
420
421 /** Called when the format widget has been changed */
422 void
423 FilmEditor::format_changed (wxCommandEvent &)
424 {
425         if (!_film) {
426                 return;
427         }
428
429         _ignore_changes = true;
430         int const n = _format->GetSelection ();
431         if (n >= 0) {
432                 _film->set_format (Format::from_index (n));
433         }
434         _ignore_changes = false;
435 }
436
437 /** Called when the DCP content type widget has been changed */
438 void
439 FilmEditor::dcp_content_type_changed (wxCommandEvent &)
440 {
441         if (!_film) {
442                 return;
443         }
444
445         _ignore_changes = true;
446         int const n = _dcp_content_type->GetSelection ();
447         if (n >= 0) {
448                 _film->set_dcp_content_type (DCPContentType::from_index (n));
449         }
450         _ignore_changes = false;
451 }
452
453 /** Sets the Film that we are editing */
454 void
455 FilmEditor::set_film (Film* f)
456 {
457         _film = f;
458
459         set_things_sensitive (_film != 0);
460
461         if (_film) {
462                 _film->Changed.connect (sigc::mem_fun (*this, &FilmEditor::film_changed));
463         }
464
465         if (_film) {
466                 FileChanged (_film->directory ());
467         } else {
468                 FileChanged ("");
469         }
470         
471         film_changed (Film::NAME);
472         film_changed (Film::CONTENT);
473         film_changed (Film::DCP_CONTENT_TYPE);
474         film_changed (Film::FORMAT);
475         film_changed (Film::LEFT_CROP);
476         film_changed (Film::RIGHT_CROP);
477         film_changed (Film::TOP_CROP);
478         film_changed (Film::BOTTOM_CROP);
479         film_changed (Film::FILTERS);
480         film_changed (Film::DCP_FRAMES);
481         film_changed (Film::DCP_TRIM_ACTION);
482         film_changed (Film::DCP_AB);
483         film_changed (Film::SIZE);
484         film_changed (Film::LENGTH);
485         film_changed (Film::FRAMES_PER_SECOND);
486         film_changed (Film::AUDIO_CHANNELS);
487         film_changed (Film::AUDIO_SAMPLE_RATE);
488         film_changed (Film::SCALER);
489         film_changed (Film::AUDIO_GAIN);
490         film_changed (Film::AUDIO_DELAY);
491         film_changed (Film::STILL_DURATION);
492 }
493
494 /** Updates the sensitivity of lots of widgets to a given value.
495  *  @param s true to make sensitive, false to make insensitive.
496  */
497 void
498 FilmEditor::set_things_sensitive (bool s)
499 {
500         _name->Enable (s);
501         _frames_per_second->Enable (s);
502         _format->Enable (s);
503         _content->Enable (s);
504         _left_crop->Enable (s);
505         _right_crop->Enable (s);
506         _top_crop->Enable (s);
507         _bottom_crop->Enable (s);
508         _filters_button->Enable (s);
509         _scaler->Enable (s);
510         _dcp_content_type->Enable (s);
511         _dcp_range->Enable (s);
512         _change_dcp_range_button->Enable (s);
513         _dcp_ab->Enable (s);
514         _audio_gain->Enable (s);
515         _audio_delay->Enable (s);
516         _still_duration->Enable (s);
517 }
518
519 /** Called when the `Edit filters' button has been clicked */
520 void
521 FilmEditor::edit_filters_clicked (wxCommandEvent &)
522 {
523 //      FilterDialog d (_film->filters ());
524 //      d.ActiveChanged.connect (sigc::mem_fun (*_film, &Film::set_filters));
525 //      d.run ();
526 }
527
528 /** Called when the scaler widget has been changed */
529 void
530 FilmEditor::scaler_changed (wxCommandEvent &)
531 {
532         if (!_film) {
533                 return;
534         }
535
536         _ignore_changes = true;
537         int const n = _scaler->GetSelection ();
538         if (n >= 0) {
539                 _film->set_scaler (Scaler::from_index (n));
540         }
541         _ignore_changes = false;
542 }
543
544 /** Called when the frames per second widget has been changed */
545 void
546 FilmEditor::frames_per_second_changed (wxCommandEvent &)
547 {
548         if (!_film) {
549                 return;
550         }
551
552         _ignore_changes = true;
553         _film->set_frames_per_second (boost::lexical_cast<float> (wx_to_std (_frames_per_second->GetValue ())));
554         _ignore_changes = false;
555 }
556
557 void
558 FilmEditor::audio_gain_changed (wxCommandEvent &)
559 {
560         if (!_film) {
561                 return;
562         }
563
564         _ignore_changes = true;
565         _film->set_audio_gain (_audio_gain->GetValue ());
566         _ignore_changes = false;
567 }
568
569 void
570 FilmEditor::audio_delay_changed (wxCommandEvent &)
571 {
572         if (!_film) {
573                 return;
574         }
575
576         _ignore_changes = true;
577         _film->set_audio_delay (_audio_delay->GetValue ());
578         _ignore_changes = false;
579 }
580
581 wxControl *
582 FilmEditor::video_control (wxControl* c)
583 {
584         _video_controls.push_back (c);
585         return c;
586 }
587
588 wxControl *
589 FilmEditor::still_control (wxControl* c)
590 {
591         _still_controls.push_back (c);
592         return c;
593 }
594
595 void
596 FilmEditor::setup_visibility ()
597 {
598         ContentType c = VIDEO;
599
600         if (_film) {
601                 c = _film->content_type ();
602         }
603
604         for (list<wxControl*>::iterator i = _video_controls.begin(); i != _video_controls.end(); ++i) {
605                 (*i)->Show (c == VIDEO);
606         }
607
608         for (list<wxControl*>::iterator i = _still_controls.begin(); i != _still_controls.end(); ++i) {
609                 (*i)->Show (c == STILL);
610         }
611 }
612
613 void
614 FilmEditor::still_duration_changed (wxCommandEvent &)
615 {
616         if (!_film) {
617                 return;
618         }
619
620         _ignore_changes = true;
621         _film->set_still_duration (_still_duration->GetValue ());
622         _ignore_changes = false;
623 }
624
625 void
626 FilmEditor::change_dcp_range_clicked (wxCommandEvent &)
627 {
628 //XXX   DCPRangeDialog d (_film);
629 //XXX   d.Changed.connect (sigc::mem_fun (*this, &FilmEditor::dcp_range_changed));
630 //XXX   d.run ();
631 }
632
633 void
634 FilmEditor::dcp_range_changed (int frames, TrimAction action)
635 {
636         _ignore_changes = true;
637         _film->set_dcp_frames (frames);
638         _film->set_dcp_trim_action (action);
639         _ignore_changes = false;
640 }