libdcp
|
A set of subtitles/captions to be read and/or written in the SMPTE format. More...
#include <smpte_text_asset.h>
Public Member Functions | |
SMPTETextAsset (SubtitleStandard standard=SubtitleStandard::SMPTE_2014) | |
SMPTETextAsset (boost::filesystem::path file) | |
bool | equals (std::shared_ptr< const Asset >, EqualityOptions const &, NoteHandler note) const override |
std::vector< std::shared_ptr< LoadFontNode > > | load_font_nodes () const override |
std::string | xml_as_string () const override |
void | write (boost::filesystem::path path) const override |
void | add (std::shared_ptr< Text >) override |
void | add_font (std::string id, dcp::ArrayData data) override |
void | set_key (Key key) override |
void | set_content_title_text (std::string t) |
void | set_language (dcp::LanguageTag l) |
void | set_issue_date (LocalTime t) |
void | set_reel_number (int r) |
void | set_edit_rate (Fraction e) |
void | set_time_code_rate (int t) |
void | set_start_time (Time t) |
void | set_intrinsic_duration (int64_t d) |
int64_t | intrinsic_duration () const |
std::string | content_title_text () const |
boost::optional< std::string > | language () const |
boost::optional< std::string > | annotation_text () const |
LocalTime | issue_date () const |
boost::optional< int > | reel_number () const |
Fraction | edit_rate () const |
int | time_code_rate () const override |
boost::optional< Time > | start_time () const |
boost::optional< std::string > | xml_id () const |
boost::optional< std::string > | resource_id () const |
SubtitleStandard | subtitle_standard () const override |
Public Member Functions inherited from dcp::TextAsset | |
TextAsset (boost::filesystem::path file) | |
bool | equals (std::shared_ptr< const Asset >, EqualityOptions const &, NoteHandler note) const override |
std::vector< std::shared_ptr< const Text > > | texts_during (Time from, Time to, bool starting) const |
std::vector< std::shared_ptr< const Text > > | texts () const |
void | ensure_font (std::string id, dcp::ArrayData data) |
std::map< std::string, ArrayData > | font_data () const |
std::map< std::string, boost::filesystem::path > | font_filenames () const |
Time | latest_text_out () const |
void | fix_empty_font_ids () |
virtual boost::optional< std::string > | raw_xml () const |
Public Member Functions inherited from dcp::Asset | |
Asset () | |
Asset (boost::filesystem::path file) | |
Asset (std::string id, boost::filesystem::path file) | |
virtual void | add_to_assetmap (AssetMap &asset_map, boost::filesystem::path root) const |
virtual void | add_to_pkl (std::shared_ptr< PKL > pkl, boost::filesystem::path root) const |
boost::optional< boost::filesystem::path > | file () const |
void | set_file (boost::filesystem::path file) const |
void | set_file_preserving_hash (boost::filesystem::path file) const |
void | rename_file (boost::filesystem::path file) |
std::string | hash (boost::function< void(int64_t, int64_t)> progress={}) const |
void | set_hash (std::string hash) |
void | unset_hash () |
Public Member Functions inherited from dcp::Object | |
Object () | |
Object (std::string id) | |
Object (Object const &other) | |
Object & | operator= (Object const &other) |
std::string | id () const |
Public Member Functions inherited from dcp::MXF | |
MXF (Standard standard) | |
bool | encrypted () const |
void | set_key_id (std::string i) |
boost::optional< std::string > | key_id () const |
boost::optional< Key > | key () const |
void | set_context_id (std::string id) |
std::string | context_id () const |
void | set_metadata (MXFMetadata m) |
MXFMetadata | metadata () const |
Standard | standard () const |
Static Public Member Functions | |
static bool | valid_mxf (boost::filesystem::path) |
static std::string | static_pkl_type (Standard) |
Static Public Member Functions inherited from dcp::TextAsset | |
static std::string | format_xml (xmlpp::Document const &document, boost::optional< std::pair< std::string, std::string >> xml_namespace) |
Protected Member Functions | |
std::string | pkl_type (Standard s) const override |
Protected Member Functions inherited from dcp::TextAsset | |
void | parse_texts (xmlpp::Element const *node, std::vector< ParseState > &state, boost::optional< int > tcr, Standard standard) |
ParseState | font_node_state (xmlpp::Element const *node, Standard standard) const |
ParseState | text_node_state (xmlpp::Element const *node) const |
ParseState | image_node_state (xmlpp::Element const *node) const |
ParseState | subtitle_node_state (xmlpp::Element const *node, boost::optional< int > tcr) const |
Time | fade_time (xmlpp::Element const *node, std::string name, boost::optional< int > tcr) const |
void | position_align (ParseState &ps, xmlpp::Element const *node) const |
void | texts_as_xml (xmlpp::Element *root, int time_code_rate, Standard standard) const |
Protected Member Functions inherited from dcp::MXF | |
std::string | read_writer_info (ASDCP::WriterInfo const &) |
void | fill_writer_info (ASDCP::WriterInfo *w, std::string id) const |
Private Member Functions | |
void | read_fonts (std::shared_ptr< ASDCP::TimedText::MXFReader >) |
void | parse_xml (std::shared_ptr< cxml::Document > xml) |
void | read_mxf_descriptor (std::shared_ptr< ASDCP::TimedText::MXFReader > reader) |
void | read_mxf_resources (std::shared_ptr< ASDCP::TimedText::MXFReader > reader, std::shared_ptr< DecryptionContext > dec) |
std::string | schema_namespace () const |
Private Attributes | |
int64_t | _intrinsic_duration = 0 |
std::string | _content_title_text |
boost::optional< std::string > | _language |
boost::optional< std::string > | _annotation_text |
LocalTime | _issue_date |
boost::optional< int > | _reel_number |
Fraction | _edit_rate |
int | _time_code_rate = 0 |
boost::optional< Time > | _start_time |
SubtitleStandard | _subtitle_standard |
std::vector< std::shared_ptr< SMPTELoadFontNode > > | _load_font_nodes |
boost::optional< std::string > | _xml_id |
boost::optional< std::string > | _resource_id |
Additional Inherited Members | |
Static Protected Member Functions inherited from dcp::Asset | |
static void | add_file_to_assetmap (AssetMap &asset_map, boost::filesystem::path root, boost::filesystem::path file, std::string id) |
Protected Attributes inherited from dcp::TextAsset | |
std::vector< std::shared_ptr< Text > > | _texts |
std::vector< Font > | _fonts |
boost::optional< std::string > | _raw_xml |
Protected Attributes inherited from dcp::Asset | |
boost::optional< boost::filesystem::path > | _file |
Protected Attributes inherited from dcp::Object | |
std::string | _id |
Protected Attributes inherited from dcp::MXF | |
boost::optional< std::string > | _key_id |
boost::optional< Key > | _key |
std::string | _context_id |
MXFMetadata | _metadata |
boost::optional< Standard > | _standard |
A set of subtitles/captions to be read and/or written in the SMPTE format.
Definition at line 75 of file smpte_text_asset.h.
|
explicit |
Construct a SMPTETextAsset by reading an MXF or XML file
file | Filename |
Definition at line 93 of file smpte_text_asset.cc.
|
inline |
Definition at line 153 of file smpte_text_asset.h.
|
inline |
Definition at line 141 of file smpte_text_asset.h.
|
inline |
Definition at line 158 of file smpte_text_asset.h.
|
inline |
Definition at line 148 of file smpte_text_asset.h.
|
inlineoverrideprotectedvirtual |
Implements dcp::Asset.
Definition at line 205 of file smpte_text_asset.h.
|
inline |
Definition at line 190 of file smpte_text_asset.h.
|
overridevirtual |
|
inlineoverridevirtual |
Implements dcp::TextAsset.
Definition at line 174 of file smpte_text_asset.h.
|
overridevirtual |
Write this content to a MXF file
Implements dcp::TextAsset.
Definition at line 406 of file smpte_text_asset.cc.
|
inline |
Definition at line 185 of file smpte_text_asset.h.
|
private |
<ContentTitleText> from the asset
Definition at line 228 of file smpte_text_asset.h.
|
private |
The total length of this content in video frames. The amount of content presented may be less than this.
Definition at line 226 of file smpte_text_asset.h.
|
private |
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.
Definition at line 232 of file smpte_text_asset.h.
|
private |
ResourceID read from the MXF, if there was one
Definition at line 254 of file smpte_text_asset.h.
|
private |
There are two SMPTE standards describing subtitles, 428-7:2010 and 428-7:2014, and they have different interpretations of what Vposition means. Though libdcp does not need to know the difference, this variable stores the standard from the namespace that this asset was written with (or will be written with).
Definition at line 244 of file smpte_text_asset.h.
|
private |
UUID for the XML inside the MXF, which should be the same as the ResourceID in the MXF (our _resource_id) but different to the AssetUUID in the MXF (our _id) according to SMPTE Bv2.1 and Doremi's 2.8.18 release notes. May be boost::none if this object has been made from an encrypted object without a key.
Definition at line 251 of file smpte_text_asset.h.