summaryrefslogtreecommitdiff
path: root/src/lib/player_text.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-12-19 02:13:12 +0100
committerCarl Hetherington <cth@carlh.net>2019-12-19 02:13:12 +0100
commitea67859b383a31496a604e65a166974b20a1c94e (patch)
tree1740b2658f5033b59442e3958ba77b53905b16fa /src/lib/player_text.cc
parentb5335ed37e52c216a6773789c0edba5f335c8df2 (diff)
Hack: delay decisions about subtitle position late enough that we can refresh the preview image quickly.attic/hack-faster-subtitle-moving
Diffstat (limited to 'src/lib/player_text.cc')
-rw-r--r--src/lib/player_text.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/lib/player_text.cc b/src/lib/player_text.cc
index d31c7d024..ab28f9221 100644
--- a/src/lib/player_text.cc
+++ b/src/lib/player_text.cc
@@ -41,3 +41,31 @@ PlayerText::add_fonts (list<shared_ptr<Font> > fonts_)
}
}
}
+
+bool
+operator== (PlayerText const & a, PlayerText const & b)
+{
+ if (a.fonts.size() != b.fonts.size()) {
+ return false;
+ }
+
+ {
+ list<shared_ptr<Font> >::const_iterator i = a.fonts.begin();
+ list<shared_ptr<Font> >::const_iterator j = b.fonts.begin();
+ while (i != a.fonts.end()) {
+ if (**i != **j) {
+ return false;
+ }
+ ++i;
+ ++j;
+ }
+ }
+
+ return a.bitmap == b.bitmap && a.string == b.string;
+}
+
+bool
+operator!= (PlayerText const & a, PlayerText const & b)
+{
+ return !(a == b);
+}