2 Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
4 This program is free software; you -can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include "certificates.h"
32 #include <libxml++/libxml++.h>
33 #include <boost/shared_ptr.hpp>
34 #include <boost/function.hpp>
35 #include <boost/optional.hpp>
36 #include <boost/filesystem.hpp>
49 * @brief A Composition Playlist.
51 class CPL : public Asset
54 CPL (std::string annotation_text, ContentKind content_kind);
55 CPL (boost::filesystem::path file);
58 boost::shared_ptr<const Asset> other,
59 EqualityOptions options,
60 boost::function<void (NoteType, std::string)> note
63 void add (boost::shared_ptr<Reel> reel);
64 void add (DecryptedKDM const &);
66 /** @return contents of the <AnnotationText> node */
67 std::string annotation_text () const {
68 return _annotation_text;
71 /** @return contents of the <ContentTitleText> node */
72 std::string content_title_text () const {
73 return _content_title_text;
76 /** @return contents of the <Id> node within <ContentVersion> */
77 void set_content_version_id (std::string id) {
78 _content_version_id = id;
81 /** @return contents of the <LabelText> node within <ContentVersion> */
82 void set_content_version_label_text (std::string text) {
83 _content_version_label_text = text;
86 /** @return the type of the content, used by media servers
87 * to categorise things (e.g. feature, trailer, etc.)
89 ContentKind content_kind () const {
93 /** @return the reels in this CPL */
94 std::list<boost::shared_ptr<Reel> > reels () const {
98 /** @return the ReelAssets in this CPL in all reels.
100 std::list<boost::shared_ptr<const ReelAsset> > reel_assets () const;
102 bool encrypted () const;
104 void set_metadata (XMLMetadata m) {
109 boost::filesystem::path file,
111 boost::shared_ptr<const Signer>
114 void resolve_refs (std::list<boost::shared_ptr<Object> >);
117 /** @return type string for PKLs for this asset */
118 std::string pkl_type (Standard standard) const;
121 std::string _annotation_text; ///< <AnnotationText>
122 /** <Issuer>, <Creator> and <IssueDate>. These are grouped
123 * because they occur together in a few places.
125 XMLMetadata _metadata;
126 std::string _content_title_text; ///< <ContentTitleText>
127 ContentKind _content_kind; ///< <ContentKind>
128 std::string _content_version_id; ///< <Id> in <ContentVersion>
129 std::string _content_version_label_text; ///< <LabelText> in <ContentVersion>
130 std::list<boost::shared_ptr<Reel> > _reels;