Simple cover sheet support (#1039).
authorCarl Hetherington <cth@carlh.net>
Tue, 9 May 2017 10:24:03 +0000 (11:24 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 9 May 2017 10:24:03 +0000 (11:24 +0100)
36 files changed:
ChangeLog
graphics/linux/128/dcpomatic2.png
graphics/linux/16/dcpomatic2.png
graphics/linux/22/dcpomatic2.png
graphics/linux/256/dcpomatic2.png
graphics/linux/32/dcpomatic2.png
graphics/linux/48/dcpomatic2.png
graphics/linux/512/dcpomatic2.png
graphics/linux/64/dcpomatic2.png
graphics/osx/dcpomatic2.iconset/icon_128x128.png
graphics/osx/dcpomatic2.iconset/icon_128x128@2x.png
graphics/osx/dcpomatic2.iconset/icon_16x16.png
graphics/osx/dcpomatic2.iconset/icon_16x16@2x.png
graphics/osx/dcpomatic2.iconset/icon_256x256.png
graphics/osx/dcpomatic2.iconset/icon_256x256@2x.png
graphics/osx/dcpomatic2.iconset/icon_32x32.png
graphics/osx/dcpomatic2.iconset/icon_32x32@2x.png
graphics/osx/dcpomatic2.iconset/icon_512x512.png
graphics/osx/dcpomatic2.iconset/icon_512x512@2x.png
graphics/osx/preferences/cover_sheet.png [new file with mode: 0644]
graphics/src/cover_sheet.svg [new file with mode: 0644]
graphics/update
graphics/web/favicon-128x128.png
graphics/web/favicon-16x16.png
graphics/web/favicon-256x256.png
graphics/web/favicon-32x32.png
graphics/web/favicon-64x64.png
graphics/web/logo.png [new file with mode: 0644]
src/lib/config.cc
src/lib/config.h
src/lib/film.cc
src/lib/util.cc
src/lib/util.h
src/lib/writer.cc
src/lib/writer.h
src/wx/config_dialog.cc

index f349abaa9f724b23ee05683ffb090c11d43c0dcb..bc8e6bb81f0dd23a92d92d7ac75fbf01268c3873 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-05-09  Carl Hetherington  <cth@carlh.net>
+
+       * Write a simple cover sheet when making a DCP (#1039).
+
 2017-05-08  Carl Hetherington  <cth@carlh.net>
 
        * Show multiple tracks in the timeline if there are overlapping subtitles (#941).
index ae3ae23e99e26e6efa371687849ee8cd1108389f..5ff12d6ed9dfc614260cbf897db6081ff668409c 100644 (file)
Binary files a/graphics/linux/128/dcpomatic2.png and b/graphics/linux/128/dcpomatic2.png differ
index ea90bf94bc3d05dfb0f4b6c5a9d3b4ffb15b0797..82ed012b7b180e97dcdf505a0baac3dbbe04f79e 100644 (file)
Binary files a/graphics/linux/16/dcpomatic2.png and b/graphics/linux/16/dcpomatic2.png differ
index d99654779b5b383264e2c3560fbab8b248b103ac..6d27f8c11f3827ac43d3d1b50a36eba5ed1e5d2a 100644 (file)
Binary files a/graphics/linux/22/dcpomatic2.png and b/graphics/linux/22/dcpomatic2.png differ
index 394da0332aaa567eacd1a1b33029a9d923e4ae66..bf734859cb87119e8cc2abaccbdedf7a78e163ff 100644 (file)
Binary files a/graphics/linux/256/dcpomatic2.png and b/graphics/linux/256/dcpomatic2.png differ
index 5b0b2de56766a0ea6a7cab9f11332b1e77fae748..482f5ded871b413e57c800cb96897263870f36bd 100644 (file)
Binary files a/graphics/linux/32/dcpomatic2.png and b/graphics/linux/32/dcpomatic2.png differ
index 746c589a9e45f85039544c32fb14f37ea6772eca..8e0d6087b279e54775a23a5e32d5e38bc8a20e1b 100644 (file)
Binary files a/graphics/linux/48/dcpomatic2.png and b/graphics/linux/48/dcpomatic2.png differ
index 6f7543daf6a847ad856a3e0042b157ac3e021322..4cd8938046a74fbc615eab943e5f772958ae9fc0 100644 (file)
Binary files a/graphics/linux/512/dcpomatic2.png and b/graphics/linux/512/dcpomatic2.png differ
index f0c487d0604d7184c60cdd738086bfdf95d242b7..0e446e77d529f56ed85e6db45014a104da22b8fd 100644 (file)
Binary files a/graphics/linux/64/dcpomatic2.png and b/graphics/linux/64/dcpomatic2.png differ
index 6e028b2c3c6d08fcb00737e46ae55cd297e640eb..f0d6df56dadf02e71ea43ac3f07fced9ff955f44 100644 (file)
Binary files a/graphics/osx/dcpomatic2.iconset/icon_128x128.png and b/graphics/osx/dcpomatic2.iconset/icon_128x128.png differ
index 6e028b2c3c6d08fcb00737e46ae55cd297e640eb..f0d6df56dadf02e71ea43ac3f07fced9ff955f44 100644 (file)
Binary files a/graphics/osx/dcpomatic2.iconset/icon_128x128@2x.png and b/graphics/osx/dcpomatic2.iconset/icon_128x128@2x.png differ
index e2b750e9460fa3a83ac8967f2926500e4c9e5fd5..cf150c09be8ec2edab85120965116f26d0d3160e 100644 (file)
Binary files a/graphics/osx/dcpomatic2.iconset/icon_16x16.png and b/graphics/osx/dcpomatic2.iconset/icon_16x16.png differ
index e2b750e9460fa3a83ac8967f2926500e4c9e5fd5..cf150c09be8ec2edab85120965116f26d0d3160e 100644 (file)
Binary files a/graphics/osx/dcpomatic2.iconset/icon_16x16@2x.png and b/graphics/osx/dcpomatic2.iconset/icon_16x16@2x.png differ
index 724869aacfef404da0f41bd3c40c7dbf5890e767..d84d2285bfc660c6dad530093ef4b2f6bc5fb62f 100644 (file)
Binary files a/graphics/osx/dcpomatic2.iconset/icon_256x256.png and b/graphics/osx/dcpomatic2.iconset/icon_256x256.png differ
index 724869aacfef404da0f41bd3c40c7dbf5890e767..d84d2285bfc660c6dad530093ef4b2f6bc5fb62f 100644 (file)
Binary files a/graphics/osx/dcpomatic2.iconset/icon_256x256@2x.png and b/graphics/osx/dcpomatic2.iconset/icon_256x256@2x.png differ
index abad340e1d6d393256e3a7203f3419ba45a97651..46e0fb786f9da1ab38444e8ad52d20fbcdde042f 100644 (file)
Binary files a/graphics/osx/dcpomatic2.iconset/icon_32x32.png and b/graphics/osx/dcpomatic2.iconset/icon_32x32.png differ
index abad340e1d6d393256e3a7203f3419ba45a97651..46e0fb786f9da1ab38444e8ad52d20fbcdde042f 100644 (file)
Binary files a/graphics/osx/dcpomatic2.iconset/icon_32x32@2x.png and b/graphics/osx/dcpomatic2.iconset/icon_32x32@2x.png differ
index 846c7bd9e6fd6067b7e42644ddd4d11bad098d0a..ff8c3758c1cb628710ca807d9735c7da7fd8f1b2 100644 (file)
Binary files a/graphics/osx/dcpomatic2.iconset/icon_512x512.png and b/graphics/osx/dcpomatic2.iconset/icon_512x512.png differ
index 846c7bd9e6fd6067b7e42644ddd4d11bad098d0a..ff8c3758c1cb628710ca807d9735c7da7fd8f1b2 100644 (file)
Binary files a/graphics/osx/dcpomatic2.iconset/icon_512x512@2x.png and b/graphics/osx/dcpomatic2.iconset/icon_512x512@2x.png differ
diff --git a/graphics/osx/preferences/cover_sheet.png b/graphics/osx/preferences/cover_sheet.png
new file mode 100644 (file)
index 0000000..ec81368
Binary files /dev/null and b/graphics/osx/preferences/cover_sheet.png differ
diff --git a/graphics/src/cover_sheet.svg b/graphics/src/cover_sheet.svg
new file mode 100644 (file)
index 0000000..c6511ce
--- /dev/null
@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   id="svg5816"
+   viewBox="0 0 48 48"
+   sodipodi:version="0.32"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="cover_sheet.svg"
+   version="1.1">
+  <defs
+     id="defs3">
+    <radialGradient
+       id="radialGradient6719"
+       xlink:href="#linearGradient5060"
+       gradientUnits="userSpaceOnUse"
+       cy="486.65"
+       cx="605.71"
+       gradientTransform="matrix(-2.7744,0,0,1.9697,112.76,-872.89)"
+       r="117.14"
+       inkscape:collect="always" />
+    <linearGradient
+       id="linearGradient5060"
+       inkscape:collect="always">
+      <stop
+         id="stop5062"
+         style="stop-color:black"
+         offset="0" />
+      <stop
+         id="stop5064"
+         style="stop-color:black;stop-opacity:0"
+         offset="1" />
+    </linearGradient>
+    <radialGradient
+       id="radialGradient6717"
+       xlink:href="#linearGradient5060"
+       gradientUnits="userSpaceOnUse"
+       cy="486.65"
+       cx="605.71"
+       gradientTransform="matrix(2.7744,0,0,1.9697,-1891.6,-872.89)"
+       r="117.14"
+       inkscape:collect="always" />
+    <linearGradient
+       id="linearGradient6715"
+       y2="609.51"
+       gradientUnits="userSpaceOnUse"
+       x2="302.86"
+       gradientTransform="matrix(2.7744,0,0,1.9697,-1892.2,-872.89)"
+       y1="366.65"
+       x1="302.86"
+       inkscape:collect="always">
+      <stop
+         id="stop5050"
+         style="stop-color:black;stop-opacity:0"
+         offset="0" />
+      <stop
+         id="stop5056"
+         style="stop-color:black"
+         offset=".5" />
+      <stop
+         id="stop5052"
+         style="stop-color:black;stop-opacity:0"
+         offset="1" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient2152">
+      <stop
+         id="stop2154"
+         style="stop-color:#9aa29a"
+         offset="0" />
+      <stop
+         id="stop2156"
+         style="stop-color:#b5beb5"
+         offset="1" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient27488"
+       y2="15.257"
+       gradientUnits="userSpaceOnUse"
+       y1="15.257"
+       gradientTransform="matrix(1.3435 0 0 1.4179 2.8795 .31460)"
+       x2="30.6"
+       x1="2.0619"
+       inkscape:collect="always">
+      <stop
+         id="stop2138"
+         style="stop-color:#989690"
+         offset="0" />
+      <stop
+         id="stop2140"
+         style="stop-color:#656460"
+         offset="1" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient27488"
+       id="linearGradient8193"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.8693657,0,0,0.80274289,29.209849,80.26044)"
+       x1="2.0619"
+       y1="15.257"
+       x2="30.6"
+       y2="15.257" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     bordercolor="#666666"
+     inkscape:window-x="0"
+     inkscape:window-y="27"
+     pagecolor="#ffffff"
+     inkscape:grid-bbox="true"
+     inkscape:zoom="4"
+     inkscape:pageshadow="2"
+     showgrid="false"
+     borderopacity="1.0"
+     inkscape:current-layer="layer1"
+     inkscape:cx="4.3829084"
+     inkscape:cy="-18.515601"
+     inkscape:window-width="1280"
+     inkscape:pageopacity="0.0"
+     inkscape:window-height="968"
+     inkscape:document-units="px"
+     inkscape:window-maximized="1" />
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <g
+       id="g6707"
+       transform="matrix(0.0227,0,0,0.022979,44.190742,39.034)">
+      <rect
+         id="rect6709"
+         style="color:#000000;opacity:0.40206;fill:url(#linearGradient6715)"
+         height="478.35999"
+         width="1339.6"
+         y="-150.7"
+         x="-1559.3" />
+      <path
+         id="path6711"
+         sodipodi:nodetypes="cccc"
+         style="color:#000000;opacity:0.40206;fill:url(#radialGradient6717)"
+         d="m -219.62,-150.68 0,478.33 c 142.88,0.9 345.4,-107.17 345.4,-239.2 0,-132.02 -159.44,-239.13 -345.4,-239.13 z"
+         inkscape:connector-curvature="0" />
+      <path
+         id="path6713"
+         sodipodi:nodetypes="cccc"
+         style="color:#000000;opacity:0.40206;fill:url(#radialGradient6719)"
+         d="m -1559.3,-150.68 0,478.33 c -142.8,0.9 -345.4,-107.17 -345.4,-239.2 0,-132.02 159.5,-239.13 345.4,-239.13 z"
+         inkscape:connector-curvature="0" />
+    </g>
+    <g
+       id="g8222"
+       transform="translate(-0.1111002,-106.75)">
+      <rect
+         y="108.95594"
+         x="8.5809364"
+         height="40.338127"
+         width="31.060328"
+         id="rect8133"
+         style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e6e6e6;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient8193);stroke-width:0.51847273;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
+      <path
+         inkscape:connector-curvature="0"
+         id="path8167"
+         d="m 11.232107,112.40472 13.7113,0"
+         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.64635694px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <path
+         inkscape:connector-curvature="0"
+         id="path8169"
+         d="m 11.232107,115.77542 17.367647,0"
+         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.64635694px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <path
+         inkscape:connector-curvature="0"
+         id="path8171"
+         d="m 11.232107,119.14611 5.598781,0"
+         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.64635694px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <path
+         inkscape:connector-curvature="0"
+         id="path8173"
+         d="m 11.232107,122.51681 11.083301,0"
+         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.64635694px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <path
+         inkscape:connector-curvature="0"
+         id="path8175"
+         d="m 11.232107,125.8875 21.82382,0"
+         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.64635694px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <path
+         inkscape:connector-curvature="0"
+         id="path8177"
+         d="m 11.232107,129.2582 9.940693,0"
+         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.64635694px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <path
+         inkscape:connector-curvature="0"
+         id="path8179"
+         d="m 11.232107,132.62889 16.453561,0"
+         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.64635694px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+    </g>
+  </g>
+  <metadata
+     id="metadata54">
+    <rdf:RDF>
+      <cc:Work>
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <cc:license
+           rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
+        <dc:publisher>
+          <cc:Agent
+             rdf:about="http://openclipart.org/">
+            <dc:title>Openclipart</dc:title>
+          </cc:Agent>
+        </dc:publisher>
+        <dc:title>tango internet mail</dc:title>
+        <dc:date>2010-03-29T08:04:16</dc:date>
+        <dc:description>&quot;E-mail&quot; icon from &lt;a href=&quot;http://tango.freedesktop.org/Tango_Desktop_Project&quot;&gt; Tango Project &lt;/a&gt; \r\n&lt;br&gt;&lt;br&gt;\r\nSince version 0.8.90 Tango Project icons are Public Domain: &lt;a href=&quot;http://tango.freedesktop.org/Frequently_Asked_Questions#Terms_of_Use.3F&quot;&gt; Tango Project FAQ &lt;/a&gt;</dc:description>
+        <dc:source>https://openclipart.org/detail/35215/tango-internet-mail-by-warszawianka</dc:source>
+        <dc:creator>
+          <cc:Agent>
+            <dc:title>warszawianka</dc:title>
+          </cc:Agent>
+        </dc:creator>
+        <dc:subject>
+          <rdf:Bag>
+            <rdf:li>email</rdf:li>
+            <rdf:li>envelope</rdf:li>
+            <rdf:li>externalsource</rdf:li>
+            <rdf:li>icon</rdf:li>
+            <rdf:li>letter</rdf:li>
+            <rdf:li>tango</rdf:li>
+          </rdf:Bag>
+        </dc:subject>
+      </cc:Work>
+      <cc:License
+         rdf:about="http://creativecommons.org/licenses/publicdomain/">
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Reproduction" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Distribution" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+</svg>
index 2b72080f8fcaa2d47013bd266921ac05c050834a..06e4de302423c97164bdd2b8e90f8b403aa05dcf 100755 (executable)
@@ -55,7 +55,7 @@ else
     # OS X preferences icons
     # servers.png does not have an SVG version
     mkdir -p osx/preferences
-    for i in colour_conversions defaults kdm_email keys tms; do
+    for i in colour_conversions defaults kdm_email cover_sheet keys tms; do
        $INKSCAPE osx/preferences/$i.png src/$i.svg -w 32 -h 32
     done
 
index 3c684fc8bae9cadec662bdefd8d30082b4ee4b6d..93a1ebbcd20bf0fdccca7ca72449ba88c507f59b 100644 (file)
Binary files a/graphics/web/favicon-128x128.png and b/graphics/web/favicon-128x128.png differ
index 666411ee28a0e80867d9b40817c2feecba761507..7dfaf35227d16fd5e06a09edab461aef41177c5f 100644 (file)
Binary files a/graphics/web/favicon-16x16.png and b/graphics/web/favicon-16x16.png differ
index 6be1a06ba0e4861253a5ad25c1fe83392686d6d2..df20b5c921e6c19f89c0e851022e506db754eec0 100644 (file)
Binary files a/graphics/web/favicon-256x256.png and b/graphics/web/favicon-256x256.png differ
index 86d2850f13797f043420d54bf7cc73238c91acbc..c7b87ba0511a4db349ee01028a4630f61353fc83 100644 (file)
Binary files a/graphics/web/favicon-32x32.png and b/graphics/web/favicon-32x32.png differ
index 0c849d96abe8d6a863971f78af11223fe4b8391c..0fa6bd7d6525151ff4da393544a203a3e7189370 100644 (file)
Binary files a/graphics/web/favicon-64x64.png and b/graphics/web/favicon-64x64.png differ
diff --git a/graphics/web/logo.png b/graphics/web/logo.png
new file mode 100644 (file)
index 0000000..992894e
Binary files /dev/null and b/graphics/web/logo.png differ
index c0ab44923a4d8b9344de0b77a294ee12a0066e3d..a19a60f55aa06d5d16072f2cacea23f5bdd4ced6 100644 (file)
@@ -132,6 +132,7 @@ Config::set_defaults ()
        _allowed_dcp_frame_rates.push_back (60);
 
        set_kdm_email_to_default ();
+       set_cover_sheet_to_default ();
 }
 
 void
@@ -329,6 +330,9 @@ try
        }
        _preview_sound = f.optional_bool_child("PreviewSound").get_value_or (false);
        _preview_sound_output = f.optional_string_child("PreviewSoundOutput");
