diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-05-05 22:28:25 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-05-06 20:15:49 +0200 |
| commit | 8f12e84009d7c2685bb2eeb32665876463d4e6e5 (patch) | |
| tree | 49f9de5db8ad762a3179869ebde2d9093b132b16 /src/wx/kdm_dialog.cc | |
| parent | 8dabe7c3d815ff95c2fb3edc3cfce62434711fc4 (diff) | |
Extract common code out into kdm_for_screen()
Diffstat (limited to 'src/wx/kdm_dialog.cc')
| -rw-r--r-- | src/wx/kdm_dialog.cc | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc index d74741871..d3bbf02c9 100644 --- a/src/wx/kdm_dialog.cc +++ b/src/wx/kdm_dialog.cc @@ -162,35 +162,11 @@ KDMDialog::make_clicked () } BOOST_FOREACH (shared_ptr<dcpomatic::Screen> i, _screens->screens()) { - if (i->recipient) { - dcp::LocalTime const begin(_timing->from(), i->cinema ? i->cinema->utc_offset_hour() : 0, i->cinema ? i->cinema->utc_offset_minute() : 0); - dcp::LocalTime const end(_timing->until(), i->cinema ? i->cinema->utc_offset_hour() : 0, i->cinema ? i->cinema->utc_offset_minute() : 0); - - dcp::EncryptedKDM const kdm = film->make_kdm ( - i->recipient.get(), - i->trusted_device_thumbprints(), - _cpl->cpl(), - begin, - end, - _output->formulation(), - !_output->forensic_mark_video(), - for_audio - ); - - dcp::NameFormat::Map name_values; - if (i->cinema) { - name_values['c'] = i->cinema->name; - } - name_values['s'] = i->name; - name_values['f'] = film->name(); - name_values['b'] = dcp::LocalTime(begin).date() + " " + dcp::LocalTime(begin).time_of_day(false, false); - name_values['e'] = dcp::LocalTime(end).date() + " " + dcp::LocalTime(end).time_of_day(false, false); - name_values['i'] = kdm.cpl_id(); - - kdms.push_back (KDMWithMetadataPtr(new DCPKDMWithMetadata(name_values, i->cinema, kdm))); + KDMWithMetadataPtr p = kdm_for_screen (film, _cpl->cpl(), i, _timing->from(), _timing->until(), _output->formulation(), !_output->forensic_mark_video(), for_audio); + if (p) { + kdms.push_back (p); } } - } catch (dcp::BadKDMDateError& e) { if (e.starts_too_early()) { error_dialog (this, _("The KDM start period is before (or close to) the start of the signing certificate's validity period. Use a later start time for this KDM.")); |
