#include <fstream>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
+#include <libxml++/nodes/element.h>
#include "subtitle_asset.h"
+#include "parse/subtitle.h"
#include "util.h"
#include "xml.h"
void
SubtitleAsset::read_xml (string xml_file)
{
- shared_ptr<cxml::File> xml (new cxml::File (xml_file, "DCSubtitle"));
+ shared_ptr<cxml::Document> xml (new cxml::Document ("DCSubtitle"));
+ xml->read_file (xml_file);
_uuid = xml->string_child ("SubtitleID");
_movie_title = xml->string_child ("MovieTitle");
}
void
-SubtitleAsset::write_to_cpl (xmlpp::Node* node) const
+SubtitleAsset::write_to_cpl (xmlpp::Element* node, bool) const
{
/* XXX: should EditRate, Duration and IntrinsicDuration be in here? */
font->set_attribute ("Weight", "normal");
}
- if (!subtitle ||
+ if (!subtitle || font_changed ||
(last_in != (*i)->in() ||
last_out != (*i)->out() ||
last_fade_up_time != (*i)->fade_up_time() ||
text->add_child_text ((*i)->text());
}
- doc.write_to_stream_formatted (s);
+ doc.write_to_stream_formatted (s, "UTF-8");
}