Tweak ISO6937 mapping to put $ sign on 0xa4 (164) (from master).
[libsub.git] / src / subtitle.cc
index d637ed969183ba597a6f5e4b5f65bfd9118079a2..663c16185da051659c2f62597b5eceed59c969bd 100644 (file)
 
 using namespace sub;
 
+Subtitle::Subtitle (RawSubtitle s)
+       : from (s.from)
+       , to (s.to)
+       , fade_up (s.fade_up)
+       , fade_down (s.fade_down)
+{
+       lines.push_back (Line (s));
+}
+
+bool
+Subtitle::same_metadata (RawSubtitle s) const
+{
+       return from == s.from && to == s.to && fade_up == s.fade_up && fade_down == s.fade_down;
+}
+
+Line::Line (RawSubtitle s)
+       : vertical_position (s.vertical_position)
+{
+       blocks.push_back (Block (s));
+}
+
 bool
-sub::operator< (Subtitle const & a, Subtitle const & b)
+Line::same_metadata (RawSubtitle s) const
 {
-       if (a.from.frame && b.from.frame) {
-               return a.from.frame.get() < b.from.frame.get();
-       }
+       return vertical_position == s.vertical_position;
+}
 
-       if (a.from.metric && b.from.metric) {
-               return a.from.metric.get() < b.from.metric.get();
-       }
+Block::Block (RawSubtitle s)
+       : text (s.text)
+       , font (s.font)
+       , font_size (s.font_size)
+       , effect (s.effect)
+       , effect_colour (s.effect_colour)
+       , colour (s.colour)
+       , bold (s.bold)
+       , italic (s.italic)
+       , underline (s.underline)
+{
 
-       assert (false);
 }