X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fdcp.h;h=9c97e6aa2bcafd6f15898efd7f12fe7e9a9d8360;hb=f380b960018e5b81b6a10834822fa962bfab2c7b;hp=7c318622ae2a30478284334618f7b15de951561a;hpb=d927e9b913606f4fc982885c7582ecaf0e3c5a1a;p=libdcp.git diff --git a/src/dcp.h b/src/dcp.h index 7c318622..9c97e6aa 100644 --- a/src/dcp.h +++ b/src/dcp.h @@ -39,8 +39,10 @@ #define LIBDCP_DCP_H #include "types.h" +#include "util.h" #include "certificate.h" #include "metadata.h" +#include "name_format.h" #include #include #include @@ -55,6 +57,7 @@ namespace xmlpp { namespace dcp { +class PKL; class Content; class Reel; class CPL; @@ -102,7 +105,7 @@ public: void add (boost::shared_ptr cpl); std::list > cpls () const; - std::list > assets () const; + std::list > assets (bool ignore_unresolved = false) const; bool encrypted () const; @@ -111,7 +114,8 @@ public: void write_xml ( Standard standard, XMLMetadata metadata = XMLMetadata (), - boost::shared_ptr signer = boost::shared_ptr () + boost::shared_ptr signer = boost::shared_ptr (), + NameFormat name_format = NameFormat("%t") ); void resolve_refs (std::list > assets); @@ -121,30 +125,34 @@ public: return _standard; } -private: + boost::filesystem::path directory () const { + return _directory; + } - /** Write the PKL file. - * @param pkl_uuid UUID to use. + /** @return PKL if this DCP was read from an existing one, or if write_xml() has been called on it. + * If neither is true, this method returns 0. */ - boost::filesystem::path write_pkl ( - Standard standard, - std::string pkl_uuid, - XMLMetadata metadata, - boost::shared_ptr signer - ) const; + boost::shared_ptr pkl () const { + return _pkl; + } + + static std::vector directories_from_files (std::vector files); + +private: void write_volindex (Standard standard) const; /** Write the ASSETMAP file. * @param pkl_uuid UUID of our PKL. - * @param pkl_length Length of our PKL in bytes. + * @param pkl_path Pathname of our PKL file. */ - void write_assetmap (Standard standard, std::string pkl_uuid, int pkl_length, XMLMetadata metadata) const; + void write_assetmap (Standard standard, std::string pkl_uuid, boost::filesystem::path pkl_path, XMLMetadata metadata) const; /** the directory that we are writing to */ boost::filesystem::path _directory; /** the CPLs that make up this DCP */ std::list > _cpls; + boost::shared_ptr _pkl; /** Standard of DCP that was read in */ boost::optional _standard;