2 Copyright (C) 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.
25 sub::operator< (Subtitle const & a, Subtitle const & b)
27 if (a.from.frame() && b.from.frame()) {
28 return a.from.frame().get() < b.from.frame().get();
31 if (a.from.metric() && b.from.metric()) {
32 return a.from.metric().get() < b.from.metric().get();
40 Block::FontSize::proportional (int screen_height_in_points) const
43 return _proportional.get ();
46 return float (_points.get ()) / screen_height_in_points;
50 Block::FontSize::points (int screen_height_in_points) const
53 return _points.get ();
56 return _proportional.get() * screen_height_in_points;
60 Subtitle::same_metadata (Subtitle const & other) const
63 vertical_position == other.vertical_position &&
66 fade_up == other.fade_up &&
67 fade_down == other.fade_down
72 Subtitle::VerticalPosition::operator== (Subtitle::VerticalPosition const & other) const
74 if (proportional && reference && other.proportional && other.reference) {
75 return proportional.get() == other.proportional.get() && reference.get() == other.reference.get();
76 } else if (line && other.line) {
77 return line.get() == other.line.get();