X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdkdm_wrapper.h;h=d828ffac2536a4298563764ae58a4c390321aa03;hb=4b7185e4eda53534c4d71a1f31ba33ca3dd8dc8d;hp=b877722d91732eb103a42bee80e86b81ca11e44b;hpb=bfb8c684886592f325f85c490d9f0aafd7056734;p=dcpomatic.git diff --git a/src/lib/dkdm_wrapper.h b/src/lib/dkdm_wrapper.h index b877722d9..d828ffac2 100644 --- a/src/lib/dkdm_wrapper.h +++ b/src/lib/dkdm_wrapper.h @@ -18,26 +18,44 @@ */ +#ifdef DCPOMATIC_VARIANT_SWAROOP +#include "encrypted_ecinema_kdm.h" +#endif #include #include +#include namespace xmlpp { class Element; } -class DKDMBase +class DKDMGroup; + +class DKDMBase : public boost::enable_shared_from_this { public: + virtual ~DKDMBase () {} virtual std::string name () const = 0; virtual void as_xml (xmlpp::Element *) const = 0; static boost::shared_ptr read (cxml::ConstNodePtr node); + + boost::shared_ptr parent () const { + return _parent; + } + + void set_parent (boost::shared_ptr parent) { + _parent = parent; + } + +private: + boost::shared_ptr _parent; }; class DKDM : public DKDMBase { public: - DKDM (dcp::EncryptedKDM k) + explicit DKDM (dcp::EncryptedKDM k) : _dkdm (k) {} @@ -52,10 +70,30 @@ private: dcp::EncryptedKDM _dkdm; }; +#ifdef DCPOMATIC_VARIANT_SWAROOP +class ECinemaDKDM : public DKDMBase +{ +public: + explicit ECinemaDKDM (EncryptedECinemaKDM k) + : _dkdm (k) + {} + + std::string name () const; + void as_xml (xmlpp::Element *) const; + + EncryptedECinemaKDM dkdm () const { + return _dkdm; + } + +private: + EncryptedECinemaKDM _dkdm; +}; +#endif + class DKDMGroup : public DKDMBase { public: - DKDMGroup (std::string name) + explicit DKDMGroup (std::string name) : _name (name) {} @@ -69,7 +107,7 @@ public: return _children; } - void add (boost::shared_ptr child); + void add (boost::shared_ptr child, boost::shared_ptr previous = boost::shared_ptr ()); void remove (boost::shared_ptr child); private: