- enum ContentType
- {
- FEATURE,
- SHORT,
- TRAILER,
- TEST,
- TRANSITIONAL,
- RATING,
- TEASER,
- POLICY,
- PUBLIC_SERVICE_ANNOUNCEMENT,
- ADVERTISEMENT
- };
-
- DCP (std::string, std::string, ContentType, int, int);
-
- void add_sound_asset (std::list<std::string> const &);
- void add_picture_asset (std::list<std::string> const &, int, int);
-
- void write_xml () const;
-
- /** Emitted with a parameter between 0 and 1 to indicate progress
- * for long jobs.
+ /** Construct a DCP. You can pass an existing DCP's directory
+ * as the parameter; alternatively, directory will be created
+ * if it does not exist. Note that if you pass an existing DCP
+ * into this constructor it will not be read until you call ::read().
+ *
+ * @param directory Directory containing the DCP's files.
+ */
+ explicit DCP (boost::filesystem::path directory);
+
+ 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.
+ *
+ * Errors that are so serious that they prevent the method from working will result
+ * in an exception being thrown. For example, a missing ASSETMAP means that the DCP
+ * can't be read without a lot of guesswork, so this will throw.
+ *
+ * Errors that are not fatal will be added to notes, if it's non-null. For example,
+ * if the DCP contains a mixture of Interop and SMPTE elements this will result
+ * in a note being added to the vector.
+ *
+ * For more thorough checking of a DCP's contents, see dcp::verify().
+ *
+ * @param notes List of notes that will be added to if non-0.
+ * @param ignore_incorrect_picture_mxf_type true to try loading MXF files marked as monoscopic
+ * as stereoscopic if the monoscopic load fails; fixes problems some 3D DCPs that (I think)
+ * have an incorrect descriptor in their MXF.
+ */
+ void read (std::vector<VerificationNote>* notes = nullptr, bool ignore_incorrect_picture_mxf_type = false);
+
+ /** Compare this DCP with another, according to various options.
+ * @param other DCP to compare this one to.
+ * @param options Options to define what "equality" means.
+ * @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;
+
+ void add (std::shared_ptr<CPL> cpl);
+
+ std::vector<std::shared_ptr<CPL>> cpls () const;
+
+ /** @param ignore_unresolved true to silently ignore unresolved assets, otherwise
+ * an exception is thrown if they are found.
+ * @return All assets (including CPLs).