summaryrefslogtreecommitdiff
path: root/src/lib/content_factory.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-01-11 14:04:58 +0000
committerCarl Hetherington <cth@carlh.net>2014-01-11 14:04:58 +0000
commit3af978d2d688cb1e4be7c8d95155a6b8cc7456a3 (patch)
treefdb7f3fe7eea7a433d38d14307e78731d1e49dc2 /src/lib/content_factory.cc
parent0523d4a83d7d334560d261686bdb329eea8bfb96 (diff)
Various work on SubRip.
Diffstat (limited to 'src/lib/content_factory.cc')
-rw-r--r--src/lib/content_factory.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc
index bab22b8eb..825c80498 100644
--- a/src/lib/content_factory.cc
+++ b/src/lib/content_factory.cc
@@ -21,6 +21,7 @@
#include "ffmpeg_content.h"
#include "image_content.h"
#include "sndfile_content.h"
+#include "subrip_content.h"
#include "util.h"
using std::string;
@@ -39,6 +40,8 @@ content_factory (shared_ptr<const Film> film, cxml::NodePtr node, int version)
content.reset (new ImageContent (film, node, version));
} else if (type == "Sndfile") {
content.reset (new SndfileContent (film, node, version));
+ } else if (type == "SubRip") {
+ content.reset (new SubRipContent (film, node, version));
}
return content;
@@ -48,11 +51,16 @@ shared_ptr<Content>
content_factory (shared_ptr<const Film> film, boost::filesystem::path path)
{
shared_ptr<Content> content;
+
+ string ext = path.extension().string ();
+ transform (ext.begin(), ext.end(), ext.begin(), ::tolower);
if (valid_image_file (path)) {
content.reset (new ImageContent (film, path));
} else if (SndfileContent::valid_file (path)) {
content.reset (new SndfileContent (film, path));
+ } else if (ext == ".srt") {
+ content.reset (new SubRipContent (film, path));
} else {
content.reset (new FFmpegContent (film, path));
}