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

A Composition Playlist. More...

#include <cpl.h>

Inheritance diagram for dcp::CPL:
dcp::Asset dcp::Object

Public Member Functions

 CPL (std::string annotation_text, ContentKind content_kind, Standard standard)
 
 CPL (boost::filesystem::path file)
 
bool equals (std::shared_ptr< const Asset > other, EqualityOptions options, NoteHandler note) const override
 
void add (std::shared_ptr< Reel > reel)
 
void add (DecryptedKDM const &)
 
std::vector< std::shared_ptr< Reel > > reels () const
 
std::vector< std::shared_ptr< const ReelFileAsset > > reel_file_assets () const
 
std::vector< std::shared_ptr< ReelFileAsset > > reel_file_assets ()
 
bool any_encrypted () const
 
bool all_encrypted () const
 
void write_xml (boost::filesystem::path file, std::shared_ptr< const CertificateChain >) const
 
void resolve_refs (std::vector< std::shared_ptr< Asset >>)
 
int64_t duration () const
 
std::string issuer () const
 
void set_issuer (std::string issuer)
 
std::string creator () const
 
void set_creator (std::string creator)
 
void set_issue_date (std::string issue_date)
 
boost::optional< std::string > annotation_text () const
 
void set_annotation_text (std::string at)
 
std::string content_title_text () const
 
void set_content_title_text (std::string ct)
 
void set_content_kind (dcp::ContentKind k)
 
ContentKind content_kind () const
 
boost::optional< ContentVersioncontent_version () const
 
std::vector< ContentVersioncontent_versions () const
 
void set_content_version (ContentVersion v)
 
void set_content_versions (std::vector< ContentVersion > v)
 
std::vector< Ratingratings () const
 
void set_ratings (std::vector< Rating > r)
 
boost::optional< std::string > full_content_title_text () const
 
void set_full_content_title_text (std::string t)
 
boost::optional< std::string > full_content_title_text_language () const
 
void set_full_content_title_text_language (dcp::LanguageTag l)
 
boost::optional< std::string > release_territory () const
 
void set_release_territory (dcp::LanguageTag::RegionSubtag t)
 
boost::optional< std::string > release_territory_scope () const
 
boost::optional< int > version_number () const
 
void set_version_number (int v)
 
void unset_version_number ()
 
boost::optional< Statusstatus () const
 
void set_status (Status s)
 
boost::optional< std::string > chain () const
 
void set_chain (std::string c)
 
boost::optional< std::string > distributor () const
 
void set_distributor (std::string d)
 
boost::optional< std::string > facility () const
 
void set_facility (std::string f)
 
boost::optional< Luminanceluminance () const
 
void set_luminance (Luminance l)
 
boost::optional< std::string > main_sound_configuration () const
 
void set_main_sound_configuration (std::string c)
 
boost::optional< int > main_sound_sample_rate () const
 
void set_main_sound_sample_rate (int r)
 
boost::optional< dcp::Sizemain_picture_stored_area () const
 
void set_main_picture_stored_area (dcp::Size s)
 
boost::optional< dcp::Sizemain_picture_active_area () const
 
void set_main_picture_active_area (dcp::Size s)
 
std::vector< std::string > additional_subtitle_languages () const
 
void set_additional_subtitle_languages (std::vector< dcp::LanguageTag > const &lang)
 
void set_sign_language_video_language (dcp::LanguageTag lang)
 
boost::optional< std::string > sign_language_video_language () const
 
Standard standard () 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
 
Objectoperator= (Object const &)=delete
 
std::string id () const
 

Static Public Member Functions

static std::string static_pkl_type (Standard standard)
 

Protected Member Functions

std::string pkl_type (Standard standard) const override
 

Private Member Functions

void maybe_write_composition_metadata_asset (xmlpp::Element *node) const
 
void read_composition_metadata_asset (cxml::ConstNodePtr node)
 

Private Attributes

std::string _issuer
 
std::string _creator
 
std::string _issue_date
 
boost::optional< std::string > _annotation_text
 
std::string _content_title_text
 <ContentTitleText>
 
ContentKind _content_kind
 <ContentKind>
 
std::vector< ContentVersion_content_versions
 
std::vector< Rating_ratings
 
std::string _cpl_metadata_id = make_uuid()
 
boost::optional< std::string > _full_content_title_text
 
boost::optional< std::string > _full_content_title_text_language
 
boost::optional< std::string > _release_territory
 
boost::optional< std::string > _release_territory_scope
 
boost::optional< int > _version_number
 
boost::optional< Status_status
 
