summaryrefslogtreecommitdiff
path: root/src/reel_asset.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-06-04 16:42:03 +0100
committerCarl Hetherington <cth@carlh.net>2015-06-05 14:34:42 +0100
commit2105caa32a12236d5b70a0cf8b9ac62fcf7f574e (patch)
treec19bc651579257b262ab5001790790b75edc95c8 /src/reel_asset.cc
parent4f590672720ace3ccb9582a2f539683fa83e1ac8 (diff)
Remove unnecessary Content class.
Diffstat (limited to 'src/reel_asset.cc')
-rw-r--r--src/reel_asset.cc33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/reel_asset.cc b/src/reel_asset.cc
index 57b709a7..7f129f90 100644
--- a/src/reel_asset.cc
+++ b/src/reel_asset.cc
@@ -19,9 +19,10 @@
#include "raw_convert.h"
#include "reel_asset.h"
-#include "content.h"
+#include "asset.h"
#include "compose.hpp"
#include <libcxml/cxml.h>
+#include <libxml++/libxml++.h>
using std::pair;
using std::string;
@@ -32,7 +33,7 @@ using namespace dcp;
ReelAsset::ReelAsset ()
: Object (make_uuid ())
- , _content (_id)
+ , _asset (_id)
, _edit_rate (Fraction (24, 1))
, _intrinsic_duration (0)
, _entry_point (0)
@@ -42,27 +43,27 @@ ReelAsset::ReelAsset ()
}
/** Construct a ReelAsset.
- * @param content Content that this asset refers to.
- * @param edit_rate Edit rate for the content.
- * @param intrinsic_duration Intrinsic duration of this content.
- * @param entry_point Entry point to use in that content.
+ * @param asset Asset that this ReelAsset refers to.
+ * @param edit_rate Edit rate for the asset.
+ * @param intrinsic_duration Intrinsic duration of this asset.
+ * @param entry_point Entry point to use in that asset.
*/
-ReelAsset::ReelAsset (shared_ptr<Content> content, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point)
- : Object (content->id ())
- , _content (content)
+ReelAsset::ReelAsset (shared_ptr<Asset> asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point)
+ : Object (asset->id ())
+ , _asset (asset)
, _edit_rate (edit_rate)
, _intrinsic_duration (intrinsic_duration)
, _entry_point (entry_point)
, _duration (intrinsic_duration - entry_point)
- , _hash (make_digest (content->file (), 0))
+ , _hash (make_digest (asset->file (), 0))
{
/* default _annotation_text to the leaf name of our file */
- _annotation_text = content->file().leaf().string ();
+ _annotation_text = asset->file().leaf().string ();
}
ReelAsset::ReelAsset (shared_ptr<const cxml::Node> node)
: Object (node->string_child ("Id"))
- , _content (_id)
+ , _asset (_id)
, _annotation_text (node->optional_string_child ("AnnotationText").get_value_or (""))
, _edit_rate (Fraction (node->string_child ("EditRate")))
, _intrinsic_duration (node->number_child<int64_t> ("IntrinsicDuration"))
@@ -72,7 +73,7 @@ ReelAsset::ReelAsset (shared_ptr<const cxml::Node> node)
{
if (_id.length() > 9) {
_id = _id.substr (9);
- _content.set_id (_id);
+ _asset.set_id (_id);
}
}
@@ -90,7 +91,7 @@ ReelAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const
a->add_child("IntrinsicDuration")->add_child_text (raw_convert<string> (_intrinsic_duration));
a->add_child("EntryPoint")->add_child_text (raw_convert<string> (_entry_point));
a->add_child("Duration")->add_child_text (raw_convert<string> (_duration));
- a->add_child("Hash")->add_child_text (_content.object()->hash ());
+ a->add_child("Hash")->add_child_text (_asset.object()->hash ());
}
pair<string, string>
@@ -142,8 +143,8 @@ ReelAsset::equals (shared_ptr<const ReelAsset> other, EqualityOptions opt, NoteH
}
}
- if (_content.resolved () && other->_content.resolved ()) {
- return _content->equals (other->_content.object (), opt, note);
+ if (_asset.resolved () && other->_asset.resolved ()) {
+ return _asset->equals (other->_asset.object (), opt, note);
}
return true;