From 4e62980064496060af5a8c6ecab26ddf218aa63a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 4 May 2020 23:30:23 +0200 Subject: Remove Screen pointer from KDMWithMetadata, preferring to add metadata to a dcp::NameFormat::Map earlier in the call stack. --- src/lib/kdm_with_metadata.h | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'src/lib/kdm_with_metadata.h') diff --git a/src/lib/kdm_with_metadata.h b/src/lib/kdm_with_metadata.h index 19af0356f..ee84d9eb4 100644 --- a/src/lib/kdm_with_metadata.h +++ b/src/lib/kdm_with_metadata.h @@ -28,16 +28,14 @@ #include #include -namespace dcpomatic { - class Screen; -} +class Cinema; -/** Simple class to collect a screen and an encrypted KDM */ class KDMWithMetadata { public: - KDMWithMetadata (boost::shared_ptr s) - : screen (s) + KDMWithMetadata (dcp::NameFormat::Map const& name_values, boost::shared_ptr cinema) + : _name_values (name_values) + , _cinema (cinema) {} virtual ~KDMWithMetadata () {} @@ -46,7 +44,19 @@ public: virtual void kdm_as_xml (boost::filesystem::path out) const = 0; virtual std::string kdm_id () const = 0; - boost::shared_ptr screen; + dcp::NameFormat::Map const& name_values () const { + return _name_values; + } + + boost::optional get (char k) const; + + boost::shared_ptr cinema () const { + return _cinema; + } + +private: + dcp::NameFormat::Map _name_values; + boost::shared_ptr _cinema; }; @@ -63,8 +73,8 @@ int write_files ( class DCPKDMWithMetadata : public KDMWithMetadata { public: - DCPKDMWithMetadata (boost::shared_ptr s, dcp::EncryptedKDM k) - : KDMWithMetadata (s) + DCPKDMWithMetadata (dcp::NameFormat::Map const& name_values, boost::shared_ptr cinema, dcp::EncryptedKDM k) + : KDMWithMetadata (name_values, cinema) , kdm (k) {} @@ -87,8 +97,8 @@ public: class ECinemaKDMWithMetadata : public KDMWithMetadata { public: - ECinemaKDMWithMetadata (boost::shared_ptr s, EncryptedECinemaKDM k) - : KDMWithMetadata (s) + ECinemaKDMWithMetadata (dcp::NameValues::Map const& name_values, boost::shared_ptr cinema, EncryptedECinemaKDM k) + : KDMWithMetadata (name_values, cinema) , kdm (k) {} -- cgit v1.2.3