2 Copyright (C) 2012-2021 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/>.
22 #include "check_box.h"
23 #include "content_colour_conversion_dialog.h"
24 #include "content_panel.h"
25 #include "content_widget.h"
26 #include "custom_scale_dialog.h"
27 #include "dcpomatic_button.h"
28 #include "filter_dialog.h"
29 #include "static_text.h"
30 #include "video_panel.h"
32 #include "lib/colour_conversion.h"
33 #include "lib/config.h"
34 #include "lib/dcp_content.h"
35 #include "lib/ffmpeg_content.h"
36 #include "lib/filter.h"
37 #include "lib/frame_rate_change.h"
38 #include "lib/ratio.h"
40 #include "lib/video_content.h"
41 #include <wx/spinctrl.h>
42 #include <wx/tglbtn.h>
43 #include <boost/functional/hash.hpp>
44 #include <boost/unordered_set.hpp>
55 using std::shared_ptr;
56 using std::dynamic_pointer_cast;
58 using boost::optional;
59 using namespace dcpomatic;
60 #if BOOST_VERSION >= 106100
61 using namespace boost::placeholders;
65 VideoPanel::VideoPanel (ContentPanel* p)
66 : ContentSubPanel (p, _("Video"))
68 _reference = new CheckBox (this, _("Use this DCP's video as OV and make VF"));
69 _reference_note = new StaticText (this, wxT(""));
70 _reference_note->Wrap (200);
71 auto font = _reference_note->GetFont();
72 font.SetStyle(wxFONTSTYLE_ITALIC);
73 font.SetPointSize(font.GetPointSize() - 1);
74 _reference_note->SetFont(font);
76 _type_label = create_label (this, _("Type"), true);
77 _frame_type = new ContentChoice<VideoContent, VideoFrameType> (
79 new wxChoice (this, wxID_ANY),
80 VideoContentProperty::FRAME_TYPE,
82 boost::mem_fn (&VideoContent::frame_type),
83 boost::mem_fn (&VideoContent::set_frame_type),
84 &caster<int, VideoFrameType>,
85 &caster<VideoFrameType, int>
88 _crop_label = create_label (this, _("Crop"), true);
90 #if defined(__WXGTK3__)
91 int const crop_width = 128;
92 int const link_width = 32;
93 int const link_height = 64;
94 #elif defined(__WXGTK20__)
95 int const crop_width = 56;
96 int const link_width = 24;
97 int const link_height = 32;
98 #elif defined(DCPOMATIC_OSX)
99 int const crop_width = 56;
100 int const link_width = 23;
101 int const link_height = 28;
103 int const crop_width = 56;
104 int const link_width = 22;
105 int const link_height = 28;
108 _left_crop_label = create_label (this, _("Left"), true);
109 _left_crop = new ContentSpinCtrl<VideoContent> (
111 new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(crop_width, -1)),
112 VideoContentProperty::CROP,
114 boost::mem_fn (&VideoContent::left_crop),
115 boost::mem_fn (&VideoContent::set_left_crop),
116 boost::bind (&VideoPanel::left_crop_changed, this)
119 _left_right_link = new wxToggleButton (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(link_width, link_height));
120 _left_right_link->SetBitmap (wxBitmap(bitmap_path("link"), wxBITMAP_TYPE_PNG));
122 _right_crop_label = create_label (this, _("Right"), true);
123 _right_crop = new ContentSpinCtrl<VideoContent> (
125 new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(crop_width, -1)),
126 VideoContentProperty::CROP,
128 boost::mem_fn (&VideoContent::right_crop),
129 boost::mem_fn (&VideoContent::set_right_crop),
130 boost::bind (&VideoPanel::right_crop_changed, this)
133 _top_crop_label = create_label (this, _("Top"), true);
134 _top_crop = new ContentSpinCtrl<VideoContent> (
136 new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(crop_width, -1)),
137 VideoContentProperty::CROP,
139 boost::mem_fn (&VideoContent::top_crop),
140 boost::mem_fn (&VideoContent::set_top_crop),
141 boost::bind (&VideoPanel::top_crop_changed, this)
144 _top_bottom_link = new wxToggleButton (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(link_width, link_height));
145 _top_bottom_link->SetBitmap (wxBitmap(bitmap_path("link"), wxBITMAP_TYPE_PNG));
147 _bottom_crop_label = create_label (this, _("Bottom"), true);
148 _bottom_crop = new ContentSpinCtrl<VideoContent> (
150 new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(crop_width, -1)),
151 VideoContentProperty::CROP,
153 boost::mem_fn (&VideoContent::bottom_crop),
154 boost::mem_fn (&VideoContent::set_bottom_crop),
155 boost::bind (&VideoPanel::bottom_crop_changed, this)
158 _fade_in_label = create_label (this, _("Fade in"), true);
159 _fade_in = new Timecode<ContentTime> (this);
161 _fade_out_label = create_label (this, _("Fade out"), true);
162 _fade_out = new Timecode<ContentTime> (this);
164 wxClientDC dc (this);
165 auto size = dc.GetTextExtent (wxT ("A quite long name"));
167 size.SetWidth (size.GetWidth() + 64);
171 _scale_label = create_label (this, _("Scale"), true);
172 _scale_fit = new wxRadioButton (this, wxID_ANY, _("to fit DCP"));
173 _scale_custom = new wxRadioButton (this, wxID_ANY, _("custom"));
174 _scale_custom_edit = new Button (this, _("Edit..."), wxDefaultPosition, small_button_size(this, _("Edit...")));
176 _colour_conversion_label = create_label (this, _("Colour"), true);
177 _colour_conversion = new wxChoice (this, wxID_ANY, wxDefaultPosition, size);
178 _colour_conversion->Append (_("None"));
179 for (auto const& i: PresetColourConversion::all()) {
180 _colour_conversion->Append (std_to_wx (i.name));
183 /// TRANSLATORS: translate the word "Custom" here; do not include the "Colour|" prefix
184 _colour_conversion->Append (S_("Colour|Custom"));
185 _edit_colour_conversion_button = new Button (this, _("Edit..."), wxDefaultPosition, small_button_size(this, _("Edit...")));
187 _range_label = create_label (this, _("Range"), true);
188 _range = new wxChoice (this, wxID_ANY);
189 _range->Append (_("Full (JPEG, 0-255)"));
190 _range->Append (_("Video (MPEG, 16-235)"));
192 _description = new StaticText (this, wxT ("\n \n \n \n \n"), wxDefaultPosition, wxDefaultSize);
193 _description->SetFont(font);
195 _left_crop->wrapped()->SetRange (0, 4096);
196 _top_crop->wrapped()->SetRange (0, 4096);
197 _right_crop->wrapped()->SetRange (0, 4096);
198 _bottom_crop->wrapped()->SetRange (0, 4096);
200 _frame_type->wrapped()->Append (_("2D"));
201 _frame_type->wrapped()->Append (_("3D"));
202 _frame_type->wrapped()->Append (_("3D left/right"));
203 _frame_type->wrapped()->Append (_("3D top/bottom"));
204 _frame_type->wrapped()->Append (_("3D alternate"));
205 _frame_type->wrapped()->Append (_("3D left only"));
206 _frame_type->wrapped()->Append (_("3D right only"));
208 content_selection_changed ();
210 _fade_in->Changed.connect (boost::bind (&VideoPanel::fade_in_changed, this));
211 _fade_out->Changed.connect (boost::bind (&VideoPanel::fade_out_changed, this));
213 _reference->Bind (wxEVT_CHECKBOX, boost::bind (&VideoPanel::reference_clicked, this));
214 _scale_fit->Bind (wxEVT_RADIOBUTTON, boost::bind (&VideoPanel::scale_fit_clicked, this));
215 _scale_custom->Bind (wxEVT_RADIOBUTTON, boost::bind (&VideoPanel::scale_custom_clicked, this));
216 _scale_custom_edit->Bind (wxEVT_BUTTON, boost::bind (&VideoPanel::scale_custom_edit_clicked, this));
217 _colour_conversion->Bind (wxEVT_CHOICE, boost::bind (&VideoPanel::colour_conversion_changed, this));
218 _range->Bind (wxEVT_CHOICE, boost::bind (&VideoPanel::range_changed, this));
219 _edit_colour_conversion_button->Bind (wxEVT_BUTTON, boost::bind (&VideoPanel::edit_colour_conversion_clicked, this));
220 _left_right_link->Bind (wxEVT_TOGGLEBUTTON, boost::bind(&VideoPanel::left_right_link_clicked, this));
221 _top_bottom_link->Bind (wxEVT_TOGGLEBUTTON, boost::bind(&VideoPanel::top_bottom_link_clicked, this));
228 VideoPanel::add_to_grid ()
232 auto reference_sizer = new wxBoxSizer (wxVERTICAL);
233 reference_sizer->Add (_reference, 0);
234 reference_sizer->Add (_reference_note, 0);
235 _grid->Add (reference_sizer, wxGBPosition(r, 0), wxGBSpan(1, 3));
238 add_label_to_sizer (_grid, _type_label, true, wxGBPosition(r, 0));
239 _frame_type->add (_grid, wxGBPosition(r, 1), wxGBSpan(1, 2));
243 auto crop = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
245 add_label_to_sizer (crop, _left_crop_label, true, wxGBPosition (cr, 0));
246 _left_crop->add (crop, wxGBPosition(cr, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
248 crop->Add (_left_right_link, wxGBPosition(cr, 2), wxGBSpan(2, 1));
250 add_label_to_sizer (crop, _right_crop_label, true, wxGBPosition(cr, 0));
251 _right_crop->add (crop, wxGBPosition(cr, 1));
253 crop->Add (_left_right_link, wxGBPosition(cr, 2), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
254 add_label_to_sizer (crop, _right_crop_label, true, wxGBPosition (cr, 3));
255 _right_crop->add (crop, wxGBPosition (cr, 4), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
258 add_label_to_sizer (crop, _top_crop_label, true, wxGBPosition (cr, 0));
259 _top_crop->add (crop, wxGBPosition (cr, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
261 crop->Add (_top_bottom_link, wxGBPosition(cr, 2), wxGBSpan(2, 1));
263 add_label_to_sizer (crop, _bottom_crop_label, true, wxGBPosition(cr, 0));
264 _bottom_crop->add (crop, wxGBPosition(cr, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
266 crop->Add (_top_bottom_link, wxGBPosition(cr, 2), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
267 add_label_to_sizer (crop, _bottom_crop_label, true, wxGBPosition (cr, 3));
268 _bottom_crop->add (crop, wxGBPosition (cr, 4), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
270 add_label_to_sizer (_grid, _crop_label, true, wxGBPosition(r, 0));
271 _grid->Add (crop, wxGBPosition(r, 1));
274 add_label_to_sizer (_grid, _fade_in_label, true, wxGBPosition (r, 0));
275 _grid->Add (_fade_in, wxGBPosition (r, 1), wxGBSpan (1, 3));
278 add_label_to_sizer (_grid, _fade_out_label, true, wxGBPosition (r, 0));
279 _grid->Add (_fade_out, wxGBPosition (r, 1), wxGBSpan (1, 3));
282 add_label_to_sizer (_grid, _scale_label, true, wxGBPosition (r, 0));
284 auto v = new wxBoxSizer (wxVERTICAL);
285 v->Add (_scale_fit, 0, wxBOTTOM, 4);
286 auto h = new wxBoxSizer (wxHORIZONTAL);
287 h->Add (_scale_custom, 1, wxRIGHT | wxALIGN_CENTER_VERTICAL, 6);
288 h->Add (_scale_custom_edit, 0, wxALIGN_CENTER_VERTICAL);
290 _grid->Add (v, wxGBPosition(r, 1));
294 add_label_to_sizer (_grid, _colour_conversion_label, true, wxGBPosition(r, 0));
296 auto s = new wxBoxSizer (wxHORIZONTAL);
297 s->Add (_colour_conversion, 1, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxRIGHT, 6);
298 s->Add (_edit_colour_conversion_button, 0, wxALIGN_CENTER_VERTICAL);
299 _grid->Add (s, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
303 add_label_to_sizer (_grid, _range_label, true, wxGBPosition(r, 0));
304 _grid->Add (_range, wxGBPosition(r, 1), wxGBSpan(1, 2), wxALIGN_CENTER_VERTICAL);
307 _grid->Add (_description, wxGBPosition (r, 0), wxGBSpan (1, 4), wxEXPAND | wxALIGN_CENTER_VERTICAL, 6);
313 VideoPanel::range_changed ()
315 auto vc = _parent->selected_video ();
316 if (vc.size() != 1) {
320 switch (_range->GetSelection()) {
322 vc.front()->video->set_range (VideoRange::FULL);
325 vc.front()->video->set_range (VideoRange::VIDEO);
328 DCPOMATIC_ASSERT (false);
334 VideoPanel::film_changed (Film::Property property)
337 case Film::Property::VIDEO_FRAME_RATE:
338 case Film::Property::CONTAINER:
339 case Film::Property::RESOLUTION:
340 setup_description ();
341 setup_sensitivity ();
343 case Film::Property::REEL_TYPE:
344 case Film::Property::INTEROP:
345 setup_sensitivity ();
354 hash_value (boost::optional<ColourConversion> const & c)
356 boost::hash<string> hasher;
358 return hasher ("none");
360 return hasher (c->identifier());
365 VideoPanel::film_content_changed (int property)
367 auto vc = _parent->selected_video ();
368 shared_ptr<Content> vcs;
369 shared_ptr<FFmpegContent> fcs;
372 fcs = dynamic_pointer_cast<FFmpegContent> (vcs);
375 if (property == ContentProperty::VIDEO_FRAME_RATE ||
376 property == VideoContentProperty::FRAME_TYPE ||
377 property == VideoContentProperty::CROP ||
378 property == VideoContentProperty::SCALE) {
379 setup_description ();
380 } else if (property == VideoContentProperty::COLOUR_CONVERSION) {
381 boost::unordered_set<optional<ColourConversion>> check;
383 check.insert (i->video->colour_conversion());
386 /* Remove any "Many" entry that we might have added previously. There should
387 * be entries for each preset plus one for "None" and one for "Custom".
389 auto cc = PresetColourConversion::all ();
390 if (_colour_conversion->GetCount() > cc.size() + 2) {
391 _colour_conversion->Delete (_colour_conversion->GetCount() - 1);
394 if (check.size() == 1) {
395 if (vcs && vcs->video->colour_conversion ()) {
396 auto preset = vcs->video->colour_conversion().get().preset();
398 checked_set (_colour_conversion, preset.get() + 1);
400 checked_set (_colour_conversion, cc.size() + 1);
403 checked_set (_colour_conversion, 0);
405 } else if (check.size() > 1) {
406 /* Add a "many" entry and select it as an indication that multiple different
407 * colour conversions are present in the selection.
409 _colour_conversion->Append (_("Many"));
410 checked_set (_colour_conversion, _colour_conversion->GetCount() - 1);
413 setup_sensitivity ();
415 } else if (property == VideoContentProperty::USE) {
416 setup_sensitivity ();
417 } else if (property == VideoContentProperty::FADE_IN) {
420 check.insert (i->video->fade_in ());
423 if (check.size() == 1) {
425 ContentTime::from_frames (vc.front()->video->fade_in(), vc.front()->active_video_frame_rate(_parent->film())),
426 vc.front()->active_video_frame_rate(_parent->film())
431 } else if (property == VideoContentProperty::FADE_OUT) {
434 check.insert (i->video->fade_out ());
437 if (check.size() == 1) {
439 ContentTime::from_frames (vc.front()->video->fade_out(), vc.front()->active_video_frame_rate(_parent->film())),
440 vc.front()->active_video_frame_rate(_parent->film())
445 } else if (property == DCPContentProperty::REFERENCE_VIDEO) {
446 if (vc.size() == 1) {
447 shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (vc.front ());
448 checked_set (_reference, dcp ? dcp->reference_video () : false);
450 checked_set (_reference, false);
453 setup_sensitivity ();
454 } else if (property == VideoContentProperty::RANGE) {
456 checked_set (_range, vcs->video->range() == VideoRange::FULL ? 0 : 1);
458 checked_set (_range, 0);
461 setup_sensitivity ();
462 } else if (property == VideoContentProperty::CUSTOM_RATIO || property == VideoContentProperty::CUSTOM_SIZE) {
465 check.insert (i->video->custom_ratio() || i->video->custom_size());
468 if (check.size() == 1) {
469 checked_set (_scale_fit, !vc.front()->video->custom_ratio() && !vc.front()->video->custom_size());
470 checked_set (_scale_custom, vc.front()->video->custom_ratio() || vc.front()->video->custom_size());
472 checked_set (_scale_fit, true);
473 checked_set (_scale_custom, false);
475 setup_sensitivity ();
481 VideoPanel::setup_description ()
483 auto vc = _parent->selected_video ();
485 checked_set (_description, wxT (""));
487 } else if (vc.size() > 1) {
488 checked_set (_description, _("Multiple content selected"));
492 auto d = vc.front()->video->processing_description(_parent->film());
493 size_t lines = count (d.begin(), d.end(), '\n');
495 for (int i = lines; i < 6; ++i) {
499 checked_set (_description, d);
505 VideoPanel::colour_conversion_changed ()
507 auto vc = _parent->selected_video ();
509 int const s = _colour_conversion->GetSelection ();
510 auto all = PresetColourConversion::all ();
512 if (s == int(all.size() + 1)) {
513 edit_colour_conversion_clicked ();
515 for (auto 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);
527 VideoPanel::edit_colour_conversion_clicked ()
529 auto vc = _parent->selected_video ();
531 auto d = new ContentColourConversionDialog (this, vc.front()->video->yuv ());
532 d->set (vc.front()->video->colour_conversion().get_value_or (PresetColourConversion::all().front().conversion));
533 if (d->ShowModal() == wxID_OK) {
535 i->video->set_colour_conversion (d->get ());
538 /* Reset the colour conversion choice */
539 film_content_changed (VideoContentProperty::COLOUR_CONVERSION);
546 VideoPanel::content_selection_changed ()
548 auto video_sel = _parent->selected_video ();
550 _frame_type->set_content (video_sel);
551 _left_crop->set_content (video_sel);
552 _right_crop->set_content (video_sel);
553 _top_crop->set_content (video_sel);
554 _bottom_crop->set_content (video_sel);
556 film_content_changed (ContentProperty::VIDEO_FRAME_RATE);
557 film_content_changed (VideoContentProperty::CROP);
558 film_content_changed (VideoContentProperty::COLOUR_CONVERSION);
559 film_content_changed (VideoContentProperty::FADE_IN);
560 film_content_changed (VideoContentProperty::FADE_OUT);
561 film_content_changed (VideoContentProperty::RANGE);
562 film_content_changed (VideoContentProperty::USE);
563 film_content_changed (VideoContentProperty::CUSTOM_RATIO);
564 film_content_changed (VideoContentProperty::CUSTOM_SIZE);
565 film_content_changed (FFmpegContentProperty::FILTERS);
566 film_content_changed (DCPContentProperty::REFERENCE_VIDEO);
568 setup_sensitivity ();
573 VideoPanel::setup_sensitivity ()
575 auto sel = _parent->selected ();
577 shared_ptr<DCPContent> dcp;
578 if (sel.size() == 1) {
579 dcp = dynamic_pointer_cast<DCPContent> (sel.front ());
583 bool const can_reference = dcp && dcp->can_reference_video (_parent->film(), why_not);
585 if (why_not.empty()) {
586 cannot = _("Cannot reference this DCP's video.");
588 cannot = _("Cannot reference this DCP's video: ") + std_to_wx(why_not);
590 setup_refer_button (_reference, _reference_note, dcp, can_reference, cannot);
592 bool any_use = false;
593 for (auto i: _parent->selected_video()) {
594 if (i->video && i->video->use()) {
599 bool const enable = !_reference->GetValue() && any_use;
602 _frame_type->wrapped()->Enable (false);
603 _left_crop->wrapped()->Enable (false);
604 _right_crop->wrapped()->Enable (false);
605 _top_crop->wrapped()->Enable (false);
606 _bottom_crop->wrapped()->Enable (false);
607 _fade_in->Enable (false);
608 _fade_out->Enable (false);
609 _scale_fit->Enable (false);
610 _scale_custom->Enable (false);
611 _scale_custom_edit->Enable (false);
612 _description->Enable (false);
613 _colour_conversion->Enable (false);
614 _range->Enable (false);
616 auto video_sel = _parent->selected_video ();
617 auto ffmpeg_sel = _parent->selected_ffmpeg ();
618 bool const single = video_sel.size() == 1;
620 _frame_type->wrapped()->Enable (true);
621 _left_crop->wrapped()->Enable (true);
622 _right_crop->wrapped()->Enable (true);
623 _top_crop->wrapped()->Enable (true);
624 _bottom_crop->wrapped()->Enable (true);
625 _fade_in->Enable (!video_sel.empty ());
626 _fade_out->Enable (!video_sel.empty ());
627 _scale_fit->Enable (true);
628 _scale_custom->Enable (true);
629 _scale_custom_edit->Enable (_scale_custom->GetValue());
630 _description->Enable (true);
631 _colour_conversion->Enable (!video_sel.empty());
632 _range->Enable (single && !video_sel.empty() && !dcp);
635 auto vc = _parent->selected_video ();
636 shared_ptr<Content> vcs;
641 if (vcs && vcs->video->colour_conversion ()) {
642 _edit_colour_conversion_button->Enable (!vcs->video->colour_conversion().get().preset());
644 _edit_colour_conversion_button->Enable (false);
650 VideoPanel::fade_in_changed ()
652 auto const hmsf = _fade_in->get();
653 for (auto i: _parent->selected_video()) {
654 auto const vfr = i->active_video_frame_rate(_parent->film());
655 i->video->set_fade_in (dcpomatic::ContentTime(hmsf, vfr).frames_round(vfr));
661 VideoPanel::fade_out_changed ()
663 auto const hmsf = _fade_out->get();
664 for (auto i: _parent->selected_video()) {
665 auto const vfr = i->active_video_frame_rate (_parent->film());
666 i->video->set_fade_out (dcpomatic::ContentTime(hmsf, vfr).frames_round(vfr));
672 VideoPanel::reference_clicked ()
674 auto c = _parent->selected ();
679 auto d = dynamic_pointer_cast<DCPContent> (c.front ());
684 d->set_reference_video (_reference->GetValue ());
689 VideoPanel::scale_fit_clicked ()
691 for (auto i: _parent->selected_video()) {
692 i->video->set_custom_ratio (optional<float>());
698 VideoPanel::scale_custom_clicked ()
700 if (!scale_custom_edit_clicked()) {
701 _scale_fit->SetValue (true);
707 VideoPanel::scale_custom_edit_clicked ()
709 auto vc = _parent->selected_video().front()->video;
710 auto d = new CustomScaleDialog (this, vc->size(), _parent->film()->frame_size(), vc->custom_ratio(), vc->custom_size());
711 int const r = d->ShowModal ();
713 for (auto i: _parent->selected_video()) {
714 i->video->set_custom_ratio (d->custom_ratio());
715 i->video->set_custom_size (d->custom_size());
724 VideoPanel::left_right_link_clicked ()
726 if (_left_changed_last) {
727 left_crop_changed ();
729 right_crop_changed ();
735 VideoPanel::top_bottom_link_clicked ()
737 if (_top_changed_last) {
740 bottom_crop_changed ();
746 VideoPanel::left_crop_changed ()
748 _left_changed_last = true;
749 if (_left_right_link->GetValue()) {
750 for (auto i: _parent->selected_video()) {
751 i->video->set_right_crop (i->video->left_crop());
758 VideoPanel::right_crop_changed ()
760 _left_changed_last = false;
761 if (_left_right_link->GetValue()) {
762 for (auto i: _parent->selected_video()) {
763 i->video->set_left_crop (i->video->right_crop());
770 VideoPanel::top_crop_changed ()
772 _top_changed_last = true;
773 if (_top_bottom_link->GetValue()) {
774 for (auto i: _parent->selected_video()) {
775 i->video->set_bottom_crop (i->video->top_crop());
782 VideoPanel::bottom_crop_changed ()
784 _top_changed_last = false;
785 if (_top_bottom_link->GetValue()) {
786 for (auto i: _parent->selected_video()) {
787 i->video->set_top_crop (i->video->bottom_crop());