Asset -> ContentAsset.
authorCarl Hetherington <cth@carlh.net>
Fri, 17 Jan 2014 17:42:51 +0000 (17:42 +0000)
committerCarl Hetherington <cth@carlh.net>
Fri, 17 Jan 2014 17:42:51 +0000 (17:42 +0000)
20 files changed:
src/asset.cc [deleted file]
src/asset.h [deleted file]
src/content_asset.cc [new file with mode: 0644]
src/content_asset.h [new file with mode: 0644]
src/cpl.cc
src/cpl.h
src/dcp.cc
src/dcp.h
src/kdm.cc
src/mono_picture_asset.cc
src/mono_picture_asset.h
src/mxf_asset.cc
src/mxf_asset.h
src/sound_asset.cc
src/sound_asset.h
src/stereo_picture_asset.cc
src/stereo_picture_asset.h
src/subtitle_asset.cc
src/subtitle_asset.h
src/wscript

diff --git a/src/asset.cc b/src/asset.cc
deleted file mode 100644 (file)
index 192daf4..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
-    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 <iostream>
-#include <boost/filesystem.hpp>
-#include <boost/lexical_cast.hpp>
-#include <boost/function.hpp>
-#include <libxml++/nodes/element.h>
-#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<string> (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<string> (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<void (float)> progress)
-{
-       if (!_digest.empty ()) {
-               return;
-       }
-
-       _digest = make_digest (path().string(), &progress);
-}
-
-bool
-Asset::equals (shared_ptr<const Asset> other, EqualityOptions, boost::function<void (NoteType, string)> 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 (file)
index d1819ba..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
-    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 <string>
-#include <list>
-#include <boost/filesystem.hpp>
-#include <boost/function.hpp>
-#include <libxml++/libxml++.h>
-#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<void (float)> 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<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)>) 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 (file)
index 0000000..5689100
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+
+    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 <iostream>
+#include <boost/filesystem.hpp>
+#include <boost/lexical_cast.hpp>
+#include <boost/function.hpp>
+#include <libxml++/nodes/element.h>
+#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<string> (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<string> (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<void (float)> progress)
+{
+       if (!_digest.empty ()) {
+               return;
+       }
+
+       _digest = make_digest (path().string(), &progress);
+}
+
+bool
+ContentAsset::equals (shared_ptr<const ContentAsset> other, EqualityOptions, boost::function<void (NoteType, string)> 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 (file)
index 0000000..4e7ed03
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+
+    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 <string>
+#include <list>
+#include <boost/filesystem.hpp>
+#include <boost/function.hpp>
+#include <libxml++/libxml++.h>
+#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<void (float)> 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<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)>) 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
index 2058223c5dba3f4e1ebc9ba2cb1722ab112d9d02..ec5534e0abb149fc3b20c6571ab1ac5397f56d72 100644 (file)
@@ -252,10 +252,10 @@ CPL::write_to_pkl (xmlpp::Node* node) const
        asset->add_child("Type")->add_child_text ("text/xml");
 }
 
-list<shared_ptr<const Asset> >
+list<shared_ptr<const ContentAsset> >
 CPL::assets () const
 {
-       list<shared_ptr<const Asset> > a;
+       list<shared_ptr<const ContentAsset> > a;
        for (list<shared_ptr<Reel> >::const_iterator i = _reels.begin(); i != _reels.end(); ++i) {
                if ((*i)->main_picture ()) {
                        a.push_back ((*i)->main_picture ());
index 45480ec7cc11bad78575128848815ae85ebd6ca2..ead09f24251a710c519ed7b502cca25e7a24f554 100644 (file)
--- 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<boost::shared_ptr<const Asset> > assets () const;
+       std::list<boost::shared_ptr<const ContentAsset> > assets () const;
 
        bool encrypted () const;
 
index 653dc87ab6f6a534d85e6c025352459f9f0985fa..e0730020feb7b9385dff542ebd920692e82ef2b7 100644 (file)
@@ -33,7 +33,6 @@
 #include <xmlsec/xmldsig.h>
 #include <xmlsec/app.h>
 #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<shared_ptr<const Asset> > a = assets ();
-       for (list<shared_ptr<const Asset> >::const_iterator i = a.begin(); i != a.end(); ++i) {
+       list<shared_ptr<const ContentAsset> > a = assets ();
+       for (list<shared_ptr<const ContentAsset> >::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<shared_ptr<const Asset> > a = assets ();
-       for (list<shared_ptr<const Asset> >::const_iterator i = a.begin(); i != a.end(); ++i) {
+       list<shared_ptr<const ContentAsset> > a = assets ();
+       for (list<shared_ptr<const ContentAsset> >::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> cpl)
 class AssetComparator
 {
 public:
-       bool operator() (shared_ptr<const Asset> a, shared_ptr<const Asset> b) {
+       bool operator() (shared_ptr<const ContentAsset> a, shared_ptr<const ContentAsset> b) {
                return a->uuid() < b->uuid();
        }
 };
 
-list<shared_ptr<const Asset> >
+list<shared_ptr<const ContentAsset> >
 DCP::assets () const
 {
-       list<shared_ptr<const Asset> > a;
+       list<shared_ptr<const ContentAsset> > a;
        for (list<shared_ptr<CPL> >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) {
-               list<shared_ptr<const Asset> > t = (*i)->assets ();
+               list<shared_ptr<const ContentAsset> > t = (*i)->assets ();
                a.merge (t);
        }
 
index 9b72ae74633093353a59687a5aa3ff14170dd80b..d6edafa0335864589e04ef3d5fd476f0f890a49f 100644 (file)
--- 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<boost::shared_ptr<const Asset> > assets () const;
+       std::list<boost::shared_ptr<const ContentAsset> > assets () const;
 
        struct Files {
                std::list<std::string> cpls;
index 02e6ce7f1fef9d223cc3466274e7c0b1aa43fcbb..25e87ca166c8e2d4cfba0e5c67482d714ba4286d 100644 (file)
@@ -124,8 +124,8 @@ KDM::KDM (
        */
        apu.authorized_device_info.device_list.push_back ("2jmj7l5rSw0yVb/vlWAYkK/YBwk=");
 
-       list<shared_ptr<const Asset> > assets = cpl->assets ();
-       for (list<shared_ptr<const Asset> >::iterator i = assets.begin(); i != assets.end(); ++i) {
+       list<shared_ptr<const ContentAsset> > assets = cpl->assets ();
+       for (list<shared_ptr<const ContentAsset> >::iterator i = assets.begin(); i != assets.end(); ++i) {
                /* XXX: non-MXF assets? */
                shared_ptr<const MXFAsset> mxf = boost::dynamic_pointer_cast<const MXFAsset> (*i);
                if (mxf) {
@@ -138,7 +138,7 @@ KDM::KDM (
 
        /* AuthenticatedPrivate */
 
-       for (list<shared_ptr<const Asset> >::iterator i = assets.begin(); i != assets.end(); ++i) {
+       for (list<shared_ptr<const ContentAsset> >::iterator i = assets.begin(); i != assets.end(); ++i) {
                /* XXX: non-MXF assets? */
                shared_ptr<const MXFAsset> mxf = boost::dynamic_pointer_cast<const MXFAsset> (*i);
                if (mxf) {
index 3163e89ada5054e480a9001cbad5b90580708557..766b72ca6f8a7ffb2e90032a26d7855887178ebe 100644 (file)
@@ -125,7 +125,7 @@ MonoPictureAsset::get_frame (int n) const
 }
 
 bool
-MonoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
+MonoPictureAsset::equals (shared_ptr<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
 {
        if (!MXFAsset::equals (other, opt, note)) {
                return false;
index 19308aaf2b845ef068fc4d0d3f30facd21f608d0..00017354039624fc354a55cd4c666e71f2539263 100644 (file)
@@ -50,7 +50,7 @@ public:
        boost::shared_ptr<PictureAssetWriter> start_write (bool);
 
        boost::shared_ptr<const MonoPictureFrame> get_frame (int n) const;
-       bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
+       bool equals (boost::shared_ptr<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
 
 private:
        boost::filesystem::path path_from_list (int f, std::vector<boost::filesystem::path> const & files) const;
index 1b15f7a952d6c27209f9eadb73a097875d7a1b9f..c2d19a398a0b1aaf60f7517c4ebbb60f1b6aa4e6 100644 (file)
@@ -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<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
+MXFAsset::equals (shared_ptr<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
 {
-       if (!Asset::equals (other, opt, note)) {
+       if (!ContentAsset::equals (other, opt, note)) {
                return false;
        }
        
index 5ba7032497ca4ccf6bc0248efc1a8e6021575981..4af7a38d6cefad2955a874ef185890e15f33f0a6 100644 (file)
@@ -21,7 +21,7 @@
 #define LIBDCP_MXF_ASSET_H
 
 #include <boost/signals2.hpp>
-#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<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
+       virtual bool equals (boost::shared_ptr<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
        virtual void write_to_cpl (xmlpp::Element *) const;
        virtual std::string key_type () const = 0;
        
index cc537d56252cf81b48654c85275c20507435fd6f..602f036ced933cdde3efe3581c679d0c6f148b49 100644 (file)
@@ -210,7 +210,7 @@ SoundAsset::cpl_node_name () const
 }
 
 bool
-SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
+SoundAsset::equals (shared_ptr<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
 {
        if (!MXFAsset::equals (other, opt, note)) {
                return false;
index f33e5aec12c60dadd9b702dcf10af807f2384c6c..d2aa121342f83fdd4d861f03211663c122f2c0f9 100644 (file)
@@ -92,7 +92,7 @@ public:
 
        boost::shared_ptr<SoundAssetWriter> start_write ();
        
-       bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
+       bool equals (boost::shared_ptr<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
 
        boost::shared_ptr<const SoundFrame> get_frame (int n) const;
 
index bad80832b4d06764dd7c01b71b2945f3f90ce098..711a809085016acea405995229f48e87c2980abf 100644 (file)
@@ -31,7 +31,7 @@ using boost::dynamic_pointer_cast;
 using namespace dcp;
 
 bool
-StereoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
+StereoPictureAsset::equals (shared_ptr<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
 {
        if (!MXFAsset::equals (other, opt, note)) {
                return false;
index 6ebc7239355c6a1f73569b408aa473be10582214..a6620dcffd8bb0e704bc06d753c98f49de544003 100644 (file)
@@ -36,7 +36,7 @@ public:
        boost::shared_ptr<PictureAssetWriter> start_write (bool);
 
        boost::shared_ptr<const StereoPictureFrame> get_frame (int n) const;
-       bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
+       bool equals (boost::shared_ptr<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
 
 private:
        std::string cpl_node_name () const;
index d67e3625d1ebe65d9e4c2f07af52af5c5018dd3c..fcc8bac07a779787ef3430e659beab7ed405ad93 100644 (file)
@@ -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)
index e5e2e853df91653d8c5c339d00e6046d86806fda..cff65b2bc528e136af04df8bba148b0c535e0e39 100644 (file)
@@ -21,7 +21,7 @@
 #define LIBDCP_SUBTITLE_ASSET_H
 
 #include <libcxml/cxml.h>
-#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<const Asset>, EqualityOptions, boost::function<void (NoteType, std::string)> note) const {
+       virtual bool equals (boost::shared_ptr<const ContentAsset>, EqualityOptions, boost::function<void (NoteType, std::string)> note) const {
                /* XXX */
                note (ERROR, "subtitle assets not compared yet");
                return true;
index cdf3c0620973dc08365d9080a453b022b2e4bc83..7cc5e5ea84921ba3bfc823ae579f1ef0e6c337e4 100644 (file)
@@ -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