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/sound_asset.cc | |
| parent | 7394f50d8b5334a17cac37c8956b1b7e8e5e49c8 (diff) | |
Use libxml++ for writing XML.
Diffstat (limited to 'src/sound_asset.cc')
| -rw-r--r-- | src/sound_asset.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/sound_asset.cc b/src/sound_asset.cc index 9b6b48aa..4a7abd4d 100644 --- a/src/sound_asset.cc +++ b/src/sound_asset.cc @@ -211,16 +211,15 @@ SoundAsset::construct (boost::function<string (Channel)> get_path, MXFMetadata c } void -SoundAsset::write_to_cpl (ostream& s) const +SoundAsset::write_to_cpl (xmlpp::Node* node) const { - s << " <MainSound>\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" - << " </MainSound>\n"; + xmlpp::Node* ms = node->add_child ("MainSound"); + ms->add_child ("Id")->add_child_text ("urn:uuid:" + _uuid); + ms->add_child ("AnnotationText")->add_child_text (_file_name); + ms->add_child ("EditRate")->add_child_text (lexical_cast<string> (_edit_rate) + " 1"); + ms->add_child ("IntrinsicDuration")->add_child_text (lexical_cast<string> (_intrinsic_duration)); + ms->add_child ("EntryPoint")->add_child_text (lexical_cast<string> (_entry_point)); + ms->add_child ("Duration")->add_child_text (lexical_cast<string> (_duration)); } bool |
