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/parse/cpl.h
21 * @brief Classes used to parse a CPL.
25 #include <boost/shared_ptr.hpp>
26 #include <libcxml/cxml.h>
33 /** @brief A simple representation of a CPL \<Picture\> node */
38 Picture (boost::shared_ptr<const cxml::Node> node);
41 std::string annotation_text;
43 /** Duration of the whole thing */
44 int64_t intrinsic_duration;
45 /** Start point in frames */
47 /** Duration that will actually play */
50 Fraction screen_aspect_ratio;
54 /** @brief A simple parser for and representation of a CPL \<MainPicture\> node */
55 class MainPicture : public Picture
59 MainPicture (boost::shared_ptr<const cxml::Node> node);
62 /** @brief A simple parser for and representation of a CPL \<MainStereoscopicPicture\> node */
63 class MainStereoscopicPicture : public Picture
66 MainStereoscopicPicture () {}
67 MainStereoscopicPicture (boost::shared_ptr<const cxml::Node> node);
70 /** @brief A simple parser for and representation of a CPL \<MainSound\> node */
75 MainSound (boost::shared_ptr<const cxml::Node> node);
78 std::string annotation_text;
80 int64_t intrinsic_duration;
85 /** @brief A simple parser for and representation of a CPL \<MainSubtitle\> node */
90 MainSubtitle (boost::shared_ptr<const cxml::Node> node);
93 std::string annotation_text;
95 int64_t intrinsic_duration;
100 /** @brief A simple parser for and representation of a CPL \<AssetList\> node */
105 CPLAssetList (boost::shared_ptr<const cxml::Node> node);
107 boost::shared_ptr<MainPicture> main_picture;
108 boost::shared_ptr<MainStereoscopicPicture> main_stereoscopic_picture;
109 boost::shared_ptr<MainSound> main_sound;
110 boost::shared_ptr<MainSubtitle> main_subtitle;
113 /** @brief A simple parser for and representation of a CPL \<Reel\> node */
118 Reel (boost::shared_ptr<const cxml::Node> node);
121 boost::shared_ptr<CPLAssetList> asset_list;
125 /** @brief A simple parser for and representation of a CPL \<ContentVersion\> node */
130 ContentVersion (boost::shared_ptr<const cxml::Node> node);
133 std::string label_text;
137 * @brief Class to parse a CPL
139 * This class is used to parse XML CPL files. It is rarely necessary
140 * for the caller to use it outside libdcp.
145 /** Parse a CPL XML file into our member variables */
146 CPL (std::string file);
149 std::string annotation_text;
150 std::string issue_date;
152 std::string content_title_text;
153 ContentKind content_kind;
154 boost::shared_ptr<ContentVersion> content_version;
155 std::list<boost::shared_ptr<Reel> > reels;