Add default scale-to (#664).
[dcpomatic.git] / src / lib / config.cc
index a19a60f55aa06d5d16072f2cacea23f5bdd4ced6..1baba956e3bdc0efb47aeb03e94243a6fdcee667 100644 (file)
@@ -88,6 +88,7 @@ Config::set_defaults ()
        _language = optional<string> ();
        _default_still_length = 10;
        _default_container = Ratio::from_id ("185");
+       _default_scale_to = 0;
        _default_dcp_content_type = DCPContentType::from_isdcf_name ("FTR");
        _default_dcp_audio_channels = 6;
        _default_j2k_bandwidth = 100000000;
@@ -221,6 +222,11 @@ try
                _default_container = Ratio::from_id (c.get ());
        }
 
+       c = f.optional_string_child ("DefaultScaleTo");
+       if (c) {
+               _default_scale_to = Ratio::from_id (c.get ());
+       }
+
        c = f.optional_string_child ("DefaultDCPContentType");
        if (c) {
                _default_dcp_content_type = DCPContentType::from_isdcf_name (c.get ());
@@ -439,6 +445,9 @@ Config::write_config () const
        if (_default_container) {
                root->add_child("DefaultContainer")->add_child_text (_default_container->id ());
        }
+       if (_default_scale_to) {
+               root->add_child("DefaultScaleTo")->add_child_text (_default_scale_to->id ());
+       }
        if (_default_dcp_content_type) {
                root->add_child("DefaultDCPContentType")->add_child_text (_default_dcp_content_type->isdcf_name ());
        }