X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fconfig.cc;h=a19a60f55aa06d5d16072f2cacea23f5bdd4ced6;hb=89ae13638097f259f3e50b4b61068dd23451107d;hp=c0ab44923a4d8b9344de0b77a294ee12a0066e3d;hpb=7844347e7d89ffb256167192fb414c35d416e14d;p=dcpomatic.git diff --git a/src/lib/config.cc b/src/lib/config.cc index c0ab44923..a19a60f55 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -132,6 +132,7 @@ Config::set_defaults () _allowed_dcp_frame_rates.push_back (60); set_kdm_email_to_default (); + set_cover_sheet_to_default (); } void @@ -329,6 +330,9 @@ try } _preview_sound = f.optional_bool_child("PreviewSound").get_value_or (false); _preview_sound_output = f.optional_string_child("PreviewSoundOutput"); + if (f.optional_string_child("CoverSheet")) { + _cover_sheet = f.optional_string_child("CoverSheet").get(); + } /* Replace any cinemas from config.xml with those from the configured file */ if (boost::filesystem::exists (_cinemas_file)) { @@ -514,6 +518,7 @@ Config::write_config () const if (_preview_sound_output) { root->add_child("PreviewSoundOutput")->add_child_text (_preview_sound_output.get()); } + root->add_child("CoverSheet")->add_child_text (_cover_sheet); try { doc.write_to_file_formatted (path("config.xml").string ()); @@ -607,6 +612,18 @@ Config::reset_kdm_email () changed (); } +void +Config::set_cover_sheet_to_default () +{ + _cover_sheet = _( + "$CPL_NAME\n\n" + "Type: $TYPE\n" + "Format: $CONTAINER\n" + "Audio: $AUDIO\n" + "Length: $LENGTH\n" + ); +} + void Config::add_to_history (boost::filesystem::path p) { @@ -707,3 +724,10 @@ Config::config_path () { return path("config.xml", false); } + +void +Config::reset_cover_sheet () +{ + set_cover_sheet_to_default (); + changed (); +}