#include <libcxml/cxml.h>
#include "ffmpeg_content.h"
-#include "imagemagick_content.h"
+#include "image_content.h"
#include "sndfile_content.h"
+#include "util.h"
using std::string;
using boost::shared_ptr;
shared_ptr<Content>
-content_factory (shared_ptr<const Film> film, shared_ptr<cxml::Node> node)
+content_factory (shared_ptr<const Film> film, cxml::NodePtr node, int version)
{
string const type = node->string_child ("Type");
boost::shared_ptr<Content> content;
if (type == "FFmpeg") {
- content.reset (new FFmpegContent (film, node));
- } else if (type == "ImageMagick") {
- content.reset (new ImageMagickContent (film, node));
+ content.reset (new FFmpegContent (film, node, version));
+ } else if (type == "Image") {
+ content.reset (new ImageContent (film, node, version));
} else if (type == "Sndfile") {
- content.reset (new SndfileContent (film, node));
+ content.reset (new SndfileContent (film, node, version));
+ }
+
+ return content;
+}
+
+shared_ptr<Content>
+content_factory (shared_ptr<const Film> film, boost::filesystem::path path)
+{
+ shared_ptr<Content> content;
+
+ if (valid_image_file (path)) {
+ content.reset (new ImageContent (film, path));
+ } else if (SndfileContent::valid_file (path)) {
+ content.reset (new SndfileContent (film, path));
+ } else {
+ content.reset (new FFmpegContent (film, path));
}
return content;