diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-05-04 23:30:23 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-05-06 20:15:16 +0200 |
| commit | 4e62980064496060af5a8c6ecab26ddf218aa63a (patch) | |
| tree | f3cc59c341866280e7998e7599039054a880d6b0 /src/lib/kdm_with_metadata.h | |
| parent | ca56871d4860b8ead384c410fe374c2fa993f88f (diff) | |
Remove Screen pointer from KDMWithMetadata, preferring to
add metadata to a dcp::NameFormat::Map earlier in the
call stack.
Diffstat (limited to 'src/lib/kdm_with_metadata.h')
| -rw-r--r-- | src/lib/kdm_with_metadata.h | 32 |
1 files changed, 21 insertions, 11 deletions
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 <dcp/name_format.h> #include <boost/shared_ptr.hpp> -namespace dcpomatic { - class Screen; -} +class Cinema; -/** Simple class to collect a screen and an encrypted KDM */ class KDMWithMetadata { public: - KDMWithMetadata (boost::shared_ptr<dcpomatic::Screen> s) - : screen (s) + KDMWithMetadata (dcp::NameFormat::Map const& name_values, boost::shared_ptr<Cinema> 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<dcpomatic::Screen> screen; + dcp::NameFormat::Map const& name_values () const { + return _name_values; + } + + boost::optional<std::string> get (char k) const; + + boost::shared_ptr<Cinema> cinema () const { + return _cinema; + } + +private: + dcp::NameFormat::Map _name_values; + boost::shared_ptr<Cinema> _cinema; }; @@ -63,8 +73,8 @@ int write_files ( class DCPKDMWithMetadata : public KDMWithMetadata { public: - DCPKDMWithMetadata (boost::shared_ptr<dcpomatic::Screen> s, dcp::EncryptedKDM k) - : KDMWithMetadata (s) + DCPKDMWithMetadata (dcp::NameFormat::Map const& name_values, boost::shared_ptr<Cinema> cinema, dcp::EncryptedKDM k) + : KDMWithMetadata (name_values, cinema) , kdm (k) {} @@ -87,8 +97,8 @@ public: class ECinemaKDMWithMetadata : public KDMWithMetadata { public: - ECinemaKDMWithMetadata (boost::shared_ptr<dcpomatic::Screen> s, EncryptedECinemaKDM k) - : KDMWithMetadata (s) + ECinemaKDMWithMetadata (dcp::NameValues::Map const& name_values, boost::shared_ptr<Cinema> cinema, EncryptedECinemaKDM k) + : KDMWithMetadata (name_values, cinema) , kdm (k) {} |
