diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-05-02 17:20:04 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-05-02 17:20:04 +0100 |
| commit | 568d433830710baa7b0c64a5b7491758beb95b1c (patch) | |
| tree | a37742ed23776b3df3fe2f05900aaaa5cb9aa551 /src/asset.cc | |
| parent | 49fb66ee26be51bee67ae552c9cf4f8d21495b79 (diff) | |
Move edit rate / durations / entry point etc. into Asset from MXFAsset.
Diffstat (limited to 'src/asset.cc')
| -rw-r--r-- | src/asset.cc | 28 |
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; +} |
