summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-08-21 22:23:13 +0100
committerCarl Hetherington <cth@carlh.net>2012-08-21 22:23:13 +0100
commitdf6ed597b720399f02e7b75a7cf448d0956c89a1 (patch)
tree53fcd9862ea0e9eb5abd5b4d883d1a5c03735158 /src
parentb627827aaa5a314b53fe0f8b0429dee8b542ccb3 (diff)
Vertical align.
Diffstat (limited to 'src')
-rw-r--r--src/subtitle_asset.cc12
-rw-r--r--src/subtitle_asset.h7
-rw-r--r--src/types.h7
3 files changed, 26 insertions, 0 deletions
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc
index 827fbf7d..9a3e3bbc 100644
--- a/src/subtitle_asset.cc
+++ b/src/subtitle_asset.cc
@@ -65,6 +65,7 @@ SubtitleAsset::examine_font_node (shared_ptr<FontNode> font_node, list<shared_pt
(*j)->in,
(*j)->out,
(*k)->v_position,
+ (*k)->v_align,
(*k)->text,
effective.effect.get(),
effective.effect_color.get()
@@ -149,9 +150,18 @@ SubtitleNode::SubtitleNode (xmlpp::Node const * node)
TextNode::TextNode (xmlpp::Node const * node)
: XMLNode (node)
+ , v_align (CENTER)
{
text = content ();
v_position = float_attribute ("VPosition");
+ string const v = optional_string_attribute ("VAlign");
+ if (v == "top") {
+ v_align = TOP;
+ } else if (v == "center") {
+ v_align = CENTER;
+ } else if (v == "bottom") {
+ v_align = BOTTOM;
+ }
}
list<shared_ptr<Subtitle> >
@@ -194,6 +204,7 @@ Subtitle::Subtitle (
Time in,
Time out,
float v_position,
+ VAlign v_align,
string text,
Effect effect,
Color effect_color
@@ -205,6 +216,7 @@ Subtitle::Subtitle (
, _in (in)
, _out (out)
, _v_position (v_position)
+ , _v_align (v_align)
, _text (text)
, _effect (effect)
, _effect_color (effect_color)
diff --git a/src/subtitle_asset.h b/src/subtitle_asset.h
index aff3dae5..d272957e 100644
--- a/src/subtitle_asset.h
+++ b/src/subtitle_asset.h
@@ -31,6 +31,7 @@ public:
TextNode (xmlpp::Node const * node);
float v_position;
+ VAlign v_align;
std::string text;
};
@@ -84,6 +85,7 @@ public:
Time in,
Time out,
float v_position,
+ VAlign v_align,
std::string text,
Effect effect,
Color effect_color
@@ -117,6 +119,10 @@ public:
return _v_position;
}
+ VAlign v_align () const {
+ return _v_align;
+ }
+
Effect effect () const {
return _effect;
}
@@ -135,6 +141,7 @@ private:
Time _in;
Time _out;
float _v_position;
+ VAlign _v_align;
std::string _text;
Effect _effect;
Color _effect_color;
diff --git a/src/types.h b/src/types.h
index c49c5f8f..280c60cd 100644
--- a/src/types.h
+++ b/src/types.h
@@ -57,6 +57,13 @@ enum Effect
BORDER,
SHADOW
};
+
+enum VAlign
+{
+ TOP,
+ CENTER,
+ BOTTOM
+};
class Fraction
{