From aef58f7a1caf6a67c2c0b12ba3a6bc632d890f4e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 1 Jan 2013 23:17:07 +0000 Subject: Use libxml++ to write CPLs. --- src/reel.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/reel.cc') diff --git a/src/reel.cc b/src/reel.cc index 52a4f0fb..d8703dd0 100644 --- a/src/reel.cc +++ b/src/reel.cc @@ -17,6 +17,7 @@ */ +#include #include "reel.h" #include "util.h" #include "picture_asset.h" @@ -27,22 +28,22 @@ using namespace std; using namespace libdcp; void -Reel::write_to_cpl (ostream& s) const +Reel::write_to_cpl (xmlpp::Node* parent) const { - s << " \n" - << " urn:uuid:" << make_uuid() << "\n" - << " \n"; - + xmlpp::Element* reel = parent->add_child("Reel"); + reel->add_child("Id")->add_child_text("urn:uuid:" + make_uuid()); + xmlpp::Element* asset_list = reel->add_child("AssetList"); + if (_main_picture) { - _main_picture->write_to_cpl (s); + _main_picture->write_to_cpl (asset_list); } if (_main_sound) { - _main_sound->write_to_cpl (s); + _main_sound->write_to_cpl (asset_list); } if (_main_subtitle) { - _main_subtitle->write_to_cpl (s); + _main_subtitle->write_to_cpl (asset_list); } } -- cgit v1.2.3