X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fkdm_dialog.cc;h=bec880852748c052c4de42eea3a40d457659fe2a;hb=6ebec6b3ca11a7062ae19176096b1b157275d015;hp=268573e6c35e5048699961279b59c87f806ee022;hpb=3c29aa6531a4046a8db72dcac81189eb8893233c;p=dcpomatic.git diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc index 268573e6c..bec880852 100644 --- a/src/wx/kdm_dialog.cc +++ b/src/wx/kdm_dialog.cc @@ -33,6 +33,7 @@ #include "lib/film.h" #include "lib/job_manager.h" #include "lib/kdm_with_metadata.h" +#include "lib/kdm_util.h" #include "lib/screen.h" #include #include @@ -108,7 +109,7 @@ KDMDialog::KDMDialog (wxWindow* parent, shared_ptr film) /* Sub-heading: Output */ h = new StaticText (this, _("Output")); h->SetFont (subheading_font); - right->Add (h, 0, wxTOP, DCPOMATIC_SIZER_Y_GAP * 2); + right->Add(h, 0, wxTOP, DCPOMATIC_SUBHEADING_TOP_PAD); _output = new KDMOutputPanel (this); right->Add (_output, 0, wxEXPAND | wxTOP, DCPOMATIC_SIZER_GAP); @@ -171,17 +172,39 @@ KDMDialog::make_clicked () for_audio = _output->forensic_mark_audio_up_to(); } + vector period_checks; + + std::function make_kdm = [film, this](dcp::LocalTime begin, dcp::LocalTime end) { + return film->make_kdm(_cpl->cpl(), begin, end); + }; + for (auto i: _screens->screens()) { - auto p = kdm_for_screen (film, _cpl->cpl(), i, _timing->from(), _timing->until(), _output->formulation(), !_output->forensic_mark_video(), for_audio); + auto p = kdm_for_screen(make_kdm, i, _timing->from(), _timing->until(), _output->formulation(), !_output->forensic_mark_video(), for_audio, period_checks); if (p) { kdms.push_back (p); } } + + if (find(period_checks.begin(), period_checks.end(), KDMCertificatePeriod::KDM_OUTSIDE_CERTIFICATE) != period_checks.end()) { + error_dialog( + this, + _("Some KDMs would have validity periods which are completely outside the recipient certificate periods. Such KDMs are very unlikely to work, so will not be created.") + ); + return; + } + + if (find(period_checks.begin(), period_checks.end(), KDMCertificatePeriod::KDM_OVERLAPS_CERTIFICATE) != period_checks.end()) { + message_dialog( + this, + _("For some of these KDMs the recipient certificate's validity period will not cover the whole of the KDM validity period. This might cause problems with the KDMs.") + ); + } + } 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.")); } else { - error_dialog (this, _("The KDM end period is after (or close to) the end of the signing certficates' validity period. Either use an earlier end time for this KDM or re-create your signing certificates in the DCP-o-matic preferences window.")); + error_dialog (this, _("The KDM end period is after (or close to) the end of the signing certificates' validity period. Either use an earlier end time for this KDM or re-create your signing certificates in the DCP-o-matic preferences window.")); } return; } catch (runtime_error& e) {