X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcontent.cc;h=bbbe9b6ce4bdd4dd5ff6b8dcf231c8d08126e253;hb=d2137ac5db409e686b4d9b3fa567935a5e416d41;hp=a565edb527c7339096c6accd932289e806e87c45;hpb=90b84151b9817b33381187f678cb2fdd062ed785;p=dcpomatic.git diff --git a/src/lib/content.cc b/src/lib/content.cc index a565edb52..bbbe9b6ce 100644 --- a/src/lib/content.cc +++ b/src/lib/content.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,20 +17,32 @@ */ +/** @file src/lib/content.cc + * @brief Content class. + */ + #include #include #include +#include #include "content.h" #include "util.h" #include "content_factory.h" #include "ui_signaller.h" +#include "exceptions.h" +#include "film.h" + +#include "i18n.h" using std::string; using std::stringstream; using std::set; +using std::list; using std::cout; +using std::vector; +using std::max; using boost::shared_ptr; -using boost::lexical_cast; +using dcp::raw_convert; int const ContentProperty::PATH = 400; int const ContentProperty::POSITION = 401; @@ -48,7 +60,7 @@ Content::Content (shared_ptr f) } -Content::Content (shared_ptr f, Time p) +Content::Content (shared_ptr f, DCPTime p) : _film (f) , _position (p) , _trim_start (0) @@ -68,42 +80,64 @@ Content::Content (shared_ptr f, boost::filesystem::path p) _paths.push_back (p); } -Content::Content (shared_ptr f, shared_ptr node) +Content::Content (shared_ptr f, cxml::ConstNodePtr node) : _film (f) , _change_signals_frequent (false) { - _paths.push_back (node->string_child ("Path")); + list path_children = node->node_children ("Path"); + for (list::const_iterator i = path_children.begin(); i != path_children.end(); ++i) { + _paths.push_back ((*i)->content ()); + } _digest = node->string_child ("Digest"); - _position = node->number_child