summaryrefslogtreecommitdiff
path: root/src/subtitle_asset.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/subtitle_asset.cc')
-rw-r--r--src/subtitle_asset.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc
index 100f6a4e..0e76a62d 100644
--- a/src/subtitle_asset.cc
+++ b/src/subtitle_asset.cc
@@ -192,7 +192,8 @@ SubtitleAsset::maybe_add_subtitle (string text, ParseState& parse_state)
effective_subtitle.in != c->in() ||
effective_subtitle.out != c->out() ||
effective_text.v_position != c->v_position() ||
- effective_text.v_align != c->v_align()) {
+ effective_text.v_align != c->v_align() ||
+ effective_text.h_align != c->h_align()) {
parse_state.current.reset (
new Subtitle (
@@ -204,6 +205,7 @@ SubtitleAsset::maybe_add_subtitle (string text, ParseState& parse_state)
effective_subtitle.out,
effective_text.v_position,
effective_text.v_align,
+ effective_text.h_align,
"",
effective_font.effect ? effective_font.effect.get() : NONE,
effective_font.effect_color.get(),
@@ -263,6 +265,7 @@ Subtitle::Subtitle (
Time out,
float v_position,
VAlign v_align,
+ HAlign h_align,
string text,
Effect effect,
Color effect_color,
@@ -277,6 +280,7 @@ Subtitle::Subtitle (
, _out (out)
, _v_position (v_position)
, _v_align (v_align)
+ , _h_align (h_align)
, _text (text)
, _effect (effect)
, _effect_color (effect_color)
@@ -309,6 +313,7 @@ libdcp::operator== (Subtitle const & a, Subtitle const & b)
a.out() == b.out() &&
a.v_position() == b.v_position() &&
a.v_align() == b.v_align() &&
+ a.h_align() == b.h_align() &&
a.text() == b.text() &&
a.effect() == b.effect() &&
a.effect_color() == b.effect_color() &&
@@ -330,7 +335,8 @@ libdcp::operator<< (ostream& s, Subtitle const & sub)
s << "non-italic";
}
- s << ", size " << sub.size() << ", color " << sub.color() << ", vpos " << sub.v_position() << ", valign " << ((int) sub.v_align()) << ";\n"
+ s << ", size " << sub.size() << ", color " << sub.color()
+ << ", vpos " << sub.v_position() << ", valign " << ((int) sub.v_align()) << ", halign " << ((int) sub.h_align()) << "; "
<< "effect " << ((int) sub.effect()) << ", effect color " << sub.effect_color();
return s;
@@ -482,6 +488,7 @@ SubtitleAsset::xml_as_string () const
xmlpp::Element* text = subtitle->add_child ("Text");
text->set_attribute ("VAlign", valign_to_string ((*i)->v_align()));
+ text->set_attribute ("HAlign", halign_to_string ((*i)->h_align()));
text->set_attribute ("VPosition", raw_convert<string> ((*i)->v_position()));
text->add_child_text ((*i)->text());
}