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/unordered_set.hpp>
43 #include <boost/functional/hash.hpp>
53 using std::shared_ptr;
54 using std::dynamic_pointer_cast;
56 using boost::optional;
57 using namespace dcpomatic;
58 #if BOOST_VERSION >= 106100
59 using namespace boost::placeholders;
63 VideoPanel::VideoPanel (ContentPanel* p)
64 : ContentSubPanel (p, _("Video"))
66 _reference = new CheckBox (this, _("Use this DCP's video as OV and make VF"));
67 _reference_note = new StaticText (this, wxT(""));
68 _reference_note->Wrap (200);
69 wxFont font = _reference_note->GetFont();
70 font.SetStyle(wxFONTSTYLE_ITALIC);
71 font.SetPointSize(font.GetPointSize() - 1);
72 _reference_note->SetFont(font);
74 _type_label = create_label (this, _("Type"), true);
75 _frame_type = new ContentChoice<VideoContent, VideoFrameType> (
77 new wxChoice (this, wxID_ANY),
78 VideoContentProperty::FRAME_TYPE,
80 boost::mem_fn (&VideoContent::frame_type),
81 boost::mem_fn (&VideoContent::set_frame_type),
82 &caster<int, VideoFrameType>,
83 &caster<VideoFrameType, int>
86 _crop_label = create_label (this, _("Crop"), true);
88 #if defined(__WXGTK3__)
89 int const crop_width = 128;
90 int const link_width = 32;
91 int const link_height = 64;
92 #elif defined(DCPOMATIC_OSX)
93 int const crop_width = 56;
94 int const link_width = 19;
95 int const link_height = 28;
97 int const crop_width = 56;
98 int const link_width = 22;
99 int const link_height = 28;
102 _left_crop_label = create_label (this, _("Left"), true);
103 _left_crop = new ContentSpinCtrl<VideoContent> (
105 new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(crop_width, -1)),
106 VideoContentProperty::CROP,
108 boost::mem_fn (&VideoContent::left_crop),
109 boost::mem_fn (&VideoContent::set_left_crop),
110 boost::bind (&VideoPanel::left_crop_changed, this)
113 _left_right_link = new wxToggleButton (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(link_width, link_height));
114 _left_right_link->SetBitmap (wxBitmap(bitmap_path("link"), wxBITMAP_TYPE_PNG));
116 _right_crop_label = create_label (this, _("Right"), true);
117 _right_crop = new ContentSpinCtrl<VideoContent> (
119 new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(crop_width, -1)),
120 VideoContentProperty::CROP,
122 boost::mem_fn (&VideoContent::right_crop),
123 boost::mem_fn (&VideoContent::set_right_crop),
124 boost::bind (&VideoPanel::right_crop_changed, this)
127 _top_crop_label = create_label (this, _("Top"), true);
128 _top_crop = new ContentSpinCtrl<VideoContent> (
130 new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(crop_width, -1)),
131 VideoContentProperty::CROP,
133 boost::mem_fn (&VideoContent::top_crop),
134 boost::mem_fn (&VideoContent::set_top_crop),
135 boost::bind (&VideoPanel::top_crop_changed, this)
138 _top_bottom_link = new wxToggleButton (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(link_width, link_height));
139 _top_bottom_link->SetBitmap (wxBitmap(bitmap_path("link"), wxBITMAP_TYPE_PNG));
141 _bottom_crop_label = create_label (this, _("Bottom"), true);
142 _bottom_crop = new ContentSpinCtrl<VideoContent> (
144 new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(crop_width, -1)),
145 VideoContentProperty::CROP,
147 boost::mem_fn (&VideoContent::bottom_crop),
148 boost::mem_fn (&VideoContent::set_bottom_crop),
149 boost::bind (&VideoPanel::bottom_crop_changed, this)
152 _fade_in_label = create_label (this, _("Fade in"), true);
153 _fade_in = new Timecode<ContentTime> (this);
155 _fade_out_label = create_label (this, _("Fade out"), true);
156 _fade_out = new Timecode<ContentTime> (this);
158 wxClientDC dc (this);
159 wxSize size = dc.GetTextExtent (wxT ("A quite long name"));
161 size.SetWidth (size.GetWidth() + 64);
165 _scale_label = create_label (this, _("Scale"), true);
166 _scale_fit = new wxRadioButton (this, wxID_ANY, _("to fit DCP"));
167 _scale_custom = new wxRadioButton (this, wxID_ANY, _("custom"));
168 _scale_custom_edit = new Button (this, _("Edit..."), wxDefaultPosition, small_button_size(this, _("Edit...")));
170 _colour_conversion_label = create_label (this, _("Colour conversion"), true);
171 _colour_conversion = new wxChoice (this, wxID_ANY, wxDefaultPosition, size);
172 _colour_conversion->Append (_("None"));
173 for (auto const& i: PresetColourConversion::all()) {
174 _colour_conversion->Append (std_to_wx (i.name));
177 /// TRANSLATORS: translate the word "Custom" here; do not include the "Colour|" prefix
178 _colour_conversion->Append (S_("Colour|Custom"));
179 _edit_colour_conversion_button = new Button (this, _("Edit..."), wxDefaultPosition, small_button_size(this, _("Edit...")));
181 _range_label = create_label (this, _("Range"), true);
182 _range = new wxChoice (this, wxID_ANY);
183 _range->Append (_("Full (JPEG, 0-255)"));
184 _range->Append (_("Video (MPEG, 16-235)"));
186 _description = new StaticText (this, wxT ("\n \n \n \n \n"), wxDefaultPosition, wxDefaultSize);
187 _description->SetFont(font);
189 _left_crop->wrapped()->SetRange (0, 4096);
190 _top_crop->wrapped()->SetRange (0, 4096);
191 _right_crop->wrapped()->SetRange (0, 4096);
192 _bottom_crop->wrapped()->SetRange (0, 4096);
194 _frame_type->wrapped()->Append (_("2D"));
195 _frame_type->wrapped()->Append (_("3D"));
196 _frame_type->wrapped()->Append (_("3D left/right"));
197 _frame_type->wrapped()->Append (_("3D top/bottom"));
198 _frame_type->wrapped()->Append (_("3D alternate"));
199 _frame_type->wrapped()->Append (_("3D left only"));
200 _frame_type->wrapped()->Append (_("3D right only"));
202 content_selection_changed ();
204 _fade_in->Changed.connect (boost::bind (&VideoPanel::fade_in_changed, this));
205 _fade_out->Changed.connect (boost::bind (&VideoPanel::fade_out_changed, this));
207 _reference->Bind (wxEVT_CHECKBOX, boost::bind (&VideoPanel::reference_clicked, this));
208 _scale_fit->Bind (wxEVT_RADIOBUTTON, boost::bind (&VideoPanel::scale_fit_clicked, this));
209 _scale_custom->Bind (wxEVT_RADIOBUTTON, boost::bind (&VideoPanel::scale_custom_clicked, this));
210 _scale_custom_edit->Bind (wxEVT_BUTTON, boost::bind (&VideoPanel::scale_custom_edit_clicked, this));
211 _colour_conversion->Bind (wxEVT_CHOICE, boost::bind (&VideoPanel::colour_conversion_changed, this));
212 _range->Bind (wxEVT_CHOICE, boost::bind (&VideoPanel::range_changed, this));
213 _edit_colour_conversion_button->Bind (wxEVT_BUTTON, boost::bind (&VideoPanel::edit_colour_conversion_clicked, this));
214 _left_right_link->Bind (wxEVT_TOGGLEBUTTON, boost::bind(&VideoPanel::left_right_link_clicked, this));
215 _top_bottom_link->Bind (wxEVT_TOGGLEBUTTON, boost::bind(&VideoPanel::top_bottom_link_clicked, this));
221 VideoPanel::add_to_grid ()
225 wxBoxSizer* reference_sizer = new wxBoxSizer (wxVERTICAL);
226 reference_sizer->Add (_reference, 0);
227 reference_sizer->Add (_reference_note, 0);
228 _grid->Add (reference_sizer, wxGBPosition(r, 0), wxGBSpan(1, 3));
231 add_label_to_sizer (_grid, _type_label, true, wxGBPosition(r, 0));
232 _frame_type->add (_grid, wxGBPosition(r, 1), wxGBSpan(1, 2));
236 wxGridBagSizer* crop = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
238 add_label_to_sizer (crop, _left_crop_label, true, wxGBPosition (cr, 0));
239 _left_crop->add (crop, wxGBPosition(cr, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
241 crop->Add (_left_right_link, wxGBPosition(cr, 2), wxGBSpan(2, 1));
243 add_label_to_sizer (crop, _right_crop_label, true, wxGBPosition(cr, 0));
244 _right_crop->add (crop, wxGBPosition(cr, 1));
246 crop->Add (_left_right_link, wxGBPosition(cr, 2), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
247 add_label_to_sizer (crop, _right_crop_label, true, wxGBPosition (cr, 3));
248 _right_crop->add (crop, wxGBPosition (cr, 4), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
251 add_label_to_sizer (crop, _top_crop_label, true, wxGBPosition (cr, 0));
252 _top_crop->add (crop, wxGBPosition (cr, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
254 crop->Add (_top_bottom_link, wxGBPosition(cr, 2), wxGBSpan(2, 1));
256 add_label_to_sizer (crop, _bottom_crop_label, true, wxGBPosition(cr, 0));
257 _bottom_crop->add (crop, wxGBPosition(cr, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
259 crop->Add (_top_bottom_link, wxGBPosition(cr, 2), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
260 add_label_to_sizer (crop, _bottom_crop_label, true, wxGBPosition (cr, 3));
261 _bottom_crop->add (crop, wxGBPosition (cr, 4), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
263 add_label_to_sizer (_grid, _crop_label, true, wxGBPosition(r, 0));
264 _grid->Add (crop, wxGBPosition(r, 1));
267 add_label_to_sizer (_grid, _fade_in_label, true, wxGBPosition (r, 0));
268 _grid->Add (_fade_in, wxGBPosition (r, 1), wxGBSpan (1, 3));
271 add_label_to_sizer (_grid, _fade_out_label, true, wxGBPosition (r, 0));
272 _grid->Add (_fade_out, wxGBPosition (r, 1), wxGBSpan (1, 3));
275 add_label_to_sizer (_grid, _scale_label, true, wxGBPosition (r, 0));
277 wxSizer* v = new wxBoxSizer (wxVERTICAL);
278 v->Add (_scale_fit, 0, wxBOTTOM, 4);
279 wxSizer* h = new wxBoxSizer (wxHORIZONTAL);
280 h->Add (_scale_custom, 1, wxRIGHT | wxALIGN_CENTER_VERTICAL, 6);
281 h->Add (_scale_custom_edit, 0, wxALIGN_CENTER_VERTICAL);
283 _grid->Add (v, wxGBPosition(r, 1));
287 add_label_to_sizer (_grid, _colour_conversion_label, true, wxGBPosition(r, 0));
289 wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
290 s->Add (_colour_conversion, 1, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxRIGHT, 6);
291 s->Add (_edit_colour_conversion_button, 0, wxALIGN_CENTER_VERTICAL);
292 _grid->Add (s, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
296 add_label_to_sizer (_grid, _range_label, true, wxGBPosition(r, 0));
297 _grid->Add (_range, wxGBPosition(r, 1), wxGBSpan(1, 2), wxALIGN_CENTER_VERTICAL);
300 _grid->Add (_description, wxGBPosition (r, 0), wxGBSpan (1, 4), wxEXPAND | wxALIGN_CENTER_VERTICAL, 6);
305 VideoPanel::range_changed ()
307 ContentList vc = _parent->selected_video ();
308 if (vc.size() != 1) {
312 switch (_range->GetSelection()) {
314 vc.front()->video->set_range (VideoRange::FULL);
317 vc.front()->video->set_range (VideoRange::VIDEO);
320 DCPOMATIC_ASSERT (false);
326 VideoPanel::film_changed (Film::Property property)
329 case Film::Property::VIDEO_FRAME_RATE:
330 case Film::Property::CONTAINER:
331 case Film::Property::RESOLUTION:
332 setup_description ();
333 setup_sensitivity ();
335 case Film::Property::REEL_TYPE:
336 case Film::Property::INTEROP:
337 setup_sensitivity ();
345 hash_value (boost::optional<ColourConversion> const & c)
347 boost::hash<string> hasher;
349 return hasher ("none");
351 return hasher (c->identifier());
356 VideoPanel::film_content_changed (int property)
358 ContentList vc = _parent->selected_video ();
359 shared_ptr<Content> vcs;
360 shared_ptr<FFmpegContent> fcs;
363 fcs = dynamic_pointer_cast<FFmpegContent> (vcs);
366 if (property == ContentProperty::VIDEO_FRAME_RATE ||
367 property == VideoContentProperty::FRAME_TYPE ||
368 property == VideoContentProperty::CROP ||
369 property == VideoContentProperty::SCALE) {
370 setup_description ();
371 } else if (property == VideoContentProperty::COLOUR_CONVERSION) {
372 boost::unordered_set<optional<ColourConversion> > check;
374 check.insert (i->video->colour_conversion());
377 /* Remove any "Many" entry that we might have added previously. There should
378 * be entries for each preset plus one for "None" and one for "Custom".
380 vector<PresetColourConversion> cc = PresetColourConversion::all ();
381 if (_colour_conversion->GetCount() > cc.size() + 2) {
382 _colour_conversion->Delete (_colour_conversion->GetCount() - 1);
385 if (check.size() == 1) {
386 if (vcs && vcs->video->colour_conversion ()) {
387 optional<size_t> preset = vcs->video->colour_conversion().get().preset ();
389 checked_set (_colour_conversion, preset.get() + 1);
391 checked_set (_colour_conversion, cc.size() + 1);
394 checked_set (_colour_conversion, 0);
396 } else if (check.size() > 1) {
397 /* Add a "many" entry and select it as an indication that multiple different
398 * colour conversions are present in the selection.
400 _colour_conversion->Append (_("Many"));
401 checked_set (_colour_conversion, _colour_conversion->GetCount() - 1);
404 setup_sensitivity ();
406 } else if (property == VideoContentProperty::USE) {
407 setup_sensitivity ();
408 } else if (property == VideoContentProperty::FADE_IN) {
411 check.insert (i->video->fade_in ());
414 if (check.size() == 1) {
416 ContentTime::from_frames (vc.front()->video->fade_in(), vc.front()->active_video_frame_rate(_parent->film())),
417 vc.front()->active_video_frame_rate(_parent->film())
422 } else if (property == VideoContentProperty::FADE_OUT) {
425 check.insert (i->video->fade_out ());
428 if (check.size() == 1) {
430 ContentTime::from_frames (vc.front()->video->fade_out(), vc.front()->active_video_frame_rate(_parent->film())),
431 vc.front()->active_video_frame_rate(_parent->film())
436 } else if (property == DCPContentProperty::REFERENCE_VIDEO) {
437 if (vc.size() == 1) {
438 shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (vc.front ());
439 checked_set (_reference, dcp ? dcp->reference_video () : false);
441 checked_set (_reference, false);
444 setup_sensitivity ();
445 } else if (property == VideoContentProperty::RANGE) {
447 checked_set (_range, vcs->video->range() == VideoRange::FULL ? 0 : 1);
449 checked_set (_range, 0);
452 setup_sensitivity ();
453 } else if (property == VideoContentProperty::CUSTOM_RATIO || property == VideoContentProperty::CUSTOM_SIZE) {
456 check.insert (i->video->custom_ratio() || i->video->custom_size());
459 if (check.size() == 1) {
460 checked_set (_scale_fit, !vc.front()->video->custom_ratio() && !vc.front()->video->custom_size());
461 checked_set (_scale_custom, vc.front()->video->custom_ratio() || vc.front()->video->custom_size());
463 checked_set (_scale_fit, true);
464 checked_set (_scale_custom, false);
466 setup_sensitivity ();
472 VideoPanel::setup_description ()
474 ContentList vc = _parent->selected_video ();
476 checked_set (_description, wxT (""));
478 } else if (vc.size() > 1) {
479 checked_set (_description, _("Multiple content selected"));
483 string d = vc.front()->video->processing_description (_parent->film());
484 size_t lines = count (d.begin(), d.end(), '\n');
486 for (int i = lines; i < 6; ++i) {
490 checked_set (_description, d);
495 VideoPanel::colour_conversion_changed ()
497 ContentList vc = _parent->selected_video ();
499 int const s = _colour_conversion->GetSelection ();
500 vector<PresetColourConversion> all = PresetColourConversion::all ();
502 if (s == int(all.size() + 1)) {
503 edit_colour_conversion_clicked ();
505 for (auto i: _parent->selected_video()) {
507 i->video->unset_colour_conversion ();
508 } else if (s != int(all.size() + 2)) {
509 i->video->set_colour_conversion (all[s - 1].conversion);
516 VideoPanel::edit_colour_conversion_clicked ()
518 ContentList vc = _parent->selected_video ();
520 ContentColourConversionDialog* d = new ContentColourConversionDialog (this, vc.front()->video->yuv ());
521 d->set (vc.front()->video->colour_conversion().get_value_or (PresetColourConversion::all().front().conversion));
522 if (d->ShowModal() == wxID_OK) {
524 i->video->set_colour_conversion (d->get ());
527 /* Reset the colour conversion choice */
528 film_content_changed (VideoContentProperty::COLOUR_CONVERSION);
534 VideoPanel::content_selection_changed ()
536 ContentList video_sel = _parent->selected_video ();
538 _frame_type->set_content (video_sel);
539 _left_crop->set_content (video_sel);
540 _right_crop->set_content (video_sel);
541 _top_crop->set_content (video_sel);
542 _bottom_crop->set_content (video_sel);
544 film_content_changed (ContentProperty::VIDEO_FRAME_RATE);
545 film_content_changed (VideoContentProperty::CROP);
546 film_content_changed (VideoContentProperty::COLOUR_CONVERSION);
547 film_content_changed (VideoContentProperty::FADE_IN);
548 film_content_changed (VideoContentProperty::FADE_OUT);
549 film_content_changed (VideoContentProperty::RANGE);
550 film_content_changed (VideoContentProperty::USE);
551 film_content_changed (VideoContentProperty::CUSTOM_RATIO);
552 film_content_changed (VideoContentProperty::CUSTOM_SIZE);
553 film_content_changed (FFmpegContentProperty::FILTERS);
554 film_content_changed (DCPContentProperty::REFERENCE_VIDEO);
556 setup_sensitivity ();
560 VideoPanel::setup_sensitivity ()
562 ContentList sel = _parent->selected ();
564 shared_ptr<DCPContent> dcp;
565 if (sel.size() == 1) {
566 dcp = dynamic_pointer_cast<DCPContent> (sel.front ());
570 bool const can_reference = dcp && dcp->can_reference_video (_parent->film(), why_not);
572 if (why_not.empty()) {
573 cannot = _("Cannot reference this DCP's video.");
575 cannot = _("Cannot reference this DCP's video: ") + std_to_wx(why_not);
577 setup_refer_button (_reference, _reference_note, dcp, can_reference, cannot);
579 bool any_use = false;
580 for (auto i: _parent->selected_video()) {
581 if (i->video && i->video->use()) {
586 bool const enable = !_reference->GetValue() && any_use;
589 _frame_type->wrapped()->Enable (false);
590 _left_crop->wrapped()->Enable (false);
591 _right_crop->wrapped()->Enable (false);
592 _top_crop->wrapped()->Enable (false);
593 _bottom_crop->wrapped()->Enable (false);
594 _fade_in->Enable (false);
595 _fade_out->Enable (false);
596 _scale_fit->Enable (false);
597 _scale_custom->Enable (false);
598 _scale_custom_edit->Enable (false);
599 _description->Enable (false);
600 _colour_conversion->Enable (false);
601 _range->Enable (false);
603 ContentList video_sel = _parent->selected_video ();
604 FFmpegContentList ffmpeg_sel = _parent->selected_ffmpeg ();
605 bool const single = video_sel.size() == 1;
607 _frame_type->wrapped()->Enable (true);
608 _left_crop->wrapped()->Enable (true);
609 _right_crop->wrapped()->Enable (true);
610 _top_crop->wrapped()->Enable (true);
611 _bottom_crop->wrapped()->Enable (true);
612 _fade_in->Enable (!video_sel.empty ());
613 _fade_out->Enable (!video_sel.empty ());
614 _scale_fit->Enable (true);
615 _scale_custom->Enable (true);
616 _scale_custom_edit->Enable (_scale_custom->GetValue());
617 _description->Enable (true);
618 _colour_conversion->Enable (!video_sel.empty());
619 _range->Enable (single && !video_sel.empty() && !dcp);
622 ContentList vc = _parent->selected_video ();
623 shared_ptr<Content> vcs;
628 if (vcs && vcs->video->colour_conversion ()) {
629 _edit_colour_conversion_button->Enable (!vcs->video->colour_conversion().get().preset());
631 _edit_colour_conversion_button->Enable (false);
636 VideoPanel::fade_in_changed ()
638 auto const hmsf = _fade_in->get();
639 for (auto i: _parent->selected_video()) {
640 double const vfr = i->active_video_frame_rate (_parent->film());
641 i->video->set_fade_in (dcpomatic::ContentTime(hmsf, vfr).frames_round(vfr));
646 VideoPanel::fade_out_changed ()
648 auto const hmsf = _fade_out->get();
649 for (auto i: _parent->selected_video()) {
650 double const vfr = i->active_video_frame_rate (_parent->film());
651 i->video->set_fade_out (dcpomatic::ContentTime(hmsf, vfr).frames_round(vfr));
657 VideoPanel::reference_clicked ()
659 ContentList c = _parent->selected ();
664 shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent> (c.front ());
669 d->set_reference_video (_reference->GetValue ());
674 VideoPanel::scale_fit_clicked ()
676 for (auto i: _parent->selected_video()) {
677 i->video->set_custom_ratio (optional<float>());
683 VideoPanel::scale_custom_clicked ()
685 if (!scale_custom_edit_clicked()) {
686 _scale_fit->SetValue (true);
692 VideoPanel::scale_custom_edit_clicked ()
694 shared_ptr<const VideoContent> vc = _parent->selected_video().front()->video;
695 CustomScaleDialog* d = new CustomScaleDialog (this, vc->size(), _parent->film()->frame_size(), vc->custom_ratio(), vc->custom_size());
696 int const r = d->ShowModal ();
698 for (auto i: _parent->selected_video()) {
699 i->video->set_custom_ratio (d->custom_ratio());
700 i->video->set_custom_size (d->custom_size());
709 VideoPanel::left_right_link_clicked ()
711 right_crop_changed ();
716 VideoPanel::top_bottom_link_clicked ()
718 bottom_crop_changed ();
723 VideoPanel::left_crop_changed ()
725 if (_left_right_link->GetValue()) {
726 for (auto i: _parent->selected_video()) {
727 i->video->set_right_crop (i->video->left_crop());
734 VideoPanel::right_crop_changed ()
736 if (_left_right_link->GetValue()) {
737 for (auto i: _parent->selected_video()) {
738 i->video->set_left_crop (i->video->right_crop());
745 VideoPanel::top_crop_changed ()
747 if (_top_bottom_link->GetValue()) {
748 for (auto i: _parent->selected_video()) {
749 i->video->set_bottom_crop (i->video->top_crop());
756 VideoPanel::bottom_crop_changed ()
758 if (_top_bottom_link->GetValue()) {
759 for (auto i: _parent->selected_video()) {
760 i->video->set_top_crop (i->video->bottom_crop());