+       if (f.optional_string_child("CoverSheet")) {
+               _cover_sheet = f.optional_string_child("CoverSheet").get();
+       }
 
        /* Replace any cinemas from config.xml with those from the configured file */
        if (boost::filesystem::exists (_cinemas_file)) {
@@ -514,6 +518,7 @@ Config::write_config () const
        if (_preview_sound_output) {
                root->add_child("PreviewSoundOutput")->add_child_text (_preview_sound_output.get());
        }
+       root->add_child("CoverSheet")->add_child_text (_cover_sheet);
 
        try {
                doc.write_to_file_formatted (path("config.xml").string ());
@@ -607,6 +612,18 @@ Config::reset_kdm_email ()
        changed ();
 }
 
+void
+Config::set_cover_sheet_to_default ()
+{
+       _cover_sheet = _(
+               "$CPL_NAME\n\n"
+               "Type: $TYPE\n"
+               "Format: $CONTAINER\n"
+               "Audio: $AUDIO\n"
+               "Length: $LENGTH\n"
+               );
+}
+
 void
 Config::add_to_history (boost::filesystem::path p)
 {
@@ -707,3 +724,10 @@ Config::config_path ()
 {
        return path("config.xml", false);
 }
+
+void
+Config::reset_cover_sheet ()
+{
+       set_cover_sheet_to_default ();
+       changed ();
+}
index 3e74a5049b8c0fdd5f86bdcbc7632514a02420a7..fc6315242b21d084ccdf94c696dbb039296d648e 100644 (file)
@@ -327,6 +327,10 @@ public:
                return _preview_sound;
        }
 
+       std::string cover_sheet () const {
+               return _cover_sheet;
+       }
+
        boost::optional<std::string> preview_sound_output () const {
                return _preview_sound_output;
        }
@@ -599,6 +603,12 @@ public:
                maybe_set (_nagged[nag], nagged);
        }
 
