2 Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
21 #include "filter_dialog.h"
22 #include "video_panel.h"
24 #include "content_colour_conversion_dialog.h"
25 #include "content_widget.h"
26 #include "content_panel.h"
27 #include "static_text.h"
28 #include "check_box.h"
29 #include "custom_scale_dialog.h"
30 #include "dcpomatic_button.h"
31 #include "lib/filter.h"
32 #include "lib/ffmpeg_content.h"
33 #include "lib/colour_conversion.h"
34 #include "lib/config.h"
36 #include "lib/ratio.h"
37 #include "lib/frame_rate_change.h"
38 #include "lib/dcp_content.h"
39 #include "lib/video_content.h"
40 #include <wx/spinctrl.h>
41 #include <boost/foreach.hpp>
42 #include <boost/unordered_set.hpp>
43 #include <boost/functional/hash.hpp>
53 using boost::shared_ptr;
54 using boost::dynamic_pointer_cast;
56 using boost::optional;
57 using namespace dcpomatic;
60 VideoPanel::VideoPanel (ContentPanel* p)
61 : ContentSubPanel (p, _("Video"))
63 _reference = new CheckBox (this, _("Use this DCP's video as OV and make VF"));
64 _reference_note = new StaticText (this, wxT(""));
65 _reference_note->Wrap (200);
66 wxFont font = _reference_note->GetFont();
67 font.SetStyle(wxFONTSTYLE_ITALIC);
68 font.SetPointSize(font.GetPointSize() - 1);
69 _reference_note->SetFont(font);
71 _use = new wxCheckBox (this, wxID_ANY, _("Use"));
73 _type_label = create_label (this, _("Type"), true);
74 _frame_type = new ContentChoice<VideoContent, VideoFrameType> (
76 new wxChoice (this, wxID_ANY),
77 VideoContentProperty::FRAME_TYPE,
79 boost::mem_fn (&VideoContent::frame_type),
80 boost::mem_fn (&VideoContent::set_frame_type),
81 &caster<int, VideoFrameType>,
82 &caster<VideoFrameType, int>
85 _crop_label = create_label (this, _("Crop"), true);
87 _left_crop_label = create_label (this, _("Left"), true);
88 _left_crop = new ContentSpinCtrl<VideoContent> (
90 new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1)),
91 VideoContentProperty::CROP,
93 boost::mem_fn (&VideoContent::left_crop),
94 boost::mem_fn (&VideoContent::set_left_crop)
97 _right_crop_label = create_label (this, _("Right"), true);
98 _right_crop = new ContentSpinCtrl<VideoContent> (
100 new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1)),
101 VideoContentProperty::CROP,
103 boost::mem_fn (&VideoContent::right_crop),
104 boost::mem_fn (&VideoContent::set_right_crop)
107 _top_crop_label = create_label (this, _("Top"), true);
108 _top_crop = new ContentSpinCtrl<VideoContent> (
110 new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1)),
111 VideoContentProperty::CROP,
113 boost::mem_fn (&VideoContent::top_crop),
114 boost::mem_fn (&VideoContent::set_top_crop)
117 _bottom_crop_label = create_label (this, _("Bottom"), true);
118 _bottom_crop = new ContentSpinCtrl<VideoContent> (
120 new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1)),
121 VideoContentProperty::CROP,
123 boost::mem_fn (&VideoContent::bottom_crop),
124 boost::mem_fn (&VideoContent::set_bottom_crop)
127 _fade_in_label = create_label (this, _("Fade in"), true);
128 _fade_in = new Timecode<ContentTime> (this);
130 _fade_out_label = create_label (this, _("Fade out"), true);
131 _fade_out = new Timecode<ContentTime> (this);
133 wxClientDC dc (this);
134 wxSize size = dc.GetTextExtent (wxT ("A quite long name"));
137 _scale_label = create_label (this, _("Scale"), true);
138 _scale_fit = new wxRadioButton (this, wxID_ANY, _("to fit DCP"));
139 _scale_custom = new wxRadioButton (this, wxID_ANY, _("custom"), wxDefaultPosition, size);
140 _scale_custom_edit = new Button (this, _("Edit..."));
142 _filters_label = create_label (this, _("Filters"), true);
143 _filters = new StaticText (this, _("None"), wxDefaultPosition, size);
144 _filters_button = new Button (this, _("Edit..."));
146 _colour_conversion_label = create_label (this, _("Colour conversion"), true);
147 _colour_conversion = new wxChoice (this, wxID_ANY, wxDefaultPosition, size);
148 _colour_conversion->Append (_("None"));
149 BOOST_FOREACH (PresetColourConversion const & i, PresetColourConversion::all()) {
150 _colour_conversion->Append (std_to_wx (i.name));
153 /// TRANSLATORS: translate the word "Custom" here; do not include the "Colour|" prefix
154 _colour_conversion->Append (S_("Colour|Custom"));
155 _edit_colour_conversion_button = new Button (this, _("Edit..."));
157 _range_label = create_label (this, _("Range"), true);
158 _range = new wxChoice (this, wxID_ANY);
159 _range->Append (_("Full (JPEG, 0-255)"));
160 _range->Append (_("Video (MPEG, 16-235)"));
162 _description = new StaticText (this, wxT ("\n \n \n \n \n"), wxDefaultPosition, wxDefaultSize);
163 _description->SetFont(font);
165 _left_crop->wrapped()->SetRange (0, 4096);
166 _top_crop->wrapped()->SetRange (0, 4096);
167 _right_crop->wrapped()->SetRange (0, 4096);
168 _bottom_crop->wrapped()->SetRange (0, 4096);
170 _frame_type->wrapped()->Append (_("2D"));
171 _frame_type->wrapped()->Append (_("3D"));
172 _frame_type->wrapped()->Append (_("3D left/right"));
173 _frame_type->wrapped()->Append (_("3D top/bottom"));
174 _frame_type->wrapped()->Append (_("3D alternate"));
175 _frame_type->wrapped()->Append (_("3D left only"));
176 _frame_type->wrapped()->Append (_("3D right only"));
178 content_selection_changed ();
180 _fade_in->Changed.connect (boost::bind (&VideoPanel::fade_in_changed, this));
181 _fade_out->Changed.connect (boost::bind (&VideoPanel::fade_out_changed, this));
183 _use->Bind (wxEVT_CHECKBOX, boost::bind (&VideoPanel::use_clicked, this));
184 _reference->Bind (wxEVT_CHECKBOX, boost::bind (&VideoPanel::reference_clicked, this));
185 _filters_button->Bind (wxEVT_BUTTON, boost::bind (&VideoPanel::edit_filters_clicked, this));
186 _scale_fit->Bind (wxEVT_RADIOBUTTON, boost::bind (&VideoPanel::scale_fit_clicked, this));
187 _scale_custom->Bind (wxEVT_RADIOBUTTON, boost::bind (&VideoPanel::scale_custom_clicked, this));
188 _scale_custom_edit->Bind (wxEVT_BUTTON, boost::bind (&VideoPanel::scale_custom_edit_clicked, this));
189 _colour_conversion->Bind (wxEVT_CHOICE, boost::bind (&VideoPanel::colour_conversion_changed, this));
190 _range->Bind (wxEVT_CHOICE, boost::bind (&VideoPanel::range_changed, this));
191 _edit_colour_conversion_button->Bind (wxEVT_BUTTON, boost::bind (&VideoPanel::edit_colour_conversion_clicked, this));
197 VideoPanel::add_to_grid ()
199 bool const full = Config::instance()->interface_complexity() == Config::INTERFACE_FULL;
203 _reference->Show (full);
204 _reference_note->Show (full && !_reference_note->GetLabel().IsEmpty());
207 wxBoxSizer* reference_sizer = new wxBoxSizer (wxVERTICAL);
208 reference_sizer->Add (_reference, 0);
209 reference_sizer->Add (_reference_note, 0);
210 _grid->Add (reference_sizer, wxGBPosition(r, 0), wxGBSpan(1, 3));
215 _grid->Add (_use, wxGBPosition(r, 0), wxGBSpan(1, 2));
218 add_label_to_sizer (_grid, _type_label, true, wxGBPosition(r, 0));
219 _frame_type->add (_grid, wxGBPosition(r, 1), wxGBSpan(1, 2));
223 wxGridBagSizer* crop = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
224 add_label_to_sizer (crop, _left_crop_label, true, wxGBPosition (cr, 0));
225 _left_crop->add (crop, wxGBPosition (cr, 1));
226 add_label_to_sizer (crop, _right_crop_label, true, wxGBPosition (cr, 2));
227 _right_crop->add (crop, wxGBPosition (cr, 3));
229 add_label_to_sizer (crop, _top_crop_label, true, wxGBPosition (cr, 0));
230 _top_crop->add (crop, wxGBPosition (cr, 1));
231 add_label_to_sizer (crop, _bottom_crop_label, true, wxGBPosition (cr, 2));
232 _bottom_crop->add (crop, wxGBPosition (cr, 3));
233 add_label_to_sizer (_grid, _crop_label, true, wxGBPosition(r, 0));
234 _grid->Add (crop, wxGBPosition(r, 1));
237 _scale_label->Show (full);
238 _scale_fit->Show (full);
239 _scale_custom->Show (full);
240 _scale_custom_edit->Show (full);
241 _filters_label->Show (full);
242 _filters->Show (full);
243 _filters_button->Show (full);
244 _colour_conversion_label->Show (full);
245 _colour_conversion->Show (full);
246 _edit_colour_conversion_button->Show (full);
247 _range_label->Show (full);
250 add_label_to_sizer (_grid, _fade_in_label, true, wxGBPosition (r, 0));
251 _grid->Add (_fade_in, wxGBPosition (r, 1), wxGBSpan (1, 3));
254 add_label_to_sizer (_grid, _fade_out_label, true, wxGBPosition (r, 0));
255 _grid->Add (_fade_out, wxGBPosition (r, 1), wxGBSpan (1, 3));
259 add_label_to_sizer (_grid, _scale_label, true, wxGBPosition (r, 0));
261 wxSizer* v = new wxBoxSizer (wxVERTICAL);
262 v->Add (_scale_fit, 0, wxBOTTOM, 4);
263 wxSizer* h = new wxBoxSizer (wxHORIZONTAL);
264 h->Add (_scale_custom, 1, wxRIGHT, 6);
265 h->Add (_scale_custom_edit, 0);
267 _grid->Add (v, wxGBPosition(r, 1));
271 add_label_to_sizer (_grid, _filters_label, true, wxGBPosition (r, 0));
273 wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
274 s->Add (_filters, 1, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxRIGHT, 6);
275 s->Add (_filters_button, 0, wxALIGN_CENTER_VERTICAL);
276 _grid->Add (s, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
280 add_label_to_sizer (_grid, _colour_conversion_label, true, wxGBPosition(r, 0));
282 wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
283 s->Add (_colour_conversion, 1, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxRIGHT, 6);
284 s->Add (_edit_colour_conversion_button, 0, wxALIGN_CENTER_VERTICAL);
285 _grid->Add (s, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
289 add_label_to_sizer (_grid, _range_label, true, wxGBPosition(r, 0));
290 _grid->Add (_range, wxGBPosition(r, 1), wxGBSpan(1, 2), wxALIGN_CENTER_VERTICAL);
294 _grid->Add (_description, wxGBPosition (r, 0), wxGBSpan (1, 4), wxEXPAND | wxALIGN_CENTER_VERTICAL, 6);
299 VideoPanel::range_changed ()
301 ContentList vc = _parent->selected_video ();
302 if (vc.size() != 1) {
306 switch (_range->GetSelection()) {
308 vc.front()->video->set_range (VIDEO_RANGE_FULL);
311 vc.front()->video->set_range (VIDEO_RANGE_VIDEO);
314 DCPOMATIC_ASSERT (false);
320 VideoPanel::film_changed (Film::Property property)
323 case Film::VIDEO_FRAME_RATE:
324 case Film::CONTAINER:
325 case Film::RESOLUTION:
326 setup_description ();
327 setup_sensitivity ();
329 case Film::REEL_TYPE:
331 setup_sensitivity ();
339 hash_value (boost::optional<ColourConversion> const & c)
341 boost::hash<string> hasher;
343 return hasher ("none");
345 return hasher (c->identifier());
350 VideoPanel::film_content_changed (int property)
352 ContentList vc = _parent->selected_video ();
353 shared_ptr<Content> vcs;
354 shared_ptr<FFmpegContent> fcs;
357 fcs = dynamic_pointer_cast<FFmpegContent> (vcs);
360 if (property == ContentProperty::VIDEO_FRAME_RATE ||
361 property == VideoContentProperty::FRAME_TYPE ||
362 property == VideoContentProperty::CROP ||
363 property == VideoContentProperty::SCALE) {
364 setup_description ();
365 } else if (property == VideoContentProperty::COLOUR_CONVERSION) {
366 boost::unordered_set<optional<ColourConversion> > check;
367 BOOST_FOREACH (shared_ptr<const Content> i, vc) {
368 check.insert (i->video->colour_conversion());
371 /* Remove any "Many" entry that we might have added previously. There should
372 * be entries for each preset plus one for "None" and one for "Custom".
374 vector<PresetColourConversion> cc = PresetColourConversion::all ();
375 if (_colour_conversion->GetCount() > cc.size() + 2) {
376 _colour_conversion->Delete (_colour_conversion->GetCount() - 1);
379 if (check.size() == 1) {
380 if (vcs && vcs->video->colour_conversion ()) {
381 optional<size_t> preset = vcs->video->colour_conversion().get().preset ();
383 checked_set (_colour_conversion, preset.get() + 1);
385 checked_set (_colour_conversion, cc.size() + 1);
388 checked_set (_colour_conversion, 0);
390 } else if (check.size() > 1) {
391 /* Add a "many" entry and select it as an indication that multiple different
392 * colour conversions are present in the selection.
394 _colour_conversion->Append (_("Many"));
395 checked_set (_colour_conversion, _colour_conversion->GetCount() - 1);
398 setup_sensitivity ();
400 } else if (property == FFmpegContentProperty::FILTERS) {
402 string p = Filter::ffmpeg_string (fcs->filters ());
404 checked_set (_filters, _("None"));
406 if (p.length() > 25) {
407 p = p.substr (0, 25) + "...";
409 checked_set (_filters, p);
412 } else if (property == VideoContentProperty::USE) {
414 BOOST_FOREACH (shared_ptr<const Content> i, vc) {
415 check.insert (i->video->use());
418 if (check.size() == 1) {
419 checked_set (_use, vc.front()->video->use());
421 checked_set (_use, false);
424 setup_sensitivity ();
425 } else if (property == VideoContentProperty::FADE_IN) {
427 BOOST_FOREACH (shared_ptr<const Content> i, vc) {
428 check.insert (i->video->fade_in ());
431 if (check.size() == 1) {
433 ContentTime::from_frames (vc.front()->video->fade_in(), vc.front()->active_video_frame_rate(_parent->film())),
434 vc.front()->active_video_frame_rate(_parent->film())
439 } else if (property == VideoContentProperty::FADE_OUT) {
441 BOOST_FOREACH (shared_ptr<const Content> i, vc) {
442 check.insert (i->video->fade_out ());
445 if (check.size() == 1) {
447 ContentTime::from_frames (vc.front()->video->fade_out(), vc.front()->active_video_frame_rate(_parent->film())),
448 vc.front()->active_video_frame_rate(_parent->film())
453 } else if (property == DCPContentProperty::REFERENCE_VIDEO) {
454 if (vc.size() == 1) {
455 shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (vc.front ());
456 checked_set (_reference, dcp ? dcp->reference_video () : false);
458 checked_set (_reference, false);
461 setup_sensitivity ();
462 } else if (property == VideoContentProperty::RANGE) {
464 checked_set (_range, vcs->video->range() == VIDEO_RANGE_FULL ? 0 : 1);
466 checked_set (_range, 0);
469 setup_sensitivity ();
470 } else if (property == VideoContentProperty::CUSTOM_RATIO || property == VideoContentProperty::CUSTOM_SIZE) {
472 BOOST_FOREACH (shared_ptr<const Content> i, vc) {
473 check.insert (i->video->custom_ratio() || i->video->custom_size());
476 if (check.size() == 1) {
477 checked_set (_scale_fit, !vc.front()->video->custom_ratio() && !vc.front()->video->custom_size());
478 checked_set (_scale_custom, vc.front()->video->custom_ratio() || vc.front()->video->custom_size());
480 checked_set (_scale_fit, true);
481 checked_set (_scale_custom, false);
483 setup_sensitivity ();
487 /** Called when the `Edit filters' button has been clicked */
489 VideoPanel::edit_filters_clicked ()
491 FFmpegContentList c = _parent->selected_ffmpeg ();
496 FilterDialog* d = new FilterDialog (this, c.front()->filters());
497 d->ActiveChanged.connect (bind (&FFmpegContent::set_filters, c.front(), _1));
503 VideoPanel::setup_description ()
505 ContentList vc = _parent->selected_video ();
507 checked_set (_description, wxT (""));
509 } else if (vc.size() > 1) {
510 checked_set (_description, _("Multiple content selected"));
514 string d = vc.front()->video->processing_description (_parent->film());
515 size_t lines = count (d.begin(), d.end(), '\n');
517 for (int i = lines; i < 6; ++i) {
521 checked_set (_description, d);
526 VideoPanel::colour_conversion_changed ()
528 ContentList vc = _parent->selected_video ();
530 int const s = _colour_conversion->GetSelection ();
531 vector<PresetColourConversion> all = PresetColourConversion::all ();
533 if (s == int(all.size() + 1)) {
534 edit_colour_conversion_clicked ();
536 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
538 i->video->unset_colour_conversion ();
539 } else if (s != int(all.size() + 2)) {
540 i->video->set_colour_conversion (all[s - 1].conversion);
547 VideoPanel::edit_colour_conversion_clicked ()
549 ContentList vc = _parent->selected_video ();
551 ContentColourConversionDialog* d = new ContentColourConversionDialog (this, vc.front()->video->yuv ());
552 d->set (vc.front()->video->colour_conversion().get_value_or (PresetColourConversion::all().front().conversion));
553 if (d->ShowModal() == wxID_OK) {
554 BOOST_FOREACH (shared_ptr<Content> i, vc) {
555 i->video->set_colour_conversion (d->get ());
558 /* Reset the colour conversion choice */
559 film_content_changed (VideoContentProperty::COLOUR_CONVERSION);
565 VideoPanel::content_selection_changed ()
567 ContentList video_sel = _parent->selected_video ();
569 _frame_type->set_content (video_sel);
570 _left_crop->set_content (video_sel);
571 _right_crop->set_content (video_sel);
572 _top_crop->set_content (video_sel);
573 _bottom_crop->set_content (video_sel);
575 film_content_changed (ContentProperty::VIDEO_FRAME_RATE);
576 film_content_changed (VideoContentProperty::CROP);
577 film_content_changed (VideoContentProperty::COLOUR_CONVERSION);
578 film_content_changed (VideoContentProperty::FADE_IN);
579 film_content_changed (VideoContentProperty::FADE_OUT);
580 film_content_changed (VideoContentProperty::RANGE);
581 film_content_changed (VideoContentProperty::USE);
582 film_content_changed (VideoContentProperty::CUSTOM_RATIO);
583 film_content_changed (VideoContentProperty::CUSTOM_SIZE);
584 film_content_changed (FFmpegContentProperty::FILTERS);
585 film_content_changed (DCPContentProperty::REFERENCE_VIDEO);
587 setup_sensitivity ();
591 VideoPanel::setup_sensitivity ()
593 ContentList sel = _parent->selected ();
595 shared_ptr<DCPContent> dcp;
596 if (sel.size() == 1) {
597 dcp = dynamic_pointer_cast<DCPContent> (sel.front ());
601 bool const can_reference = dcp && dcp->can_reference_video (_parent->film(), why_not);
603 if (why_not.empty()) {
604 cannot = _("Cannot reference this DCP's video.");
606 cannot = _("Cannot reference this DCP's video: ") + std_to_wx(why_not);
608 setup_refer_button (_reference, _reference_note, dcp, can_reference, cannot);
610 bool const enable = !_reference->GetValue() && _use->GetValue();
612 _use->Enable (!_reference->GetValue());
615 _frame_type->wrapped()->Enable (false);
616 _left_crop->wrapped()->Enable (false);
617 _right_crop->wrapped()->Enable (false);
618 _top_crop->wrapped()->Enable (false);
619 _bottom_crop->wrapped()->Enable (false);
620 _fade_in->Enable (false);
621 _fade_out->Enable (false);
622 _scale_fit->Enable (false);
623 _scale_custom->Enable (false);
624 _scale_custom_edit->Enable (false);
625 _description->Enable (false);
626 _filters->Enable (false);
627 _filters_button->Enable (false);
628 _colour_conversion->Enable (false);
629 _range->Enable (false);
631 ContentList video_sel = _parent->selected_video ();
632 FFmpegContentList ffmpeg_sel = _parent->selected_ffmpeg ();
633 bool const single = video_sel.size() == 1;
635 _frame_type->wrapped()->Enable (true);
636 _left_crop->wrapped()->Enable (true);
637 _right_crop->wrapped()->Enable (true);
638 _top_crop->wrapped()->Enable (true);
639 _bottom_crop->wrapped()->Enable (true);
640 _fade_in->Enable (!video_sel.empty ());
641 _fade_out->Enable (!video_sel.empty ());
642 _scale_fit->Enable (true);
643 _scale_custom->Enable (true);
644 _scale_custom_edit->Enable (_scale_custom->GetValue());
645 _description->Enable (true);
646 _filters->Enable (true);
647 _filters_button->Enable (single && !ffmpeg_sel.empty ());
648 _colour_conversion->Enable (!video_sel.empty());
649 _range->Enable (single && !video_sel.empty());
652 ContentList vc = _parent->selected_video ();
653 shared_ptr<Content> vcs;
658 if (vcs && vcs->video->colour_conversion ()) {
659 _edit_colour_conversion_button->Enable (!vcs->video->colour_conversion().get().preset());
661 _edit_colour_conversion_button->Enable (false);
666 VideoPanel::fade_in_changed ()
668 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video ()) {
669 double const vfr = i->active_video_frame_rate (_parent->film());
670 i->video->set_fade_in (_fade_in->get(vfr).frames_round(vfr));
675 VideoPanel::fade_out_changed ()
677 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video ()) {
678 double const vfr = i->active_video_frame_rate (_parent->film());
679 i->video->set_fade_out (_fade_out->get(vfr).frames_round(vfr));
684 VideoPanel::use_clicked ()
686 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
687 i->video->set_use (_use->GetValue());
692 VideoPanel::reference_clicked ()
694 ContentList c = _parent->selected ();
699 shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent> (c.front ());
704 d->set_reference_video (_reference->GetValue ());
709 VideoPanel::scale_fit_clicked ()
711 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
712 i->video->set_custom_ratio (optional<float>());
718 VideoPanel::scale_custom_clicked ()
720 if (!scale_custom_edit_clicked()) {
721 _scale_fit->SetValue (true);
727 VideoPanel::scale_custom_edit_clicked ()
729 shared_ptr<const VideoContent> vc = _parent->selected_video().front()->video;
730 CustomScaleDialog* d = new CustomScaleDialog (this, vc->size(), _parent->film()->frame_size(), vc->custom_ratio(), vc->custom_size());
731 int const r = d->ShowModal ();
733 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
734 i->video->set_custom_ratio (d->custom_ratio());
735 i->video->set_custom_size (d->custom_size());