summaryrefslogtreecommitdiff
path: root/src
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
parent78979cc6ad60c03bfc2e3757722d8e18d670a4c3 (diff)
More subs tests.
Diffstat (limited to 'src')
-rw-r--r--src/subtitle_asset.cc43
-rw-r--r--src/subtitle_asset.h11
2 files changed, 26 insertions, 28 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
{
diff --git a/src/subtitle_asset.h b/src/subtitle_asset.h
index 72563470..efcab3a3 100644
--- a/src/subtitle_asset.h
+++ b/src/subtitle_asset.h
@@ -35,12 +35,6 @@ public:
float v_position;
VAlign v_align;
std::string text;
- Time fade_up_time;
- Time fade_down_time;
-
-private:
- Time fade_time (std::string name);
-
};
class SubtitleNode : public XMLNode
@@ -51,8 +45,13 @@ public:
Time in;
Time out;
+ Time fade_up_time;
+ Time fade_down_time;
std::list<boost::shared_ptr<FontNode> > font_nodes;
std::list<boost::shared_ptr<TextNode> > text_nodes;
+
+private:
+ Time fade_time (std::string name);
};
class FontNode : public XMLNode