Add CPL_FILENAME variable for cover sheets (#2107).
authorCarl Hetherington <cth@carlh.net>
Mon, 1 Nov 2021 14:09:56 +0000 (15:09 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 1 Nov 2021 14:09:56 +0000 (15:09 +0100)
doc/manual/dcpomatic.xml
src/lib/config.cc
src/lib/writer.cc

index a269cb80f92a7e220a6a384ddcb14fa20f20a63f..5e757b90faa547d16b7966ff100f0f0ec6b85eba 100644 (file)
@@ -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>
index bfde74a75678e063de6fc90ef136083b5d35850a..efb9f8ffa52b4e50db04a36a3b2dac0117ce79bc 100644 (file)
@@ -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"
index 8b51eb58759a1364ed9af4fc80ff388401b164e1..d85be9eff2b741adebbb9165d5b3ff01938c16a8 100644 (file)
@@ -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());