X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fcpl.h;h=83fc4b9d552c63f528ebb6814492b29a2e586567;hb=59886567974bd3e79d30a4a9425d86d50bf425f3;hp=91756d3a81abf573b75795a8f1c172f41aed2ded;hpb=452144160eb864984121d3fa883a12d40fbf7e47;p=libdcp.git diff --git a/src/cpl.h b/src/cpl.h index 91756d3a..83fc4b9d 100644 --- a/src/cpl.h +++ b/src/cpl.h @@ -29,35 +29,41 @@ #include #include "types.h" #include "certificates.h" +#include "key.h" +#include "asset.h" -namespace libdcp { - -namespace parse { - class AssetMap; - class AssetMapAsset; -} +namespace dcp { -class Asset; +class Content; class Reel; class XMLMetadata; class MXFMetadata; class Signer; class KDM; -/** @brief A CPL within a DCP */ -class CPL +/** @class CPL + * @brief A Composition Playlist. + */ +class CPL : public Asset { public: - CPL (std::string directory, std::string name, ContentKind content_kind, int length, int frames_per_second); - CPL (std::string directory, std::string file, std::list asset_maps, bool require_mxfs = true); + CPL (std::string annotation_text, ContentKind content_kind); + CPL (boost::filesystem::path file); - void add_reel (boost::shared_ptr reel); - - /** @return the length in frames */ - int length () const { - return _length; + std::string pkl_type () const { + return "text/xml"; } + void add (boost::shared_ptr reel); + + std::string annotation_text () const { + return _annotation_text; + } + + std::string content_title_text () const { + return _content_title_text; + } + /** @return the type of the content, used by media servers * to categorise things (e.g. feature, trailer, etc.) */ @@ -69,71 +75,35 @@ public: return _reels; } - /** @return the CPL's name, as will be presented on projector - * media servers and theatre management systems. - */ - std::string name () const { - return _name; - } - - /** @return the number of frames per second */ - int frames_per_second () const { - return _fps; - } - - std::list > assets () const; + std::list > assets () const; bool encrypted () const; - std::string id () const { - return _id; - } - + void set_mxf_keys (Key); + bool equals (CPL const & other, EqualityOptions options, boost::function note) const; - void write_xml (bool, XMLMetadata const &, boost::shared_ptr) const; + void write_xml (boost::filesystem::path file, Standard standard, XMLMetadata, boost::shared_ptr) const; void write_to_assetmap (xmlpp::Node *) const; - void write_to_pkl (xmlpp::Node *) const; - - /** Make a KDM for this CPL. - * @param signer Details of the certificates and private key to sign the KDM with. - * @param recipient_cert The certificate of the projector that this KDM is targeted at. This will contain the - * projector's public key which is used to encrypt the content keys. - * @param from Time that the KDM should be valid from. - * @param until Time that the KDM should be valid until. - * @param interop true to generate an interop KDM, false for SMPTE. - */ - boost::shared_ptr make_kdm ( - boost::shared_ptr signer, - boost::shared_ptr recipient_cert, - boost::posix_time::ptime from, - boost::posix_time::ptime until, - bool interop, - MXFMetadata const &, - XMLMetadata const & - ) const; - - void add_kdm (KDM const &); + + void add (KDM const &); private: - std::pair > asset_from_id (std::list, std::string id) const; - std::string _directory; - /** the name of the DCP */ - std::string _name; - /** the content kind of the CPL */ + std::string _annotation_text; + std::string _issue_date; + std::string _creator; + std::string _content_title_text; ContentKind _content_kind; - /** length in frames */ - mutable int _length; - /** frames per second */ - int _fps; + std::string _content_version_id; + std::string _content_version_label_text; /** reels */ std::list > _reels; - /** our UUID */ - std::string _id; /** a SHA1 digest of our XML */ mutable std::string _digest; + /** length in bytes of the XML that we last wrote to disk */ + mutable int64_t _length; }; }