X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fsmpte_subtitle_asset.h;h=26144fe101be003e4e2c556e5a892afce0446ed9;hb=refs%2Fheads%2Ftidy-eq-options;hp=1ece2405c10952028648a4841c79d99915e1ea02;hpb=274dd30f2b11fe8ea563a2ac7436c9d463865b0b;p=libdcp.git diff --git a/src/smpte_subtitle_asset.h b/src/smpte_subtitle_asset.h index 1ece2405..26144fe1 100644 --- a/src/smpte_subtitle_asset.h +++ b/src/smpte_subtitle_asset.h @@ -41,11 +41,12 @@ */ -#include "subtitle_asset.h" +#include "crypto_context.h" #include "language_tag.h" #include "local_time.h" #include "mxf.h" -#include "crypto_context.h" +#include "subtitle_asset.h" +#include "subtitle_standard.h" #include @@ -58,6 +59,8 @@ namespace ASDCP { struct verify_invalid_language1; struct verify_invalid_language2; +struct write_subtitles_in_vertical_order_with_top_alignment; +struct write_subtitles_in_vertical_order_with_bottom_alignment; namespace dcp { @@ -72,7 +75,7 @@ class SMPTELoadFontNode; class SMPTESubtitleAsset : public SubtitleAsset, public MXF { public: - SMPTESubtitleAsset (); + explicit SMPTESubtitleAsset(SubtitleStandard standard = SubtitleStandard::SMPTE_2014); /** Construct a SMPTESubtitleAsset by reading an MXF or XML file * @param file Filename @@ -81,7 +84,7 @@ public: bool equals ( std::shared_ptr, - EqualityOptions, + EqualityOptions const&, NoteHandler note ) const override; @@ -176,15 +179,22 @@ public: return _start_time; } - std::string xml_id () const { + /** @return ID from XML's tag, or the that will be used when writing the XML, + * or boost::none if this content is encrypted and no key is available. + */ + boost::optional xml_id () const { return _xml_id; } - /** @return ResourceID read from the MXF, if there was one */ + /** @return ResourceID read from any MXF that was read */ boost::optional resource_id () const { return _resource_id; } + SubtitleStandard subtitle_standard() const override { + return _subtitle_standard; + } + static bool valid_mxf (boost::filesystem::path); static std::string static_pkl_type (Standard) { return "application/mxf"; @@ -201,10 +211,14 @@ private: friend struct ::write_smpte_subtitle_test2; friend struct ::verify_invalid_language1; friend struct ::verify_invalid_language2; + friend struct ::write_subtitles_in_vertical_order_with_top_alignment; + friend struct ::write_subtitles_in_vertical_order_with_bottom_alignment; void read_fonts (std::shared_ptr); void parse_xml (std::shared_ptr xml); - void read_mxf_descriptor (std::shared_ptr reader, std::shared_ptr dec); + void read_mxf_descriptor (std::shared_ptr reader); + void read_mxf_resources (std::shared_ptr reader, std::shared_ptr dec); + std::string schema_namespace() const; /** The total length of this content in video frames. The amount of * content presented may be less than this. @@ -222,12 +236,19 @@ private: Fraction _edit_rate; int _time_code_rate = 0; boost::optional