boost::optional< std::string > _chain
 
boost::optional< std::string > _distributor
 
boost::optional< std::string > _facility
 
boost::optional< Luminance_luminance
 
boost::optional< std::string > _main_sound_configuration
 
boost::optional< int > _main_sound_sample_rate
 
boost::optional< dcp::Size_main_picture_stored_area
 
boost::optional< dcp::Size_main_picture_active_area
 
std::vector< std::string > _additional_subtitle_languages
 
boost::optional< std::string > _sign_language_video_language
 
std::vector< std::shared_ptr< Reel > > _reels
 
Standard _standard
 

Friends

struct ::verify_invalid_language3
 

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::Asset
boost::optional< boost::filesystem::path > _file
 
- Protected Attributes inherited from dcp::Object
std::string _id
 

Detailed Description

A Composition Playlist.

Definition at line 73 of file cpl.h.

Constructor & Destructor Documentation

◆ CPL()

CPL::CPL ( boost::filesystem::path  file)
explicit

Construct a CPL object from a XML file

Definition at line 104 of file cpl.cc.

Member Function Documentation

◆ add() [1/2]

void CPL::add ( DecryptedKDM const &  kdm)

Add a KDM to this CPL. If the KDM is for any of this CPLs assets it will be used to decrypt those assets.

Parameters
kdmKDM.

Definition at line 637 of file cpl.cc.

◆ add() [2/2]

void CPL::add ( std::shared_ptr< Reel reel)

Add a reel to this CPL

Parameters
reelReel to add

Definition at line 168 of file cpl.cc.

◆ all_encrypted()

bool CPL::all_encrypted ( ) const
Returns
true if we have all our encryptable content is encrypted

Definition at line 624 of file cpl.cc.

◆ annotation_text()

boost::optional<std::string> dcp::CPL::annotation_text ( ) const
inline
Returns
contents of the <AnnotationText> node, if present

Definition at line 148 of file cpl.h.

◆ any_encrypted()

bool CPL::any_encrypted ( ) const
Returns
true if we have any encrypted content

Definition at line 611 of file cpl.cc.

◆ content_kind()

ContentKind dcp::CPL::content_kind ( ) const
inline
Returns
the type of the content, used by media servers to categorise things (e.g. feature, trailer, etc.)

Definition at line 172 of file cpl.h.

◆ content_title_text()

std::string dcp::CPL::content_title_text ( ) const
inline
Returns
contents of the <ContentTitleText> node

Definition at line 157 of file cpl.h.

◆ maybe_write_composition_metadata_asset()

void CPL::maybe_write_composition_metadata_asset ( xmlpp::Element *  node) const
private

Write a CompositionMetadataAsset node as a child of

Parameters
nodeprovided the required metadata is stored in the object. If any required metadata is missing this method will do nothing.

Definition at line 340 of file cpl.cc.

◆ pkl_type()

string CPL::pkl_type ( Standard  standard) const
overrideprotectedvirtual
Returns
type string for PKLs for this asset

Implements dcp::Asset.

Definition at line 653 of file cpl.cc.

◆ reel_file_assets()

vector< shared_ptr< const ReelFileAsset > > CPL::reel_file_assets ( ) const
Returns
the ReelFileAssets in this CPL in all reels

Definition at line 563 of file cpl.cc.

◆ reels()

std::vector<std::shared_ptr<Reel> > dcp::CPL::reels ( ) const
inline
Returns
the reels in this CPL

Definition at line 99 of file cpl.h.

◆ write_xml()

void CPL::write_xml ( boost::filesystem::path  file,
std::shared_ptr< const CertificateChain signer 
) const

Write an CompositonPlaylist XML file

Parameters
fileFilename to write
signerSigner to sign the CPL, or 0 to add no signature

Definition at line 175 of file cpl.cc.

Member Data Documentation

◆ _cpl_metadata_id

std::string dcp::CPL::_cpl_metadata_id = make_uuid()
private

ID for CompositionMetadataAsset tag; either a random one, ready for writing a new tag, or the one read in from the existing CPL.

Definition at line 346 of file cpl.h.

◆ _full_content_title_text

boost::optional<std::string> dcp::CPL::_full_content_title_text
private

Human-readable name of the composition, without any metadata (i.e. no -FTR-EN-XX- etc.)

Definition at line 348 of file cpl.h.

◆ _release_territory

boost::optional<std::string> dcp::CPL::_release_territory
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 353 of file cpl.h.

◆ _standard

Standard dcp::CPL::_standard
private

Standard of CPL that was read in

Definition at line 372 of file cpl.h.


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