summaryrefslogtreecommitdiff
path: root/src/reel.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-01-01 23:17:07 +0000
committerCarl Hetherington <cth@carlh.net>2013-01-01 23:17:07 +0000
commitaef58f7a1caf6a67c2c0b12ba3a6bc632d890f4e (patch)
treede09dea793415454c0e656b5cfd27a027abc8f57 /src/reel.cc
parent039ea029c811b7f74f02befad10d2106ad645e74 (diff)
Use libxml++ to write CPLs.
Diffstat (limited to 'src/reel.cc')
-rw-r--r--src/reel.cc17
1 files changed, 9 insertions, 8 deletions
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 <libxml++/nodes/element.h>
#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 << " <Reel>\n"
- << " <Id>urn:uuid:" << make_uuid() << "</Id>\n"
- << " <AssetList>\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);
}
}