99d5b411d901fb3477e093af22db2e3c98f75a46
[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         reel_list = sub_node<ReelList> ("ReelList");
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 ReelList::ReelList (xmlpp::Node const * node)
31         : XMLNode (node)
32 {
33         reels = sub_nodes<Reel> ("Reel");
34         done ();
35 }
36
37 Reel::Reel (xmlpp::Node const * node)
38         : XMLNode (node)
39 {
40         id = string_node ("Id");
41         asset_list = sub_node<CPLAssetList> ("AssetList");
42
43         done ();
44 }
45
46 CPLAssetList::CPLAssetList (xmlpp::Node const * node)
47         : XMLNode (node)
48 {
49         main_picture = sub_node<MainPicture> ("MainPicture");
50         main_sound = optional_sub_node<MainSound> ("MainSound");
51
52         done ();
53 }
54
55 MainPicture::MainPicture (xmlpp::Node const * node)
56         : XMLNode (node)
57 {
58         id = string_node ("Id");
59         annotation_text = string_node ("AnnotationText");
60         edit_rate = fraction_node ("EditRate");
61         intrinsic_duration = int_node ("IntrinsicDuration");
62         entry_point = int_node ("EntryPoint");
63         duration = int_node ("Duration");
64         frame_rate = fraction_node ("FrameRate");
65         screen_aspect_ratio = fraction_node ("ScreenAspectRatio");
66
67         done ();
68 }
69
70 MainSound::MainSound (xmlpp::Node const * node)
71         : XMLNode (node)
72 {
73         id = string_node ("Id");
74         annotation_text = string_node ("AnnotationText");
75         edit_rate = fraction_node ("EditRate");
76         intrinsic_duration = int_node ("IntrinsicDuration");
77         entry_point = int_node ("EntryPoint");
78         duration = int_node ("Duration");
79
80         done ();
81 }