+       void set_cover_sheet (std::string s) {
+               maybe_set (_cover_sheet, s);
+       }
+
+       void reset_cover_sheet ();
+
        void changed (Property p = OTHER);
        boost::signals2::signal<void (Property)> Changed;
        /** Emitted if read() failed on an existing Config file.  There is nothing
@@ -629,6 +639,7 @@ private:
        void read ();
        void set_defaults ();
        void set_kdm_email_to_default ();
+       void set_cover_sheet_to_default ();
        void read_cinemas (cxml::Document const & f);
        boost::shared_ptr<dcp::CertificateChain> create_certificate_chain ();
        boost::filesystem::path directory_or (boost::optional<boost::filesystem::path> dir, boost::filesystem::path a) const;
@@ -737,6 +748,7 @@ private:
        bool _preview_sound;
        /** name of a specific sound output stream to use for preview, or empty to use the default */
        boost::optional<std::string> _preview_sound_output;
+       std::string _cover_sheet;
 
        /** Singleton instance, or 0 */
        static Config* _instance;
index df19af77f062e6c5e18ac4c73872d1c0340d8d74..04ff0025088300b6712659791e9c18fc7ee44934 100644 (file)
@@ -723,24 +723,9 @@ Film::isdcf_name (bool if_created_now) const
 
        /* Count mapped audio channels */
 
