From 44791cafb91bfe1ee5c0a530c83d9f44b4d2f88f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 17 Jan 2014 17:42:51 +0000 Subject: Asset -> ContentAsset. --- src/asset.cc | 123 ---------------------------------- src/asset.h | 157 -------------------------------------------- src/content_asset.cc | 119 +++++++++++++++++++++++++++++++++ src/content_asset.h | 150 ++++++++++++++++++++++++++++++++++++++++++ src/cpl.cc | 4 +- src/cpl.h | 4 +- src/dcp.cc | 17 +++-- src/dcp.h | 4 +- src/kdm.cc | 6 +- src/mono_picture_asset.cc | 2 +- src/mono_picture_asset.h | 2 +- src/mxf_asset.cc | 6 +- src/mxf_asset.h | 6 +- src/sound_asset.cc | 2 +- src/sound_asset.h | 2 +- src/stereo_picture_asset.cc | 2 +- src/stereo_picture_asset.h | 2 +- src/subtitle_asset.cc | 4 +- src/subtitle_asset.h | 6 +- src/wscript | 2 +- 20 files changed, 304 insertions(+), 316 deletions(-) delete mode 100644 src/asset.cc delete mode 100644 src/asset.h create mode 100644 src/content_asset.cc create mode 100644 src/content_asset.h diff --git a/src/asset.cc b/src/asset.cc deleted file mode 100644 index 192daf43..00000000 --- a/src/asset.cc +++ /dev/null @@ -1,123 +0,0 @@ -/* - Copyright (C) 2012 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -/** @file src/asset.cc - * @brief Parent class for assets of DCPs. - */ - -#include -#include -#include -#include -#include -#include "AS_DCP.h" -#include "KM_util.h" -#include "asset.h" -#include "util.h" -#include "metadata.h" - -using namespace std; -using namespace boost; -using namespace dcp; - -Asset::Asset (boost::filesystem::path directory, boost::filesystem::path file_name) - : _directory (directory) - , _file_name (file_name) - , _uuid (make_uuid ()) - , _edit_rate (0) - , _entry_point (0) - , _intrinsic_duration (0) - , _duration (0) -{ - if (_file_name.empty ()) { - _file_name = _uuid + ".xml"; - } -} - -void -Asset::write_to_pkl (xmlpp::Node* node) const -{ - xmlpp::Node* asset = node->add_child ("Asset"); - asset->add_child("Id")->add_child_text ("urn:uuid:" + _uuid); - asset->add_child("AnnotationText")->add_child_text (_file_name.string ()); - asset->add_child("Hash")->add_child_text (digest ()); - asset->add_child("Size")->add_child_text (lexical_cast (filesystem::file_size(path()))); - asset->add_child("Type")->add_child_text ("application/mxf"); -} - -void -Asset::write_to_assetmap (xmlpp::Node* node) const -{ - xmlpp::Node* asset = node->add_child ("Asset"); - asset->add_child("Id")->add_child_text ("urn:uuid:" + _uuid); - xmlpp::Node* chunk_list = asset->add_child ("ChunkList"); - xmlpp::Node* chunk = chunk_list->add_child ("Chunk"); - chunk->add_child("Path")->add_child_text (_file_name.string ()); - chunk->add_child("VolumeIndex")->add_child_text ("1"); - chunk->add_child("Offset")->add_child_text ("0"); - chunk->add_child("Length")->add_child_text (lexical_cast (filesystem::file_size(path()))); -} - -filesystem::path -Asset::path () const -{ - filesystem::path p; - p /= _directory; - p /= _file_name; - return p; -} - -string -Asset::digest () const -{ - if (_digest.empty ()) { - _digest = make_digest (path().string(), 0); - } - - return _digest; -} - -void -Asset::compute_digest (boost::function progress) -{ - if (!_digest.empty ()) { - return; - } - - _digest = make_digest (path().string(), &progress); -} - -bool -Asset::equals (shared_ptr other, EqualityOptions, boost::function note) const -{ - if (_edit_rate != other->_edit_rate) { - note (ERROR, "asset edit rates differ"); - return false; - } - - if (_intrinsic_duration != other->_intrinsic_duration) { - note (ERROR, "asset intrinsic durations differ"); - } - - if (_duration != other->_duration) { - note (ERROR, "asset durations differ"); - } - - return true; -} diff --git a/src/asset.h b/src/asset.h deleted file mode 100644 index d1819ba6..00000000 --- a/src/asset.h +++ /dev/null @@ -1,157 +0,0 @@ -/* - Copyright (C) 2012 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -/** @file src/asset.h - * @brief Parent class for assets of DCPs. - */ - -#ifndef LIBDCP_ASSET_H -#define LIBDCP_ASSET_H - -#include -#include -#include -#include -#include -#include "types.h" - -namespace ASDCP { - class WriterInfo; -} - -namespace xmlpp { - class Element; -} - -namespace dcp -{ - -/** @brief Parent class for assets of DCPs - * - * These are collections of pictures or sound. - */ -class Asset -{ -public: - /** Construct an Asset. - * @param directory Directory where our XML or MXF file is. - * @param file_name Name of our file within directory, or empty to make one up based on UUID. - */ - Asset (boost::filesystem::path directory, boost::filesystem::path file_name = ""); - - virtual ~Asset() {} - - /** Write details of the asset to a CPL AssetList node. - * @param p Parent element. - */ - virtual void write_to_cpl (xmlpp::Element* p) const = 0; - - /** Write details of the asset to a PKL AssetList node. - * @param p Parent node. - */ - void write_to_pkl (xmlpp::Node *) const; - - /** Write details of the asset to a ASSETMAP stream. - * @param s Stream. - */ - void write_to_assetmap (xmlpp::Node *) const; - - /** Compute the digest for this asset. Calling this is optional: if - * it is not called, the digest will be computed when required. However, - * calling this method allows the caller to see the progress of the - * computation, which can be long for large assets. - * @param Called with progress between 0 and 1. - */ - void compute_digest (boost::function progress); - - std::string uuid () const { - return _uuid; - } - - boost::filesystem::path path () const; - - void set_directory (boost::filesystem::path d) { - _directory = d; - } - - void set_file_name (boost::filesystem::path f) { - _file_name = f; - } - - int entry_point () const { - return _entry_point; - } - - int duration () const { - return _duration; - } - - int intrinsic_duration () const { - return _intrinsic_duration; - } - - int edit_rate () const { - return _edit_rate; - } - - void set_entry_point (int e) { - _entry_point = e; - } - - void set_duration (int d) { - _duration = d; - } - - void set_intrinsic_duration (int d) { - _intrinsic_duration = d; - } - - void set_edit_rate (int r) { - _edit_rate = r; - } - - virtual bool equals (boost::shared_ptr other, EqualityOptions opt, boost::function) const; - -protected: - - std::string digest () const; - - /** Directory that our MXF or XML file is in */ - boost::filesystem::path _directory; - /** Name of our MXF or XML file */ - boost::filesystem::path _file_name; - /** Our UUID */ - std::string _uuid; - /** The edit rate; this is normally equal to the number of video frames per second */ - int _edit_rate; - /** Start point to present in frames */ - int _entry_point; - /** Total length in frames */ - int _intrinsic_duration; - /** Length to present in frames */ - int _duration; - -private: - /** Digest of our MXF or XML file */ - mutable std::string _digest; -}; - -} - -#endif diff --git a/src/content_asset.cc b/src/content_asset.cc new file mode 100644 index 00000000..56891007 --- /dev/null +++ b/src/content_asset.cc @@ -0,0 +1,119 @@ +/* + Copyright (C) 2012 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include +#include +#include +#include +#include "AS_DCP.h" +#include "KM_util.h" +#include "content_asset.h" +#include "util.h" +#include "metadata.h" + +using namespace std; +using namespace boost; +using namespace dcp; + +ContentAsset::ContentAsset (boost::filesystem::path directory, boost::filesystem::path file_name) + : _directory (directory) + , _file_name (file_name) + , _uuid (make_uuid ()) + , _edit_rate (0) + , _entry_point (0) + , _intrinsic_duration (0) + , _duration (0) +{ + if (_file_name.empty ()) { + _file_name = _uuid + ".xml"; + } +} + +void +ContentAsset::write_to_pkl (xmlpp::Node* node) const +{ + xmlpp::Node* asset = node->add_child ("Asset"); + asset->add_child("Id")->add_child_text ("urn:uuid:" + _uuid); + asset->add_child("AnnotationText")->add_child_text (_file_name.string ()); + asset->add_child("Hash")->add_child_text (digest ()); + asset->add_child("Size")->add_child_text (lexical_cast (filesystem::file_size(path()))); + asset->add_child("Type")->add_child_text ("application/mxf"); +} + +void +ContentAsset::write_to_assetmap (xmlpp::Node* node) const +{ + xmlpp::Node* asset = node->add_child ("Asset"); + asset->add_child("Id")->add_child_text ("urn:uuid:" + _uuid); + xmlpp::Node* chunk_list = asset->add_child ("ChunkList"); + xmlpp::Node* chunk = chunk_list->add_child ("Chunk"); + chunk->add_child("Path")->add_child_text (_file_name.string ()); + chunk->add_child("VolumeIndex")->add_child_text ("1"); + chunk->add_child("Offset")->add_child_text ("0"); + chunk->add_child("Length")->add_child_text (lexical_cast (filesystem::file_size(path()))); +} + +filesystem::path +ContentAsset::path () const +{ + filesystem::path p; + p /= _directory; + p /= _file_name; + return p; +} + +string +ContentAsset::digest () const +{ + if (_digest.empty ()) { + _digest = make_digest (path().string(), 0); + } + + return _digest; +} + +void +ContentAsset::compute_digest (boost::function progress) +{ + if (!_digest.empty ()) { + return; + } + + _digest = make_digest (path().string(), &progress); +} + +bool +ContentAsset::equals (shared_ptr other, EqualityOptions, boost::function note) const +{ + if (_edit_rate != other->_edit_rate) { + note (ERROR, "asset edit rates differ"); + return false; + } + + if (_intrinsic_duration != other->_intrinsic_duration) { + note (ERROR, "asset intrinsic durations differ"); + } + + if (_duration != other->_duration) { + note (ERROR, "asset durations differ"); + } + + return true; +} diff --git a/src/content_asset.h b/src/content_asset.h new file mode 100644 index 00000000..4e7ed031 --- /dev/null +++ b/src/content_asset.h @@ -0,0 +1,150 @@ +/* + Copyright (C) 2012 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef LIBDCP_ASSET_H +#define LIBDCP_ASSET_H + +#include +#include +#include +#include +#include +#include "types.h" + +namespace ASDCP { + class WriterInfo; +} + +namespace xmlpp { + class Element; +} + +namespace dcp +{ + +/** XXX */ +class ContentAsset +{ +public: + /** Construct a ContentAsset. + * @param directory Directory where our XML or MXF file is. + * @param file_name Name of our file within directory, or empty to make one up based on UUID. + */ + ContentAsset (boost::filesystem::path directory, boost::filesystem::path file_name = ""); + + virtual ~ContentAsset() {} + + /** Write details of the asset to a CPL AssetList node. + * @param p Parent element. + */ + virtual void write_to_cpl (xmlpp::Element* p) const = 0; + + /** Write details of the asset to a PKL AssetList node. + * @param p Parent node. + */ + void write_to_pkl (xmlpp::Node *) const; + + /** Write details of the asset to a ASSETMAP stream. + * @param s Stream. + */ + void write_to_assetmap (xmlpp::Node *) const; + + /** Compute the digest for this asset. Calling this is optional: if + * it is not called, the digest will be computed when required. However, + * calling this method allows the caller to see the progress of the + * computation, which can be long for large assets. + * @param Called with progress between 0 and 1. + */ + void compute_digest (boost::function progress); + + std::string uuid () const { + return _uuid; + } + + boost::filesystem::path path () const; + + void set_directory (boost::filesystem::path d) { + _directory = d; + } + + void set_file_name (boost::filesystem::path f) { + _file_name = f; + } + + int entry_point () const { + return _entry_point; + } + + int duration () const { + return _duration; + } + + int intrinsic_duration () const { + return _intrinsic_duration; + } + + int edit_rate () const { + return _edit_rate; + } + + void set_entry_point (int e) { + _entry_point = e; + } + + void set_duration (int d) { + _duration = d; + } + + void set_intrinsic_duration (int d) { + _intrinsic_duration = d; + } + + void set_edit_rate (int r) { + _edit_rate = r; + } + + virtual bool equals (boost::shared_ptr other, EqualityOptions opt, boost::function) const; + +protected: + + std::string digest () const; + + /** Directory that our MXF or XML file is in */ + boost::filesystem::path _directory; + /** Name of our MXF or XML file */ + boost::filesystem::path _file_name; + /** Our UUID */ + std::string _uuid; + /** The edit rate; this is normally equal to the number of video frames per second */ + int _edit_rate; + /** Start point to present in frames */ + int _entry_point; + /** Total length in frames */ + int _intrinsic_duration; + /** Length to present in frames */ + int _duration; + +private: + /** Digest of our MXF or XML file */ + mutable std::string _digest; +}; + +} + +#endif diff --git a/src/cpl.cc b/src/cpl.cc index 2058223c..ec5534e0 100644 --- a/src/cpl.cc +++ b/src/cpl.cc @@ -252,10 +252,10 @@ CPL::write_to_pkl (xmlpp::Node* node) const asset->add_child("Type")->add_child_text ("text/xml"); } -list > +list > CPL::assets () const { - list > a; + list > a; for (list >::const_iterator i = _reels.begin(); i != _reels.end(); ++i) { if ((*i)->main_picture ()) { a.push_back ((*i)->main_picture ()); diff --git a/src/cpl.h b/src/cpl.h index 45480ec7..ead09f24 100644 --- a/src/cpl.h +++ b/src/cpl.h @@ -38,7 +38,7 @@ namespace parse { class AssetMapAsset; } -class Asset; +class ContentAsset; class Reel; class XMLMetadata; class MXFMetadata; @@ -82,7 +82,7 @@ public: return _fps; } - std::list > assets () const; + std::list > assets () const; bool encrypted () const; diff --git a/src/dcp.cc b/src/dcp.cc index 653dc87a..e0730020 100644 --- a/src/dcp.cc +++ b/src/dcp.cc @@ -33,7 +33,6 @@ #include #include #include "dcp.h" -#include "asset.h" #include "sound_asset.h" #include "picture_asset.h" #include "subtitle_asset.h" @@ -109,8 +108,8 @@ DCP::write_pkl (string pkl_uuid, bool interop, XMLMetadata const & metadata, sha pkl->add_child("Creator")->add_child_text (metadata.creator); xmlpp::Element* asset_list = pkl->add_child("AssetList"); - list > a = assets (); - for (list >::const_iterator i = a.begin(); i != a.end(); ++i) { + list > a = assets (); + for (list >::const_iterator i = a.begin(); i != a.end(); ++i) { (*i)->write_to_pkl (asset_list); } @@ -192,8 +191,8 @@ DCP::write_assetmap (string pkl_uuid, int pkl_length, bool interop, XMLMetadata (*i)->write_to_assetmap (asset_list); } - list > a = assets (); - for (list >::const_iterator i = a.begin(); i != a.end(); ++i) { + list > a = assets (); + for (list >::const_iterator i = a.begin(); i != a.end(); ++i) { (*i)->write_to_assetmap (asset_list); } @@ -322,17 +321,17 @@ DCP::add_cpl (shared_ptr cpl) class AssetComparator { public: - bool operator() (shared_ptr a, shared_ptr b) { + bool operator() (shared_ptr a, shared_ptr b) { return a->uuid() < b->uuid(); } }; -list > +list > DCP::assets () const { - list > a; + list > a; for (list >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) { - list > t = (*i)->assets (); + list > t = (*i)->assets (); a.merge (t); } diff --git a/src/dcp.h b/src/dcp.h index 9b72ae74..d6edafa0 100644 --- a/src/dcp.h +++ b/src/dcp.h @@ -40,7 +40,7 @@ namespace xmlpp { namespace dcp { -class Asset; +class ContentAsset; class PictureAsset; class SoundAsset; class SubtitleAsset; @@ -138,7 +138,7 @@ private: void write_assetmap (std::string pkl_uuid, int pkl_length, bool, XMLMetadata const &) const; /** @return Assets in all the CPLs in this DCP */ - std::list > assets () const; + std::list > assets () const; struct Files { std::list cpls; diff --git a/src/kdm.cc b/src/kdm.cc index 02e6ce7f..25e87ca1 100644 --- a/src/kdm.cc +++ b/src/kdm.cc @@ -124,8 +124,8 @@ KDM::KDM ( */ apu.authorized_device_info.device_list.push_back ("2jmj7l5rSw0yVb/vlWAYkK/YBwk="); - list > assets = cpl->assets (); - for (list >::iterator i = assets.begin(); i != assets.end(); ++i) { + list > assets = cpl->assets (); + for (list >::iterator i = assets.begin(); i != assets.end(); ++i) { /* XXX: non-MXF assets? */ shared_ptr mxf = boost::dynamic_pointer_cast (*i); if (mxf) { @@ -138,7 +138,7 @@ KDM::KDM ( /* AuthenticatedPrivate */ - for (list >::iterator i = assets.begin(); i != assets.end(); ++i) { + for (list >::iterator i = assets.begin(); i != assets.end(); ++i) { /* XXX: non-MXF assets? */ shared_ptr mxf = boost::dynamic_pointer_cast (*i); if (mxf) { diff --git a/src/mono_picture_asset.cc b/src/mono_picture_asset.cc index 3163e89a..766b72ca 100644 --- a/src/mono_picture_asset.cc +++ b/src/mono_picture_asset.cc @@ -125,7 +125,7 @@ MonoPictureAsset::get_frame (int n) const } bool -MonoPictureAsset::equals (shared_ptr other, EqualityOptions opt, boost::function note) const +MonoPictureAsset::equals (shared_ptr other, EqualityOptions opt, boost::function note) const { if (!MXFAsset::equals (other, opt, note)) { return false; diff --git a/src/mono_picture_asset.h b/src/mono_picture_asset.h index 19308aaf..00017354 100644 --- a/src/mono_picture_asset.h +++ b/src/mono_picture_asset.h @@ -50,7 +50,7 @@ public: boost::shared_ptr start_write (bool); boost::shared_ptr get_frame (int n) const; - bool equals (boost::shared_ptr other, EqualityOptions opt, boost::function note) const; + bool equals (boost::shared_ptr other, EqualityOptions opt, boost::function note) const; private: boost::filesystem::path path_from_list (int f, std::vector const & files) const; diff --git a/src/mxf_asset.cc b/src/mxf_asset.cc index 1b15f7a9..c2d19a39 100644 --- a/src/mxf_asset.cc +++ b/src/mxf_asset.cc @@ -43,7 +43,7 @@ using boost::dynamic_pointer_cast; using namespace dcp; MXFAsset::MXFAsset (boost::filesystem::path directory, boost::filesystem::path file_name) - : Asset (directory, file_name) + : ContentAsset (directory, file_name) , _progress (0) , _encryption_context (0) , _decryption_context (0) @@ -85,9 +85,9 @@ MXFAsset::fill_writer_info (ASDCP::WriterInfo* writer_info) } bool -MXFAsset::equals (shared_ptr other, EqualityOptions opt, boost::function note) const +MXFAsset::equals (shared_ptr other, EqualityOptions opt, boost::function note) const { - if (!Asset::equals (other, opt, note)) { + if (!ContentAsset::equals (other, opt, note)) { return false; } diff --git a/src/mxf_asset.h b/src/mxf_asset.h index 5ba70324..4af7a38d 100644 --- a/src/mxf_asset.h +++ b/src/mxf_asset.h @@ -21,7 +21,7 @@ #define LIBDCP_MXF_ASSET_H #include -#include "asset.h" +#include "content_asset.h" #include "key.h" #include "metadata.h" @@ -36,7 +36,7 @@ namespace dcp class MXFMetadata; /** @brief Parent class for assets which have MXF files */ -class MXFAsset : public Asset +class MXFAsset : public ContentAsset { public: /** Construct an MXFAsset. @@ -49,7 +49,7 @@ public: ~MXFAsset (); - virtual bool equals (boost::shared_ptr other, EqualityOptions opt, boost::function note) const; + virtual bool equals (boost::shared_ptr other, EqualityOptions opt, boost::function note) const; virtual void write_to_cpl (xmlpp::Element *) const; virtual std::string key_type () const = 0; diff --git a/src/sound_asset.cc b/src/sound_asset.cc index cc537d56..602f036c 100644 --- a/src/sound_asset.cc +++ b/src/sound_asset.cc @@ -210,7 +210,7 @@ SoundAsset::cpl_node_name () const } bool -SoundAsset::equals (shared_ptr other, EqualityOptions opt, boost::function note) const +SoundAsset::equals (shared_ptr other, EqualityOptions opt, boost::function note) const { if (!MXFAsset::equals (other, opt, note)) { return false; diff --git a/src/sound_asset.h b/src/sound_asset.h index f33e5aec..d2aa1213 100644 --- a/src/sound_asset.h +++ b/src/sound_asset.h @@ -92,7 +92,7 @@ public: boost::shared_ptr start_write (); - bool equals (boost::shared_ptr other, EqualityOptions opt, boost::function note) const; + bool equals (boost::shared_ptr other, EqualityOptions opt, boost::function note) const; boost::shared_ptr get_frame (int n) const; diff --git a/src/stereo_picture_asset.cc b/src/stereo_picture_asset.cc index bad80832..711a8090 100644 --- a/src/stereo_picture_asset.cc +++ b/src/stereo_picture_asset.cc @@ -31,7 +31,7 @@ using boost::dynamic_pointer_cast; using namespace dcp; bool -StereoPictureAsset::equals (shared_ptr other, EqualityOptions opt, boost::function note) const +StereoPictureAsset::equals (shared_ptr other, EqualityOptions opt, boost::function note) const { if (!MXFAsset::equals (other, opt, note)) { return false; diff --git a/src/stereo_picture_asset.h b/src/stereo_picture_asset.h index 6ebc7239..a6620dcf 100644 --- a/src/stereo_picture_asset.h +++ b/src/stereo_picture_asset.h @@ -36,7 +36,7 @@ public: boost::shared_ptr start_write (bool); boost::shared_ptr get_frame (int n) const; - bool equals (boost::shared_ptr other, EqualityOptions opt, boost::function note) const; + bool equals (boost::shared_ptr other, EqualityOptions opt, boost::function note) const; private: std::string cpl_node_name () const; diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc index d67e3625..fcc8bac0 100644 --- a/src/subtitle_asset.cc +++ b/src/subtitle_asset.cc @@ -37,14 +37,14 @@ using boost::optional; using namespace dcp; SubtitleAsset::SubtitleAsset (string directory, string xml_file) - : Asset (directory, xml_file) + : ContentAsset (directory, xml_file) , _need_sort (false) { read_xml (path().string()); } SubtitleAsset::SubtitleAsset (string directory, string movie_title, string language) - : Asset (directory) + : ContentAsset (directory) , _movie_title (movie_title) , _reel_number ("1") , _language (language) diff --git a/src/subtitle_asset.h b/src/subtitle_asset.h index e5e2e853..cff65b2b 100644 --- a/src/subtitle_asset.h +++ b/src/subtitle_asset.h @@ -21,7 +21,7 @@ #define LIBDCP_SUBTITLE_ASSET_H #include -#include "asset.h" +#include "content_asset.h" #include "dcp_time.h" namespace dcp @@ -133,14 +133,14 @@ private: bool operator== (Subtitle const & a, Subtitle const & b); std::ostream& operator<< (std::ostream& s, Subtitle const & sub); -class SubtitleAsset : public Asset +class SubtitleAsset : public ContentAsset { public: SubtitleAsset (std::string directory, std::string xml_file); SubtitleAsset (std::string directory, std::string movie_title, std::string language); void write_to_cpl (xmlpp::Element *) const; - virtual bool equals (boost::shared_ptr, EqualityOptions, boost::function note) const { + virtual bool equals (boost::shared_ptr, EqualityOptions, boost::function note) const { /* XXX */ note (ERROR, "subtitle assets not compared yet"); return true; diff --git a/src/wscript b/src/wscript index cdf3c062..7cc5e5ea 100644 --- a/src/wscript +++ b/src/wscript @@ -13,9 +13,9 @@ def build(bld): obj.use = 'libkumu-libdcp libasdcp-libdcp' obj.source = """ argb_frame.cc - asset.cc certificates.cc colour_matrix.cc + content_asset.cc cpl.cc dcp.cc dcp_time.cc -- cgit v1.2.3