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"
27 #include <libxml++/libxml++.h>
28 #include <boost/shared_ptr.hpp>
29 #include <boost/function.hpp>
30 #include <boost/date_time/posix_time/posix_time.hpp>
31 #include <boost/optional.hpp>
32 #include <boost/filesystem.hpp>
45 * @brief A Composition Playlist.
47 class CPL : public Asset
50 CPL (std::string annotation_text, ContentKind content_kind);
51 CPL (boost::filesystem::path file);
53 std::string pkl_type () const {
57 void add (boost::shared_ptr<Reel> reel);
59 std::string annotation_text () const {
60 return _annotation_text;
63 std::string content_title_text () const {
64 return _content_title_text;
67 /** @return the type of the content, used by media servers
68 * to categorise things (e.g. feature, trailer, etc.)
70 ContentKind content_kind () const {
74 std::list<boost::shared_ptr<Reel> > reels () const {
78 std::list<boost::shared_ptr<const Content> > assets () const;
80 bool encrypted () const;
82 void set_mxf_keys (Key);
84 bool equals (CPL const & other, EqualityOptions options, boost::function<void (NoteType, std::string)> note) const;
86 void write_xml (boost::filesystem::path file, Standard standard, XMLMetadata, boost::shared_ptr<const Signer>) const;
87 void write_to_assetmap (xmlpp::Node *) const;
89 void add (KDM const &);
93 std::string _annotation_text;
94 std::string _issue_date;
96 std::string _content_title_text;
97 ContentKind _content_kind;
98 std::string _content_version_id;
99 std::string _content_version_label_text;
101 std::list<boost::shared_ptr<Reel> > _reels;
103 /** a SHA1 digest of our XML */
104 mutable std::string _digest;
105 /** length in bytes of the XML that we last wrote to disk */
106 mutable int64_t _length;