libdcp
|
A set of subtitles to be read and/or written in the SMPTE format. More...
#include <smpte_subtitle_asset.h>
Public Member Functions | |
SMPTESubtitleAsset (boost::filesystem::path file) | |
bool | equals (std::shared_ptr< const Asset >, EqualityOptions, 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< Subtitle >) 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 |
Public Member Functions inherited from dcp::SubtitleAsset | |
SubtitleAsset (boost::filesystem::path file) | |
bool | equals (std::shared_ptr< const Asset >, EqualityOptions, NoteHandler note) const override |
std::vector< std::shared_ptr< const Subtitle > > | subtitles_during (Time from, Time to, bool starting) const |
std::vector< std::shared_ptr< const Subtitle > > | subtitles_in_reel (std::shared_ptr< const dcp::ReelAsset > asset) const |
std::vector< std::shared_ptr< const Subtitle > > | subtitles () const |
std::map< std::string, ArrayData > | font_data () const |
std::map< std::string, boost::filesystem::path > | font_filenames () const |
Time | latest_subtitle_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 | write_to_assetmap (xmlpp::Node *node, 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 |
std::string | hash (boost::function< void(float)> progress={}) const |
void | set_hash (std::string hash) |
Public Member Functions inherited from dcp::Object | |
Object () | |
Object (std::string id) | |
Object (Object const &)=delete | |
Object & | operator= (Object const &)=delete |
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) |
Protected Member Functions | |
std::string | pkl_type (Standard s) const override |
Protected Member Functions inherited from dcp::SubtitleAsset | |
void | parse_subtitles (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 | subtitles_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) |
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 |
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 | write_file_to_assetmap (xmlpp::Node *node, boost::filesystem::path root, boost::filesystem::path file, std::string id) |
Protected Attributes inherited from dcp::SubtitleAsset | |
std::vector< std::shared_ptr< Subtitle > > | _subtitles |
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 to be read and/or written in the SMPTE format.
Definition at line 74 of file smpte_subtitle_asset.h.
|
explicit |
Construct a SMPTESubtitleAsset by reading an MXF or XML file
file | Filename |
Definition at line 88 of file smpte_subtitle_asset.cc.
|
inline |
Definition at line 152 of file smpte_subtitle_asset.h.
|
inline |
Definition at line 140 of file smpte_subtitle_asset.h.
|
inline |
Definition at line 157 of file smpte_subtitle_asset.h.
|
inline |
Definition at line 147 of file smpte_subtitle_asset.h.
|
inlineoverrideprotectedvirtual |
Implements dcp::Asset.
Definition at line 200 of file smpte_subtitle_asset.h.
|
inline |
Definition at line 189 of file smpte_subtitle_asset.h.
|
overridevirtual |
Set the (private) key that will be used to encrypt or decrypt this MXF's content This is the top-secret key that is distributed (itself encrypted) to cinemas via Key Delivery Messages (KDMs)
key | Key to use |
Reimplemented from dcp::MXF.
Definition at line 282 of file smpte_subtitle_asset.cc.
|
inlineoverridevirtual |
Implements dcp::SubtitleAsset.
Definition at line 173 of file smpte_subtitle_asset.h.
|
overridevirtual |
Write this content to a MXF file
Implements dcp::SubtitleAsset.
Definition at line 382 of file smpte_subtitle_asset.cc.
|
inline |
Definition at line 184 of file smpte_subtitle_asset.h.
|
private |
<ContentTitleText> from the asset
Definition at line 222 of file smpte_subtitle_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 220 of file smpte_subtitle_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 226 of file smpte_subtitle_asset.h.
|
private |
ResourceID read from the MXF, if there was one
Definition at line 242 of file smpte_subtitle_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 239 of file smpte_subtitle_asset.h.