X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fkdm_with_metadata.h;h=fbeeffbc13403614ed5c1a7439975b5c16edefd9;hp=19af0356f80d39c8e584611deb70dcde8cfa6049;hb=9f125fddff88bf62d36381f9d3f09e5240b033d5;hpb=ca56871d4860b8ead384c410fe374c2fa993f88f diff --git a/src/lib/kdm_with_metadata.h b/src/lib/kdm_with_metadata.h index 19af0356f..fbeeffbc1 100644 --- a/src/lib/kdm_with_metadata.h +++ b/src/lib/kdm_with_metadata.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2019 Carl Hetherington + Copyright (C) 2013-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,94 +18,98 @@ */ + #ifndef DCPOMATIC_KDM_WITH_METADATA_H #define DCPOMATIC_KDM_WITH_METADATA_H -#ifdef DCPOMATIC_VARIANT_SWAROOP -#include "encrypted_ecinema_kdm.h" -#endif + #include #include -#include -namespace dcpomatic { - class Screen; -} -/** Simple class to collect a screen and an encrypted KDM */ +class Cinema; + + class KDMWithMetadata { public: - KDMWithMetadata (boost::shared_ptr s) - : screen (s) + KDMWithMetadata(dcp::NameFormat::Map const& name_values, void const* group, std::vector emails, dcp::EncryptedKDM kdm) + : _name_values (name_values) + , _group (group) + , _emails (emails) + , _kdm (kdm) {} - virtual ~KDMWithMetadata () {} + std::string kdm_as_xml () const { + return _kdm.as_xml (); + } + + void kdm_as_xml (boost::filesystem::path out) const { + return _kdm.as_xml (out); + } + + dcp::NameFormat::Map const& name_values () const { + return _name_values; + } - 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; + boost::optional get (char k) const; + + void const* group () const { + return _group; + } - boost::shared_ptr screen; + std::vector emails() const { + return _emails; + } + +private: + dcp::NameFormat::Map _name_values; + void const* _group; + std::vector _emails; + dcp::EncryptedKDM _kdm; }; -typedef boost::shared_ptr KDMWithMetadataPtr; +typedef std::shared_ptr KDMWithMetadataPtr; int write_files ( std::list screen_kdms, boost::filesystem::path directory, - dcp::NameFormat name_format, dcp::NameFormat::Map name_values, - boost::function confirm_overwrite + dcp::NameFormat name_format, std::function confirm_overwrite ); -class DCPKDMWithMetadata : public KDMWithMetadata -{ -public: - DCPKDMWithMetadata (boost::shared_ptr s, dcp::EncryptedKDM k) - : KDMWithMetadata (s) - , kdm (k) - {} +void make_zip_file (std::list kdms, boost::filesystem::path zip_file, dcp::NameFormat name_format); - std::string kdm_as_xml () const { - return kdm.as_xml (); - } - void kdm_as_xml (boost::filesystem::path out) const { - return kdm.as_xml (out); - } +std::list> collect (std::list kdms); - std::string kdm_id () const { - return kdm.cpl_id (); - } - dcp::EncryptedKDM kdm; -}; +int write_directories ( + std::list> kdms, + boost::filesystem::path directory, + dcp::NameFormat container_name_format, + dcp::NameFormat filename_format, + std::function confirm_overwrite + ); -#ifdef DCPOMATIC_VARIANT_SWAROOP -class ECinemaKDMWithMetadata : public KDMWithMetadata -{ -public: - ECinemaKDMWithMetadata (boost::shared_ptr s, EncryptedECinemaKDM k) - : KDMWithMetadata (s) - , kdm (k) - {} - std::string kdm_as_xml () const { - return kdm.as_xml (); - } +int write_zip_files ( + std::list> kdms, + boost::filesystem::path directory, + dcp::NameFormat container_name_format, + dcp::NameFormat filename_format, + std::function confirm_overwrite + ); - void kdm_as_xml (boost::filesystem::path out) const { - return kdm.as_xml (out); - } - std::string kdm_id () const { - return kdm.id (); - } +void send_emails ( + std::list> kdms, + dcp::NameFormat container_name_format, + dcp::NameFormat filename_format, + std::string cpl_name, + std::vector extra_addresses + ); - EncryptedECinemaKDM kdm; -}; #endif -#endif