-       int non_lfe = 0;
-       int lfe = 0;
-
-       BOOST_FOREACH (int i, mapped_audio_channels ()) {
-               if (i >= audio_channels()) {
-                       /* This channel is mapped but is not included in the DCP */
-                       continue;
-               }
-
-               if (static_cast<dcp::Channel> (i) == dcp::LFE) {
-                       ++lfe;
-               } else {
-                       ++non_lfe;
-               }
-       }
-
-       if (non_lfe) {
-               d += String::compose("_%1%2", non_lfe, lfe);
+       pair<int, int> ch = audio_channel_types (mapped_audio_channels(), audio_channels());
+       if (ch.first) {
+               d += String::compose("_%1%2", ch.first, ch.second);
        }
 
        /* XXX: HI/VI */
index 574d1d8894a94b9a6735e81b2246b9632dc8f2b8..b1dfeab558421d3406d5535ad3022e2d63409687 100644 (file)
@@ -88,6 +88,7 @@ using std::pair;
 using std::cout;
 using std::bad_alloc;
 using std::set_terminate;
+using std::make_pair;
 using boost::shared_ptr;
 using boost::thread;
 using boost::optional;
@@ -706,3 +707,29 @@ careful_string_filter (string s)
 
        return out;
 }
+
+/** @param mapped List of mapped audio channels from a Film.
+ *  @param channels Total number of channels in the Film.
+ *  @return First: number of non-LFE channels, second: number of LFE channels.
+ */
+pair<int, int>
+audio_channel_types (list<int> mapped, int channels)
+{
+       int non_lfe = 0;
+       int lfe = 0;
+
+       BOOST_FOREACH (int i, mapped) {
+               if (i >= channels) {
+                       /* This channel is mapped but is not included in the DCP */
+                       continue;
+               }
+
+               if (static_cast<dcp::Channel> (i) == dcp::LFE) {
+                       ++lfe;
+               } else {
+                       ++non_lfe;
+               }
+       }
+
+       return make_pair (non_lfe, lfe);
+}
index 4e6e50dd7b32b8a513802a3ceb486bde84b55b82..db6c37fe11fa5a423e0cb47eb61c0cd6aa47b3f0 100644 (file)
@@ -83,5 +83,6 @@ extern std::string video_asset_filename (boost::shared_ptr<dcp::PictureAsset> as
 extern std::string audio_asset_filename (boost::shared_ptr<dcp::SoundAsset> asset, int reel_index, int reel_count, boost::optional<std::string> content_summary);
 extern float relaxed_string_to_float (std::string);
 extern std::string careful_string_filter (std::string);
+extern std::pair<int, int> audio_channel_types (std::list<int> mapped, int channels);
 
 #endif
index 87cdac2d8c97bf3ce6dd4b0e47b93cf96fe4bdcb..ec4689b2ff7025317aaefff3615ee2f0c001549b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -539,6 +539,51 @@ Writer::finish ()
        LOG_GENERAL (
                N_("Wrote %1 FULL, %2 FAKE, %3 REPEAT, %4 pushed to disk"), _full_written, _fake_written, _repeat_written, _pushed_to_disk
                );
+
+       write_cover_sheet ();
+}
+
+void
+Writer::write_cover_sheet ()
+{
+       boost::filesystem::path const cover = _film->file ("COVER_SHEET.txt");
+       FILE* f = fopen_boost (cover, "w");
+       if (!f) {
+               throw OpenFileError (cover, errno, false);
+       }
+
+       string text = Config::instance()->cover_sheet ();
+       boost::algorithm::replace_all (text, "$CPL_NAME", _film->name());
+       boost::algorithm::replace_all (text, "$TYPE", _film->dcp_content_type()->pretty_name());
+       boost::algorithm::replace_all (text, "$CONTAINER", _film->container()->nickname());
+
+       pair<int, int> ch = audio_channel_types (_film->mapped_audio_channels(), _film->audio_channels());
+       string description = String::compose("%1.%2", ch.first, ch.second);
+
+       if (description == "0.0") {
+               description = _("None");
+       } else if (description == "1.0") {
+               description = _("Mono");
+       } else if (description == "2.0") {
+               description = _("Stereo");
+       }
+       boost::algorithm::replace_all (text, "$AUDIO", description);
+
+       int h, m, s, fr;
+       _film->length().split (_film->video_frame_rate(), h, m, s, fr);
+       string length;
+       if (h == 0 && m == 0) {
+               length = String::compose("%1s", s);
+       } else if (h == 0 && m > 0) {
+               length = String::compose("%1m%2s", m, s);
+       } else if (h > 0 && m > 0) {
+               length = String::compose("%1h%2m%3s", h, m, s);
+       }
+
+       boost::algorithm::replace_all (text, "$LENGTH", length);
+
+       fwrite (text.c_str(), 1, text.length(), f);
+       fclose (f);
 }
 
 /** @param frame Frame index within the whole DCP.
index 1e4d3b6a36f5646b78ca3f31b0755dacc87bf7cb..cb1bdc5cc3fbc44a6a08db16dd83b5b2ed32639e 100644 (file)
@@ -117,6 +117,7 @@ private:
        bool have_sequenced_image_at_queue_head ();
        size_t video_reel (int frame) const;
        void set_digest_progress (Job* job, float progress);
+       void write_cover_sheet ();
 
        /** our Film */
        boost::shared_ptr<const Film> _film;
