/** @file src/cpl.h
- * @brief CPL class.
+ * @brief CPL class
*/
#include <vector>
-struct verify_various_invalid_languages;
+struct verify_invalid_language3;
namespace dcp {
-class ReelMXF;
+class ReelFileAsset;
class Reel;
class MXFMetadata;
class CertificateChain;
/** @class CPL
- * @brief A Composition Playlist.
+ * @brief A Composition Playlist
*/
class CPL : public Asset
{
public:
- CPL (std::string annotation_text, ContentKind content_kind);
+ CPL (std::string annotation_text, ContentKind content_kind, Standard standard);
+
+ /** Construct a CPL object from a XML file */
explicit CPL (boost::filesystem::path file);
bool equals (
std::shared_ptr<const Asset> other,
EqualityOptions options,
NoteHandler note
- ) const;
+ ) const override;
+ /** Add a reel to this CPL
+ * @param reel Reel to add
+ */
void add (std::shared_ptr<Reel> reel);
+
+ /** Add a KDM to this CPL. If the KDM is for any of this CPLs assets it will be used
+ * to decrypt those assets.
+ * @param kdm KDM.
+ */
void add (DecryptedKDM const &);
/** @return the reels in this CPL */
return _reels;
}
- /** @return the ReelMXFs in this CPL in all reels */
- std::vector<std::shared_ptr<const ReelMXF>> reel_mxfs () const;
- std::vector<std::shared_ptr<ReelMXF>> reel_mxfs ();
+ /** @return the ReelFileAssets in this CPL in all reels */
+ std::vector<std::shared_ptr<const ReelFileAsset>> reel_file_assets () const;
+ std::vector<std::shared_ptr<ReelFileAsset>> reel_file_assets ();
+
+ /** @return true if we have any encrypted content */
+ bool any_encrypted () const;
- bool encrypted () const;
+ /** @return true if we have all our encryptable content is encrypted */
+ bool all_encrypted () const;
+ /** Write an CompositonPlaylist XML file
+ *
+ * @param file Filename to write
+ * @param signer Signer to sign the CPL, or 0 to add no signature
+ */
void write_xml (
boost::filesystem::path file,
- Standard standard,
std::shared_ptr<const CertificateChain>
) const;
_content_title_text = ct;
}
+ void set_content_kind (dcp::ContentKind k) {
+ _content_kind = k;
+ }
+
/** @return the type of the content, used by media servers
* to categorise things (e.g. feature, trailer, etc.)
*/
_release_territory = t.subtag();
}
+ boost::optional<std::string> release_territory_scope () const {
+ return _release_territory_scope;
+ }
+
boost::optional<int> version_number () const {
return _version_number;
}
void set_version_number (int v);
+ void unset_version_number ();
+
boost::optional<Status> status () const {
return _status;
}
void set_additional_subtitle_languages (std::vector<dcp::LanguageTag> const& lang);
- boost::optional<Standard> standard () const {
+ Standard standard () const {
return _standard;
}
protected:
/** @return type string for PKLs for this asset */
- std::string pkl_type (Standard standard) const;
+ std::string pkl_type (Standard standard) const override;
private:
- friend struct ::verify_various_invalid_languages;
+ friend struct ::verify_invalid_language3;
void maybe_write_composition_metadata_asset (xmlpp::Element* node) const;
void read_composition_metadata_asset (cxml::ConstNodePtr node);
ContentKind _content_kind; ///< <ContentKind>
std::vector<ContentVersion> _content_versions;
std::vector<Rating> _ratings;
+ /** ID for CompositionMetadataAsset tag; either a random one, ready for writing a new tag,
+ * or the one read in from the existing CPL.
+ */
+ std::string _cpl_metadata_id = make_uuid();
/** Human-readable name of the composition, without any metadata (i.e. no -FTR-EN-XX- etc.) */
boost::optional<std::string> _full_content_title_text;
boost::optional<std::string> _full_content_title_text_language;
* but must be set as a dcp::LanguageTag to try to ensure that we create compliant output.
*/
boost::optional<std::string> _release_territory;
+ boost::optional<std::string> _release_territory_scope;
boost::optional<int> _version_number;
boost::optional<Status> _status;
boost::optional<std::string> _chain;
std::vector<std::shared_ptr<Reel>> _reels;
/** Standard of CPL that was read in */
- boost::optional<Standard> _standard;
+ Standard _standard;
};