It builds again.
[libdcp.git] / src / cpl.h
index 3be108946541d51a21fc05a2db33e240d92e705f..83fc4b9d552c63f528ebb6814492b29a2e586567 100644 (file)
--- a/src/cpl.h
+++ b/src/cpl.h
 
 */
 
+#ifndef LIBDCP_CPL_H
+#define LIBDCP_CPL_H
+
 #include <list>
 #include <boost/shared_ptr.hpp>
 #include <boost/function.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+#include <boost/optional.hpp>
+#include <boost/filesystem.hpp>
+#include <libxml++/libxml++.h>
 #include "types.h"
+#include "certificates.h"
+#include "key.h"
+#include "asset.h"
 
-namespace libdcp {
-
-class AssetMap;
-class Asset;
+namespace dcp {
+       
+class Content;
 class Reel;
-
-/** @brief A CPL within a DCP */
-class CPL
+class XMLMetadata;
+class MXFMetadata;
+class Signer;
+class KDM;
+       
+/** @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, boost::shared_ptr<const AssetMap> asset_map, bool require_mxfs = true);
+       CPL (std::string annotation_text, ContentKind content_kind);
+       CPL (boost::filesystem::path file);
 
-       void add_reel (boost::shared_ptr<const Reel> 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> 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.)
         */
@@ -49,47 +71,41 @@ public:
                return _content_kind;
        }
 
-       std::list<boost::shared_ptr<const Reel> > reels () const {
+       std::list<boost::shared_ptr<Reel> > reels () const {
                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;
-       }
+       std::list<boost::shared_ptr<const Content> > assets () const;
 
-       /** @return the number of frames per second */
-       int frames_per_second () const {
-               return _fps;
-       }
+       bool encrypted () const;
+
+       void set_mxf_keys (Key);
 
-       std::list<boost::shared_ptr<const Asset> > assets () const;
-       
        bool equals (CPL const & other, EqualityOptions options, boost::function<void (NoteType, std::string)> note) const;
        
-       void write_xml () const;
-       void write_to_assetmap (std::ostream& s) const;
-       void write_to_pkl (std::ostream& s) const;
+       void write_xml (boost::filesystem::path file, Standard standard, XMLMetadata, boost::shared_ptr<const Signer>) const;
+       void write_to_assetmap (xmlpp::Node *) const;
+
+       void add (KDM const &);
        
 private:
-       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<boost::shared_ptr<const Reel> > _reels;
+       std::list<boost::shared_ptr<Reel> > _reels;
 
-       /** our UUID */
-       std::string _uuid;
        /** 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;
 };
 
 }
+
+#endif