summaryrefslogtreecommitdiff
path: root/src/cpl.cc
blob: b0bf6fcf98861634693658f5295940780baba402 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include "cpl.h"

using namespace std;
using namespace libdcp;

CPL::CPL (string file)
	: XMLFile (file, "CompositionPlaylist")
{
	id = string_node ("Id");
	annotation_text = string_node ("AnnotationText");
	issue_date = string_node ("IssueDate");
	creator = string_node ("Creator");
	content_title_text = string_node ("ContentTitleText");
	content_kind = kind_node ("ContentKind");
	content_version = sub_node<ContentVersion> ("ContentVersion");
	ignore_node ("RatingList");
	reels = sub_nodes<Reel> ("ReelList", "Reel");

	done ();
}

ContentVersion::ContentVersion (xmlpp::Node const * node)
	: XMLNode (node)
{
	id = string_node ("Id");
	label_text = string_node ("LabelText");
	done ();
}

Reel::Reel (xmlpp::Node const * node)
	: XMLNode (node)
{
	id = string_node ("Id");
	asset_list = sub_node<CPLAssetList> ("AssetList");

	done ();
}

CPLAssetList::CPLAssetList (xmlpp::Node const * node)
	: XMLNode (node)
{
	main_picture = sub_node<MainPicture> ("MainPicture");
	main_sound = optional_sub_node<MainSound> ("MainSound");

	done ();
}

MainPicture::MainPicture (xmlpp::Node const * node)
	: XMLNode (node)
{
	id = string_node ("Id");
	annotation_text = string_node ("AnnotationText");
	edit_rate = fraction_node ("EditRate");
	intrinsic_duration = int64_node ("IntrinsicDuration");
	entry_point = int64_node ("EntryPoint");
	duration = int64_node ("Duration");
	frame_rate = fraction_node ("FrameRate");
	screen_aspect_ratio = fraction_node ("ScreenAspectRatio");

	done ();
}

MainSound::MainSound (xmlpp::Node const * node)
	: XMLNode (node)
{
	id = string_node ("Id");
	annotation_text = string_node ("AnnotationText");
	edit_rate = fraction_node ("EditRate");
	intrinsic_duration = int64_node ("IntrinsicDuration");
	entry_point = int64_node ("EntryPoint");
	duration = int64_node ("Duration");

	done ();
}