35 #ifndef LIBDCP_SMPTE_SUBTITLE_ASSET_H
36 #define LIBDCP_SMPTE_SUBTITLE_ASSET_H
45 #include "language_tag.h"
49 #include <boost/filesystem.hpp>
59 struct verify_invalid_language1;
60 struct verify_invalid_language2;
61 struct write_subtitles_in_vertical_order_with_top_alignment;
62 struct write_subtitles_in_vertical_order_with_bottom_alignment;
68 class SMPTELoadFontNode;
85 std::shared_ptr<const Asset>,
90 std::vector<std::shared_ptr<LoadFontNode>> load_font_nodes ()
const override;
92 std::string xml_as_string ()
const override;
95 void write (boost::filesystem::path path)
const override;
97 void add (std::shared_ptr<Subtitle>)
override;
101 void set_content_title_text (std::string t) {
113 void set_reel_number (
int r) {
121 void set_time_code_rate (
int t) {
125 void set_start_time (
Time t) {
129 void set_intrinsic_duration (int64_t d) {
133 int64_t intrinsic_duration ()
const {
153 return _annotation_text;
161 boost::optional<int> reel_number ()
const {
165 Fraction edit_rate ()
const {
174 return _time_code_rate;
177 boost::optional<Time> start_time ()
const {
184 boost::optional<std::string>
xml_id ()
const {
193 static bool valid_mxf (boost::filesystem::path);
194 static std::string static_pkl_type (Standard) {
195 return "application/mxf";
201 return static_pkl_type (s);
205 friend struct ::write_smpte_subtitle_test;
206 friend struct ::write_smpte_subtitle_test2;
207 friend struct ::verify_invalid_language1;
208 friend struct ::verify_invalid_language2;
209 friend struct ::write_subtitles_in_vertical_order_with_top_alignment;
210 friend struct ::write_subtitles_in_vertical_order_with_bottom_alignment;
212 void read_fonts (std::shared_ptr<ASDCP::TimedText::MXFReader>);
213 void parse_xml (std::shared_ptr<cxml::Document> xml);
214 void read_mxf_descriptor (std::shared_ptr<ASDCP::TimedText::MXFReader> reader);
215 void read_mxf_resources (std::shared_ptr<ASDCP::TimedText::MXFReader> reader, std::shared_ptr<DecryptionContext> dec);
227 boost::optional<std::string> _annotation_text;
229 boost::optional<int> _reel_number;
231 int _time_code_rate = 0;
232 boost::optional<Time> _start_time;
234 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 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 to be read and/or written in the SMPTE format.
boost::optional< std::string > annotation_text() const
boost::optional< std::string > xml_id() const
std::string pkl_type(Standard s) const override
int time_code_rate() const override
boost::optional< std::string > resource_id() const
std::string content_title_text() const
LocalTime issue_date() const
std::string _content_title_text
void write(boost::filesystem::path path) const override
void set_key(Key key) override
boost::optional< std::string > _xml_id
boost::optional< std::string > language() const
boost::optional< std::string > _language
int64_t _intrinsic_duration
boost::optional< std::string > _resource_id
A parent for classes representing a file containing subtitles.
A representation of time within a DCP.
Namespace for everything in libdcp.
A class to describe what "equality" means for a particular test.