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

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

#include <interop_subtitle_asset.h>

Inheritance diagram for dcp::InteropSubtitleAsset:
dcp::SubtitleAsset dcp::Asset dcp::Object

Public Member Functions

 InteropSubtitleAsset (boost::filesystem::path file)
 
bool equals (std::shared_ptr< const Asset >, EqualityOptions, NoteHandler note) const override
 
void write_to_assetmap (xmlpp::Node *node, 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 add_font_assets (std::vector< std::shared_ptr< Asset >> &assets)
 
void set_font_file (std::string load_id, boost::filesystem::path file)
 
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
 
- 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
 
virtual void add (std::shared_ptr< Subtitle >)
 
std::map< std::string, ArrayDatafont_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)
 
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
 
Objectoperator= (Object const &)=delete
 
std::string id () const
 

Static Public Member Functions

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
 

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 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
 

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 59 of file interop_subtitle_asset.h.

Member Function Documentation

◆ language()

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

Definition at line 115 of file interop_subtitle_asset.h.

◆ movie_title()

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

Definition at line 120 of file interop_subtitle_asset.h.

◆ pkl_type()

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

Implements dcp::Asset.

Definition at line 135 of file interop_subtitle_asset.h.

◆ reel_number()

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

Definition at line 110 of file interop_subtitle_asset.h.

◆ resolve_fonts()

void InteropSubtitleAsset::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 234 of file interop_subtitle_asset.cc.

◆ set_language()

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

Set the language tag of these subtitles.

Parameters
lNew language.

Definition at line 98 of file interop_subtitle_asset.h.

◆ set_movie_title()

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

Definition at line 103 of file interop_subtitle_asset.h.

◆ set_reel_number()

void dcp::InteropSubtitleAsset::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 91 of file interop_subtitle_asset.h.

◆ write()

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

Write this content to an XML file with its fonts alongside

Implements dcp::SubtitleAsset.

Definition at line 192 of file interop_subtitle_asset.cc.


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