X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fdcp.h;h=b47daf556af6b28d527d739493f1c7aa268be55b;hb=d1f2e0128c6f5daa01770b0989c66285f1284985;hp=cc87d0d14a31bc7a8d7996630e60d134bfa8720f;hpb=8ef91325f4e565d04493bc05202f8e066b5e3e0c;p=libdcp.git diff --git a/src/dcp.h b/src/dcp.h index cc87d0d1..b47daf55 100644 --- a/src/dcp.h +++ b/src/dcp.h @@ -39,9 +39,10 @@ #define LIBDCP_DCP_H #include "types.h" +#include "util.h" #include "certificate.h" #include "metadata.h" -#include "filename_format.h" +#include "name_format.h" #include #include #include @@ -56,6 +57,7 @@ namespace xmlpp { namespace dcp { +class PKL; class Content; class Reel; class CPL; @@ -103,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; @@ -113,7 +115,7 @@ public: Standard standard, XMLMetadata metadata = XMLMetadata (), boost::shared_ptr signer = boost::shared_ptr (), - FilenameFormat filename_format = FilenameFormat("%t_%i") + NameFormat name_format = NameFormat("%t") ); void resolve_refs (std::list > assets); @@ -123,31 +125,34 @@ public: return _standard; } -private: + boost::filesystem::path directory () const { + return _directory; + } - /** Write the PKL file. - * @param pkl_uuid UUID to use. + /** @return PKLs 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 an empty list. */ - boost::filesystem::path write_pkl ( - std::string file, - Standard standard, - std::string pkl_uuid, - XMLMetadata metadata, - boost::shared_ptr signer - ) const; + std::list > pkls () const { + return _pkls; + } + + 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; + std::list > _pkls; /** Standard of DCP that was read in */ boost::optional _standard;