diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-05-13 15:57:00 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-05-13 15:57:00 +0100 |
| commit | 8526058d24faec5f83ffd66758fef8d8c8159f73 (patch) | |
| tree | a43795879b2a434da50ea2f3490aa648d94f667d /src/picture_asset.cc | |
| parent | 7394f50d8b5334a17cac37c8956b1b7e8e5e49c8 (diff) | |
Use libxml++ for writing XML.
Diffstat (limited to 'src/picture_asset.cc')
| -rw-r--r-- | src/picture_asset.cc | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/picture_asset.cc b/src/picture_asset.cc index 788e3dc4..72a63173 100644 --- a/src/picture_asset.cc +++ b/src/picture_asset.cc @@ -64,18 +64,17 @@ PictureAsset::PictureAsset (string directory, string mxf_name) } void -PictureAsset::write_to_cpl (ostream& s) const +PictureAsset::write_to_cpl (xmlpp::Node* node) const { - s << " <MainPicture>\n" - << " <Id>urn:uuid:" << _uuid << "</Id>\n" - << " <AnnotationText>" << _file_name << "</AnnotationText>\n" - << " <EditRate>" << _edit_rate << " 1</EditRate>\n" - << " <IntrinsicDuration>" << _intrinsic_duration << "</IntrinsicDuration>\n" - << " <EntryPoint>" << _entry_point << "</EntryPoint>\n" - << " <Duration>" << _duration << "</Duration>\n" - << " <FrameRate>" << _edit_rate << " 1</FrameRate>\n" - << " <ScreenAspectRatio>" << _size.width << " " << _size.height << "</ScreenAspectRatio>\n" - << " </MainPicture>\n"; + xmlpp::Node* mp = node->add_child ("MainPicture"); + mp->add_child ("Id")->add_child_text ("urn:uuid:" + _uuid); + mp->add_child ("AnnotationText")->add_child_text (_file_name); + mp->add_child ("EditRate")->add_child_text (lexical_cast<string> (_edit_rate) + " 1"); + mp->add_child ("IntrinsicDuration")->add_child_text (lexical_cast<string> (_intrinsic_duration)); + mp->add_child ("EntryPoint")->add_child_text (lexical_cast<string> (_entry_point)); + mp->add_child ("Duration")->add_child_text (lexical_cast<string> (_duration)); + mp->add_child ("FrameRate")->add_child_text (lexical_cast<string> (_edit_rate) + " 1"); + mp->add_child ("ScreenAspectRatio")->add_child_text (lexical_cast<string> (_size.width) + " " + lexical_cast<string> (_size.height)); } bool |
