summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-07-31 00:32:58 +0100
committerCarl Hetherington <cth@carlh.net>2012-07-31 00:32:58 +0100
commit4678bf06d71c8a18c489912dabf8aca312ab8b6b (patch)
tree00ad12122fa34cb38182091f0e853761d104a902 /src
parentfe3476307bead95b72efc7d47a2ce3da31c35d88 (diff)
Barely-functional dcpdiff.
Diffstat (limited to 'src')
-rw-r--r--src/dcp.cc27
-rw-r--r--src/dcp.h2
-rw-r--r--src/types.h4
3 files changed, 33 insertions, 0 deletions
diff --git a/src/dcp.cc b/src/dcp.cc
index 8f7a73bc..dc895e11 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -304,3 +304,30 @@ DCP::DCP (string directory)
}
}
+list<string>
+DCP::equals (DCP const & other, EqualityType type) const
+{
+ list<string> notes;
+
+ switch (type) {
+ case LIBDCP_METADATA:
+ if (_name != other._name) {
+ notes.push_back ("names differ");
+ }
+ if (_content_kind != other._content_kind) {
+ notes.push_back ("content kinds differ");
+ }
+ if (_fps != other._fps) {
+ notes.push_back ("frames per second differ");
+ }
+ if (_length != other._length) {
+ notes.push_back ("lengths differ");
+ }
+ if (_assets.size() != other._assets.size()) {
+ notes.push_back ("asset counts differ");
+ }
+ break;
+ }
+
+ return notes;
+}
diff --git a/src/dcp.h b/src/dcp.h
index 900a5665..6ab57bcb 100644
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -106,6 +106,8 @@ public:
return _length;
}
+ std::list<std::string> equals (DCP const & other, EqualityType type) const;
+
/** Emitted with a parameter between 0 and 1 to indicate progress
* for long jobs.
*/
diff --git a/src/types.h b/src/types.h
index b8f7805a..5cd76ff4 100644
--- a/src/types.h
+++ b/src/types.h
@@ -62,6 +62,10 @@ public:
int denominator;
};
+enum EqualityType {
+ LIBDCP_METADATA
+};
+
}
#endif