#include <list>
#include <boost/shared_ptr.hpp>
#include <boost/function.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+#include <libxml++/libxml++.h>
#include "types.h"
+#include "certificates.h"
namespace libdcp {
-class AssetMap;
+namespace parse {
+ class AssetMap;
+}
+
class Asset;
class Reel;
class XMLMetadata;
-
+class MXFMetadata;
+class Encryption;
+class KDM;
+
/** @brief A CPL within a DCP */
class CPL
{
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 directory, std::string file, boost::shared_ptr<const parse::AssetMap> asset_map, bool require_mxfs = true);
- void add_reel (boost::shared_ptr<const Reel> reel);
+ void add_reel (boost::shared_ptr<Reel> reel);
/** @return the length in frames */
int length () const {
return _content_kind;
}
- std::list<boost::shared_ptr<const Reel> > reels () const {
+ std::list<boost::shared_ptr<Reel> > reels () const {
return _reels;
}
}
std::list<boost::shared_ptr<const Asset> > assets () const;
+
+ bool encrypted () const;
+
+ std::string id () const {
+ return _id;
+ }
bool equals (CPL const & other, EqualityOptions options, boost::function<void (NoteType, std::string)> note) const;
- void write_xml (XMLMetadata const &) const;
- void write_to_assetmap (std::ostream& s) const;
- void write_to_pkl (std::ostream& s) const;
+ void write_xml (XMLMetadata const &, boost::shared_ptr<Encryption>) const;
+ void write_to_assetmap (xmlpp::Node *) const;
+ void write_to_pkl (xmlpp::Node *) const;
+
+ boost::shared_ptr<xmlpp::Document> make_kdm (
+ CertificateChain const &,
+ std::string const &,
+ boost::shared_ptr<const Certificate>,
+ boost::posix_time::ptime from,
+ boost::posix_time::ptime until,
+ MXFMetadata const &,
+ XMLMetadata const &
+ ) const;
+
+ void add_kdm (KDM const &);
private:
std::string _directory;
/** frames per second */
int _fps;
/** reels */
- std::list<boost::shared_ptr<const Reel> > _reels;
+ std::list<boost::shared_ptr<Reel> > _reels;
/** our UUID */
- std::string _uuid;
+ std::string _id;
/** a SHA1 digest of our XML */
mutable std::string _digest;
};