summaryrefslogtreecommitdiff
path: root/src/lib/content_factory.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/content_factory.cc')
-rw-r--r--src/lib/content_factory.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc
index 6ed01f174..d42491f7f 100644
--- a/src/lib/content_factory.cc
+++ b/src/lib/content_factory.cc
@@ -22,6 +22,7 @@
#include "still_image_content.h"
#include "moving_image_content.h"
#include "sndfile_content.h"
+#include "util.h"
using std::string;
using boost::shared_ptr;
@@ -45,3 +46,19 @@ content_factory (shared_ptr<const Film> film, shared_ptr<cxml::Node> node)
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 StillImageContent (film, path));
+ } else if (SndfileContent::valid_file (path)) {
+ content.reset (new SndfileContent (film, path));
+ } else {
+ content.reset (new FFmpegContent (film, path));
+ }
+
+ return content;
+}