summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-11-01 15:09:56 +0100
committerCarl Hetherington <cth@carlh.net>2022-05-02 00:11:02 +0200
commit0afe79d5c913f4c85a8de4ae448a8e54b8249dff (patch)
treeedef44920b91a88b15537edee7a2ffdfdf96e875
parentd8a8f4565b167aa23826999448601c8907728e8f (diff)
Add CPL_FILENAME variable for cover sheets (#2107).
-rw-r--r--doc/manual/dcpomatic.xml3
-rw-r--r--src/lib/config.cc1
-rw-r--r--src/lib/writer.cc4
3 files changed, 8 insertions, 0 deletions
diff --git a/doc/manual/dcpomatic.xml b/doc/manual/dcpomatic.xml
index 88c4b984b..4a59c6964 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 <xref linkend="tab-kdm-magic"
<entry><code>$CPL_NAME</code></entry><entry>DCP title</entry>
</row>
<row>
+<entry><code>$CPL_FILENAME</code></entry><entry>Filename of the CPL</entry>
+</row>
+<row>
<entry><code>$CINEMA_NAME</code></entry><entry>Cinema name</entry>
</row>
<row>
diff --git a/src/lib/config.cc b/src/lib/config.cc
index d11a60c94..3334e6fbf 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -1162,6 +1162,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 954c135d3..309cfb78c 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());