Make overridden subtitle language option respect OK/Cancel.
[dcpomatic.git] / src / wx / content_advanced_dialog.cc
index 21cba5e8a31041ec2d97c58684b8fc5255f90232..547b77bb31bf6710bd4a879ec42ecc2516b4bdaf 100644 (file)
@@ -139,7 +139,6 @@ ContentAdvancedDialog::ContentAdvancedDialog (wxWindow* parent, shared_ptr<Conte
        _set_video_frame_rate->Bind (wxEVT_BUTTON, bind(&ContentAdvancedDialog::set_video_frame_rate, this));
        _video_frame_rate->Bind (wxEVT_TEXT, boost::bind(&ContentAdvancedDialog::video_frame_rate_changed, this));
        _burnt_subtitle->Bind (wxEVT_CHECKBOX, boost::bind(&ContentAdvancedDialog::burnt_subtitle_changed, this));
-       _burnt_subtitle_language->Changed.connect (boost::bind(&ContentAdvancedDialog::burnt_subtitle_language_changed, this));
 
        setup_sensitivity ();
 }
@@ -197,15 +196,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);
 }
 
@@ -240,10 +244,9 @@ ContentAdvancedDialog::burnt_subtitle_changed ()
 }
 
 
-void
-ContentAdvancedDialog::burnt_subtitle_language_changed ()
+optional<dcp::LanguageTag>
+ContentAdvancedDialog::burnt_subtitle_language() const
 {
-       DCPOMATIC_ASSERT (_content->video);
-       _content->video->set_burnt_subtitle_language (_burnt_subtitle_language->get());
+       return _burnt_subtitle_language->get();
 }