Put ISDCF name subtitle language in lower case if subs are burnt in.
[dcpomatic.git] / src / lib / film.cc
index 4691925bce3b12d0dfb8650c07c0037baae64dd0..e066bfc50fe7bf0f48ebab851596c51c781cb7b6 100644 (file)
@@ -274,7 +274,9 @@ Film::make_dcp ()
 
        set_isdcf_date_today ();
 
-       environment_info (log ());
+       BOOST_FOREACH (string i, environment_info ()) {
+               LOG_GENERAL_NC (i);
+       }
 
        BOOST_FOREACH (shared_ptr<const Content> i, content ()) {
                LOG_GENERAL ("Content: %1", i->technical_summary());
@@ -594,7 +596,27 @@ Film::isdcf_name (bool if_created_now) const
        if (!dm.audio_language.empty ()) {
                d << "_" << dm.audio_language;
                if (!dm.subtitle_language.empty()) {
-                       d << "-" << dm.subtitle_language;
+
+                       bool burnt_in = false;
+                       BOOST_FOREACH (shared_ptr<Content> i, content ()) {
+                               shared_ptr<SubtitleContent> sc = dynamic_pointer_cast<SubtitleContent> (i);
+                               if (!sc) {
+                                       continue;
+                               }
+
+                               if (sc->use_subtitles() && sc->burn_subtitles()) {
+                                       burnt_in = true;
+                               }
+                       }
+
+                       string language = dm.subtitle_language;
+                       if (burnt_in) {
+                               transform (language.begin(), language.end(), language.begin(), ::tolower);
+                       } else {
+                               transform (language.begin(), language.end(), language.begin(), ::toupper);
+                       }
+
+                       d << "-" << language;
                } else {
                        d << "-XX";
                }
@@ -831,6 +853,7 @@ Film::set_reel_type (ReelType t)
        signal_changed (REEL_TYPE);
 }
 
+/** @param r Desired reel length in bytes */
 void
 Film::set_reel_length (int64_t r)
 {
@@ -1113,7 +1136,8 @@ Film::frame_size () const
 
 dcp::EncryptedKDM
 Film::make_kdm (
-       dcp::Certificate target,
+       dcp::Certificate recipient,
+       vector<dcp::Certificate> trusted_devices,
        boost::filesystem::path cpl_file,
        dcp::LocalTime from,
        dcp::LocalTime until,
@@ -1128,7 +1152,7 @@ Film::make_kdm (
 
        return dcp::DecryptedKDM (
                cpl, key(), from, until, "DCP-o-matic", cpl->content_title_text(), dcp::LocalTime().as_string()
-               ).encrypt (signer, target, formulation);
+               ).encrypt (signer, recipient, trusted_devices, formulation);
 }
 
 list<ScreenKDM>
@@ -1143,8 +1167,8 @@ Film::make_kdms (
        list<ScreenKDM> kdms;
 
        BOOST_FOREACH (shared_ptr<Screen> i, screens) {
-               if (i->certificate) {
-                       kdms.push_back (ScreenKDM (i, make_kdm (i->certificate.get(), dcp, from, until, formulation)));
+               if (i->recipient) {
+                       kdms.push_back (ScreenKDM (i, make_kdm (i->recipient.get(), i->trusted_devices, dcp, from, until, formulation)));
                }
        }
 
@@ -1270,8 +1294,8 @@ Film::audio_output_names () const
        n.push_back (_("BsR"));
        n.push_back (_("DBP"));
        n.push_back (_("DBS"));
-       n.push_back (_("NC"));
-       n.push_back (_("NC"));
+       n.push_back ("");
+       n.push_back ("");
 
        return vector<string> (n.begin(), n.begin() + audio_channels ());
 }