X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Freel_sound_asset.cc;h=1f2ddcdd78b79d9bcd6b9cedbece7256cfca4ae8;hb=0eff1f460e187c5d0e3f3829a266d8dc9ee000db;hp=ab763cb33f3b3afc69469c5ba085b582888adc2c;hpb=2d60083498861ac30c751dbf0ca387573df6dc68;p=libdcp.git diff --git a/src/reel_sound_asset.cc b/src/reel_sound_asset.cc index ab763cb3..1f2ddcdd 100644 --- a/src/reel_sound_asset.cc +++ b/src/reel_sound_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,67 +31,63 @@ files in the program, then also delete it here. */ + /** @file src/reel_sound_asset.cc - * @brief ReelSoundAsset class. + * @brief ReelSoundAsset class */ -#include "reel_sound_asset.h" + #include "dcp_assert.h" +#include "reel_sound_asset.h" +#include "warnings.h" #include +LIBDCP_DISABLE_WARNINGS #include +LIBDCP_ENABLE_WARNINGS + using std::string; -using boost::shared_ptr; +using std::shared_ptr; +using boost::optional; using namespace dcp; + ReelSoundAsset::ReelSoundAsset (shared_ptr asset, int64_t entry_point) - : ReelAsset (asset, asset->edit_rate(), asset->intrinsic_duration(), entry_point) - , ReelMXF (asset, asset->key_id()) + : ReelFileAsset (asset, asset->key_id(), asset->id(), asset->edit_rate(), asset->intrinsic_duration(), entry_point) { } + ReelSoundAsset::ReelSoundAsset (shared_ptr node) - : ReelAsset (node) - , ReelMXF (node) + : ReelFileAsset (node) { node->ignore_child ("Language"); node->done (); } + string ReelSoundAsset::cpl_node_name (Standard) const { return "MainSound"; } -string + +optional ReelSoundAsset::key_type () const { - return "MDAK"; + return string("MDAK"); } -xmlpp::Node * -ReelSoundAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const -{ - xmlpp::Node* asset = write_to_cpl_base (node, standard, hash()); - - if (key_id ()) { - /* Find */ - xmlpp::Node* hash = find_child (asset, "Hash"); - asset->add_child_before(hash, "KeyId")->add_child_text("urn:uuid:" + key_id().get()); - } - - return asset; -} bool -ReelSoundAsset::equals (shared_ptr other, EqualityOptions opt, NoteHandler note) const +ReelSoundAsset::equals(shared_ptr other, EqualityOptions const& opt, NoteHandler note) const { if (!asset_equals (other, opt, note)) { return false; } - if (!mxf_equals (other, opt, note)) { + if (!file_asset_equals (other, opt, note)) { return false; }