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 <wx/tglbtn.h>
42 #include <boost/foreach.hpp>
43 #include <boost/unordered_set.hpp>
44 #include <boost/functional/hash.hpp>
54 using boost::shared_ptr;
55 using boost::dynamic_pointer_cast;
57 using boost::optional;
58 using namespace dcpomatic;
61 VideoPanel::VideoPanel (ContentPanel* p)
62 : ContentSubPanel (p, _("Video"))
64 _reference = new CheckBox (this, _("Use this DCP's video as OV and make VF"));
65 _reference_note = new StaticText (this, wxT(""));
66 _reference_note->Wrap (200);
67 wxFont font = _reference_note->GetFont();
68 font.SetStyle(wxFONTSTYLE_ITALIC);
69 font.SetPointSize(font.GetPointSize() - 1);
70 _reference_note->SetFont(font);
72 _type_label = create_label (this, _("Type"), true);
73 _frame_type = new ContentChoice<VideoContent, VideoFrameType> (
75 new wxChoice (this, wxID_ANY),
76 VideoContentProperty::FRAME_TYPE,
78 boost::mem_fn (&VideoContent::frame_type),
79 boost::mem_fn (&VideoContent::set_frame_type),
80 &caster<int, VideoFrameType>,
81 &caster<VideoFrameType, int>
84 _crop_label = create_label (this, _("Crop"), true);
87 int const crop_width = 128;
88 int const link_height = 64;
90 int const crop_width = 56;
91 int const link_height = 28;
94 _left_crop_label = create_label (this, _("Left"), true);
95 _left_crop = new ContentSpinCtrl<VideoContent> (
97 new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(crop_width, -1)),
98 VideoContentProperty::CROP,
100 boost::mem_fn (&VideoContent::left_crop),
101 boost::mem_fn (&VideoContent::set_left_crop),
102 boost::bind (&VideoPanel::left_crop_changed, this)
105 _left_right_link = new wxToggleButton (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(22, link_height));
106 _left_right_link->SetBitmap (wxBitmap(bitmap_path("link"), wxBITMAP_TYPE_PNG));
108 _right_crop_label = create_label (this, _("Right"), true);
109 _right_crop = new ContentSpinCtrl<VideoContent> (
111 new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(crop_width, -1)),
112 VideoContentProperty::CROP,
114 boost::mem_fn (&VideoContent::right_crop),
115 boost::mem_fn (&VideoContent::set_right_crop),
116 boost::bind (&VideoPanel::right_crop_changed, this)
119 _top_crop_label = create_label (this, _("Top"), true);
120 _top_crop = new ContentSpinCtrl<VideoContent> (
122 new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(crop_width, -1)),
123 VideoContentProperty::CROP,
125 boost::mem_fn (&VideoContent::top_crop),
126 boost::mem_fn (&VideoContent::set_top_crop),
127 boost::bind (&VideoPanel::top_crop_changed, this)
130 _top_bottom_link = new wxToggleButton (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(22, link_height));
131 _top_bottom_link->SetBitmap (wxBitmap(bitmap_path("link"), wxBITMAP_TYPE_PNG));
133 _bottom_crop_label = create_label (this, _("Bottom"), true);
134 _bottom_crop = new ContentSpinCtrl<VideoContent> (
136 new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(crop_width, -1)),
137 VideoContentProperty::CROP,
139 boost::mem_fn (&VideoContent::bottom_crop),
140 boost::mem_fn (&VideoContent::set_bottom_crop),
141 boost::bind (&VideoPanel::bottom_crop_changed, this)
144 _fade_in_label = create_label (this, _("Fade in"), true);
145 _fade_in = new Timecode<ContentTime> (this);
147 _fade_out_label = create_label (this, _("Fade out"), true);
148 _fade_out = new Timecode<ContentTime> (this);
150 wxClientDC dc (this);
151 wxSize size = dc.GetTextExtent (wxT ("A quite long name"));
153 size.SetWidth (size.GetWidth() + 64);
157 _scale_label = create_label (this, _("Scale"), true);
158 _scale_fit = new wxRadioButton (this, wxID_ANY, _("to fit DCP"));
159 _scale_custom = new wxRadioButton (this, wxID_ANY, _("custom"));
160 _scale_custom_edit = new Button (this, _("Edit..."));
162 _colour_conversion_label = create_label (this, _("Colour conversion"), true);
163 _colour_conversion = new wxChoice (this, wxID_ANY, wxDefaultPosition, size);
164 _colour_conversion->Append (_("None"));
165 BOOST_FOREACH (PresetColourConversion const & i, PresetColourConversion::all()) {
166 _colour_conversion->Append (std_to_wx (i.name));
169 /// TRANSLATORS: translate the word "Custom" here; do not include the "Colour|" prefix
170 _colour_conversion->Append (S_("Colour|Custom"));
171 _edit_colour_conversion_button = new Button (this, _("Edit..."));
173 _range_label = create_label (this, _("Range"), true);
174 _range = new wxChoice (this, wxID_ANY);
175 _range->Append (_("Full (JPEG, 0-255)"));
176 _range->Append (_("Video (MPEG, 16-235)"));
178 _description = new StaticText (this, wxT ("\n \n \n \n \n"), wxDefaultPosition, wxDefaultSize);
179 _description->SetFont(font);
181 _left_crop->wrapped()->SetRange (0, 4096);
182 _top_crop->wrapped()->SetRange (0, 4096);
183 _right_crop->wrapped()->SetRange (0, 4096);
184 _bottom_crop->wrapped()->SetRange (0, 4096);
186 _frame_type->wrapped()->Append (_("2D"));
187 _frame_type->wrapped()->Append (_("3D"));
188 _frame_type->wrapped()->Append (_("3D left/right"));
189 _frame_type->wrapped()->Append (_("3D top/bottom"));
190 _frame_type->wrapped()->Append (_("3D alternate"));
191 _frame_type->wrapped()->Append (_("3D left only"));
192 _frame_type->wrapped()->Append (_("3D right only"));
194 content_selection_changed ();
196 _fade_in->Changed.connect (boost::bind (&VideoPanel::fade_in_changed, this));
197 _fade_out->Changed.connect (boost::bind (&VideoPanel::fade_out_changed, this));
199 _reference->Bind (wxEVT_CHECKBOX, boost::bind (&VideoPanel::reference_clicked, this));
200 _scale_fit->Bind (wxEVT_RADIOBUTTON, boost::bind (&VideoPanel::scale_fit_clicked, this));
201 _scale_custom->Bind (wxEVT_RADIOBUTTON, boost::bind (&VideoPanel::scale_custom_clicked, this));
202 _scale_custom_edit->Bind (wxEVT_BUTTON, boost::bind (&VideoPanel::scale_custom_edit_clicked, this));
203 _colour_conversion->Bind (wxEVT_CHOICE, boost::bind (&VideoPanel::colour_conversion_changed, this));
204 _range->Bind (wxEVT_CHOICE, boost::bind (&VideoPanel::range_changed, this));
205 _edit_colour_conversion_button->Bind (wxEVT_BUTTON, boost::bind (&VideoPanel::edit_colour_conversion_clicked, this));
206 _left_right_link->Bind (wxEVT_TOGGLEBUTTON, boost::bind(&VideoPanel::left_right_link_clicked, this));
207 _top_bottom_link->Bind (wxEVT_TOGGLEBUTTON, boost::bind(&VideoPanel::top_bottom_link_clicked, this));
213 VideoPanel::add_to_grid ()
215 bool const full = Config::instance()->interface_complexity() == Config::INTERFACE_FULL;
219 _reference->Show (full);
220 _reference_note->Show (full && !_reference_note->GetLabel().IsEmpty());
223 wxBoxSizer* reference_sizer = new wxBoxSizer (wxVERTICAL);
224 reference_sizer->Add (_reference, 0);
225 reference_sizer->Add (_reference_note, 0);
226 _grid->Add (reference_sizer, wxGBPosition(r, 0), wxGBSpan(1, 3));
230 add_label_to_sizer (_grid, _type_label, true, wxGBPosition(r, 0));
231 _frame_type->add (_grid, wxGBPosition(r, 1), wxGBSpan(1, 2));
235 wxGridBagSizer* crop = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
236 add_label_to_sizer (crop, _left_crop_label, true, wxGBPosition (cr, 0));
237 _left_crop->add (crop, wxGBPosition (cr, 1));
239 crop->Add (_left_right_link, wxGBPosition(cr, 2), wxGBSpan(2, 1));
241 add_label_to_sizer (crop, _right_crop_label, true, wxGBPosition(cr, 0));
242 _right_crop->add (crop, wxGBPosition(cr, 1));
244 crop->Add (_left_right_link, wxGBPosition(cr, 2));
245 add_label_to_sizer (crop, _right_crop_label, true, wxGBPosition (cr, 3));
246 _right_crop->add (crop, wxGBPosition (cr, 4));
249 add_label_to_sizer (crop, _top_crop_label, true, wxGBPosition (cr, 0));
250 _top_crop->add (crop, wxGBPosition (cr, 1));
252 crop->Add (_top_bottom_link, wxGBPosition(cr, 2), wxGBSpan(2, 1));
254 add_label_to_sizer (crop, _bottom_crop_label, true, wxGBPosition(cr, 0));
255 _bottom_crop->add (crop, wxGBPosition(cr, 1));
257 crop->Add (_top_bottom_link, wxGBPosition(cr, 2));
258 add_label_to_sizer (crop, _bottom_crop_label, true, wxGBPosition (cr, 3));
259 _bottom_crop->add (crop, wxGBPosition (cr, 4));
261 add_label_to_sizer (_grid, _crop_label, true, wxGBPosition(r, 0));
262 _grid->Add (crop, wxGBPosition(r, 1));
265 _scale_label->Show (full);
266 _scale_fit->Show (full);
267 _scale_custom->Show (full);
268 _scale_custom_edit->Show (full);
269 _colour_conversion_label->Show (full);
270 _colour_conversion->Show (full);
271 _edit_colour_conversion_button->Show (full);
272 _range_label->Show (full);
275 add_label_to_sizer (_grid, _fade_in_label, true, wxGBPosition (r, 0));
276 _grid->Add (_fade_in, wxGBPosition (r, 1), wxGBSpan (1, 3));
279 add_label_to_sizer (_grid, _fade_out_label, true, wxGBPosition (r, 0));
280 _grid->Add (_fade_out, wxGBPosition (r, 1), wxGBSpan (1, 3));
284 add_label_to_sizer (_grid, _scale_label, true, wxGBPosition (r, 0));
286 wxSizer* v = new wxBoxSizer (wxVERTICAL);
287 v->Add (_scale_fit, 0, wxBOTTOM, 4);
288 wxSizer* h = new wxBoxSizer (wxHORIZONTAL);
289 h->Add (_scale_custom, 1, wxRIGHT | wxALIGN_CENTER_VERTICAL, 6);
290 h->Add (_scale_custom_edit, 0, wxALIGN_CENTER_VERTICAL);
292 _grid->Add (v, wxGBPosition(r, 1));
296 add_label_to_sizer (_grid, _colour_conversion_label, true, wxGBPosition(r, 0));
298 wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
299 s->Add (_colour_conversion, 1, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxRIGHT, 6);
300 s->Add (_edit_colour_conversion_button, 0, wxALIGN_CENTER_VERTICAL);
301 _grid->Add (s, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
305 add_label_to_sizer (_grid, _range_label, true, wxGBPosition(r, 0));
306 _grid->Add (_range, wxGBPosition(r, 1), wxGBSpan(1, 2), wxALIGN_CENTER_VERTICAL);
310 _grid->Add (_description, wxGBPosition (r, 0), wxGBSpan (1, 4), wxEXPAND | wxALIGN_CENTER_VERTICAL, 6);
315 VideoPanel::range_changed ()
317 ContentList vc = _parent->selected_video ();
318 if (vc.size() != 1) {
322 switch (_range->GetSelection()) {
324 vc.front()->video->set_range (VIDEO_RANGE_FULL);
327 vc.front()->video->set_range (VIDEO_RANGE_VIDEO);
330 DCPOMATIC_ASSERT (false);
336 VideoPanel::film_changed (Film::Property property)
339 case Film::VIDEO_FRAME_RATE:
340 case Film::CONTAINER:
341 case Film::RESOLUTION:
342 setup_description ();
343 setup_sensitivity ();
345 case Film::REEL_TYPE:
347 setup_sensitivity ();
355 hash_value (boost::optional<ColourConversion> const & c)
357 boost::hash<string> hasher;
359 return hasher ("none");
361 return hasher (c->identifier());
366 VideoPanel::film_content_changed (int property)
368 ContentList vc = _parent->selected_video ();
369 shared_ptr<Content> vcs;
370 shared_ptr<FFmpegContent> fcs;
373 fcs = dynamic_pointer_cast<FFmpegContent> (vcs);
376 if (property == ContentProperty::VIDEO_FRAME_RATE ||
377 property == VideoContentProperty::FRAME_TYPE ||
378 property == VideoContentProperty::CROP ||
379 property == VideoContentProperty::SCALE) {
380 setup_description ();
381 } else if (property == VideoContentProperty::COLOUR_CONVERSION) {
382 boost::unordered_set<optional<ColourConversion> > check;
383 BOOST_FOREACH (shared_ptr<const Content> i, vc) {
384 check.insert (i->video->colour_conversion());
387 /* Remove any "Many" entry that we might have added previously. There should
388 * be entries for each preset plus one for "None" and one for "Custom".
390 vector<PresetColourConversion> cc = PresetColourConversion::all ();
391 if (_colour_conversion->GetCount() > cc.size() + 2) {
392 _colour_conversion->Delete (_colour_conversion->GetCount() - 1);
395 if (check.size() == 1) {
396 if (vcs && vcs->video->colour_conversion ()) {
397 optional<size_t> preset = vcs->video->colour_conversion().get().preset ();
399 checked_set (_colour_conversion, preset.get() + 1);
401 checked_set (_colour_conversion, cc.size() + 1);
404 checked_set (_colour_conversion, 0);
406 } else if (check.size() > 1) {
407 /* Add a "many" entry and select it as an indication that multiple different
408 * colour conversions are present in the selection.
410 _colour_conversion->Append (_("Many"));
411 checked_set (_colour_conversion, _colour_conversion->GetCount() - 1);
414 setup_sensitivity ();
416 } else if (property == VideoContentProperty::USE) {
417 setup_sensitivity ();
418 } else if (property == VideoContentProperty::FADE_IN) {
420 BOOST_FOREACH (shared_ptr<const Content> i, vc) {
421 check.insert (i->video->fade_in ());
424 if (check.size() == 1) {
426 ContentTime::from_frames (vc.front()->video->fade_in(), vc.front()->active_video_frame_rate(_parent->film())),
427 vc.front()->active_video_frame_rate(_parent->film())
432 } else if (property == VideoContentProperty::FADE_OUT) {
434 BOOST_FOREACH (shared_ptr<const Content> i, vc) {
435 check.insert (i->video->fade_out ());
438 if (check.size() == 1) {
440 ContentTime::from_frames (vc.front()->video->fade_out(), vc.front()->active_video_frame_rate(_parent->film())),
441 vc.front()->active_video_frame_rate(_parent->film())
446 } else if (property == DCPContentProperty::REFERENCE_VIDEO) {
447 if (vc.size() == 1) {
448 shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (vc.front ());
449 checked_set (_reference, dcp ? dcp->reference_video () : false);
451 checked_set (_reference, false);
454 setup_sensitivity ();
455 } else if (property == VideoContentProperty::RANGE) {
457 checked_set (_range, vcs->video->range() == VIDEO_RANGE_FULL ? 0 : 1);
459 checked_set (_range, 0);
462 setup_sensitivity ();
463 } else if (property == VideoContentProperty::CUSTOM_RATIO || property == VideoContentProperty::CUSTOM_SIZE) {
465 BOOST_FOREACH (shared_ptr<const Content> i, vc) {
466 check.insert (i->video->custom_ratio() || i->video->custom_size());
469 if (check.size() == 1) {
470 checked_set (_scale_fit, !vc.front()->video->custom_ratio() && !vc.front()->video->custom_size());
471 checked_set (_scale_custom, vc.front()->video->custom_ratio() || vc.front()->video->custom_size());
473 checked_set (_scale_fit, true);
474 checked_set (_scale_custom, false);
476 setup_sensitivity ();
482 VideoPanel::setup_description ()
484 ContentList vc = _parent->selected_video ();
486 checked_set (_description, wxT (""));
488 } else if (vc.size() > 1) {
489 checked_set (_description, _("Multiple content selected"));
493 string d = vc.front()->video->processing_description (_parent->film());
494 size_t lines = count (d.begin(), d.end(), '\n');
496 for (int i = lines; i < 6; ++i) {
500 checked_set (_description, d);
505 VideoPanel::colour_conversion_changed ()
507 ContentList vc = _parent->selected_video ();
509 int const s = _colour_conversion->GetSelection ();
510 vector<PresetColourConversion> all = PresetColourConversion::all ();
512 if (s == int(all.size() + 1)) {
513 edit_colour_conversion_clicked ();
515 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
517 i->video->unset_colour_conversion ();
518 } else if (s != int(all.size() + 2)) {
519 i->video->set_colour_conversion (all[s - 1].conversion);
526 VideoPanel::edit_colour_conversion_clicked ()
528 ContentList vc = _parent->selected_video ();
530 ContentColourConversionDialog* d = new ContentColourConversionDialog (this, vc.front()->video->yuv ());
531 d->set (vc.front()->video->colour_conversion().get_value_or (PresetColourConversion::all().front().conversion));
532 if (d->ShowModal() == wxID_OK) {
533 BOOST_FOREACH (shared_ptr<Content> i, vc) {
534 i->video->set_colour_conversion (d->get ());
537 /* Reset the colour conversion choice */
538 film_content_changed (VideoContentProperty::COLOUR_CONVERSION);
544 VideoPanel::content_selection_changed ()
546 ContentList video_sel = _parent->selected_video ();
548 _frame_type->set_content (video_sel);
549 _left_crop->set_content (video_sel);
550 _right_crop->set_content (video_sel);
551 _top_crop->set_content (video_sel);
552 _bottom_crop->set_content (video_sel);
554 film_content_changed (ContentProperty::VIDEO_FRAME_RATE);
555 film_content_changed (VideoContentProperty::CROP);
556 film_content_changed (VideoContentProperty::COLOUR_CONVERSION);
557 film_content_changed (VideoContentProperty::FADE_IN);
558 film_content_changed (VideoContentProperty::FADE_OUT);
559 film_content_changed (VideoContentProperty::RANGE);
560 film_content_changed (VideoContentProperty::USE);
561 film_content_changed (VideoContentProperty::CUSTOM_RATIO);
562 film_content_changed (VideoContentProperty::CUSTOM_SIZE);
563 film_content_changed (FFmpegContentProperty::FILTERS);
564 film_content_changed (DCPContentProperty::REFERENCE_VIDEO);
566 setup_sensitivity ();
570 VideoPanel::setup_sensitivity ()
572 ContentList sel = _parent->selected ();
574 shared_ptr<DCPContent> dcp;
575 if (sel.size() == 1) {
576 dcp = dynamic_pointer_cast<DCPContent> (sel.front ());
580 bool const can_reference = dcp && dcp->can_reference_video (_parent->film(), why_not);
582 if (why_not.empty()) {
583 cannot = _("Cannot reference this DCP's video.");
585 cannot = _("Cannot reference this DCP's video: ") + std_to_wx(why_not);
587 setup_refer_button (_reference, _reference_note, dcp, can_reference, cannot);
589 bool any_use = false;
590 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
591 if (i->video && i->video->use()) {
596 bool const enable = !_reference->GetValue() && any_use;
599 _frame_type->wrapped()->Enable (false);
600 _left_crop->wrapped()->Enable (false);
601 _right_crop->wrapped()->Enable (false);
602 _top_crop->wrapped()->Enable (false);
603 _bottom_crop->wrapped()->Enable (false);
604 _fade_in->Enable (false);
605 _fade_out->Enable (false);
606 _scale_fit->Enable (false);
607 _scale_custom->Enable (false);
608 _scale_custom_edit->Enable (false);
609 _description->Enable (false);
610 _colour_conversion->Enable (false);
611 _range->Enable (false);
613 ContentList video_sel = _parent->selected_video ();
614 FFmpegContentList ffmpeg_sel = _parent->selected_ffmpeg ();
615 bool const single = video_sel.size() == 1;
617 _frame_type->wrapped()->Enable (true);
618 _left_crop->wrapped()->Enable (true);
619 _right_crop->wrapped()->Enable (true);
620 _top_crop->wrapped()->Enable (true);
621 _bottom_crop->wrapped()->Enable (true);
622 _fade_in->Enable (!video_sel.empty ());
623 _fade_out->Enable (!video_sel.empty ());
624 _scale_fit->Enable (true);
625 _scale_custom->Enable (true);
626 _scale_custom_edit->Enable (_scale_custom->GetValue());
627 _description->Enable (true);
628 _colour_conversion->Enable (!video_sel.empty());
629 _range->Enable (single && !video_sel.empty());
632 ContentList vc = _parent->selected_video ();
633 shared_ptr<Content> vcs;
638 if (vcs && vcs->video->colour_conversion ()) {
639 _edit_colour_conversion_button->Enable (!vcs->video->colour_conversion().get().preset());
641 _edit_colour_conversion_button->Enable (false);
646 VideoPanel::fade_in_changed ()
648 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video ()) {
649 double const vfr = i->active_video_frame_rate (_parent->film());
650 i->video->set_fade_in (_fade_in->get(vfr).frames_round(vfr));
655 VideoPanel::fade_out_changed ()
657 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video ()) {
658 double const vfr = i->active_video_frame_rate (_parent->film());
659 i->video->set_fade_out (_fade_out->get(vfr).frames_round(vfr));
665 VideoPanel::reference_clicked ()
667 ContentList c = _parent->selected ();
672 shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent> (c.front ());
677 d->set_reference_video (_reference->GetValue ());
682 VideoPanel::scale_fit_clicked ()
684 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
685 i->video->set_custom_ratio (optional<float>());
691 VideoPanel::scale_custom_clicked ()
693 if (!scale_custom_edit_clicked()) {
694 _scale_fit->SetValue (true);
700 VideoPanel::scale_custom_edit_clicked ()
702 shared_ptr<const VideoContent> vc = _parent->selected_video().front()->video;
703 CustomScaleDialog* d = new CustomScaleDialog (this, vc->size(), _parent->film()->frame_size(), vc->custom_ratio(), vc->custom_size());
704 int const r = d->ShowModal ();
706 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
707 i->video->set_custom_ratio (d->custom_ratio());
708 i->video->set_custom_size (d->custom_size());
717 VideoPanel::left_right_link_clicked ()
719 right_crop_changed ();
724 VideoPanel::top_bottom_link_clicked ()
726 bottom_crop_changed ();
731 VideoPanel::left_crop_changed ()
733 if (_left_right_link->GetValue()) {
734 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
735 i->video->set_right_crop (i->video->left_crop());
742 VideoPanel::right_crop_changed ()
744 if (_left_right_link->GetValue()) {
745 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
746 i->video->set_left_crop (i->video->right_crop());
753 VideoPanel::top_crop_changed ()
755 if (_top_bottom_link->GetValue()) {
756 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
757 i->video->set_bottom_crop (i->video->top_crop());
764 VideoPanel::bottom_crop_changed ()
766 if (_top_bottom_link->GetValue()) {
767 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) {
768 i->video->set_top_crop (i->video->bottom_crop());