35 #ifndef LIBDCP_SMPTE_TEXT_ASSET_H
36 #define LIBDCP_SMPTE_TEXT_ASSET_H
49 #include "subtitle_standard.h"
50 #include <boost/filesystem.hpp>
60 struct verify_invalid_language1;
61 struct verify_invalid_language2;
62 struct write_subtitles_in_vertical_order_with_top_alignment;
63 struct write_subtitles_in_vertical_order_with_bottom_alignment;
69 class SMPTELoadFontNode;
78 explicit SMPTETextAsset(SubtitleStandard standard = SubtitleStandard::SMPTE_2014);
86 std::shared_ptr<const Asset>,
91 std::vector<std::shared_ptr<LoadFontNode>> load_font_nodes ()
const override;
93 std::string xml_as_string ()
const override;
96 void write (boost::filesystem::path path)
const override;
98 void add(std::shared_ptr<Text>)
override;
102 void set_content_title_text (std::string t) {
114 void set_reel_number (
int r) {
122 void set_time_code_rate (
int t) {
126 void set_start_time (
Time t) {
130 void set_intrinsic_duration (int64_t d) {
134 int64_t intrinsic_duration ()
const {
154 return _annotation_text;
162 boost::optional<int> reel_number ()
const {
166 Fraction edit_rate ()
const {
175 return _time_code_rate;
178 boost::optional<Time> start_time ()
const {
185 boost::optional<std::string>
xml_id ()
const {
194 SubtitleStandard subtitle_standard()
const override {
198 static bool valid_mxf (boost::filesystem::path);
199 static std::string static_pkl_type (Standard) {
200 return "application/mxf";
206 return static_pkl_type (s);
210 friend struct ::write_smpte_subtitle_test;
211 friend struct ::write_smpte_subtitle_test2;
212 friend struct ::verify_invalid_language1;
213 friend struct ::verify_invalid_language2;
214 friend struct ::write_subtitles_in_vertical_order_with_top_alignment;
215 friend struct ::write_subtitles_in_vertical_order_with_bottom_alignment;
217 void read_fonts (std::shared_ptr<ASDCP::TimedText::MXFReader>);
218 void parse_xml (std::shared_ptr<cxml::Document> xml);
219 void read_mxf_descriptor (std::shared_ptr<ASDCP::TimedText::MXFReader> reader);
220 void read_mxf_resources (std::shared_ptr<ASDCP::TimedText::MXFReader> reader, std::shared_ptr<DecryptionContext> dec);
221 std::string schema_namespace()
const;
233 boost::optional<std::string> _annotation_text;
235 boost::optional<int> _reel_number;
237 int _time_code_rate = 0;
238 boost::optional<Time> _start_time;
246 std::vector<std::shared_ptr<SMPTELoadFontNode>> _load_font_nodes;
Class to hold an arbitrary block of data.
boost::optional< boost::filesystem::path > file() const
A class to describe what "equality" means for a particular test.
A fraction (i.e. a thing with an integer numerator and an integer denominator).
A key for decrypting/encrypting assets.
A representation of a local time (down to the second), including its offset from GMT (equivalent to x...
Parent for classes which represent MXF files.
boost::optional< Key > key() const
A set of subtitles/captions to be read and/or written in the SMPTE format.
int64_t _intrinsic_duration
boost::optional< std::string > _language
std::string _content_title_text
std::string pkl_type(Standard s) const override
boost::optional< std::string > language() const
boost::optional< std::string > xml_id() const
SubtitleStandard _subtitle_standard
LocalTime issue_date() const
boost::optional< std::string > _xml_id
boost::optional< std::string > annotation_text() const
int time_code_rate() const override
boost::optional< std::string > resource_id() const
void write(boost::filesystem::path path) const override
void set_key(Key key) override
boost::optional< std::string > _resource_id
std::string content_title_text() const
A parent for classes representing a file containing subtitles or captions.
A representation of time within a DCP.
Namespace for everything in libdcp.