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>
Sun, 1 May 2022 22:11:02 +0000 (00:11 +0200)
doc/manual/dcpomatic.xml
src/lib/config.cc
src/lib/writer.cc

index 88c4b984b041a11a6ef8a8f3a4dd2a29d2bd77e0..4a59c69648bd3341bade5a8901c6fb4fb088356f 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_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>
 <entry><code>$CINEMA_NAME</code></entry><entry>Cinema name</entry>
 </row>
 <row>
index d11a60c94f8ac8be7a2f4682a63716c0577db4cf..3334e6fbf164b72123eb46f0ebde307be40b9305 100644 (file)
@@ -1162,6 +1162,7 @@ Config::set_cover_sheet_to_default ()
 {
        _cover_sheet = _(
                "$CPL_NAME\n\n"
 {
        _cover_sheet = _(
                "$CPL_NAME\n\n"
+               "CPL Filename: $CPL_FILENAME\n"
                "Type: $TYPE\n"
                "Format: $CONTAINER\n"
                "Audio: $AUDIO\n"
                "Type: $TYPE\n"
                "Format: $CONTAINER\n"
                "Audio: $AUDIO\n"
index 954c135d3a90d4e43fcfa0e4e3b34ea4b81320e0..309cfb78c8355211c16abfb617418fc9629edc24 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 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());
 
        boost::algorithm::replace_all (text, "$TYPE", film()->dcp_content_type()->pretty_name());
        boost::algorithm::replace_all (text, "$CONTAINER", film()->container()->container_nickname());