summaryrefslogtreecommitdiff
path: root/src/subtitle_asset.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-08-22 18:03:18 +0100
committerCarl Hetherington <cth@carlh.net>2012-08-22 18:03:18 +0100
commit422c8a63d2368a2e63aee4c391207e3332d1d4c7 (patch)
tree67c27019f5d47130f7512f1d46e75ced3a2558bc /src/subtitle_asset.cc
parent78979cc6ad60c03bfc2e3757722d8e18d670a4c3 (diff)
More subs tests.
Diffstat (limited to 'src/subtitle_asset.cc')
-rw-r--r--src/subtitle_asset.cc43
1 files changed, 21 insertions, 22 deletions
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc
index 2446c137..ac222638 100644
--- a/src/subtitle_asset.cc
+++ b/src/subtitle_asset.cc
@@ -96,8 +96,8 @@ SubtitleAsset::examine_text_nodes (
(*i)->text,
effective.effect.get(),
effective.effect_color.get(),
- (*i)->fade_up_time,
- (*i)->fade_down_time
+ subtitle_node->fade_up_time,
+ subtitle_node->fade_down_time
)
)
);
@@ -170,30 +170,12 @@ SubtitleNode::SubtitleNode (xmlpp::Node const * node)
out = time_attribute ("TimeOut");
font_nodes = sub_nodes<FontNode> ("Font");
text_nodes = sub_nodes<TextNode> ("Text");
-}
-
-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;
- }
-
fade_up_time = fade_time ("FadeUpTime");
- fade_down_time = fade_time ("FadeUpTime");
+ fade_down_time = fade_time ("FadeDownTime");
}
-
Time
-TextNode::fade_time (string name)
+SubtitleNode::fade_time (string name)
{
string const u = optional_string_attribute (name);
Time t;
@@ -213,6 +195,23 @@ TextNode::fade_time (string name)
return t;
}
+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> >
SubtitleAsset::subtitles_at (Time t) const
{