Make video frame rate option respect OK/Cancel.
[dcpomatic.git] / src / wx / content_advanced_dialog.cc
index 21cba5e8a31041ec2d97c58684b8fc5255f90232..ba2c3f43b67b2e2588388c7b62c0004776386b99 100644 (file)
@@ -197,15 +197,20 @@ ContentAdvancedDialog::filters_changed (vector<Filter const *> filters)
 }
 
 
-void
-ContentAdvancedDialog::set_video_frame_rate ()
+optional<double>
+ContentAdvancedDialog::video_frame_rate() const
 {
-       if (_video_frame_rate->GetValue() != wxT("")) {
-               _content->set_video_frame_rate (locale_convert<double>(wx_to_std(_video_frame_rate->GetValue())));
-       } else {
-               _content->unset_video_frame_rate ();
+       if (_video_frame_rate->GetValue() == wxT("")) {
+               return {};
        }
 
+       return locale_convert<double>(wx_to_std(_video_frame_rate->GetValue()));
+}
+
+
+void
+ContentAdvancedDialog::set_video_frame_rate ()
+{
        _set_video_frame_rate->Enable (false);
 }