From d8c9cbec9d87f28da338350880b7618b94f4da81 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 31 Jul 2012 00:07:08 +0100 Subject: Bits. --- src/dcp.cc | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/dcp.cc') diff --git a/src/dcp.cc b/src/dcp.cc index 27f3243e..4b0e9087 100644 --- a/src/dcp.cc +++ b/src/dcp.cc @@ -35,6 +35,7 @@ #include "exceptions.h" #include "cpl.h" #include "pkl.h" +#include "asset_map.h" using namespace std; using namespace boost; @@ -273,7 +274,43 @@ DCP::DCP (string directory) } } + /* Read the XML */ CPL cpl (cpl_file); PKL pkl (pkl_file); + AssetMap asset_map (asset_map_file); + + /* Cross-check */ + /* XXX */ + + /* Now cherry-pick the required bits into our own data structure */ + + _name = cpl.annotation_text; + _content_kind = cpl.content_kind; + + shared_ptr cpl_assets = cpl.reels.front()->asset_list; + + /* XXX */ + _fps = cpl_assets->main_picture->frame_rate.numerator; + _length = cpl_assets->main_picture->duration; + + _assets.push_back (shared_ptr ( + new PictureAsset ( + cpl_assets->main_picture->annotation_text, + _fps, + _length, + cpl_assets->main_picture->screen_aspect_ratio.numerator, + cpl_assets->main_picture->screen_aspect_ratio.denominator + ) + )); + + if (cpl_assets->main_sound) { + _assets.push_back (shared_ptr ( + new SoundAsset ( + cpl_assets->main_picture->annotation_text, + _fps, + _length + ) + )); + } } -- cgit v1.2.3