X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcontent_factory.cc;h=789496d08e043c7d911ce2991eff4f689b3e4e68;hb=4e411ea97b4dab8a5fa282d1d4cf7971ef1e24ad;hp=825c8049854ba3032519b7d27430560a18d9f8b8;hpb=79ce26d031d109177ba4b0f637fa2960345a37a3;p=dcpomatic.git diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc index 825c80498..789496d08 100644 --- a/src/lib/content_factory.cc +++ b/src/lib/content_factory.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2014 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,6 +17,10 @@ */ +/** @file src/lib/content_factory.cc + * @brief Methods to create content objects. + */ + #include #include "ffmpeg_content.h" #include "image_content.h" @@ -25,17 +29,25 @@ #include "util.h" using std::string; +using std::list; using boost::shared_ptr; +/** Create a Content object from an XML node. + * @param film Film that the content will be in. + * @param node XML description. + * @param version XML state version. + * @param notes A list to which is added descriptions of any non-critial warnings / messages. + * @return Content object, or 0 if no content was recognised in the XML. + */ shared_ptr -content_factory (shared_ptr film, cxml::NodePtr node, int version) +content_factory (shared_ptr film, cxml::NodePtr node, int version, list& notes) { string const type = node->string_child ("Type"); boost::shared_ptr content; if (type == "FFmpeg") { - content.reset (new FFmpegContent (film, node, version)); + content.reset (new FFmpegContent (film, node, version, notes)); } else if (type == "Image") { content.reset (new ImageContent (film, node, version)); } else if (type == "Sndfile") { @@ -47,6 +59,11 @@ content_factory (shared_ptr film, cxml::NodePtr node, int version) return content; } +/** Create a Content object from a file, depending on its extension. + * @param film Film that the content will be in. + * @param path File's path. + * @return Content object. + */ shared_ptr content_factory (shared_ptr film, boost::filesystem::path path) {