summaryrefslogtreecommitdiff
path: root/src/cpl.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-07-30 23:47:57 +0100
committerCarl Hetherington <cth@carlh.net>2012-07-30 23:47:57 +0100
commit9a9d4e014c16be88d72914a9480343445bc785a5 (patch)
tree1857fcdd8963d51ac50f1467d9ae81d4d9be5f8e /src/cpl.cc
parent34a25d89b16a33b5f619ae0eaaa03c17f93980af (diff)
Various.
Diffstat (limited to 'src/cpl.cc')
-rw-r--r--src/cpl.cc87
1 files changed, 76 insertions, 11 deletions
diff --git a/src/cpl.cc b/src/cpl.cc
index 1eba666c..99d5b411 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -1,16 +1,81 @@
#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");
+ reel_list = sub_node<ReelList> ("ReelList");
+
+ done ();
+}
+
+ContentVersion::ContentVersion (xmlpp::Node const * node)
+ : XMLNode (node)
+{
+ id = string_node ("Id");
+ label_text = string_node ("LabelText");
+ done ();
+}
+
+ReelList::ReelList (xmlpp::Node const * node)
+ : XMLNode (node)
+{
+ reels = sub_nodes<Reel> ("Reel");
+ 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 = int_node ("IntrinsicDuration");
+ entry_point = int_node ("EntryPoint");
+ duration = int_node ("Duration");
+ frame_rate = fraction_node ("FrameRate");
+ screen_aspect_ratio = fraction_node ("ScreenAspectRatio");
+
+ done ();
+}
+
+MainSound::MainSound (xmlpp::Node const * node)
+ : XMLNode (node)
{
- file_is (file);
-
- _id = string_tag ("Id");
- _annotation_text = string_tag ("AnnotationText");
- _issue_date = string_tag ("IssueDate");
- _creator = string_tag ("Creator");
- _content_title_text = string_tag ("ContentTitleText");
- _content_kind = kind_tag ("ContentKind");
- _content_version = sub (new ContentVersion, "ContentVersion");
- ignore ("RatingList");
- _reel_list = sub (new ReelList, "ReelList");
+ id = string_node ("Id");
+ annotation_text = string_node ("AnnotationText");
+ edit_rate = fraction_node ("EditRate");
+ intrinsic_duration = int_node ("IntrinsicDuration");
+ entry_point = int_node ("EntryPoint");
+ duration = int_node ("Duration");
+
+ done ();
}