libdcp
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
dcp::InteropTextAsset Class Reference

A set of subtitles to be read and/or written in the Inter-Op format. More...

#include <interop_text_asset.h>

Inheritance diagram for dcp::InteropTextAsset:
dcp::TextAsset dcp::Asset dcp::Object

Public Member Functions

 InteropTextAsset (boost::filesystem::path file)
 
bool equals (std::shared_ptr< const Asset >, EqualityOptions const &, NoteHandler note) const override
 
void add_to_assetmap (AssetMap &asset_map, boost::filesystem::path root) const override
 
void add_to_pkl (std::shared_ptr< PKL > pkl, boost::filesystem::path root) const override
 
std::vector< std::shared_ptr< LoadFontNode > > load_font_nodes () const override
 
void add_font (std::string load_id, dcp::ArrayData data) override
 
std::string xml_as_string () const override
 
void write (boost::filesystem::path path) const override
 
void resolve_fonts (std::vector< std::shared_ptr< Asset >> assets)
 
void set_font_file (std::string load_id, boost::filesystem::path file)
 
std::vector< std::shared_ptr< Asset > > font_assets ()
 
std::vector< std::shared_ptr< const Asset > > font_assets () const
 
std::vector< std::string > unresolved_fonts () const
 
void set_reel_number (std::string n)
 
void set_language (std::string l)
 
void set_movie_title (std::string m)
 
std::string reel_number () const
 
std::string language () const
 
std::string movie_title () const
 
int time_code_rate () const override
 
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
 
virtual void add (std::shared_ptr< Text >)
 
void ensure_font (std::string id, dcp::ArrayData data)
 
std::map< std::string, ArrayDatafont_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)
 
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)
 
Objectoperator= (Object const &other)
 
std::string id () const
 

Static Public Member Functions

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
 

Private Attributes

std::string _reel_number
 
std::string _language
 
std::string _movie_title
 
std::vector< std::shared_ptr< InteropLoadFontNode > > _load_font_nodes
 

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
 

Detailed Description

A set of subtitles to be read and/or written in the Inter-Op format.

Inter-Op subtitles are sometimes known as CineCanvas.

Definition at line 60 of file interop_text_asset.h.

Member Function Documentation

◆ language()

std::string dcp::InteropTextAsset::language ( ) const
inline
Returns
language used in the subtitles

Definition at line 123 of file interop_text_asset.h.

◆ movie_title()

std::string dcp::InteropTextAsset::movie_title ( ) const
inline
Returns
movie title that these subtitles are for

Definition at line 128 of file interop_text_asset.h.

◆ pkl_type()

std::string dcp::InteropTextAsset::pkl_type ( Standard  standard) const
inlineoverrideprotectedvirtual
Returns
type string for PKLs for this asset

Implements dcp::Asset.

Definition at line 147 of file interop_text_asset.h.

◆ reel_number()

std::string dcp::InteropTextAsset::reel_number ( ) const
inline
Returns
reel number or sub-element of a programme that these subtitles refer to.

Definition at line 118 of file interop_text_asset.h.

◆ resolve_fonts()

void InteropTextAsset::resolve_fonts ( std::vector< std::shared_ptr< Asset >>  assets)

Look at a supplied list of assets and find the fonts. Then match these fonts up with anything requested by a <LoadFont> so that _fonts contains a list of font ID, load ID and data.

Definition at line 232 of file interop_text_asset.cc.

◆ set_language()

void dcp::InteropTextAsset::set_language ( std::string  l)
inline

Set the language tag of these subtitles.

Parameters
lNew language.

Definition at line 106 of file interop_text_asset.h.

◆ set_movie_title()

void dcp::InteropTextAsset::set_movie_title ( std::string  m)
inline
Returns
title of the movie that the subtitles are for

Definition at line 111 of file interop_text_asset.h.

◆ set_reel_number()

void dcp::InteropTextAsset::set_reel_number ( std::string  n)
inline

Set the reel number or sub-element identifier of these subtitles.

Parameters
nNew reel number.

Definition at line 99 of file interop_text_asset.h.

◆ unresolved_fonts()

vector< string > InteropTextAsset::unresolved_fonts ( ) const
Returns
the <LoadFont> IDs of fonts for which we have not (yet) found a font asset. This could be because resolve_fonts() has not yet been called, or because there is a missing font file.

Definition at line 329 of file interop_text_asset.cc.

◆ write()

void InteropTextAsset::write ( boost::filesystem::path  path) const
overridevirtual

Write this content to an XML file with its fonts alongside

Implements dcp::TextAsset.

Definition at line 195 of file interop_text_asset.cc.


The documentation for this class was generated from the following files: