X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fvideo_panel.cc;h=8a02dff25b01acc08e958f05717124dce8f96ad0;hb=7a301e22de2a3c47a81ebc4c9f19b68131b482aa;hp=74b2d22192925be9df1447d9ff77bbd80f5f1095;hpb=b9a1ad3df5f9d85fb7439efd93fede72b9b078af;p=dcpomatic.git diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc index 74b2d2219..8a02dff25 100644 --- a/src/wx/video_panel.cc +++ b/src/wx/video_panel.cc @@ -33,16 +33,17 @@ #include "lib/config.h" #include "lib/dcp_content.h" #include "lib/ffmpeg_content.h" +#include "lib/film.h" #include "lib/filter.h" #include "lib/frame_rate_change.h" #include "lib/ratio.h" #include "lib/util.h" #include "lib/video_content.h" -#include "lib/warnings.h" -DCPOMATIC_DISABLE_WARNINGS +#include +LIBDCP_DISABLE_WARNINGS #include #include -DCPOMATIC_ENABLE_WARNINGS +LIBDCP_ENABLE_WARNINGS #include #include #include @@ -127,7 +128,7 @@ VideoPanel::create () ); _left_right_link = new wxToggleButton (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(link_width, link_height)); - _left_right_link->SetBitmap (wxBitmap(bitmap_path("link"), wxBITMAP_TYPE_PNG)); + _left_right_link->SetBitmap (wxBitmap(bitmap_path("link.png"), wxBITMAP_TYPE_PNG)); _right_crop_label = create_label (this, _("Right"), true); _right_crop = new ContentSpinCtrl ( @@ -152,7 +153,7 @@ VideoPanel::create () ); _top_bottom_link = new wxToggleButton (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(link_width, link_height)); - _top_bottom_link->SetBitmap (wxBitmap(bitmap_path("link"), wxBITMAP_TYPE_PNG)); + _top_bottom_link->SetBitmap (wxBitmap(bitmap_path("link.png"), wxBITMAP_TYPE_PNG)); _bottom_crop_label = create_label (this, _("Bottom"), true); _bottom_crop = new ContentSpinCtrl ( @@ -220,7 +221,7 @@ VideoPanel::create () _fade_in->Changed.connect (boost::bind (&VideoPanel::fade_in_changed, this)); _fade_out->Changed.connect (boost::bind (&VideoPanel::fade_out_changed, this)); - _reference->Bind (wxEVT_CHECKBOX, boost::bind (&VideoPanel::reference_clicked, this)); + _reference->bind(&VideoPanel::reference_clicked, this); _scale_fit->Bind (wxEVT_RADIOBUTTON, boost::bind (&VideoPanel::scale_fit_clicked, this)); _scale_custom->Bind (wxEVT_RADIOBUTTON, boost::bind (&VideoPanel::scale_custom_clicked, this)); _scale_custom_edit->Bind (wxEVT_BUTTON, boost::bind (&VideoPanel::scale_custom_edit_clicked, this)); @@ -343,17 +344,17 @@ VideoPanel::range_changed () void -VideoPanel::film_changed (Film::Property property) +VideoPanel::film_changed(FilmProperty property) { switch (property) { - case Film::Property::VIDEO_FRAME_RATE: - case Film::Property::CONTAINER: - case Film::Property::RESOLUTION: + case FilmProperty::VIDEO_FRAME_RATE: + case FilmProperty::CONTAINER: + case FilmProperty::RESOLUTION: setup_description (); setup_sensitivity (); break; - case Film::Property::REEL_TYPE: - case Film::Property::INTEROP: + case FilmProperty::REEL_TYPE: + case FilmProperty::INTEROP: setup_sensitivity (); break; default: @@ -541,17 +542,16 @@ VideoPanel::edit_colour_conversion_clicked () { auto vc = _parent->selected_video (); - auto d = new ContentColourConversionDialog (this, vc.front()->video->yuv ()); - d->set (vc.front()->video->colour_conversion().get_value_or (PresetColourConversion::all().front().conversion)); - if (d->ShowModal() == wxID_OK) { + ContentColourConversionDialog dialog(this, vc.front()->video->yuv()); + dialog.set(vc.front()->video->colour_conversion().get_value_or(PresetColourConversion::all().front().conversion)); + if (dialog.ShowModal() == wxID_OK) { for (auto i: vc) { - i->video->set_colour_conversion (d->get ()); + i->video->set_colour_conversion(dialog.get()); } } else { /* Reset the colour conversion choice */ film_content_changed (VideoContentProperty::COLOUR_CONVERSION); } - d->Destroy (); } @@ -725,16 +725,17 @@ bool VideoPanel::scale_custom_edit_clicked () { auto vc = _parent->selected_video().front()->video; - auto d = new CustomScaleDialog (this, vc->size(), _parent->film()->frame_size(), vc->custom_ratio(), vc->custom_size()); - int const r = d->ShowModal (); - if (r == wxID_OK) { - for (auto i: _parent->selected_video()) { - i->video->set_custom_ratio (d->custom_ratio()); - i->video->set_custom_size (d->custom_size()); - } + CustomScaleDialog dialog(this, vc->size(), _parent->film()->frame_size(), vc->custom_ratio(), vc->custom_size()); + if (dialog.ShowModal() != wxID_OK) { + return false; + } + + for (auto i: _parent->selected_video()) { + i->video->set_custom_ratio(dialog.custom_ratio()); + i->video->set_custom_size(dialog.custom_size()); } - d->Destroy (); - return r == wxID_OK; + + return true; } @@ -765,7 +766,7 @@ VideoPanel::left_crop_changed () { _left_changed_last = true; if (_left_right_link->GetValue()) { - for (auto i: _parent->selected_video()) { + for (auto const& i: _parent->selected_video()) { i->video->set_right_crop (i->video->requested_left_crop()); } } @@ -777,7 +778,7 @@ VideoPanel::right_crop_changed () { _left_changed_last = false; if (_left_right_link->GetValue()) { - for (auto i: _parent->selected_video()) { + for (auto const& i: _parent->selected_video()) { i->video->set_left_crop (i->video->requested_right_crop()); } }