+++ /dev/null
-/*
- 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)
-{
-
-}
+++ /dev/null
-/*
- 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
#include "xml.h"
#include "raw_convert.h"
#include "font_node.h"
+#include <libxml++/libxml++.h>
#include <boost/foreach.hpp>
#include <cmath>
}
MXF::MXF (boost::filesystem::path file)
- : Content (file)
+ : Asset (file)
, _intrinsic_duration (0)
, _encryption_context (0)
, _decryption_context (0)
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;
}
#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 */
/** @class MXF
* @brief Parent class for classes which represent MXF files.
*/
-class MXF : public Content
+class MXF : public Asset
{
public:
MXF (Fraction edit_rate);
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 &);
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);
}
}
#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;
ReelAsset::ReelAsset ()
: Object (make_uuid ())
- , _content (_id)
+ , _asset (_id)
, _edit_rate (Fraction (24, 1))
, _intrinsic_duration (0)
, _entry_point (0)
}
/** 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"))
{
if (_id.length() > 9) {
_id = _id.substr (9);
- _content.set_id (_id);
+ _asset.set_id (_id);
}
}
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>
}
}
- 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;
namespace dcp {
-class Content;
+class Asset;
/** @class ReelAsset
* @brief An entry in a <Reel> which refers to a use of a piece of content.
{
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 {
*/
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:
/*
- 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
#include "mxf.h"
#include "dcp_assert.h"
#include <libcxml/cxml.h>
+#include <libxml++/libxml++.h>
using boost::shared_ptr;
using namespace dcp;
* @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;
}
-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 ())
{
}
{
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;
/** @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 */
/** @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:
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:
}
SubtitleContent::SubtitleContent (boost::filesystem::path file)
- : Content (file)
+ : Asset (file)
, _reel_number ("1")
{
#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>
/** @class SubtitleContent
* @brief A parent for classes representing a file containing subtitles.
*/
-class SubtitleContent : public Content
+class SubtitleContent : public Asset
{
public:
SubtitleContent ();
certificates.cc
colour_conversion.cc
colour_matrix.cc
- content.cc
cpl.cc
dcp.cc
dcp_time.cc
colour_conversion.h
colour_matrix.h
cpl.h
- content.h
dcp.h
dcp_time.h
decrypted_kdm.h
*/
+namespace xmlpp {
+ class Element;
+}
+
extern boost::filesystem::path private_test;
extern void check_xml (xmlpp::Element* ref, xmlpp::Element* test, std::list<std::string> ignore);
extern void check_xml (std::string ref, std::string test, std::list<std::string> ignore);