X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcontent_factory.cc;h=092efd7903d7dba9219c483c57a03307d6733945;hb=2e504b33eb9f38cac629ad31b7c107fb0cf5efda;hp=98b1dd859536643c83c524e3a22a4df45b039c8a;hpb=5d3ebbb2e7844485e8dddd6471209d56b05633ae;p=dcpomatic.git diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc index 98b1dd859..092efd790 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; @@ -40,6 +41,8 @@ content_factory (shared_ptr film, cxml::NodePtr node, int version, l 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; @@ -49,11 +52,16 @@ shared_ptr content_factory (shared_ptr film, boost::filesystem::path path) { shared_ptr 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)); }