X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic_kdm.cc;h=7920f7e5756b9994c7147fd5c45bccc1fb87cd9d;hp=bbaf5bad717d03b6b6eb12c3855251113fe23210;hb=5579acd7ff7e1460f0b5bb54a4deedbd356153cd;hpb=8f8730cadb3dae36e8aa7b7c732a7c162eac0fb6 diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc index bbaf5bad7..7920f7e57 100644 --- a/src/tools/dcpomatic_kdm.cc +++ b/src/tools/dcpomatic_kdm.cc @@ -302,7 +302,7 @@ private: return; } - list screen_kdms; + list kdms; string title; #ifdef DCPOMATIC_VARIANT_SWAROOP @@ -317,20 +317,26 @@ private: continue; } + dcp::LocalTime begin(_timing->from(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()); + dcp::LocalTime end(_timing->until(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()); + DecryptedECinemaKDM kdm ( decrypted.id(), decrypted.name(), decrypted.key(), - dcp::LocalTime (_timing->from(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()), - dcp::LocalTime (_timing->until(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()) + begin, + end ); dcp::NameFormat::Map name_values; name_values['c'] = i->cinema->name; name_values['s'] = i->name; + name_values['f'] = title; + name_values['b'] = begin.date() + " " + begin.time_of_day(true, false); + name_values['e'] = end.date() + " " + end.time_of_day(true, false); /* Encrypt */ - screen_kdms.push_back ( + kdms.push_back ( KDMWithMetadataPtr( new ECinemaKDMWithMetadata(name_values, i->cinema, kdm.encrypt(i->recipient.get())) ) @@ -358,10 +364,13 @@ private: continue; } + dcp::LocalTime begin(_timing->from(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()); + dcp::LocalTime end(_timing->until(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()); + /* Make an empty KDM */ dcp::DecryptedKDM kdm ( - dcp::LocalTime (_timing->from(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()), - dcp::LocalTime (_timing->until(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()), + begin, + end, decrypted.annotation_text().get_value_or (""), decrypted.content_title_text(), dcp::LocalTime().as_string() @@ -375,9 +384,12 @@ private: dcp::NameFormat::Map name_values; name_values['c'] = i->cinema->name; name_values['s'] = i->name; + name_values['f'] = title; + name_values['b'] = begin.date() + " " + begin.time_of_day(true, false); + name_values['e'] = end.date() + " " + end.time_of_day(true, false); /* Encrypt */ - screen_kdms.push_back ( + kdms.push_back ( KDMWithMetadataPtr( new DCPKDMWithMetadata( name_values, @@ -392,12 +404,12 @@ private: } } - if (screen_kdms.empty()) { + if (kdms.empty()) { return; } pair, int> result = _output->make ( - screen_kdms, title, _timing, bind (&DOMFrame::confirm_overwrite, this, _1) + kdms, title, bind (&DOMFrame::confirm_overwrite, this, _1) ); if (result.first) {