X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fsubtitle_string.cc;h=a8dfd555674c54f39bc571f21afd4d8e30b71c8b;hb=9fc6bcde891567ca04fe2d9835ab48a17c9b69a7;hp=66869fd59329db90e04343f98b44a633ce8dd921;hpb=bfb33feb40c5b014e9eae3958b1ecb8161f1d090;p=libdcp.git diff --git a/src/subtitle_string.cc b/src/subtitle_string.cc index 66869fd5..a8dfd555 100644 --- a/src/subtitle_string.cc +++ b/src/subtitle_string.cc @@ -22,12 +22,13 @@ using std::string; using std::ostream; +using boost::optional; using namespace dcp; SubtitleString::SubtitleString ( - string font, + optional font, bool italic, - Color color, + Colour colour, int size, Time in, Time out, @@ -35,13 +36,13 @@ SubtitleString::SubtitleString ( VAlign v_align, string text, Effect effect, - Color effect_color, + Colour effect_colour, Time fade_up_time, Time fade_down_time ) : _font (font) , _italic (italic) - , _color (color) + , _colour (colour) , _size (size) , _in (in) , _out (out) @@ -49,7 +50,7 @@ SubtitleString::SubtitleString ( , _v_align (v_align) , _text (text) , _effect (effect) - , _effect_color (effect_color) + , _effect_colour (effect_colour) , _fade_up_time (fade_up_time) , _fade_down_time (fade_down_time) { @@ -73,7 +74,7 @@ dcp::operator== (SubtitleString const & a, SubtitleString const & b) return ( a.font() == b.font() && a.italic() == b.italic() && - a.color() == b.color() && + a.colour() == b.colour() && a.size() == b.size() && a.in() == b.in() && a.out() == b.out() && @@ -81,7 +82,7 @@ dcp::operator== (SubtitleString const & a, SubtitleString const & b) a.v_align() == b.v_align() && a.text() == b.text() && a.effect() == b.effect() && - a.effect_color() == b.effect_color() && + a.effect_colour() == b.effect_colour() && a.fade_up_time() == b.fade_up_time() && a.fade_down_time() == b.fade_down_time() ); @@ -92,7 +93,7 @@ dcp::operator<< (ostream& s, SubtitleString const & sub) { s << "\n`" << sub.text() << "' from " << sub.in() << " to " << sub.out() << ";\n" << "fade up " << sub.fade_up_time() << ", fade down " << sub.fade_down_time() << ";\n" - << "font " << sub.font() << ", "; + << "font " << sub.font().get_value_or ("[default]") << ", "; if (sub.italic()) { s << "italic"; @@ -100,8 +101,8 @@ dcp::operator<< (ostream& s, SubtitleString const & sub) s << "non-italic"; } - s << ", size " << sub.size() << ", color " << sub.color() << ", vpos " << sub.v_position() << ", valign " << ((int) sub.v_align()) << ";\n" - << "effect " << ((int) sub.effect()) << ", effect color " << sub.effect_color(); + s << ", size " << sub.size() << ", colour " << sub.colour() << ", vpos " << sub.v_position() << ", valign " << ((int) sub.v_align()) << ";\n" + << "effect " << ((int) sub.effect()) << ", effect colour " << sub.effect_colour(); return s; }