summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-03-24 20:02:37 +0100
committerCarl Hetherington <cth@carlh.net>2022-03-24 20:02:37 +0100
commit04e215a7688239cb47fc86e8396756c685f338a1 (patch)
tree86ad3969cf50cfbedd3cbf4a088f179af67cbc83 /src
parent56fcbad9cac0972d4895ac03d935471da8673e0c (diff)
Some more detailed notes in dcpdiff.
Diffstat (limited to 'src')
-rw-r--r--src/reel_asset.cc32
1 files changed, 27 insertions, 5 deletions
diff --git a/src/reel_asset.cc b/src/reel_asset.cc
index 6b6bdc0b..6b0cd4d5 100644
--- a/src/reel_asset.cc
+++ b/src/reel_asset.cc
@@ -126,11 +126,21 @@ ReelAsset::cpl_node_namespace () const
}
+template <class T>
+string
+optional_to_string (optional<T> o)
+{
+ return o ? raw_convert<string>(*o) : "[none]";
+}
+
+
bool
ReelAsset::asset_equals (shared_ptr<const ReelAsset> other, EqualityOptions opt, NoteHandler note) const
{
+ auto const node = cpl_node_name(Standard::SMPTE);
+
if (_annotation_text != other->_annotation_text) {
- string const s = "Reel: annotation texts differ (" + _annotation_text.get_value_or("") + " vs " + other->_annotation_text.get_value_or("") + ")\n";
+ string const s = String::compose("Reel %1: annotation texts differ (%2 vs %3)", node, optional_to_string(_annotation_text), optional_to_string(other->_annotation_text));
if (!opt.reel_annotation_texts_can_differ) {
note (NoteType::ERROR, s);
return false;
@@ -140,22 +150,34 @@ ReelAsset::asset_equals (shared_ptr<const ReelAsset> other, EqualityOptions opt,
}
if (_edit_rate != other->_edit_rate) {
- note (NoteType::ERROR, "Reel: edit rates differ");
+ note (
+ NoteType::ERROR,
+ String::compose("Reel %1: edit rates differ (%2 vs %3)", node, _edit_rate.as_string(), other->_edit_rate.as_string())
+ );
return false;
}
if (_intrinsic_duration != other->_intrinsic_duration) {
- note (NoteType::ERROR, String::compose ("Reel: intrinsic durations differ (%1 vs %2)", _intrinsic_duration, other->_intrinsic_duration));
+ note (
+ NoteType::ERROR,
+ String::compose("Reel %1: intrinsic durations differ (%2 vs %3)", node, _intrinsic_duration, other->_intrinsic_duration)
+ );
return false;
}
if (_entry_point != other->_entry_point) {
- note (NoteType::ERROR, "Reel: entry points differ");
+ note (
+ NoteType::ERROR,
+ String::compose("Reel %1: entry points differ (%2 vs %3)", node, optional_to_string(_entry_point), optional_to_string(other->_entry_point))
+ );
return false;
}
if (_duration != other->_duration) {
- note (NoteType::ERROR, "Reel: durations differ");
+ note (
+ NoteType::ERROR,
+ String::compose("Reel %1: durations differ (%2 vs %3)", node, optional_to_string(_duration), optional_to_string(other->_duration))
+ );
return false;
}