X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcontent.cc;h=af85e0ff08d17fcbf7fd4111ce27988d9fe405dd;hb=7998c12eb59c07f583db27a250ff566b543bf40b;hp=6a33e9f7e27ce8961ce6439d648138cf891af7ce;hpb=883d885dc8690519d205c8baa275385af8a39f4b;p=dcpomatic.git diff --git a/src/lib/content.cc b/src/lib/content.cc index 6a33e9f7e..af85e0ff0 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2015 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,82 +17,281 @@ */ -#include -#include -#include +/** @file src/lib/content.cc + * @brief Content class. + */ + #include "content.h" #include "util.h" +#include "content_factory.h" +#include "exceptions.h" +#include "film.h" +#include "safe_stringstream.h" +#include "job.h" +#include "compose.hpp" +#include "raw_convert.h" +#include +#include +#include +#include + +#include "i18n.h" using std::string; +using std::list; +using std::cout; +using std::vector; +using std::max; +using std::pair; using boost::shared_ptr; -using boost::lexical_cast; -int const ContentProperty::START = 400; -int const ContentProperty::LENGTH = 401; +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, Time s) - : _film (f) - , _start (s) +Content::Content (shared_ptr film) + : _film (film) + , _position (0) + , _trim_start (0) + , _trim_end (0) + , _change_signals_frequent (false) { } -Content::Content (shared_ptr f, boost::filesystem::path p) - : _film (f) - , _file (p) - , _start (0) +Content::Content (shared_ptr film, DCPTime p) + : _film (film) + , _position (p) + , _trim_start (0) + , _trim_end (0) + , _change_signals_frequent (false) { } -Content::Content (shared_ptr f, shared_ptr node) - : _film (f) +Content::Content (shared_ptr film, boost::filesystem::path p) + : _film (film) + , _position (0) + , _trim_start (0) + , _trim_end (0) + , _change_signals_frequent (false) +{ + _paths.push_back (p); +} + +Content::Content (shared_ptr film, cxml::ConstNodePtr node) + : _film (film) + , _change_signals_frequent (false) { - _file = node->string_child ("File"); - _digest = node->string_child ("Digest"); - _start = node->number_child