X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcontent_factory.cc;h=b64c1b9a3d6f383fed236e6e79cf4f8622d86f29;hb=571a29b441ce6fe4a1e35bbcbcf4ea6abc885c22;hp=e912589fcb9e89e51603dde5ec666423cfbcf407;hpb=7bc2134d658778e04f1756c255e604b4ab5a5831;p=dcpomatic.git diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc index e912589fc..b64c1b9a3 100644 --- a/src/lib/content_factory.cc +++ b/src/lib/content_factory.cc @@ -50,7 +50,6 @@ using std::list; using std::make_shared; using std::shared_ptr; using std::string; -using boost::optional; /** Create a Content object from an XML node. @@ -70,14 +69,14 @@ content_factory (cxml::ConstNodePtr node, int version, list& notes) /* SndfileContent is now handled by the FFmpeg code rather than by separate libsndfile-based code. */ - content.reset (new FFmpegContent(node, version, notes)); + content = make_shared(node, version, notes); } else if (type == "Image") { - content.reset (new ImageContent(node, version)); + content = make_shared(node, version); } else if (type == "Sndfile") { /* SndfileContent is now handled by the FFmpeg code rather than by separate libsndfile-based code. */ - content.reset (new FFmpegContent(node, version, notes)); + content = make_shared(node, version, notes); content->audio->set_stream ( make_shared( @@ -89,15 +88,15 @@ content_factory (cxml::ConstNodePtr node, int version, list& notes) ); } else if (type == "SubRip" || type == "TextSubtitle") { - content.reset (new StringTextFileContent(node, version)); + content = make_shared(node, version, notes); } else if (type == "DCP") { - content.reset (new DCPContent(node, version)); + content = make_shared(node, version); } else if (type == "DCPSubtitle") { - content.reset (new DCPSubtitleContent(node, version)); + content = make_shared(node, version); } else if (type == "VideoMXF") { - content.reset (new VideoMXFContent(node, version)); + content = make_shared(node, version); } else if (type == "AtmosMXF") { - content.reset (new AtmosMXFContent(node, version)); + content = make_shared(node, version); } return content; @@ -169,26 +168,26 @@ content_factory (boost::filesystem::path path) transform (ext.begin(), ext.end(), ext.begin(), ::tolower); if (valid_image_file (path)) { - single.reset (new ImageContent(path)); + single = make_shared(path); } else if (ext == ".srt" || ext == ".ssa" || ext == ".ass" || ext == ".stl") { - single.reset (new StringTextFileContent(path)); + single = make_shared(path); } else if (ext == ".xml") { cxml::Document doc; doc.read_file (path); if (doc.root_name() == "DCinemaSecurityMessage") { throw KDMAsContentError (); } - single.reset (new DCPSubtitleContent(path)); + single = make_shared(path); } else if (ext == ".mxf" && dcp::SMPTESubtitleAsset::valid_mxf(path)) { - single.reset (new DCPSubtitleContent(path)); + single = make_shared(path); } else if (ext == ".mxf" && VideoMXFContent::valid_mxf(path)) { - single.reset (new VideoMXFContent(path)); + single = make_shared(path); } else if (ext == ".mxf" && AtmosMXFContent::valid_mxf(path)) { - single.reset (new AtmosMXFContent(path)); + single = make_shared(path); } if (!single) { - single.reset (new FFmpegContent(path)); + single = make_shared(path); } content.push_back (single);