X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fscreen_kdm.h;h=a1e36245cc7e5ccf46fb3337c899932c6fad7a5e;hb=7c730205e50014347bd96ab9735346d0b5922798;hp=227526449a3b18abe8ec4a5b6a7a715535677e40;hpb=f4964573a60155545e02cbbebc47199f7480cf14;p=dcpomatic.git diff --git a/src/lib/screen_kdm.h b/src/lib/screen_kdm.h index 227526449..a1e36245c 100644 --- a/src/lib/screen_kdm.h +++ b/src/lib/screen_kdm.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2016 Carl Hetherington + Copyright (C) 2013-2019 Carl Hetherington This file is part of DCP-o-matic. @@ -21,30 +21,86 @@ #ifndef DCPOMATIC_SCREEN_KDM_H #define DCPOMATIC_SCREEN_KDM_H -#include "kdm_filename_format.h" +#ifdef DCPOMATIC_VARIANT_SWAROOP +#include "encrypted_ecinema_kdm.h" +#endif #include +#include #include -class Screen; +namespace dcpomatic { + class Screen; +} /** Simple class to collect a screen and an encrypted KDM */ class ScreenKDM { public: - ScreenKDM (boost::shared_ptr s, dcp::EncryptedKDM k) + ScreenKDM (boost::shared_ptr s) : screen (s) - , kdm (k) {} - static void write_files ( - std::list screen_kdms, boost::filesystem::path directory, - KDMFilenameFormat name_format, dcp::NameFormat::Map name_values + virtual ~ScreenKDM () {} + + 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, + dcp::NameFormat name_format, dcp::NameFormat::Map name_values, + boost::function confirm_overwrite ); - boost::shared_ptr screen; + boost::shared_ptr screen; +}; + +class DCPScreenKDM : public ScreenKDM +{ +public: + DCPScreenKDM (boost::shared_ptr s, dcp::EncryptedKDM k) + : ScreenKDM (s) + , kdm (k) + {} + + 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::string kdm_id () const { + return kdm.cpl_id (); + } + dcp::EncryptedKDM kdm; }; -extern bool operator== (ScreenKDM const & a, ScreenKDM const & b); +#ifdef DCPOMATIC_VARIANT_SWAROOP +class ECinemaScreenKDM : public ScreenKDM +{ +public: + ECinemaScreenKDM (boost::shared_ptr s, EncryptedECinemaKDM k) + : ScreenKDM (s) + , kdm (k) + {} + + 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::string kdm_id () const { + return kdm.id (); + } + + EncryptedECinemaKDM kdm; +}; +#endif #endif