index 570d5e44806c3e2191bf45e76a518e7c2235f9cd..49a8a6849a0f1dd59d3dff56160e227c7ae31154 100644 (file)
@@ -1482,6 +1482,71 @@ private:
        wxButton* _reset_kdm_email;
 };
 
+class CoverSheetPage : public StandardPage
+{
+public:
+
+       CoverSheetPage (wxSize panel_size, int border)
+#ifdef DCPOMATIC_OSX
+               /* We have to force both width and height of this one */
+               : StandardPage (wxSize (480, 128), border)
+#else
+               : StandardPage (panel_size, border)
+#endif
+       {}
+
+       wxString GetName () const
+       {
+               return _("Cover Sheet");
+       }
+
+#ifdef DCPOMATIC_OSX
+       wxBitmap GetLargeIcon () const
+       {
+               return wxBitmap ("cover_sheet", wxBITMAP_TYPE_PNG_RESOURCE);
+       }
+#endif
+
+private:
+       void setup ()
+       {
+               _cover_sheet = new wxTextCtrl (_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (-1, 200), wxTE_MULTILINE);
+               _panel->GetSizer()->Add (_cover_sheet, 0, wxEXPAND | wxALL, _border);
+
+               _reset_cover_sheet = new wxButton (_panel, wxID_ANY, _("Reset to default text"));
+               _panel->GetSizer()->Add (_reset_cover_sheet, 0, wxEXPAND | wxALL, _border);
+
+               _cover_sheet->Bind (wxEVT_TEXT, boost::bind (&CoverSheetPage::cover_sheet_changed, this));
+               _reset_cover_sheet->Bind (wxEVT_BUTTON, boost::bind (&CoverSheetPage::reset_cover_sheet, this));
+       }
+
+       void config_changed ()
+       {
+               checked_set (_cover_sheet, Config::instance()->cover_sheet ());
+       }
+
+       void cover_sheet_changed ()
+       {
+               if (_cover_sheet->GetValue().IsEmpty ()) {
+                       /* Sometimes we get sent an erroneous notification that the cover sheet
+                          is empty; I don't know why.
+                       */
+                       return;
+               }
+               Config::instance()->set_cover_sheet (wx_to_std (_cover_sheet->GetValue ()));
+       }
+
+       void reset_cover_sheet ()
+       {
+               Config::instance()->reset_cover_sheet ();
+               checked_set (_cover_sheet, Config::instance()->cover_sheet ());
+       }
+
+       wxTextCtrl* _cover_sheet;
+       wxButton* _reset_cover_sheet;
+};
+
+
 /** @class AdvancedPage
  *  @brief Advanced page of the preferences dialog.
  */
@@ -1730,6 +1795,7 @@ create_config_dialog ()
        e->AddPage (new KeysPage (ps, border));
        e->AddPage (new TMSPage (ps, border));
        e->AddPage (new KDMEmailPage (ps, border));
+       e->AddPage (new CoverSheetPage (ps, border));
        e->AddPage (new AdvancedPage (ps, border));
        return e;
 }