-Subtitle::Subtitle (boost::shared_ptr<const cxml::Node> node, int tcr)
-{
- in = Time (node->string_attribute ("TimeIn"), tcr);
- out = Time (node->string_attribute ("TimeOut"), tcr);
-
- list<cxml::NodePtr> f = node->node_children ("Font");
- for (list<cxml::NodePtr>::iterator i = f.begin(); i != f.end(); ++i) {
- font_nodes.push_back (shared_ptr<Font> (new Font (*i, tcr)));
- }
-
- list<cxml::NodePtr> t = node->node_children ("Text");
- for (list<cxml::NodePtr>::iterator i = t.begin(); i != t.end(); ++i) {
- text_nodes.push_back (shared_ptr<Text> (new Text (*i, tcr)));
- }
-
- fade_up_time = fade_time (node, "FadeUpTime", tcr);
- fade_down_time = fade_time (node, "FadeDownTime", tcr);
-}
-
-Time
-Subtitle::fade_time (shared_ptr<const cxml::Node> node, string name, int tcr)
+/** @param v_position Vertical position as a fraction of the screen height (between 0 and 1) from v_align */
+Subtitle::Subtitle (
+ Time in,
+ Time out,
+ float h_position,
+ HAlign h_align,
+ float v_position,
+ VAlign v_align,
+ Time fade_up_time,
+ Time fade_down_time
+ )
+ : _in (in)
+ , _out (out)
+ , _h_position (h_position)
+ , _h_align (h_align)
+ , _v_position (v_position)
+ , _v_align (v_align)
+ , _fade_up_time (fade_up_time)
+ , _fade_down_time (fade_down_time)