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.
24 #include "certificates.h"
28 #include <libxml++/libxml++.h>
29 #include <boost/shared_ptr.hpp>
30 #include <boost/function.hpp>
31 #include <boost/date_time/posix_time/posix_time.hpp>
32 #include <boost/optional.hpp>
33 #include <boost/filesystem.hpp>
46 * @brief A Composition Playlist.
48 class CPL : public Asset
51 CPL (std::string annotation_text, ContentKind content_kind);
52 CPL (boost::filesystem::path file);
56 EqualityOptions options,
57 boost::function<void (NoteType, std::string)> note
60 void add (boost::shared_ptr<Reel> reel);
61 void add (KDM const &);
63 /** @return contents of the <AnnotationText> node */
64 std::string annotation_text () const {
65 return _annotation_text;
68 /** @return contents of the <ContentTitleText> node */
69 std::string content_title_text () const {
70 return _content_title_text;
73 /** @return contents of the <Id> node within <ContentVersion> */
74 void set_content_version_id (std::string id) {
75 _content_version_id = id;
78 /** @return contents of the <LabelText> node within <ContentVersion> */
79 void set_content_version_label_text (std::string text) {
80 _content_version_label_text = text;
83 /** @return the type of the content, used by media servers
84 * to categorise things (e.g. feature, trailer, etc.)
86 ContentKind content_kind () const {
90 /** @return the reels in this CPL */
91 std::list<boost::shared_ptr<Reel> > reels () const {
95 /** @return the Content in this CPL across all its reels
96 * (Content is picture, sound and subtitles)
98 std::list<boost::shared_ptr<const Content> > content () const;
100 bool encrypted () const;
102 void set_mxf_keys (Key);
105 boost::filesystem::path file,
107 boost::shared_ptr<const Signer>
110 void resolve_refs (std::list<boost::shared_ptr<Object> >);
113 /** @return type string for PKLs for this asset */
114 std::string pkl_type () const {
119 std::string _annotation_text; ///< <AnnotationText>
120 /** <Issuer>, <Creator> and <IssueDate>. These are grouped
121 * because they occur together in a few places.
123 XMLMetadata _metadata;
124 std::string _content_title_text; ///< <ContentTitleText>
125 ContentKind _content_kind; ///< <ContentKind>
126 std::string _content_version_id; ///< <Id> in <ContentVersion>
127 std::string _content_version_label_text; ///< <LabelText> in <ContentVersion>
128 std::list<boost::shared_ptr<Reel> > _reels;