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.
21 * @brief Classes used to parse a CPL.
25 #include <boost/shared_ptr.hpp>
30 class Picture : public XMLNode
34 Picture (xmlpp::Node const * node);
37 std::string annotation_text;
39 int64_t intrinsic_duration;
43 Fraction screen_aspect_ratio;
47 /** CPL MainPicture node */
48 class MainPicture : public Picture
52 MainPicture (xmlpp::Node const * node);
55 /** CPL MainStereoscopicPicture node */
56 class MainStereoscopicPicture : public Picture
59 MainStereoscopicPicture () {}
60 MainStereoscopicPicture (xmlpp::Node const * node);
63 /** CPL MainSound node */
64 class MainSound : public XMLNode
68 MainSound (xmlpp::Node const * node);
71 std::string annotation_text;
73 int64_t intrinsic_duration;
78 /** CPL MainSubtitle node */
79 class MainSubtitle : public XMLNode
83 MainSubtitle (xmlpp::Node const * node);
86 std::string annotation_text;
88 int64_t intrinsic_duration;
93 /** CPL AssetList node */
94 class CPLAssetList : public XMLNode
98 CPLAssetList (xmlpp::Node const * node);
100 boost::shared_ptr<MainPicture> main_picture;
101 boost::shared_ptr<MainStereoscopicPicture> main_stereoscopic_picture;
102 boost::shared_ptr<MainSound> main_sound;
103 boost::shared_ptr<MainSubtitle> main_subtitle;
107 class CPLReel : public XMLNode
111 CPLReel (xmlpp::Node const * node);
114 boost::shared_ptr<CPLAssetList> asset_list;
117 /** CPL ContentVersion node */
118 class ContentVersion : public XMLNode
122 ContentVersion (xmlpp::Node const * node);
125 std::string label_text;
129 * @brief Class to parse a CPL
131 * This class is used to parse XML CPL files. It is rarely necessary
132 * for the caller to use it outside libdcp.
134 class CPL : public XMLFile
137 /** Parse a CPL XML file into our member variables */
138 CPL (std::string file);
141 std::string annotation_text;
142 std::string issue_date;
144 std::string content_title_text;
145 ContentKind content_kind;
146 boost::shared_ptr<ContentVersion> content_version;
147 std::list<boost::shared_ptr<CPLReel> > reels;