diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-07-30 23:47:57 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-07-30 23:47:57 +0100 |
| commit | 9a9d4e014c16be88d72914a9480343445bc785a5 (patch) | |
| tree | 1857fcdd8963d51ac50f1467d9ae81d4d9be5f8e /src/cpl.cc | |
| parent | 34a25d89b16a33b5f619ae0eaaa03c17f93980af (diff) | |
Various.
Diffstat (limited to 'src/cpl.cc')
| -rw-r--r-- | src/cpl.cc | 87 |
1 files changed, 76 insertions, 11 deletions
@@ -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 (); } |
