Parent class for DCP assets, i.e. picture, sound, subtitles, closed captions, CPLs, fonts.
More...
#include <asset.h>
|
| Asset () |
|
| Asset (boost::filesystem::path file) |
|
| Asset (std::string id, boost::filesystem::path file) |
|
virtual bool | equals (std::shared_ptr< const Asset > other, EqualityOptions opt, NoteHandler note) const |
|
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 |
|
|
static void | write_file_to_assetmap (xmlpp::Node *node, boost::filesystem::path root, boost::filesystem::path file, std::string id) |
|
|
boost::optional< boost::filesystem::path > | _file |
|
std::string | _id |
|
|
virtual std::string | pkl_type (Standard standard) const =0 |
|
|
boost::optional< std::string > | _hash |
|
Parent class for DCP assets, i.e. picture, sound, subtitles, closed captions, CPLs, fonts.
Note that this class is not used for ReelAssets; those are just for the metadata that gets put into <Reel>s.
Definition at line 69 of file asset.h.
◆ Asset() [1/3]
Create an Asset with a randomly-generated ID
Definition at line 62 of file asset.cc.
◆ Asset() [2/3]
dcp::Asset::Asset |
( |
boost::filesystem::path |
file | ) |
|
|
explicit |
Create an Asset from a given file with a randomly-generated ID
- Parameters
-
◆ Asset() [3/3]
dcp::Asset::Asset |
( |
std::string |
id, |
|
|
boost::filesystem::path |
file |
|
) |
| |
Create an Asset from a given file with a given ID
- Parameters
-
◆ file()
boost::optional<boost::filesystem::path> dcp::Asset::file |
( |
| ) |
const |
|
inline |
- Returns
- the most recent disk file used to read or write this asset, if there is one
Definition at line 97 of file asset.h.
◆ hash()
std::string dcp::Asset::hash |
( |
boost::function< void(float)> |
progress = {} | ) |
const |
Calculate the hash of this asset's file, if it has not already been calculated, then return it
- Parameters
-
progress | Function that will be called with a parameter between 0 and 1 to indicate progress in the calculation |
- Returns
- the hash
◆ pkl_type()
virtual std::string dcp::Asset::pkl_type |
( |
Standard |
standard | ) |
const |
|
privatepure virtual |
◆ set_file()
void Asset::set_file |
( |
boost::filesystem::path |
file | ) |
const |
Set the file that holds this asset on disk. Calling this function clears this object's store of its hash, so you should call ::hash after this.
- Parameters
-
Definition at line 165 of file asset.cc.
◆ _file
boost::optional<boost::filesystem::path> dcp::Asset::_file |
|
mutableprotected |
The most recent disk file used to read or write this asset
Definition at line 122 of file asset.h.
◆ _hash
boost::optional<std::string> dcp::Asset::_hash |
|
mutableprivate |
Hash of _file if it has been computed
Definition at line 133 of file asset.h.
The documentation for this class was generated from the following files: