+
+ list<cxml::NodePtr> dkdm = f.node_children ("DKDM");
+ BOOST_FOREACH (cxml::NodePtr i, f.node_children ("DKDM")) {
+ _dkdms.push_back (dcp::EncryptedKDM (i->content ()));
+ }
+
+ _cinemas_file = f.optional_string_child("CinemasFile").get_value_or (path ("cinemas.xml").string ());
+ _show_hints_before_make_dcp = f.optional_bool_child("ShowHintsBeforeMakeDCP").get_value_or (true);
+ _kdm_filename_format = dcp::NameFormat (f.optional_string_child("KDMFilenameFormat").get_value_or ("KDM %f %c %s"));
+ _dcp_metadata_filename_format = dcp::NameFormat (f.optional_string_child("DCPMetadataFilenameFormat").get_value_or ("%t_%i"));
+ _dcp_asset_filename_format = dcp::NameFormat (f.optional_string_child("DCPAssetFilenameFormat").get_value_or ("%t_%i"));
+
+ /* Replace any cinemas from config.xml with those from the configured file */
+ if (boost::filesystem::exists (_cinemas_file)) {
+ cxml::Document f ("Cinemas");
+ f.read_file (_cinemas_file);
+ read_cinemas (f);
+ }
+}
+catch (...) {
+ if (have_existing ("config.xml")) {
+ /* We have a config file but it didn't load */
+ FailedToLoad ();
+ }
+ set_defaults ();
+ /* Make a new set of signing certificates and key */
+ _signer_chain = create_certificate_chain ();
+ /* And similar for decryption of KDMs */
+ _decryption_chain = create_certificate_chain ();
+ write ();