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;
55 /** @brief A simple parser for and representation of a CPL \<MainPicture\> node */
56 class MainPicture : public Picture
60 MainPicture (boost::shared_ptr<const cxml::Node> node);
63 /** @brief A simple parser for and representation of a CPL \<MainStereoscopicPicture\> node */
64 class MainStereoscopicPicture : public Picture
67 MainStereoscopicPicture () {}
68 MainStereoscopicPicture (boost::shared_ptr<const cxml::Node> node);
71 /** @brief A simple parser for and representation of a CPL \<MainSound\> node */
76 MainSound (boost::shared_ptr<const cxml::Node> node);
79 std::string annotation_text;
81 int64_t intrinsic_duration;
87 /** @brief A simple parser for and representation of a CPL \<MainSubtitle\> node */
92 MainSubtitle (boost::shared_ptr<const cxml::Node> node);
95 std::string annotation_text;
97 int64_t intrinsic_duration;
102 /** @brief A simple parser for and representation of a CPL \<AssetList\> node */
107 CPLAssetList (boost::shared_ptr<const cxml::Node> node);
109 boost::shared_ptr<MainPicture> main_picture;
110 boost::shared_ptr<MainStereoscopicPicture> main_stereoscopic_picture;
111 boost::shared_ptr<MainSound> main_sound;
112 boost::shared_ptr<MainSubtitle> main_subtitle;
115 /** @brief A simple parser for and representation of a CPL \<Reel\> node */
120 Reel (boost::shared_ptr<const cxml::Node> node);
123 boost::shared_ptr<CPLAssetList> asset_list;
127 /** @brief A simple parser for and representation of a CPL \<ContentVersion\> node */
132 ContentVersion (boost::shared_ptr<const cxml::Node> node);
135 std::string label_text;
139 * @brief Class to parse a CPL
141 * This class is used to parse XML CPL files. It is rarely necessary
142 * for the caller to use it outside libdcp.
147 /** Parse a CPL XML file into our member variables */
148 CPL (std::string file);
151 std::string annotation_text;
152 std::string issue_date;
154 std::string content_title_text;
155 ContentKind content_kind;
156 boost::shared_ptr<ContentVersion> content_version;
157 std::list<boost::shared_ptr<Reel> > reels;