X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcontent.cc;h=11a4b21cca3026706911cb0c51ea9230eabc8797;hb=0b6c6de07f9a3aa28c2e8ca8ef30340e3fa1bfc6;hp=9c3bcd39dcf6cd5585c20d7e9d70a4d8f52cb9c9;hpb=147cca5876dfbdf56e21289c3a36bec4b4850191;p=dcpomatic.git diff --git a/src/lib/content.cc b/src/lib/content.cc index 9c3bcd39d..11a4b21cc 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -20,50 +20,257 @@ #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 "safe_stringstream.h" + +#include "i18n.h" using std::string; +using std::set; +using std::list; +using std::cout; +using std::vector; +using std::max; using boost::shared_ptr; +using libdcp::raw_convert; + +int const ContentProperty::PATH = 400; +int const ContentProperty::POSITION = 401; +int const ContentProperty::LENGTH = 402; +int const ContentProperty::TRIM_START = 403; +int const ContentProperty::TRIM_END = 404; + +Content::Content (shared_ptr f) + : _film (f) + , _position (0) + , _trim_start (0) + , _trim_end (0) + , _change_signals_frequent (false) +{ -Content::Content (boost::filesystem::path f) - : _file (f) +} + +Content::Content (shared_ptr f, Time p) + : _film (f) + , _position (p) + , _trim_start (0) + , _trim_end (0) + , _change_signals_frequent (false) { } -Content::Content (shared_ptr node) +Content::Content (shared_ptr f, boost::filesystem::path p) + : _film (f) + , _position (0) + , _trim_start (0) + , _trim_end (0) + , _change_signals_frequent (false) { - _file = node->string_child ("File"); + _paths.push_back (p); +} + +Content::Content (shared_ptr f, shared_ptr node) + : _film (f) + , _change_signals_frequent (false) +{ + 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