summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-11-01 15:09:56 +0100
committerCarl Hetherington <cth@carlh.net>2021-11-01 15:09:56 +0100
commit3661ccf24272923221c78b4469c6def07199cee6 (patch)
treec3464abf27404b4eb613bff8b715ac961af3eb81
parentc3a6425cf43781895774f800967c09767a1e9332 (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 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 <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 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());