2 Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include "subtitle_string.h"
27 SubtitleString::SubtitleString (
48 , _v_position (v_position)
52 , _effect_color (effect_color)
53 , _fade_up_time (fade_up_time)
54 , _fade_down_time (fade_down_time)
60 SubtitleString::size_in_pixels (int screen_height) const
62 /* Size in the subtitle file is given in points as if the screen
63 height is 11 inches, so a 72pt font would be 1/11th of the screen
67 return _size * screen_height / (11 * 72);
71 dcp::operator== (SubtitleString const & a, SubtitleString const & b)
74 a.font() == b.font() &&
75 a.italic() == b.italic() &&
76 a.color() == b.color() &&
77 a.size() == b.size() &&
80 a.v_position() == b.v_position() &&
81 a.v_align() == b.v_align() &&
82 a.text() == b.text() &&
83 a.effect() == b.effect() &&
84 a.effect_color() == b.effect_color() &&
85 a.fade_up_time() == b.fade_up_time() &&
86 a.fade_down_time() == b.fade_down_time()
91 dcp::operator<< (ostream& s, SubtitleString const & sub)
93 s << "\n`" << sub.text() << "' from " << sub.in() << " to " << sub.out() << ";\n"
94 << "fade up " << sub.fade_up_time() << ", fade down " << sub.fade_down_time() << ";\n"
95 << "font " << sub.font() << ", ";
103 s << ", size " << sub.size() << ", color " << sub.color() << ", vpos " << sub.v_position() << ", valign " << ((int) sub.v_align()) << ";\n"
104 << "effect " << ((int) sub.effect()) << ", effect color " << sub.effect_color();