summaryrefslogtreecommitdiff
path: root/src/asset.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-05-04 11:15:35 +0100
committerCarl Hetherington <cth@carlh.net>2013-05-04 11:15:35 +0100
commitfca67f5661c55db6d4206cd17f4cdcf7ede865da (patch)
treebd1d4f8fa6fa7befa30c78c646f636e31a6b3e80 /src/asset.cc
parentaf87bfc82beee0b0600558c84c3843dfd5a252f6 (diff)
parenta7bf2931ce47b1f3a2e4dbea0cf642d955619ac9 (diff)
Merge master.
Diffstat (limited to 'src/asset.cc')
-rw-r--r--src/asset.cc28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/asset.cc b/src/asset.cc
index 305fc9a7..58c821a7 100644
--- a/src/asset.cc
+++ b/src/asset.cc
@@ -35,10 +35,14 @@ using namespace std;
using namespace boost;
using namespace libdcp;
-Asset::Asset (string directory, string file_name)
+Asset::Asset (string directory, string file_name, int edit_rate, int intrinsic_duration)
: _directory (directory)
, _file_name (file_name)
, _uuid (make_uuid ())
+ , _edit_rate (edit_rate)
+ , _entry_point (0)
+ , _intrinsic_duration (intrinsic_duration)
+ , _duration (intrinsic_duration)
{
if (_file_name.empty ()) {
_file_name = _uuid + ".xml";
@@ -91,3 +95,25 @@ Asset::digest () const
return _digest;
}
+
+
+bool
+Asset::equals (shared_ptr<const Asset> other, EqualityOptions, boost::function<void (NoteType, string)> note) const
+{
+ if (_edit_rate != other->_edit_rate) {
+ note (ERROR, "MXF edit rates differ");
+ return false;
+ }
+
+ if (_intrinsic_duration != other->_intrinsic_duration) {
+ note (ERROR, "MXF intrinsic durations differ");
+ return false;
+ }
+
+ if (_duration != other->_duration) {
+ note (ERROR, "MXF durations differ");
+ return false;
+ }
+
+ return true;
+}