+SMPTESubtitleAsset::equals(shared_ptr<const Asset> other_asset, EqualityOptions const& options, NoteHandler note) const
+{
+ if (!SubtitleAsset::equals (other_asset, options, note)) {
+ return false;
+ }
+
+ auto other = dynamic_pointer_cast<const SMPTESubtitleAsset>(other_asset);
+ if (!other) {
+ note (NoteType::ERROR, "Subtitles are in different standards");
+ return false;
+ }
+
+ auto i = _load_font_nodes.begin();
+ auto j = other->_load_font_nodes.begin();
+
+ while (i != _load_font_nodes.end ()) {
+ if (j == other->_load_font_nodes.end ()) {
+ note (NoteType::ERROR, "<LoadFont> nodes differ");
+ return false;
+ }
+
+ if ((*i)->id != (*j)->id) {
+ note (NoteType::ERROR, "<LoadFont> nodes differ");
+ return false;
+ }
+
+ ++i;
+ ++j;
+ }
+
+ if (_content_title_text != other->_content_title_text) {
+ note (NoteType::ERROR, "Subtitle content title texts differ");
+ return false;
+ }
+
+ if (_language != other->_language) {
+ note (NoteType::ERROR, String::compose("Subtitle languages differ (`%1' vs `%2')", _language.get_value_or("[none]"), other->_language.get_value_or("[none]")));
+ return false;
+ }
+
+ if (_annotation_text != other->_annotation_text) {
+ note (NoteType::ERROR, "Subtitle annotation texts differ");
+ return false;
+ }
+
+ if (_issue_date != other->_issue_date) {
+ if (options.issue_dates_can_differ) {
+ note (NoteType::NOTE, "Subtitle issue dates differ");
+ } else {
+ note (NoteType::ERROR, "Subtitle issue dates differ");
+ return false;
+ }
+ }
+
+ if (_reel_number != other->_reel_number) {
+ note (NoteType::ERROR, "Subtitle reel numbers differ");
+ return false;
+ }
+
+ if (_edit_rate != other->_edit_rate) {
+ note (NoteType::ERROR, "Subtitle edit rates differ");
+ return false;
+ }
+
+ if (_time_code_rate != other->_time_code_rate) {
+ note (NoteType::ERROR, "Subtitle time code rates differ");
+ return false;
+ }
+
+ if (_start_time != other->_start_time) {
+ note (NoteType::ERROR, "Subtitle start times differ");
+ return false;
+ }
+
+ return true;
+}
+
+
+void
+SMPTESubtitleAsset::add_font (string load_id, dcp::ArrayData data)
+{
+ string const uuid = make_uuid ();
+ _fonts.push_back (Font(load_id, uuid, data));
+ _load_font_nodes.push_back (make_shared<SMPTELoadFontNode>(load_id, uuid));
+}
+
+
+void
+SMPTESubtitleAsset::add (shared_ptr<Subtitle> s)