X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Freel_subtitle_asset.h;h=a4e674ba419e52f97b50aefebe7f4146a0e1501b;hb=488e3d1bd5e6b17d49f6db4df14c64f4b64db89b;hp=a0cc405cca7b92cdebfe75deafa672befc541deb;hpb=f614b4526cd06a4d28b46bd2d98a55d56b97b14f;p=libdcp.git diff --git a/src/reel_subtitle_asset.h b/src/reel_subtitle_asset.h index a0cc405c..a4e674ba 100644 --- a/src/reel_subtitle_asset.h +++ b/src/reel_subtitle_asset.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2020 Carl Hetherington + Copyright (C) 2012-2021 Carl Hetherington This file is part of libdcp. @@ -31,36 +31,46 @@ files in the program, then also delete it here. */ + /** @file src/reel_subtitle_asset.h * @brief ReelSubtitleAsset class. */ + #ifndef LIBDCP_REEL_SUBTITLE_ASSET_H #define LIBDCP_REEL_SUBTITLE_ASSET_H + #include "language_tag.h" #include "reel_asset.h" -#include "reel_mxf.h" +#include "reel_file_asset.h" #include "subtitle_asset.h" + +struct verify_invalid_language1; + + namespace dcp { + class SubtitleAsset; + /** @class ReelSubtitleAsset - * @brief Part of a Reel's description which refers to a subtitle XML/MXF file. + * @brief Part of a Reel's description which refers to a subtitle XML/MXF file */ -class ReelSubtitleAsset : public ReelAsset, public ReelMXF +class ReelSubtitleAsset : public ReelFileAsset { public: - ReelSubtitleAsset (boost::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); - explicit ReelSubtitleAsset (boost::shared_ptr); + ReelSubtitleAsset (std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); + explicit ReelSubtitleAsset (std::shared_ptr); xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const; - bool equals (boost::shared_ptr, EqualityOptions, NoteHandler) const; - boost::shared_ptr asset () const { - return asset_of_type (); + bool equals (std::shared_ptr, EqualityOptions, NoteHandler) const; + + std::shared_ptr asset () const { + return std::dynamic_pointer_cast(_asset_ref.asset()); } void set_language (dcp::LanguageTag language); @@ -69,17 +79,21 @@ public: return _language; } -private: - std::string key_type () const; - std::string cpl_node_name (Standard standard) const; - +protected: /** As in other places, this is stored and returned as a string so that * we can tolerate non-RFC-5646 strings, but must be set as a dcp::LanguageTag * to try to ensure that we create compliant output. */ boost::optional _language; + +private: + friend struct ::verify_invalid_language1; + + std::string cpl_node_name (Standard standard) const; }; + } + #endif