From: Carl Hetherington Date: Mon, 1 Nov 2021 14:09:56 +0000 (+0100) Subject: Add CPL_FILENAME variable for cover sheets (#2107). X-Git-Tag: checked-for-v2.16.x~213 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=3661ccf24272923221c78b4469c6def07199cee6 Add CPL_FILENAME variable for cover sheets (#2107). --- diff --git a/doc/manual/dcpomatic.xml b/doc/manual/dcpomatic.xml index a269cb80f..5e757b90f 100644 --- a/doc/manual/dcpomatic.xml +++ b/doc/manual/dcpomatic.xml @@ -2932,6 +2932,9 @@ KDM that is being sent; these strings are shown in $CPL_NAMEDCP title +$CPL_FILENAMEFilename of the CPL + + $CINEMA_NAMECinema name diff --git a/src/lib/config.cc b/src/lib/config.cc index bfde74a75..efb9f8ffa 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -1137,6 +1137,7 @@ Config::set_cover_sheet_to_default () { _cover_sheet = _( "$CPL_NAME\n\n" + "CPL Filename: $CPL_FILENAME\n" "Type: $TYPE\n" "Format: $CONTAINER\n" "Audio: $AUDIO\n" diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 8b51eb587..d85be9eff 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -717,6 +717,10 @@ Writer::write_cover_sheet (boost::filesystem::path output_dcp) auto text = Config::instance()->cover_sheet (); boost::algorithm::replace_all (text, "$CPL_NAME", film()->name()); + auto cpls = film()->cpls(); + if (!cpls.empty()) { + boost::algorithm::replace_all (text, "$CPL_FILENAME", cpls[0].cpl_file.filename().string()); + } boost::algorithm::replace_all (text, "$TYPE", film()->dcp_content_type()->pretty_name()); boost::algorithm::replace_all (text, "$CONTAINER", film()->container()->container_nickname());