summaryrefslogtreecommitdiff
path: root/src
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
parent4f590672720ace3ccb9582a2f539683fa83e1ac8 (diff)
Remove unnecessary Content class.
Diffstat (limited to 'src')
-rw-r--r--src/content.cc38
-rw-r--r--src/content.h67
-rw-r--r--src/interop_subtitle_content.cc1
-rw-r--r--src/mxf.cc4
-rw-r--r--src/mxf.h7
-rw-r--r--src/reel.cc6
-rw-r--r--src/reel_asset.cc33
-rw-r--r--src/reel_asset.h14
-rw-r--r--src/reel_mxf_asset.cc3
-rw-r--r--src/reel_picture_asset.cc10
-rw-r--r--src/reel_picture_asset.h4
-rw-r--r--src/reel_sound_asset.h4
-rw-r--r--src/reel_subtitle_asset.h2
-rw-r--r--src/subtitle_content.cc2
-rw-r--r--src/subtitle_content.h4
-rw-r--r--src/wscript2
16 files changed, 50 insertions, 151 deletions
diff --git a/src/content.cc b/src/content.cc
deleted file mode 100644
index 3842ec09..00000000
--- a/src/content.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- Copyright (C) 2012-2014 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 "content.h"
-#include "util.h"
-#include "metadata.h"
-#include "AS_DCP.h"
-#include "KM_util.h"
-#include <libxml++/nodes/element.h>
-#include <boost/filesystem.hpp>
-#include <boost/function.hpp>
-#include <iostream>
-
-using namespace std;
-using namespace boost;
-using namespace dcp;
-
-Content::Content (boost::filesystem::path file)
- : Asset (file)
-{
-
-}
diff --git a/src/content.h b/src/content.h
deleted file mode 100644
index fcbfc25d..00000000
--- a/src/content.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2012-2014 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/content.h
- * @brief Content class.
- */
-
-#ifndef LIBDCP_CONTENT_H
-#define LIBDCP_CONTENT_H
-
-#include "types.h"
-#include "asset.h"
-#include <libxml++/libxml++.h>
-#include <boost/filesystem.hpp>
-#include <boost/function.hpp>
-#include <string>
-#include <list>
-
-namespace ASDCP {
- struct WriterInfo;
-}
-
-namespace xmlpp {
- class Element;
-}
-
-namespace dcp
-{
-
-/** @class Content
- * @brief An asset that represents a piece of content, i.e. picture, sound or subtitle.
- *
- * Such a piece of content will be contained in a file (either MXF or XML) within a DCP.
- */
-class Content : public Asset
-{
-public:
- Content () {}
-
- /** Construct a Content object by reading a file.
- * @param file File to read.
- */
- Content (boost::filesystem::path file);
-
-protected:
- virtual std::string asdcp_kind () const = 0;
-};
-
-}
-
-#endif
diff --git a/src/interop_subtitle_content.cc b/src/interop_subtitle_content.cc
index 7b99e16e..29da0b21 100644
--- a/src/interop_subtitle_content.cc
+++ b/src/interop_subtitle_content.cc
@@ -22,6 +22,7 @@
#include "xml.h"
#include "raw_convert.h"
#include "font_node.h"
+#include <libxml++/libxml++.h>
#include <boost/foreach.hpp>
#include <cmath>
diff --git a/src/mxf.cc b/src/mxf.cc
index 5c99e01f..ba614202 100644
--- a/src/mxf.cc
+++ b/src/mxf.cc
@@ -52,7 +52,7 @@ MXF::MXF (Fraction edit_rate)
}
MXF::MXF (boost::filesystem::path file)
- : Content (file)
+ : Asset (file)
, _intrinsic_duration (0)
, _encryption_context (0)
, _decryption_context (0)
@@ -95,7 +95,7 @@ MXF::fill_writer_info (ASDCP::WriterInfo* writer_info, Standard standard)
bool
MXF::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHandler note) const
{
- if (!Content::equals (other, opt, note)) {
+ if (!Asset::equals (other, opt, note)) {
return false;
}
diff --git a/src/mxf.h b/src/mxf.h
index f0ad4bd8..1b5b03d6 100644
--- a/src/mxf.h
+++ b/src/mxf.h
@@ -20,14 +20,16 @@
#ifndef LIBDCP_MXF_H
#define LIBDCP_MXF_H
-#include "content.h"
+#include "asset.h"
#include "key.h"
#include "metadata.h"
+
#include <boost/signals2.hpp>
namespace ASDCP {
class AESEncContext;
class AESDecContext;
+ class WriterInfo;
}
/* Undefine some stuff that the OS X 10.5 SDK defines */
@@ -42,7 +44,7 @@ class MXFMetadata;
/** @class MXF
* @brief Parent class for classes which represent MXF files.
*/
-class MXF : public Content
+class MXF : public Asset
{
public:
MXF (Fraction edit_rate);
@@ -116,6 +118,7 @@ public:
protected:
friend class MXFWriter;
+ virtual std::string asdcp_kind () const = 0;
std::string pkl_type (Standard standard) const;
void read_writer_info (ASDCP::WriterInfo const &);
diff --git a/src/reel.cc b/src/reel.cc
index 9e6e0ca7..eb682aea 100644
--- a/src/reel.cc
+++ b/src/reel.cc
@@ -167,14 +167,14 @@ void
Reel::resolve_refs (list<shared_ptr<Object> > objects)
{
if (_main_picture) {
- _main_picture->content().resolve (objects);
+ _main_picture->asset().resolve (objects);
}
if (_main_sound) {
- _main_sound->content().resolve (objects);
+ _main_sound->asset().resolve (objects);
}
if (_main_subtitle) {
- _main_subtitle->content().resolve (objects);
+ _main_subtitle->asset().resolve (objects);
}
}
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;
diff --git a/src/reel_asset.h b/src/reel_asset.h
index 6db621cc..7588c063 100644
--- a/src/reel_asset.h
+++ b/src/reel_asset.h
@@ -35,7 +35,7 @@ namespace xmlpp {
namespace dcp {
-class Content;
+class Asset;
/** @class ReelAsset
* @brief An entry in a &lt;Reel&gt; which refers to a use of a piece of content.
@@ -48,15 +48,15 @@ class ReelAsset : public Object
{
public:
ReelAsset ();
- ReelAsset (boost::shared_ptr<Content> content, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point);
+ ReelAsset (boost::shared_ptr<Asset> asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point);
ReelAsset (boost::shared_ptr<const cxml::Node>);
virtual void write_to_cpl (xmlpp::Node* node, Standard standard) const;
virtual bool equals (boost::shared_ptr<const ReelAsset>, EqualityOptions, NoteHandler) const;
- /** @return a Ref to our actual content */
- Ref<Content>& content () {
- return _content;
+ /** @return a Ref to our actual asset */
+ Ref<Asset>& asset () {
+ return _asset;
}
int64_t entry_point () const {
@@ -78,10 +78,10 @@ protected:
*/
virtual std::pair<std::string, std::string> cpl_node_attribute (Standard) const;
- /** Reference to the content (MXF or XML file) that this reel entry
+ /** Reference to the asset (MXF or XML file) that this reel entry
* applies to.
*/
- Ref<Content> _content;
+ Ref<Asset> _asset;
private:
diff --git a/src/reel_mxf_asset.cc b/src/reel_mxf_asset.cc
index 55cb7e9c..95b97021 100644
--- a/src/reel_mxf_asset.cc
+++ b/src/reel_mxf_asset.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2015 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
@@ -21,6 +21,7 @@
#include "mxf.h"
#include "dcp_assert.h"
#include <libcxml/cxml.h>
+#include <libxml++/libxml++.h>
using boost::shared_ptr;
using namespace dcp;
diff --git a/src/reel_picture_asset.cc b/src/reel_picture_asset.cc
index d08f1781..de4ae5f6 100644
--- a/src/reel_picture_asset.cc
+++ b/src/reel_picture_asset.cc
@@ -21,12 +21,12 @@
* @brief ReelPictureAsset class.
*/
-#include "content.h"
#include "reel_picture_asset.h"
#include "picture_mxf.h"
#include "dcp_assert.h"
#include "compose.hpp"
#include <libcxml/cxml.h>
+#include <libxml++/libxml++.h>
#include <iomanip>
using std::bad_cast;
@@ -43,10 +43,10 @@ ReelPictureAsset::ReelPictureAsset ()
}
-ReelPictureAsset::ReelPictureAsset (shared_ptr<PictureMXF> content, int64_t entry_point)
- : ReelMXFAsset (content, content->edit_rate(), content->intrinsic_duration(), entry_point)
- , _frame_rate (content->frame_rate ())
- , _screen_aspect_ratio (content->screen_aspect_ratio ())
+ReelPictureAsset::ReelPictureAsset (shared_ptr<PictureMXF> asset, int64_t entry_point)
+ : ReelMXFAsset (asset, asset->edit_rate(), asset->intrinsic_duration(), entry_point)
+ , _frame_rate (asset->frame_rate ())
+ , _screen_aspect_ratio (asset->screen_aspect_ratio ())
{
}
diff --git a/src/reel_picture_asset.h b/src/reel_picture_asset.h
index 1607379a..fd4d11fc 100644
--- a/src/reel_picture_asset.h
+++ b/src/reel_picture_asset.h
@@ -36,7 +36,7 @@ class ReelPictureAsset : public ReelMXFAsset
{
public:
ReelPictureAsset ();
- ReelPictureAsset (boost::shared_ptr<PictureMXF> content, int64_t entry_point);
+ ReelPictureAsset (boost::shared_ptr<PictureMXF> asset, int64_t entry_point);
ReelPictureAsset (boost::shared_ptr<const cxml::Node>);
virtual void write_to_cpl (xmlpp::Node* node, Standard standard) const;
@@ -44,7 +44,7 @@ public:
/** @return the PictureMXF that this object refers to */
boost::shared_ptr<PictureMXF> mxf () {
- return boost::dynamic_pointer_cast<PictureMXF> (_content.object ());
+ return boost::dynamic_pointer_cast<PictureMXF> (_asset.object ());
}
/** @return picture frame rate */
diff --git a/src/reel_sound_asset.h b/src/reel_sound_asset.h
index 622a97cf..92667429 100644
--- a/src/reel_sound_asset.h
+++ b/src/reel_sound_asset.h
@@ -41,12 +41,12 @@ public:
/** @return the SoundMXF that this object refers to */
boost::shared_ptr<SoundMXF> mxf () {
- return boost::dynamic_pointer_cast<SoundMXF> (_content.object ());
+ return boost::dynamic_pointer_cast<SoundMXF> (_asset.object ());
}
/** @return the SoundMXF that this object refers to */
boost::shared_ptr<const SoundMXF> mxf () const {
- return boost::dynamic_pointer_cast<const SoundMXF> (_content.object ());
+ return boost::dynamic_pointer_cast<const SoundMXF> (_asset.object ());
}
private:
diff --git a/src/reel_subtitle_asset.h b/src/reel_subtitle_asset.h
index f0537cb5..bc00b4c3 100644
--- a/src/reel_subtitle_asset.h
+++ b/src/reel_subtitle_asset.h
@@ -41,7 +41,7 @@ public:
ReelSubtitleAsset (boost::shared_ptr<const cxml::Node>);
boost::shared_ptr<SubtitleContent> subtitle_content () const {
- return boost::dynamic_pointer_cast<SubtitleContent> (_content.object ());
+ return boost::dynamic_pointer_cast<SubtitleContent> (_asset.object ());
}
private:
diff --git a/src/subtitle_content.cc b/src/subtitle_content.cc
index fb01502d..d2be6fe0 100644
--- a/src/subtitle_content.cc
+++ b/src/subtitle_content.cc
@@ -49,7 +49,7 @@ SubtitleContent::SubtitleContent ()
}
SubtitleContent::SubtitleContent (boost::filesystem::path file)
- : Content (file)
+ : Asset (file)
, _reel_number ("1")
{
diff --git a/src/subtitle_content.h b/src/subtitle_content.h
index ee424916..d80d631c 100644
--- a/src/subtitle_content.h
+++ b/src/subtitle_content.h
@@ -20,7 +20,7 @@
#ifndef LIBDCP_SUBTITLE_CONTENT_H
#define LIBDCP_SUBTITLE_CONTENT_H
-#include "content.h"
+#include "asset.h"
#include "dcp_time.h"
#include "subtitle_string.h"
#include <libcxml/cxml.h>
@@ -37,7 +37,7 @@ class LoadFontNode;
/** @class SubtitleContent
* @brief A parent for classes representing a file containing subtitles.
*/
-class SubtitleContent : public Content
+class SubtitleContent : public Asset
{
public:
SubtitleContent ();
diff --git a/src/wscript b/src/wscript
index fac20fb7..7328178b 100644
--- a/src/wscript
+++ b/src/wscript
@@ -7,7 +7,6 @@ def build(bld):
certificates.cc
colour_conversion.cc
colour_matrix.cc
- content.cc
cpl.cc
dcp.cc
dcp_time.cc
@@ -70,7 +69,6 @@ def build(bld):
colour_conversion.h
colour_matrix.h
cpl.h
- content.h
dcp.h
dcp_time.h
decrypted_kdm.h