Preserve export video settings in the config (#2259).
[dcpomatic.git] / src / lib / config.cc
index 3661d8ba58268b85d0d606ea6e1b8123b19e449b..caea995be50c96cb1879aeb647235ee219672078 100644 (file)
@@ -79,6 +79,7 @@ Config::Config ()
         /* DKDMs are not considered a thing to reset on set_defaults() */
        : _dkdms (new DKDMGroup ("root"))
        , _default_kdm_duration (1, RoughDuration::Unit::WEEKS)
+       , _export(this)
 {
        set_defaults ();
 }
@@ -203,6 +204,8 @@ Config::set_defaults ()
        set_kdm_email_to_default ();
        set_notification_email_to_default ();
        set_cover_sheet_to_default ();
+
+       _export.set_defaults();
 }
 
 void
@@ -589,6 +592,8 @@ try
        }
        _auto_crop_threshold = f.optional_number_child<double>("AutoCropThreshold").get_value_or(0.1);
 
+       _export.read(f.optional_node_child("Export"));
+
        if (boost::filesystem::exists (_cinemas_file)) {
                cxml::Document f ("Cinemas");
                f.read_file (_cinemas_file);
@@ -1026,6 +1031,8 @@ Config::write_config () const
        root->add_child("DefaultKDMType")->add_child_text(dcp::formulation_to_string(_default_kdm_type));
        root->add_child("AutoCropThreshold")->add_child_text(raw_convert<string>(_auto_crop_threshold));
 
+       _export.write(root->add_child("Export"));
+
        auto target = config_write_file();
 
        try {