#include "image_content.h"
#include "sndfile_content.h"
#include "subrip_content.h"
+#include "dcp_content.h"
#include "util.h"
using std::string;
content.reset (new SndfileContent (film, node, version));
} else if (type == "SubRip") {
content.reset (new SubRipContent (film, node, version));
+ } else if (type == "DCP") {
+ content.reset (new DCPContent (film, node, version));
}
return content;
read_directory (p);
}
+DCPContent::DCPContent (shared_ptr<const Film> f, cxml::ConstNodePtr node, int version)
+ : Content (f, node)
+ , VideoContent (f, node, version)
+ , SingleStreamAudioContent (f, node, version)
+ , SubtitleContent (f, node, version)
+{
+ _name = node->string_child ("Name");
+ _directory = node->string_child ("Directory");
+}
+
void
DCPContent::read_directory (boost::filesystem::path p)
{
DCPContent::as_xml (xmlpp::Node* node) const
{
node->add_child("Type")->add_child_text ("DCP");
+
Content::as_xml (node);
VideoContent::as_xml (node);
SingleStreamAudioContent::as_xml (node);
+ SubtitleContent::as_xml (node);
+
+ node->add_child("Name")->add_child_text (_name);
+ node->add_child("Directory")->add_child_text (_directory.string ());
}
DCPTime
*/
+#include <libcxml/cxml.h>
#include "video_content.h"
#include "single_stream_audio_content.h"
#include "subtitle_content.h"
{
public:
DCPContent (boost::shared_ptr<const Film> f, boost::filesystem::path p);
+ DCPContent (boost::shared_ptr<const Film> f, cxml::ConstNodePtr, int version);
boost::shared_ptr<DCPContent> shared_from_this () {
return boost::dynamic_pointer_cast<DCPContent> (Content::shared_from_this ());
private:
void read_directory (boost::filesystem::path);
-
- boost::filesystem::path _directory;
+
std::string _name;
+ boost::filesystem::path _directory;
};