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.
20 /** @file src/cpl_file.h
21 * @brief Classes used to parse a CPL.
25 #include <boost/shared_ptr.hpp>
30 /** @brief A simple parser for and representation of a CPL \<Picture\> node */
31 class Picture : public XMLNode
35 Picture (xmlpp::Node const * node);
38 std::string annotation_text;
40 /** Duration of the whole thing */
41 int64_t intrinsic_duration;
42 /** Start point in frames */
44 /** Duration that will actually play */
47 Fraction screen_aspect_ratio;
51 /** @brief A simple parser for and representation of a CPL \<MainPicture\> node */
52 class MainPicture : public Picture
56 MainPicture (xmlpp::Node const * node);
59 /** @brief A simple parser for and representation of a CPL \<MainStereoscopicPicture\> node */
60 class MainStereoscopicPicture : public Picture
63 MainStereoscopicPicture () {}
64 MainStereoscopicPicture (xmlpp::Node const * node);
67 /** @brief A simple parser for and representation of a CPL \<MainSound\> node */
68 class MainSound : public XMLNode
72 MainSound (xmlpp::Node const * node);
75 std::string annotation_text;
77 int64_t intrinsic_duration;
82 /** @brief A simple parser for and representation of a CPL \<MainSubtitle\> node */
83 class MainSubtitle : public XMLNode
87 MainSubtitle (xmlpp::Node const * node);
90 std::string annotation_text;
92 int64_t intrinsic_duration;
97 /** @brief A simple parser for and representation of a CPL \<AssetList\> node */
98 class CPLAssetList : public XMLNode
102 CPLAssetList (xmlpp::Node const * node);
104 boost::shared_ptr<MainPicture> main_picture;
105 boost::shared_ptr<MainStereoscopicPicture> main_stereoscopic_picture;
106 boost::shared_ptr<MainSound> main_sound;
107 boost::shared_ptr<MainSubtitle> main_subtitle;
110 /** @brief A simple parser for and representation of a CPL \<Reel\> node */
111 class CPLReel : public XMLNode
115 CPLReel (xmlpp::Node const * node);
118 boost::shared_ptr<CPLAssetList> asset_list;
122 /** @brief A simple parser for and representation of a CPL \<ContentVersion\> node */
123 class ContentVersion : public XMLNode
127 ContentVersion (xmlpp::Node const * node);
130 std::string label_text;
134 * @brief Class to parse a CPL
136 * This class is used to parse XML CPL files. It is rarely necessary
137 * for the caller to use it outside libdcp.
139 class CPLFile : public XMLFile
142 /** Parse a CPL XML file into our member variables */
143 CPLFile (std::string file);
146 std::string annotation_text;
147 std::string issue_date;
149 std::string content_title_text;
150 ContentKind content_kind;
151 boost::shared_ptr<ContentVersion> content_version;
152 std::list<boost::shared_ptr<CPLReel> > reels;