diff options
Diffstat (limited to 'src/reel.cc')
| -rw-r--r-- | src/reel.cc | 50 |
1 files changed, 8 insertions, 42 deletions
diff --git a/src/reel.cc b/src/reel.cc index 43c934ea..fc6cbd49 100644 --- a/src/reel.cc +++ b/src/reel.cc @@ -31,57 +31,23 @@ using std::cout; using boost::shared_ptr; using namespace libdcp; +Reel::Reel (shared_ptr<cxml::Node> node) +{ + asset_list = type_child<AssetList> (node, "AssetList"); +} + void Reel::write_to_cpl (xmlpp::Element* node, bool interop) const { xmlpp::Element* reel = node->add_child ("Reel"); reel->add_child("Id")->add_child_text ("urn:uuid:" + make_uuid()); - xmlpp::Element* asset_list = reel->add_child ("AssetList"); - - if (_main_picture) { - _main_picture->write_to_cpl (asset_list, interop); - } - - if (_main_sound) { - _main_sound->write_to_cpl (asset_list, interop); - } - - if (_main_subtitle) { - _main_subtitle->write_to_cpl (asset_list, interop); - } + asset_list->write_to_cpl (reel, interop); } bool -Reel::equals (boost::shared_ptr<const Reel> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const +Reel::equals (shared_ptr<const Reel> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const { - if ((_main_picture && !other->_main_picture) || (!_main_picture && other->_main_picture)) { - note (ERROR, "reel has different assets"); - return false; - } - - if (_main_picture && !_main_picture->equals (other->_main_picture, opt, note)) { - return false; - } - - if ((_main_sound && !other->_main_sound) || (!_main_sound && other->_main_sound)) { - note (ERROR, "reel has different assets"); - return false; - } - - if (_main_sound && !_main_sound->equals (other->_main_sound, opt, note)) { - return false; - } - - if ((_main_subtitle && !other->_main_subtitle) || (!_main_subtitle && other->_main_subtitle)) { - note (ERROR, "reel has different assets"); - return false; - } - - if (_main_subtitle && !_main_subtitle->equals (other->_main_subtitle, opt, note)) { - return false; - } - - return true; + return asset_list->equals (other.asset_list, opt, note); } bool |
