#include "font.h"
#include "raw_convert.h"
#include <libcxml/cxml.h>
+#include <libxml++/libxml++.h>
#include <boost/foreach.hpp>
+#include <iostream>
#include "i18n.h"
int const SubtitleContentProperty::BURN_SUBTITLES = 505;
int const SubtitleContentProperty::SUBTITLE_LANGUAGE = 506;
int const SubtitleContentProperty::FONTS = 507;
+int const SubtitleContentProperty::SUBTITLE_VIDEO_FRAME_RATE = 508;
SubtitleContent::SubtitleContent (shared_ptr<const Film> film)
: Content (film)
}
if (version >= 7) {
- _subtitle_x_offset = node->number_child<float> ("SubtitleXOffset");
- _subtitle_y_offset = node->number_child<float> ("SubtitleYOffset");
+ _subtitle_x_offset = node->number_child<double> ("SubtitleXOffset");
+ _subtitle_y_offset = node->number_child<double> ("SubtitleYOffset");
} else {
- _subtitle_y_offset = node->number_child<float> ("SubtitleOffset");
+ _subtitle_y_offset = node->number_child<double> ("SubtitleOffset");
}
if (version >= 10) {
- _subtitle_x_scale = node->number_child<float> ("SubtitleXScale");
- _subtitle_y_scale = node->number_child<float> ("SubtitleYScale");
+ _subtitle_x_scale = node->number_child<double> ("SubtitleXScale");
+ _subtitle_y_scale = node->number_child<double> ("SubtitleYScale");
} else {
- _subtitle_x_scale = _subtitle_y_scale = node->number_child<float> ("SubtitleScale");
+ _subtitle_x_scale = _subtitle_y_scale = node->number_child<double> ("SubtitleScale");
}
_subtitle_language = node->optional_string_child ("SubtitleLanguage").get_value_or ("");
<< "_" << raw_convert<string> (subtitle_x_offset())
<< "_" << raw_convert<string> (subtitle_y_offset());
+ /* XXX: I suppose really _fonts shouldn't be in here, since not all
+ types of subtitle content involve fonts.
+ */
+ BOOST_FOREACH (shared_ptr<Font> f, _fonts) {
+ for (int i = 0; i < FontFiles::VARIANTS; ++i) {
+ s << "_" << f->file(static_cast<FontFiles::Variant>(i)).get_value_or ("Default");
+ }
+ }
+
/* The language is for metadata only, and doesn't affect
how this content looks.
*/