Merge.
[libdcp.git] / src / cpl.cc
1 #include "cpl.h"
2
3 using namespace std;
4 using namespace libdcp;
5
6 CPL::CPL (string file)
7         : XMLFile (file, "CompositionPlaylist")
8 {
9         id = string_node ("Id");
10         annotation_text = string_node ("AnnotationText");
11         issue_date = string_node ("IssueDate");
12         creator = string_node ("Creator");
13         content_title_text = string_node ("ContentTitleText");
14         content_kind = kind_node ("ContentKind");
15         content_version = sub_node<ContentVersion> ("ContentVersion");
16         ignore_node ("RatingList");
17         reels = sub_nodes<Reel> ("ReelList", "Reel");
18
19         done ();
20 }
21
22 ContentVersion::ContentVersion (xmlpp::Node const * node)
23         : XMLNode (node)
24 {
25         id = string_node ("Id");
26         label_text = string_node ("LabelText");
27         done ();
28 }
29
30 Reel::Reel (xmlpp::Node const * node)
31         : XMLNode (node)
32 {
33         id = string_node ("Id");
34         asset_list = sub_node<CPLAssetList> ("AssetList");
35
36         done ();
37 }
38
39 CPLAssetList::CPLAssetList (xmlpp::Node const * node)
40         : XMLNode (node)
41 {
42         main_picture = sub_node<MainPicture> ("MainPicture");
43         main_sound = optional_sub_node<MainSound> ("MainSound");
44
45         done ();
46 }
47
48 MainPicture::MainPicture (xmlpp::Node const * node)
49         : XMLNode (node)
50 {
51         id = string_node ("Id");
52         annotation_text = string_node ("AnnotationText");
53         edit_rate = fraction_node ("EditRate");
54         intrinsic_duration = int64_node ("IntrinsicDuration");
55         entry_point = int64_node ("EntryPoint");
56         duration = int64_node ("Duration");
57         frame_rate = fraction_node ("FrameRate");
58         screen_aspect_ratio = fraction_node ("ScreenAspectRatio");
59
60         done ();
61 }
62
63 MainSound::MainSound (xmlpp::Node const * node)
64         : XMLNode (node)
65 {
66         id = string_node ("Id");
67         annotation_text = string_node ("AnnotationText");
68         edit_rate = fraction_node ("EditRate");
69         intrinsic_duration = int64_node ("IntrinsicDuration");
70         entry_point = int64_node ("EntryPoint");
71         duration = int64_node ("Duration");
72
73         done ();
74 }