Add add_days to LocalTime.
[libdcp.git] / src / subtitle_string.cc
index 8e106c6df78dee5d920b6d0d01e054345c9dc73e..f5f8c8acb34e60d0bc9332681a9763c06213278a 100644 (file)
@@ -45,6 +45,7 @@ SubtitleString::SubtitleString (
        optional<string> font,
        bool italic,
        bool bold,
+       bool underline,
        Colour colour,
        int size,
        float aspect_adjust,
@@ -61,24 +62,18 @@ SubtitleString::SubtitleString (
        Time fade_up_time,
        Time fade_down_time
        )
-       : _font (font)
+       : Subtitle (in, out, h_position, h_align, v_position, v_align, fade_up_time, fade_down_time)
+       , _font (font)
        , _italic (italic)
        , _bold (bold)
+       , _underline (underline)
        , _colour (colour)
        , _size (size)
        , _aspect_adjust (aspect_adjust)
-       , _in (in)
-       , _out (out)
-       , _h_position (h_position)
-       , _h_align (h_align)
-       , _v_position (v_position)
-       , _v_align (v_align)
        , _direction (direction)
        , _text (text)
        , _effect (effect)
        , _effect_colour (effect_colour)
-       , _fade_up_time (fade_up_time)
-       , _fade_down_time (fade_down_time)
 {
 
 }
@@ -101,6 +96,7 @@ dcp::operator== (SubtitleString const & a, SubtitleString const & b)
                a.font() == b.font() &&
                a.italic() == b.italic() &&
                a.bold() == b.bold() &&
+               a.underline() == b.underline() &&
                a.colour() == b.colour() &&
                a.size() == b.size() &&
                fabs (a.aspect_adjust() - b.aspect_adjust()) < ASPECT_ADJUST_EPSILON &&
@@ -119,6 +115,12 @@ dcp::operator== (SubtitleString const & a, SubtitleString const & b)
                );
 }
 
+bool
+dcp::operator!= (SubtitleString const & a, SubtitleString const & b)
+{
+       return !(a == b);
+}
+
 ostream&
 dcp::operator<< (ostream& s, SubtitleString const & sub)
 {
@@ -138,6 +140,10 @@ dcp::operator<< (ostream& s, SubtitleString const & sub)
                s << "normal, ";
        }
 
+       if (sub.underline()) {
+               s << "underlined, ";
+       }
+
        s << "size " << sub.size() << ", aspect " << sub.aspect_adjust() << ", colour " << sub.colour()
          << ", vpos " << sub.v_position() << ", valign " << ((int) sub.v_align())
          << ", hpos " << sub.h_position() << ", halign " << ((int) sub.h_align())