From 4678bf06d71c8a18c489912dabf8aca312ab8b6b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 31 Jul 2012 00:32:58 +0100 Subject: Barely-functional dcpdiff. --- src/dcp.cc | 27 +++++++++++++++++++++++++++ src/dcp.h | 2 ++ src/types.h | 4 ++++ 3 files changed, 33 insertions(+) (limited to 'src') 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 +DCP::equals (DCP const & other, EqualityType type) const +{ + list 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 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 -- cgit v1.2.3