diff options
Diffstat (limited to 'src/reel_subtitle_asset.cc')
| -rw-r--r-- | src/reel_subtitle_asset.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/reel_subtitle_asset.cc b/src/reel_subtitle_asset.cc index 029c8cb0..3a531962 100644 --- a/src/reel_subtitle_asset.cc +++ b/src/reel_subtitle_asset.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net> This file is part of libdcp. @@ -31,22 +31,26 @@ files in the program, then also delete it here. */ + /** @file src/reel_subtitle_asset.cc - * @brief ReelSubtitleAsset class. + * @brief ReelSubtitleAsset class */ + #include "language_tag.h" #include "subtitle_asset.h" #include "reel_subtitle_asset.h" #include "smpte_subtitle_asset.h" #include <libxml++/libxml++.h> + using std::string; using std::shared_ptr; using std::dynamic_pointer_cast; using boost::optional; using namespace dcp; + ReelSubtitleAsset::ReelSubtitleAsset (std::shared_ptr<SubtitleAsset> asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) : ReelAsset (asset->id(), edit_rate, intrinsic_duration, entry_point) , ReelMXF (asset, dynamic_pointer_cast<SMPTESubtitleAsset>(asset) ? dynamic_pointer_cast<SMPTESubtitleAsset>(asset)->key_id() : optional<string>()) @@ -54,6 +58,7 @@ ReelSubtitleAsset::ReelSubtitleAsset (std::shared_ptr<SubtitleAsset> asset, Frac } + ReelSubtitleAsset::ReelSubtitleAsset (std::shared_ptr<const cxml::Node> node) : ReelAsset (node) , ReelMXF (node) @@ -62,22 +67,25 @@ ReelSubtitleAsset::ReelSubtitleAsset (std::shared_ptr<const cxml::Node> node) node->done (); } + string ReelSubtitleAsset::cpl_node_name (Standard) const { return "MainSubtitle"; } + string ReelSubtitleAsset::key_type () const { return "MDSK"; } + xmlpp::Node * ReelSubtitleAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const { - xmlpp::Node* asset = write_to_cpl_asset (node, standard, hash()); + auto asset = write_to_cpl_asset (node, standard, hash()); write_to_cpl_mxf (asset); if (_language) { asset->add_child("Language")->add_child_text(*_language); @@ -85,6 +93,7 @@ ReelSubtitleAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const return asset; } + bool ReelSubtitleAsset::equals (shared_ptr<const ReelSubtitleAsset> other, EqualityOptions opt, NoteHandler note) const { |
