2 Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
4 This file is part of libdcp.
6 libdcp is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 libdcp is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with libdcp. If not, see <http://www.gnu.org/licenses/>.
28 #include "certificate.h"
32 #include <boost/shared_ptr.hpp>
33 #include <boost/function.hpp>
34 #include <boost/optional.hpp>
35 #include <boost/filesystem.hpp>
44 class CertificateChain;
48 * @brief A Composition Playlist.
50 class CPL : public Asset
53 CPL (std::string annotation_text, ContentKind content_kind);
54 explicit CPL (boost::filesystem::path file);
57 boost::shared_ptr<const Asset> other,
58 EqualityOptions options,
62 void add (boost::shared_ptr<Reel> reel);
63 void add (DecryptedKDM const &);
65 /** @return contents of the <AnnotationText> node */
66 std::string annotation_text () const {
67 return _annotation_text;
70 /** @return contents of the <ContentTitleText> node */
71 std::string content_title_text () const {
72 return _content_title_text;
75 /** @return contents of the <Id> node within <ContentVersion> */
76 void set_content_version_id (std::string id) {
77 _content_version_id = id;
80 /** @return contents of the <LabelText> node within <ContentVersion> */
81 void set_content_version_label_text (std::string text) {
82 _content_version_label_text = text;
85 /** @return the type of the content, used by media servers
86 * to categorise things (e.g. feature, trailer, etc.)
88 ContentKind content_kind () const {
92 /** @return the reels in this CPL */
93 std::list<boost::shared_ptr<Reel> > reels () const {
97 /** @return the ReelAssets in this CPL in all reels.
99 std::list<boost::shared_ptr<const ReelAsset> > reel_assets () const;
101 bool encrypted () const;
103 void set_metadata (XMLMetadata m) {
108 boost::filesystem::path file,
110 boost::shared_ptr<const CertificateChain>
113 void resolve_refs (std::list<boost::shared_ptr<Asset> >);
115 int64_t duration () const;
117 boost::optional<Standard> standard () const {
122 /** @return type string for PKLs for this asset */
123 std::string pkl_type (Standard standard) const;
126 std::string _annotation_text; ///< <AnnotationText>
127 /** <Issuer>, <Creator> and <IssueDate>. These are grouped
128 * because they occur together in a few places.
130 XMLMetadata _metadata;
131 std::string _content_title_text; ///< <ContentTitleText>
132 ContentKind _content_kind; ///< <ContentKind>
133 std::string _content_version_id; ///< <Id> in <ContentVersion>
134 std::string _content_version_label_text; ///< <LabelText> in <ContentVersion>
135 std::list<boost::shared_ptr<Reel> > _reels;
137 /** Standard of CPL that was read in */
138 boost::optional<Standard> _standard;