Allow more complete control over the libdcp/DCP-o-matic metadata written to various...
[dcpomatic.git] / src / lib / config.cc
index ebb6ece931f0bed3899e734f17c0baefdb2f4dad..7b381e33bce5cfb717473cdef6eb184363e6cd40 100644 (file)
@@ -99,13 +99,12 @@ 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 = 150000000;
        _default_audio_delay = 0;
        _default_interop = true;
-       _default_upload_after_make_dcp = false;
+       _upload_after_make_dcp = false;
        _mail_server = "";
        _mail_port = 25;
        _mail_protocol = EMAIL_PROTOCOL_AUTO;
@@ -309,11 +308,6 @@ try
                _default_container = Ratio::from_id ("185");
        }
 
-       c = f.optional_string_child ("DefaultScaleTo");
-       if (c) {
-               _default_scale_to = Ratio::from_id (c.get ());
-       }
-
        _default_dcp_content_type = DCPContentType::from_isdcf_name(f.optional_string_child("DefaultDCPContentType").get_value_or("FTR"));
        _default_dcp_audio_channels = f.optional_number_child<int>("DefaultDCPAudioChannels").get_value_or (6);
 
@@ -323,8 +317,16 @@ try
                _dcp_issuer = f.string_child ("DCPIssuer");
        }
 
-       _default_upload_after_make_dcp = f.optional_bool_child("DefaultUploadAfterMakeDCP").get_value_or (false);
+       optional<bool> up = f.optional_bool_child("UploadAfterMakeDCP");
+       if (!up) {
+               up = f.optional_bool_child("DefaultUploadAfterMakeDCP");
+       }
+       _upload_after_make_dcp = up.get_value_or (false);
        _dcp_creator = f.optional_string_child ("DCPCreator").get_value_or ("");
+       _dcp_company_name = f.optional_string_child("DCPCompanyName").get_value_or("");
+       _dcp_product_name = f.optional_string_child("DCPProductName").get_value_or("");
+       _dcp_product_version = f.optional_string_child("DCPProductVersion").get_value_or("");
+       _dcp_j2k_comment = f.optional_string_child("DCPJ2KComment").get_value_or("");
 
        if (version && version.get() >= 2) {
                _default_isdcf_metadata = ISDCFMetadata (f.node_child ("ISDCFMetadata"));
@@ -719,12 +721,6 @@ Config::write_config () const
                */
                root->add_child("DefaultContainer")->add_child_text (_default_container->id ());
        }
-       if (_default_scale_to) {
-               /* [XML:opt] DefaultScaleTo ID of default ratio to scale content to when creating new films
-                  (see <code>DefaultContainer</code> for IDs).
-               */
-               root->add_child("DefaultScaleTo")->add_child_text (_default_scale_to->id ());
-       }
        if (_default_dcp_content_type) {
                /* [XML:opt] DefaultDCPContentType Default content type ot use when creating new films (<code>FTR</code>, <code>SHR</code>,
                   <code>TLR</code>, <code>TST</code>, <code>XSN</code>, <code>RTG</code>, <code>TSR</code>, <code>POL</code>,
@@ -737,8 +733,16 @@ Config::write_config () const
        root->add_child("DCPIssuer")->add_child_text (_dcp_issuer);
        /* [XML] DCPIssuer Creator text to write into CPL files. */
        root->add_child("DCPCreator")->add_child_text (_dcp_creator);
-       /* [XML] DefaultUploadAfterMakeDCP 1 to default to uploading to a TMS after making a DCP, 0 to default to no upload. */
-       root->add_child("DefaultUploadAfterMakeDCP")->add_child_text (_default_upload_after_make_dcp ? "1" : "0");
+       /* [XML] Company name to write into MXF files. */
+       root->add_child("DCPCompanyName")->add_child_text (_dcp_company_name);
+       /* [XML] Product name to write into MXF files. */
+       root->add_child("DCPProductName")->add_child_text (_dcp_product_name);
+       /* [XML] Product version to write into MXF files. */
+       root->add_child("DCPProductVersion")->add_child_text (_dcp_product_version);
+       /* [XML] Comment to write into JPEG2000 data. */
+       root->add_child("DCPJ2KComment")->add_child_text (_dcp_j2k_comment);
+       /* [XML] UploadAfterMakeDCP 1 to upload to a TMS after making a DCP, 0 for no upload. */
+       root->add_child("UploadAfterMakeDCP")->add_child_text (_upload_after_make_dcp ? "1" : "0");
 
        /* [XML] ISDCFMetadata Default ISDCF metadata to use for new films; child tags are <code>&lt;ContentVersion&gt;</code>,
           <code>&lt;AudioLanguage&gt;</code>, <code>&lt;SubtitleLanguage&gt;</code>, <code>&lt;Territory&gt;</code>,
@@ -821,7 +825,7 @@ Config::write_config () const
        root->add_child("MaximumJ2KBandwidth")->add_child_text (raw_convert<string> (_maximum_j2k_bandwidth));
        /* [XML] AllowAnyDCPFrameRate 1 to allow users to specify any frame rate when creating DCPs, 0 to limit the GUI to standard rates. */
        root->add_child("AllowAnyDCPFrameRate")->add_child_text (_allow_any_dcp_frame_rate ? "1" : "0");
-       /* [XML] AllowAnyContainer 1 to allow users to user any container ratio for their DCP, 0 to limit the GUI to standard containers. */
+       /* [XML] AllowAnyContainer 1 to allow users to user any container ratio for their DCP, 0 to limit the GUI to DCI Flat/Scope */
        root->add_child("AllowAnyContainer")->add_child_text (_allow_any_container ? "1" : "0");
        /* [XML] ShowExperimentalAudioProcessors 1 to offer users the (experimental) audio upmixer processors, 0 to hide them */
        root->add_child("ShowExperimentalAudioProcessors")->add_child_text (_show_experimental_audio_processors ? "1" : "0");