diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-12-20 22:25:55 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-12-20 22:25:55 +0000 |
| commit | 13a693315da47ee8c1306c92f9af2e95d4e6829e (patch) | |
| tree | 4eda98c12ba36b0df450f7d3000d1ec0f52925ac /src/subtitle_content.cc | |
| parent | 6e4224ae8c9efa7f9e56e511531b7f53d8bd4f9c (diff) | |
Basic comparison of subtitle assets; tweaks to InteropLoadFont.
Diffstat (limited to 'src/subtitle_content.cc')
| -rw-r--r-- | src/subtitle_content.cc | 32 |
1 files changed, 32 insertions, 0 deletions
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<const Asset> other_asset, EqualityOptions options, function<void (NoteType, std::string)> note) const +{ + if (!Asset::equals (other_asset, options, note)) { + return false; + } + + shared_ptr<const SubtitleContent> other = dynamic_pointer_cast<const SubtitleContent> (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; +} |
