X-Git-Url: https://main.carlh.net/gitweb/?p=libdcp.git;a=blobdiff_plain;f=src%2Freel_asset.cc;h=0f47e08dc5dc6c37b180c6cf7db31f1cc8b051de;hp=4d26e4f4b25ff714ef495771697e330555359e52;hb=ceaf7bc52712cb60708ed5eb5c62c5e463dd8e89;hpb=6c37cc1979b2a01205a888c4c98f3334685ee8dd diff --git a/src/reel_asset.cc b/src/reel_asset.cc index 4d26e4f4..0f47e08d 100644 --- a/src/reel_asset.cc +++ b/src/reel_asset.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2015 Carl Hetherington + Copyright (C) 2014-2021 Carl Hetherington This file is part of libdcp. @@ -31,10 +31,12 @@ files in the program, then also delete it here. */ + /** @file src/reel_asset.cc - * @brief ReelAsset class. + * @brief ReelAsset class */ + #include "raw_convert.h" #include "reel_asset.h" #include "asset.h" @@ -43,6 +45,7 @@ #include #include + using std::pair; using std::string; using std::make_pair; @@ -50,12 +53,7 @@ using std::shared_ptr; using boost::optional; using namespace dcp; -/** Construct a ReelAsset. - * @param id ID of this ReelAsset (which is that of the MXF, if there is one) - * @param edit_rate Edit rate for the asset. - * @param intrinsic_duration Intrinsic duration of this asset. - * @param entry_point Entry point to use in that asset. - */ + ReelAsset::ReelAsset (string id, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) : Object (id) , _intrinsic_duration (intrinsic_duration) @@ -66,6 +64,7 @@ ReelAsset::ReelAsset (string id, Fraction edit_rate, int64_t intrinsic_duration, DCP_ASSERT (_entry_point <= _intrinsic_duration); } + ReelAsset::ReelAsset (shared_ptr node) : Object (remove_urn_uuid (node->string_child ("Id"))) , _intrinsic_duration (node->number_child ("IntrinsicDuration")) @@ -77,15 +76,16 @@ ReelAsset::ReelAsset (shared_ptr node) } + xmlpp::Node* ReelAsset::write_to_cpl_asset (xmlpp::Node* node, Standard standard, optional hash) const { - xmlpp::Element* a = node->add_child (cpl_node_name (standard)); - pair const attr = cpl_node_attribute (standard); + auto a = node->add_child (cpl_node_name (standard)); + auto const attr = cpl_node_attribute (standard); if (!attr.first.empty ()) { a->set_attribute (attr.first, attr.second); } - pair const ns = cpl_node_namespace (standard); + auto const ns = cpl_node_namespace (standard); if (!ns.first.empty ()) { a->set_namespace_declaration (ns.first, ns.second); } @@ -105,18 +105,21 @@ ReelAsset::write_to_cpl_asset (xmlpp::Node* node, Standard standard, optional ReelAsset::cpl_node_attribute (Standard) const { return make_pair ("", ""); } + pair ReelAsset::cpl_node_namespace (Standard) const { return make_pair ("", ""); } + bool ReelAsset::asset_equals (shared_ptr other, EqualityOptions opt, NoteHandler note) const { @@ -153,7 +156,7 @@ ReelAsset::asset_equals (shared_ptr other, EqualityOptions opt, return true; } -/** @return , or - if is not present */ + int64_t ReelAsset::actual_duration () const {