2 Copyright (C) 2012 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 <boost/shared_ptr.hpp>
25 #include <boost/function.hpp>
26 #include <boost/date_time/posix_time/posix_time.hpp>
27 #include <libxml++/libxml++.h>
29 #include "certificates.h"
45 /** @brief A CPL within a DCP */
49 CPL (std::string directory, std::string name, ContentKind content_kind, int length, int frames_per_second);
50 CPL (std::string directory, std::string file, std::list<boost::shared_ptr<const parse::AssetMap> > asset_maps, bool require_mxfs = true);
52 void add_reel (boost::shared_ptr<Reel> reel);
54 /** @return the length in frames */
59 /** @return the type of the content, used by media servers
60 * to categorise things (e.g. feature, trailer, etc.)
62 ContentKind content_kind () const {
66 std::list<boost::shared_ptr<Reel> > reels () const {
70 /** @return the CPL's name, as will be presented on projector
71 * media servers and theatre management systems.
73 std::string name () const {
77 /** @return the number of frames per second */
78 int frames_per_second () const {
82 std::list<boost::shared_ptr<const Asset> > assets () const;
84 bool encrypted () const;
86 std::string id () const {
90 bool equals (CPL const & other, EqualityOptions options, boost::function<void (NoteType, std::string)> note) const;
92 void write_xml (bool, XMLMetadata const &, boost::shared_ptr<Encryption>) const;
93 void write_to_assetmap (xmlpp::Node *) const;
94 void write_to_pkl (xmlpp::Node *) const;
96 boost::shared_ptr<xmlpp::Document> make_kdm (
97 CertificateChain const &,
99 boost::shared_ptr<const Certificate>,
100 boost::posix_time::ptime from,
101 boost::posix_time::ptime until,
107 void add_kdm (KDM const &);
110 boost::shared_ptr<parse::AssetMapAsset> asset_from_id (std::list<boost::shared_ptr<const parse::AssetMap> > asset_maps, std::string id) const;
112 std::string _directory;
113 /** the name of the DCP */
115 /** the content kind of the CPL */
116 ContentKind _content_kind;
117 /** length in frames */
119 /** frames per second */
122 std::list<boost::shared_ptr<Reel> > _reels;
126 /** a SHA1 digest of our XML */
127 mutable std::string _digest;