From: Carl Hetherington Date: Fri, 14 Oct 2022 23:58:54 +0000 (+0200) Subject: Make video frame rate option respect OK/Cancel. X-Git-Tag: v2.16.31~12^2~1 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=ae92bd2fbd2a74d14e2635003554aa76016ab425 Make video frame rate option respect OK/Cancel. --- diff --git a/src/wx/content_advanced_dialog.cc b/src/wx/content_advanced_dialog.cc index 21cba5e8a..ba2c3f43b 100644 --- a/src/wx/content_advanced_dialog.cc +++ b/src/wx/content_advanced_dialog.cc @@ -197,15 +197,20 @@ ContentAdvancedDialog::filters_changed (vector filters) } -void -ContentAdvancedDialog::set_video_frame_rate () +optional +ContentAdvancedDialog::video_frame_rate() const { - if (_video_frame_rate->GetValue() != wxT("")) { - _content->set_video_frame_rate (locale_convert(wx_to_std(_video_frame_rate->GetValue()))); - } else { - _content->unset_video_frame_rate (); + if (_video_frame_rate->GetValue() == wxT("")) { + return {}; } + return locale_convert(wx_to_std(_video_frame_rate->GetValue())); +} + + +void +ContentAdvancedDialog::set_video_frame_rate () +{ _set_video_frame_rate->Enable (false); } diff --git a/src/wx/content_advanced_dialog.h b/src/wx/content_advanced_dialog.h index 26c1a374a..3c2454449 100644 --- a/src/wx/content_advanced_dialog.h +++ b/src/wx/content_advanced_dialog.h @@ -23,6 +23,7 @@ LIBDCP_DISABLE_WARNINGS #include LIBDCP_ENABLE_WARNINGS +#include #include #include @@ -38,10 +39,13 @@ public: ContentAdvancedDialog (wxWindow* parent, std::shared_ptr content); bool ignore_video() const; + std::vector filters() { return _filters_list; } + boost::optional video_frame_rate() const; + private: void edit_filters (); void filters_changed (std::vector filters); diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc index 6e903397d..3dfb2f282 100644 --- a/src/wx/content_menu.cc +++ b/src/wx/content_menu.cc @@ -480,6 +480,12 @@ ContentMenu::advanced () if (ffmpeg) { ffmpeg->set_filters(dialog->filters()); } + + if (dialog->video_frame_rate()) { + content->set_video_frame_rate(*dialog->video_frame_rate()); + } else { + content->unset_video_frame_rate(); + } }