A parent for classes representing a file containing subtitles.
More...
#include <subtitle_asset.h>
|
class | Font |
|
struct | ParseState |
|
|
| 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 |
|
virtual void | add (std::shared_ptr< Subtitle >) |
|
virtual void | add_font (std::string id, dcp::ArrayData data)=0 |
|
std::map< std::string, ArrayData > | font_data () const |
|
std::map< std::string, boost::filesystem::path > | font_filenames () const |
|
virtual void | write (boost::filesystem::path) const =0 |
|
virtual std::string | xml_as_string () const =0 |
|
Time | latest_subtitle_out () const |
|
void | fix_empty_font_ids () |
|
virtual std::vector< std::shared_ptr< LoadFontNode > > | load_font_nodes () const =0 |
|
virtual int | time_code_rate () const =0 |
|
virtual boost::optional< std::string > | raw_xml () const |
|
| 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) |
|
| Object () |
|
| Object (std::string id) |
|
| Object (Object const &)=delete |
|
Object & | operator= (Object const &)=delete |
|
std::string | id () const |
|
|
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 |
|
|
void | maybe_add_subtitle (std::string text, std::vector< ParseState > const &parse_state, float space_before, Standard standard) |
|
|
static void | pull_fonts (std::shared_ptr< order::Part > part) |
|
|
struct | ::interop_dcp_font_test |
|
struct | ::smpte_dcp_font_test |
|
struct | ::pull_fonts_test1 |
|
struct | ::pull_fonts_test2 |
|
struct | ::pull_fonts_test3 |
|
|
static void | write_file_to_assetmap (xmlpp::Node *node, boost::filesystem::path root, boost::filesystem::path file, std::string id) |
|
A parent for classes representing a file containing subtitles.
This class holds a list of Subtitle objects which it can extract from the appropriate part of either an Interop or SMPTE XML file. Its subclasses InteropSubtitleAsset and SMPTESubtitleAsset handle the differences between the two types.
Definition at line 91 of file subtitle_asset.h.
◆ fix_empty_font_ids()
void SubtitleAsset::fix_empty_font_ids |
( |
| ) |
|
Replace empty IDs in any <LoadFontId> and <Font> tags with a dummy string. Some systems give errors with empty font IDs (see DCP-o-matic bug #1689).
Definition at line 771 of file subtitle_asset.cc.
◆ raw_xml()
virtual boost::optional<std::string> dcp::SubtitleAsset::raw_xml |
( |
| ) |
const |
|
inlinevirtual |
- Returns
- Raw XML loaded from, or written to, an on-disk asset, or boost::none if
- this object was not created from an existing on-disk asset and has not been written to one, or
- this asset is encrypted and no key is available.
Definition at line 127 of file subtitle_asset.h.
◆ subtitles_as_xml()
void SubtitleAsset::subtitles_as_xml |
( |
xmlpp::Element * |
xml_root, |
|
|
int |
time_code_rate, |
|
|
Standard |
standard |
|
) |
| const |
|
protected |
- Parameters
-
standard | Standard (INTEROP or SMPTE); this is used rather than putting things in the child class because the differences between the two are fairly subtle. |
Definition at line 655 of file subtitle_asset.cc.
◆ _fonts
std::vector<Font> dcp::SubtitleAsset::_fonts |
|
protected |
◆ _raw_xml
boost::optional<std::string> dcp::SubtitleAsset::_raw_xml |
|
mutableprotected |
The raw XML data that we read from or wrote to our asset; useful for validation
Definition at line 202 of file subtitle_asset.h.
◆ _subtitles
std::vector<std::shared_ptr<Subtitle> > dcp::SubtitleAsset::_subtitles |
|
protected |
The documentation for this class was generated from the following files: