From 36ce958a516567d8481163692c028a88c6ce0df7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 4 May 2020 22:53:08 +0200 Subject: [PATCH] Rename ScreenKDM -> KDMWithMetadata --- src/lib/cinema_kdms.cc | 16 ++++++------- src/lib/cinema_kdms.h | 6 ++--- src/lib/film.cc | 2 +- .../{screen_kdm.cc => kdm_with_metadata.cc} | 10 ++++---- src/lib/{screen_kdm.h => kdm_with_metadata.h} | 24 +++++++++---------- src/lib/wscript | 2 +- src/tools/dcpomatic.cc | 2 +- src/tools/dcpomatic_kdm.cc | 12 +++++----- src/tools/dcpomatic_kdm_cli.cc | 16 ++++++------- src/wx/kdm_dialog.cc | 6 ++--- src/wx/kdm_output_panel.cc | 4 ++-- src/wx/kdm_output_panel.h | 4 ++-- 12 files changed, 52 insertions(+), 52 deletions(-) rename src/lib/{screen_kdm.cc => kdm_with_metadata.cc} (88%) rename src/lib/{screen_kdm.h => kdm_with_metadata.h} (76%) diff --git a/src/lib/cinema_kdms.cc b/src/lib/cinema_kdms.cc index 3af1e0d84..99d151152 100644 --- a/src/lib/cinema_kdms.cc +++ b/src/lib/cinema_kdms.cc @@ -47,7 +47,7 @@ CinemaKDMs::make_zip_file (boost::filesystem::path zip_file, dcp::NameFormat nam name_values['c'] = cinema->name; - BOOST_FOREACH (shared_ptr i, screen_kdms) { + BOOST_FOREACH (shared_ptr i, screen_kdms) { name_values['s'] = i->screen->name; name_values['i'] = i->kdm_id (); string const name = careful_string_filter(name_format.get(name_values, ".xml")); @@ -57,11 +57,11 @@ CinemaKDMs::make_zip_file (boost::filesystem::path zip_file, dcp::NameFormat nam zipper.close (); } -/** Collect a list of ScreenKDMs into a list of CinemaKDMs so that each +/** Collect a list of KDMWithMetadatas into a list of CinemaKDMs so that each * CinemaKDM contains the KDMs for its cinema. */ list -CinemaKDMs::collect (list > screen_kdms) +CinemaKDMs::collect (list > screen_kdms) { list cinema_kdms; @@ -71,17 +71,17 @@ CinemaKDMs::collect (list > screen_kdms) CinemaKDMs ck; - list >::iterator i = screen_kdms.begin (); + list >::iterator i = screen_kdms.begin (); ck.cinema = (*i)->screen->cinema; ck.screen_kdms.push_back (*i); - list >::iterator j = i; + list >::iterator j = i; ++i; screen_kdms.remove (*j); while (i != screen_kdms.end ()) { if ((*i)->screen->cinema == ck.cinema) { ck.screen_kdms.push_back (*i); - list >::iterator j = i; + list >::iterator j = i; ++i; screen_kdms.remove (*j); } else { @@ -117,7 +117,7 @@ CinemaKDMs::write_directories ( path /= container_name_format.get(name_values, ""); if (!boost::filesystem::exists (path) || confirm_overwrite (path)) { boost::filesystem::create_directories (path); - ScreenKDM::write_files (i.screen_kdms, path, filename_format, name_values, confirm_overwrite); + KDMWithMetadata::write_files (i.screen_kdms, path, filename_format, name_values, confirm_overwrite); } written += i.screen_kdms.size(); } @@ -209,7 +209,7 @@ CinemaKDMs::email ( boost::algorithm::replace_all (body, "$CINEMA_NAME", i.cinema->name); string screens; - BOOST_FOREACH (shared_ptr j, i.screen_kdms) { + BOOST_FOREACH (shared_ptr j, i.screen_kdms) { screens += j->screen->name + ", "; } boost::algorithm::replace_all (body, "$SCREENS", screens.substr (0, screens.length() - 2)); diff --git a/src/lib/cinema_kdms.h b/src/lib/cinema_kdms.h index 2b82cdab6..0626ded5d 100644 --- a/src/lib/cinema_kdms.h +++ b/src/lib/cinema_kdms.h @@ -18,7 +18,7 @@ */ -#include "screen_kdm.h" +#include "kdm_with_metadata.h" class Cinema; class Job; @@ -29,7 +29,7 @@ class CinemaKDMs public: void make_zip_file (boost::filesystem::path zip_file, dcp::NameFormat name_format, dcp::NameFormat::Map name_values) const; - static std::list collect (std::list > kdms); + static std::list collect (std::list > kdms); static int write_directories ( std::list cinema_kdms, @@ -58,5 +58,5 @@ public: ); boost::shared_ptr cinema; - std::list > screen_kdms; + std::list > screen_kdms; }; diff --git a/src/lib/film.cc b/src/lib/film.cc index cbbdf5964..b233e5ee6 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -50,7 +50,7 @@ #include "text_content.h" #include "ffmpeg_content.h" #include "dcp_content.h" -#include "screen_kdm.h" +#include "kdm_with_metadata.h" #include "cinema.h" #include "change_signaller.h" #include "check_content_change_job.h" diff --git a/src/lib/screen_kdm.cc b/src/lib/kdm_with_metadata.cc similarity index 88% rename from src/lib/screen_kdm.cc rename to src/lib/kdm_with_metadata.cc index f9a3fa36e..e6b283415 100644 --- a/src/lib/screen_kdm.cc +++ b/src/lib/kdm_with_metadata.cc @@ -18,7 +18,7 @@ */ -#include "screen_kdm.h" +#include "kdm_with_metadata.h" #include "cinema.h" #include "screen.h" #include "util.h" @@ -30,8 +30,8 @@ using std::list; using boost::shared_ptr; int -ScreenKDM::write_files ( - list > screen_kdms, +KDMWithMetadata::write_files ( + list > screen_kdms, boost::filesystem::path directory, dcp::NameFormat name_format, dcp::NameFormat::Map name_values, @@ -42,7 +42,7 @@ ScreenKDM::write_files ( if (directory == "-") { /* Write KDMs to the stdout */ - BOOST_FOREACH (shared_ptr i, screen_kdms) { + BOOST_FOREACH (shared_ptr i, screen_kdms) { cout << i->kdm_as_xml (); ++written; } @@ -55,7 +55,7 @@ ScreenKDM::write_files ( } /* Write KDMs to the specified directory */ - BOOST_FOREACH (shared_ptr i, screen_kdms) { + BOOST_FOREACH (shared_ptr i, screen_kdms) { name_values['c'] = i->screen->cinema ? i->screen->cinema->name : ""; name_values['s'] = i->screen->name; name_values['i'] = i->kdm_id (); diff --git a/src/lib/screen_kdm.h b/src/lib/kdm_with_metadata.h similarity index 76% rename from src/lib/screen_kdm.h rename to src/lib/kdm_with_metadata.h index a1e36245c..8d6d61daa 100644 --- a/src/lib/screen_kdm.h +++ b/src/lib/kdm_with_metadata.h @@ -18,8 +18,8 @@ */ -#ifndef DCPOMATIC_SCREEN_KDM_H -#define DCPOMATIC_SCREEN_KDM_H +#ifndef DCPOMATIC_KDM_WITH_METADATA_H +#define DCPOMATIC_KDM_WITH_METADATA_H #ifdef DCPOMATIC_VARIANT_SWAROOP #include "encrypted_ecinema_kdm.h" @@ -33,21 +33,21 @@ namespace dcpomatic { } /** Simple class to collect a screen and an encrypted KDM */ -class ScreenKDM +class KDMWithMetadata { public: - ScreenKDM (boost::shared_ptr s) + KDMWithMetadata (boost::shared_ptr s) : screen (s) {} - virtual ~ScreenKDM () {} + virtual ~KDMWithMetadata () {} virtual std::string kdm_as_xml () const = 0; virtual void kdm_as_xml (boost::filesystem::path out) const = 0; virtual std::string kdm_id () const = 0; static int write_files ( - std::list > screen_kdms, boost::filesystem::path directory, + std::list > screen_kdms, boost::filesystem::path directory, dcp::NameFormat name_format, dcp::NameFormat::Map name_values, boost::function confirm_overwrite ); @@ -55,11 +55,11 @@ public: boost::shared_ptr screen; }; -class DCPScreenKDM : public ScreenKDM +class DCPKDMWithMetadata : public KDMWithMetadata { public: - DCPScreenKDM (boost::shared_ptr s, dcp::EncryptedKDM k) - : ScreenKDM (s) + DCPKDMWithMetadata (boost::shared_ptr s, dcp::EncryptedKDM k) + : KDMWithMetadata (s) , kdm (k) {} @@ -79,11 +79,11 @@ public: }; #ifdef DCPOMATIC_VARIANT_SWAROOP -class ECinemaScreenKDM : public ScreenKDM +class ECinemaKDMWithMetadata : public KDMWithMetadata { public: - ECinemaScreenKDM (boost::shared_ptr s, EncryptedECinemaKDM k) - : ScreenKDM (s) + ECinemaKDMWithMetadata (boost::shared_ptr s, EncryptedECinemaKDM k) + : KDMWithMetadata (s) , kdm (k) {} diff --git a/src/lib/wscript b/src/lib/wscript index ea52079d0..19d68f045 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -125,6 +125,7 @@ sources = """ job_manager.cc j2k_encoder.cc json_server.cc + kdm_with_metadata.cc lock_file_checker.cc log.cc log_entry.cc @@ -145,7 +146,6 @@ sources = """ scoped_temporary.cc scp_uploader.cc screen.cc - screen_kdm.cc send_kdm_email_job.cc send_notification_email_job.cc send_problem_report_job.cc diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index aea058d80..5976de22a 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -65,7 +65,7 @@ #include "lib/job_manager.h" #include "lib/exceptions.h" #include "lib/cinema.h" -#include "lib/screen_kdm.h" +#include "lib/kdm_with_metadata.h" #include "lib/send_kdm_email_job.h" #include "lib/encode_server_finder.h" #include "lib/update_checker.h" diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc index ef6b783f4..1ff69d135 100644 --- a/src/tools/dcpomatic_kdm.cc +++ b/src/tools/dcpomatic_kdm.cc @@ -38,7 +38,7 @@ #include "lib/util.h" #include "lib/screen.h" #include "lib/job_manager.h" -#include "lib/screen_kdm.h" +#include "lib/kdm_with_metadata.h" #include "lib/exceptions.h" #include "lib/cinema_kdms.h" #include "lib/send_kdm_email_job.h" @@ -303,7 +303,7 @@ private: return; } - list > screen_kdms; + list > screen_kdms; string title; #ifdef DCPOMATIC_VARIANT_SWAROOP @@ -328,8 +328,8 @@ private: /* Encrypt */ screen_kdms.push_back ( - shared_ptr( - new ECinemaScreenKDM(i, kdm.encrypt(i->recipient.get())) + shared_ptr( + new ECinemaKDMWithMetadata(i, kdm.encrypt(i->recipient.get())) ) ); } @@ -371,8 +371,8 @@ private: /* Encrypt */ screen_kdms.push_back ( - shared_ptr( - new DCPScreenKDM( + shared_ptr( + new DCPKDMWithMetadata( i, kdm.encrypt( signer, i->recipient.get(), i->trusted_device_thumbprints(), _output->formulation(), diff --git a/src/tools/dcpomatic_kdm_cli.cc b/src/tools/dcpomatic_kdm_cli.cc index 505a70c2b..1aad31cb5 100644 --- a/src/tools/dcpomatic_kdm_cli.cc +++ b/src/tools/dcpomatic_kdm_cli.cc @@ -24,7 +24,7 @@ #include "lib/film.h" #include "lib/cinema.h" -#include "lib/screen_kdm.h" +#include "lib/kdm_with_metadata.h" #include "lib/cinema_kdms.h" #include "lib/config.h" #include "lib/exceptions.h" @@ -130,7 +130,7 @@ always_overwrite () void write_files ( - list > screen_kdms, + list > screen_kdms, bool zip, boost::filesystem::path output, dcp::NameFormat container_name_format, @@ -153,7 +153,7 @@ write_files ( cout << "Wrote " << N << " ZIP files to " << output << "\n"; } } else { - int const N = ScreenKDM::write_files ( + int const N = KDMWithMetadata::write_files ( screen_kdms, output, filename_format, values, bind (&always_overwrite) ); @@ -229,7 +229,7 @@ from_film ( values['e'] = dcp::LocalTime(valid_to).date() + " " + dcp::LocalTime(valid_to).time_of_day(true, false); try { - list > kdms; + list > kdms; BOOST_FOREACH (shared_ptr i, screens) { if (i->recipient) { @@ -244,7 +244,7 @@ from_film ( disable_forensic_marking_audio ); - kdms.push_back (shared_ptr(new DCPScreenKDM(i, kdm))); + kdms.push_back (shared_ptr(new DCPKDMWithMetadata(i, kdm))); } } @@ -345,15 +345,15 @@ from_dkdm ( values['e'] = dcp::LocalTime(valid_to).date() + " " + dcp::LocalTime(valid_to).time_of_day(true, false); try { - list > screen_kdms; + list > screen_kdms; BOOST_FOREACH (shared_ptr i, screens) { if (!i->recipient) { continue; } screen_kdms.push_back ( - shared_ptr( - new DCPScreenKDM( + shared_ptr( + new DCPKDMWithMetadata( i, kdm_from_dkdm( dkdm, diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc index 59d961e6c..06600ac7a 100644 --- a/src/wx/kdm_dialog.cc +++ b/src/wx/kdm_dialog.cc @@ -29,7 +29,7 @@ #include "dcpomatic_button.h" #include "lib/film.h" #include "lib/screen.h" -#include "lib/screen_kdm.h" +#include "lib/kdm_with_metadata.h" #include "lib/job_manager.h" #include "lib/cinema_kdms.h" #include "lib/config.h" @@ -150,7 +150,7 @@ KDMDialog::make_clicked () shared_ptr film = _film.lock (); DCPOMATIC_ASSERT (film); - list > screen_kdms; + list > screen_kdms; try { /* Start off by enabling forensic marking for all */ optional for_audio; @@ -175,7 +175,7 @@ KDMDialog::make_clicked () for_audio ); - screen_kdms.push_back (shared_ptr(new DCPScreenKDM(i, kdm))); + screen_kdms.push_back (shared_ptr(new DCPKDMWithMetadata(i, kdm))); } } diff --git a/src/wx/kdm_output_panel.cc b/src/wx/kdm_output_panel.cc index d76a27359..0320ed1b7 100644 --- a/src/wx/kdm_output_panel.cc +++ b/src/wx/kdm_output_panel.cc @@ -183,7 +183,7 @@ KDMOutputPanel::kdm_write_type_changed () pair, int> KDMOutputPanel::make ( - list > screen_kdms, string name, KDMTimingPanel* timing, function confirm_overwrite + list > screen_kdms, string name, KDMTimingPanel* timing, function confirm_overwrite ) { list const cinema_kdms = CinemaKDMs::collect (screen_kdms); @@ -247,7 +247,7 @@ KDMOutputPanel::make ( if (_write_to->GetValue()) { if (_write_flat->GetValue()) { - written = ScreenKDM::write_files ( + written = KDMWithMetadata::write_files ( screen_kdms, directory(), _filename_format->get(), diff --git a/src/wx/kdm_output_panel.h b/src/wx/kdm_output_panel.h index 7b9315071..730cb9360 100644 --- a/src/wx/kdm_output_panel.h +++ b/src/wx/kdm_output_panel.h @@ -18,7 +18,7 @@ */ -#include "lib/screen_kdm.h" +#include "lib/kdm_with_metadata.h" #include "wx_util.h" #include "name_format_editor.h" #include @@ -52,7 +52,7 @@ public: } std::pair, int> make ( - std::list > screen_kdms, + std::list > screen_kdms, std::string name, KDMTimingPanel* timing, boost::function confirm_overwrite -- 2.30.2