Tweaks for more real-life DCPs; beginning of subtitle support.
[libdcp.git] / src / cpl.h
1 #include <stdint.h>
2 #include <boost/shared_ptr.hpp>
3 #include "xml.h"
4
5 namespace libdcp {
6
7 class MainPicture : public XMLNode
8 {
9 public:
10         MainPicture () {}
11         MainPicture (xmlpp::Node const * node);
12
13         std::string id;
14         std::string annotation_text;
15         Fraction edit_rate;
16         int64_t intrinsic_duration;
17         int64_t entry_point;
18         int64_t duration;
19         Fraction frame_rate;
20         Fraction screen_aspect_ratio;
21 };
22
23 class MainSound : public XMLNode
24 {
25 public:
26         MainSound () {}
27         MainSound (xmlpp::Node const * node);
28
29         std::string id;
30         std::string annotation_text;
31         Fraction edit_rate;
32         int64_t intrinsic_duration;
33         int64_t entry_point;
34         int64_t duration;
35 };
36
37 class MainSubtitle : public XMLNode
38 {
39 public:
40         MainSubtitle () {}
41         MainSubtitle (xmlpp::Node const * node);
42
43         std::string id;
44         std::string annotation_text;
45         Fraction edit_rate;
46         int64_t intrinsic_duration;
47         int64_t entry_point;
48         int64_t duration;
49 };
50
51 class CPLAssetList : public XMLNode
52 {
53 public:
54         CPLAssetList () {}
55         CPLAssetList (xmlpp::Node const * node);
56
57         boost::shared_ptr<MainPicture> main_picture;
58         boost::shared_ptr<MainSound> main_sound;
59         boost::shared_ptr<MainSubtitle> main_subtitle;
60 };
61
62 class Reel : public XMLNode
63 {
64 public:
65         Reel () {}
66         Reel (xmlpp::Node const * node);
67
68         std::string id;
69         boost::shared_ptr<CPLAssetList> asset_list;
70 };
71
72 class ContentVersion : public XMLNode
73 {
74 public:
75         ContentVersion () {}
76         ContentVersion (xmlpp::Node const * node);
77
78         std::string id;
79         std::string label_text;
80 };
81
82 class CPL : public XMLFile
83 {
84 public:
85         CPL (std::string file);
86
87         std::string id;
88         std::string annotation_text;
89         std::string issue_date;
90         std::string creator;
91         std::string content_title_text;
92         ContentKind content_kind;
93         boost::shared_ptr<ContentVersion> content_version;
94         std::list<boost::shared_ptr<Reel> > reels;
95 };
96
97 }
98