Pass MainSoundConfiguration object rather than a string.
[libdcp.git] / src / dcp.h
index 48c36e7ae79464142cd2e69a193fb2a7f03b169e..bf9b3aaf03da832ec938d8497ce80e4048a1a582 100644 (file)
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -95,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.
         *
@@ -142,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 <Issuer> tags
-        *  @param creator Value for the PKL and AssetMap <Creator> tags
-        *  @param issue_date Value for the PKL and AssetMap <IssueDate> tags
-        *  @param annotation_text Value for the PKL and AssetMap <AnnotationText> 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<const CertificateChain> signer = std::shared_ptr<const CertificateChain>(),
+               bool include_mca_subdescriptors = true,
                NameFormat name_format = NameFormat("%t")
        );
 
@@ -182,12 +183,16 @@ public:
                return _pkls;
        }
 
-       boost::optional<boost::filesystem::path> asset_map_path() {
+       boost::optional<boost::filesystem::path> asset_map_file() const {
                if (!_asset_map) {
                        return {};
                }
 
-               return _asset_map->path();
+               return _asset_map->file();
+       }
+
+       boost::optional<AssetMap> asset_map() const {
+               return _asset_map;
        }
 
        static std::vector<boost::filesystem::path> directories_from_files (std::vector<boost::filesystem::path> files);
@@ -203,6 +208,12 @@ private:
        /** The PKLs that make up this DCP */
        std::vector<std::shared_ptr<PKL>> _pkls;
        boost::optional<AssetMap> _asset_map;
+
+       /* Metadata to use for newly created PKLs and AssetMaps */
+       boost::optional<std::string> _new_issuer;
+       boost::optional<std::string> _new_creator;
+       boost::optional<std::string> _new_issue_date;
+       boost::optional<std::string> _new_annotation_text;
 };