X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fdcp.h;h=21cc3aac822ab9165949066c3081327ecc379cfe;hb=dfc34502469e9c975bf78011b0efc365c11e9779;hp=dd357f4848c3fd89890f9f4f231657e474725661;hpb=a5a92e294e2c4fac704d488b7b6c164b9a6fee88;p=libdcp.git diff --git a/src/dcp.h b/src/dcp.h index dd357f48..21cc3aac 100644 --- a/src/dcp.h +++ b/src/dcp.h @@ -41,12 +41,12 @@ #define LIBDCP_DCP_H -#include "compose.hpp" -#include "types.h" -#include "util.h" +#include "asset_map.h" #include "certificate.h" +#include "compose.hpp" #include "metadata.h" #include "name_format.h" +#include "util.h" #include "verify.h" #include "version.h" #include @@ -66,14 +66,15 @@ namespace dcp { -class PKL; -class Content; -class Reel; +class Asset; class CPL; class CertificateChain; +class Content; class DecryptedKDM; -class Asset; +class EqualityOptions; +class PKL; class ReadError; +class Reel; /** @class DCP @@ -94,6 +95,9 @@ public: DCP (DCP const&) = delete; DCP& operator= (DCP const&) = delete; + DCP (DCP &&); + DCP& operator= (DCP &&); + /** Read a DCP. This method does not do any deep checking of the DCP's validity, but * if it comes across any bad things it will do one of two things. * @@ -120,7 +124,7 @@ public: * @param note Functor to handle notes made by the equality operation. * @return true if the DCPs are equal according to EqualityOptions, otherwise false. */ - bool equals (DCP const & other, EqualityOptions options, NoteHandler note) const; + bool equals(DCP const & other, EqualityOptions const& options, NoteHandler note) const; void add (std::shared_ptr cpl); @@ -141,21 +145,19 @@ public: */ void add (DecryptedKDM const &); - /** Write all the XML files for this DCP - * @param standand INTEROP or SMPTE - * @param issuer Value for the PKL and AssetMap tags - * @param creator Value for the PKL and AssetMap tags - * @param issue_date Value for the PKL and AssetMap tags - * @param annotation_text Value for the PKL and AssetMap tags + void set_issuer(std::string issuer); + void set_creator(std::string creator); + void set_issue_date(std::string issue_date); + void set_annotation_text(std::string annotation_text); + + /** Write all the XML files for this DCP. * @param signer Signer to use + * @param include_mca_subdescriptors true to write MCA subdescriptors to CPLs. * @param name_format Name format to use for the CPL and PKL filenames */ - void write_xml ( - std::string issuer = String::compose("libdcp %1", dcp::version), - std::string creator = String::compose("libdcp %1", dcp::version), - std::string issue_date = LocalTime().as_string(), - std::string annotation_text = String::compose("Created by libdcp %1", dcp::version), + void write_xml( std::shared_ptr signer = std::shared_ptr(), + bool include_mca_subdescriptors = true, NameFormat name_format = NameFormat("%t") ); @@ -163,7 +165,11 @@ public: /** @return Standard of a DCP that was read in */ boost::optional standard () const { - return _standard; + if (!_asset_map) { + return {}; + } + + return _asset_map->standard(); } boost::filesystem::path directory () const { @@ -177,7 +183,15 @@ public: return _pkls; } - boost::optional asset_map_path () { + boost::optional asset_map_file() const { + if (!_asset_map) { + return {}; + } + + return _asset_map->file(); + } + + boost::optional asset_map() const { return _asset_map; } @@ -187,26 +201,19 @@ private: void write_volindex (Standard standard) const; - /** Write the ASSETMAP file. - * @param pkl_uuid UUID of our PKL. - * @param pkl_path Pathname of our PKL file. - */ - void write_assetmap ( - Standard standard, std::string pkl_uuid, boost::filesystem::path pkl_path, - std::string issuer, std::string creator, std::string issue_date, std::string annotation_text - ) const; - /** The directory that we are writing to */ boost::filesystem::path _directory; /** The CPLs that make up this DCP */ std::vector> _cpls; /** The PKLs that make up this DCP */ std::vector> _pkls; - /** File that the ASSETMAP was read from or last written to */ - mutable boost::optional _asset_map; + boost::optional _asset_map; - /** Standard of DCP that was read in */ - boost::optional _standard; + /* Metadata to use for newly created PKLs and AssetMaps */ + boost::optional _new_issuer; + boost::optional _new_creator; + boost::optional _new_issue_date; + boost::optional _new_annotation_text; };