From 13a693315da47ee8c1306c92f9af2e95d4e6829e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 20 Dec 2014 22:25:55 +0000 Subject: Basic comparison of subtitle assets; tweaks to InteropLoadFont. --- src/subtitle_content.cc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/subtitle_content.cc') diff --git a/src/subtitle_content.cc b/src/subtitle_content.cc index 7bc080b3..e2c3efb2 100644 --- a/src/subtitle_content.cc +++ b/src/subtitle_content.cc @@ -38,6 +38,8 @@ using std::stringstream; using std::cout; using boost::shared_ptr; using boost::optional; +using boost::function; +using boost::dynamic_pointer_cast; using namespace dcp; SubtitleContent::SubtitleContent (boost::filesystem::path file) @@ -184,3 +186,33 @@ SubtitleContent::latest_subtitle_out () const return t; } + +bool +SubtitleContent::equals (shared_ptr other_asset, EqualityOptions options, function note) const +{ + if (!Asset::equals (other_asset, options, note)) { + return false; + } + + shared_ptr other = dynamic_pointer_cast (other_asset); + if (!other) { + return false; + } + + if (_reel_number != other->_reel_number) { + note (DCP_ERROR, "subtitle reel numbers differ"); + return false; + } + + if (_language != other->_language) { + note (DCP_ERROR, "subtitle languages differ"); + return false; + } + + if (_subtitles != other->_subtitles) { + note (DCP_ERROR, "subtitles differ"); + return false; + } + + return true; +} -- cgit v1.2.3