diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-05-01 22:53:01 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-05-04 17:17:12 +0200 |
| commit | 08f96200aacf9f91ef3e3f5b80224a5b2437f279 (patch) | |
| tree | 04ed6b723d3c41e514f8f78659590a89809b3658 | |
| parent | e81c5eb9e8ff875240dde9fdaaab0a46f99af615 (diff) | |
Move Film::make_kdms to the call sites.
| -rw-r--r-- | src/lib/film.cc | 41 | ||||
| -rw-r--r-- | src/lib/film.h | 13 | ||||
| -rw-r--r-- | src/tools/dcpomatic_kdm_cli.cc | 23 | ||||
| -rw-r--r-- | src/wx/kdm_dialog.cc | 21 |
4 files changed, 37 insertions, 61 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index a24e9aa30..cbbdf5964 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -1502,47 +1502,6 @@ Film::make_kdm ( ).encrypt (signer, recipient, trusted_devices, formulation, disable_forensic_marking_picture, disable_forensic_marking_audio); } -/** @param screens Screens to make KDMs for. - * @param cpl_file Path to CPL to make KDMs for. - * @param from KDM from time expressed as a local time in the time zone of the Screen's Cinema. - * @param until KDM to time expressed as a local time in the time zone of the Screen's Cinema. - * @param formulation KDM formulation to use. - * @param disable_forensic_marking_picture true to disable forensic marking of picture. - * @param disable_forensic_marking_audio if not set, don't disable forensic marking of audio. If set to 0, - * disable all forensic marking; if set above 0, disable forensic marking above that channel. - */ -list<shared_ptr<ScreenKDM> > -Film::make_kdms ( - list<shared_ptr<Screen> > screens, - boost::filesystem::path cpl_file, - boost::posix_time::ptime from, - boost::posix_time::ptime until, - dcp::Formulation formulation, - bool disable_forensic_marking_picture, - optional<int> disable_forensic_marking_audio - ) const -{ - list<shared_ptr<ScreenKDM> > kdms; - - BOOST_FOREACH (shared_ptr<Screen> i, screens) { - if (i->recipient) { - dcp::EncryptedKDM const kdm = make_kdm ( - i->recipient.get(), - i->trusted_device_thumbprints(), - cpl_file, - dcp::LocalTime (from, i->cinema ? i->cinema->utc_offset_hour() : 0, i->cinema ? i->cinema->utc_offset_minute() : 0), - dcp::LocalTime (until, i->cinema ? i->cinema->utc_offset_hour() : 0, i->cinema ? i->cinema->utc_offset_minute() : 0), - formulation, - disable_forensic_marking_picture, - disable_forensic_marking_audio - ); - - kdms.push_back (shared_ptr<ScreenKDM>(new DCPScreenKDM(i, kdm))); - } - } - - return kdms; -} /** @return The approximate disk space required to encode a DCP of this film with the * current settings, in bytes. diff --git a/src/lib/film.h b/src/lib/film.h index 6cce07c17..40d366f8f 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -60,7 +60,6 @@ class AudioProcessor; class AudioMapping; class Ratio; class Job; -class ScreenKDM; class Film; struct isdcf_name_test; @@ -169,16 +168,6 @@ public: boost::optional<int> disable_forensic_marking_audio ) const; - std::list<boost::shared_ptr<ScreenKDM> > make_kdms ( - std::list<boost::shared_ptr<dcpomatic::Screen> > screens, - boost::filesystem::path cpl_file, - boost::posix_time::ptime from, - boost::posix_time::ptime until, - dcp::Formulation formulation, - bool disable_forensic_marking_picture, - boost::optional<int> disable_forensic_marking_audio - ) const; - int state_version () const { return _state_version; } diff --git a/src/tools/dcpomatic_kdm_cli.cc b/src/tools/dcpomatic_kdm_cli.cc index 166b22285..505a70c2b 100644 --- a/src/tools/dcpomatic_kdm_cli.cc +++ b/src/tools/dcpomatic_kdm_cli.cc @@ -229,11 +229,26 @@ from_film ( values['e'] = dcp::LocalTime(valid_to).date() + " " + dcp::LocalTime(valid_to).time_of_day(true, false); try { - list<shared_ptr<ScreenKDM> > screen_kdms = film->make_kdms ( - screens, cpl, valid_from, valid_to, formulation, disable_forensic_marking_picture, disable_forensic_marking_audio - ); + list<shared_ptr<ScreenKDM> > kdms; - write_files (screen_kdms, zip, output, container_name_format, filename_format, values, verbose); + BOOST_FOREACH (shared_ptr<Screen> i, screens) { + if (i->recipient) { + dcp::EncryptedKDM const kdm = film->make_kdm ( + i->recipient.get(), + i->trusted_device_thumbprints(), + cpl, + dcp::LocalTime(valid_from, i->cinema ? i->cinema->utc_offset_hour() : 0, i->cinema ? i->cinema->utc_offset_minute() : 0), + dcp::LocalTime(valid_to, i->cinema ? i->cinema->utc_offset_hour() : 0, i->cinema ? i->cinema->utc_offset_minute() : 0), + formulation, + disable_forensic_marking_picture, + disable_forensic_marking_audio + ); + + kdms.push_back (shared_ptr<ScreenKDM>(new DCPScreenKDM(i, kdm))); + } + } + + write_files (kdms, zip, output, container_name_format, filename_format, values, verbose); } catch (FileError& e) { cerr << program_name << ": " << e.what() << " (" << e.file().string() << ")\n"; exit (EXIT_FAILURE); diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc index 8682fe82f..59d961e6c 100644 --- a/src/wx/kdm_dialog.cc +++ b/src/wx/kdm_dialog.cc @@ -161,10 +161,23 @@ KDMDialog::make_clicked () /* Forensic mark up to this channel; disabled on channels greater than this */ for_audio = _output->forensic_mark_audio_up_to(); } - screen_kdms = film->make_kdms ( - _screens->screens(), _cpl->cpl(), _timing->from(), _timing->until(), _output->formulation(), - !_output->forensic_mark_video(), for_audio - ); + + BOOST_FOREACH (shared_ptr<dcpomatic::Screen> i, _screens->screens()) { + if (i->recipient) { + dcp::EncryptedKDM const kdm = film->make_kdm ( + i->recipient.get(), + i->trusted_device_thumbprints(), + _cpl->cpl(), + dcp::LocalTime(_timing->from(), i->cinema ? i->cinema->utc_offset_hour() : 0, i->cinema ? i->cinema->utc_offset_minute() : 0), + dcp::LocalTime(_timing->until(), i->cinema ? i->cinema->utc_offset_hour() : 0, i->cinema ? i->cinema->utc_offset_minute() : 0), + _output->formulation(), + !_output->forensic_mark_video(), + for_audio + ); + + screen_kdms.push_back (shared_ptr<ScreenKDM>(new DCPScreenKDM(i, kdm))); + } + } } catch (dcp::BadKDMDateError& e) { if (e.starts_too_early()) { |
