X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcontent.h;h=6bbf33b35cd4d4e10377bdda2ad77be6cf673f7c;hb=3574212ee42b2bd924eb95d5c0f4f69ec9e0a2f0;hp=78a41e306010cf38828e0090151b81065ef263e7;hpb=cc3900735839ff4b0da0c046b5c606c440ba917a;p=dcpomatic.git diff --git a/src/lib/content.h b/src/lib/content.h index 78a41e306..6bbf33b35 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -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.h + * @brief Content class. + */ + #ifndef DCPOMATIC_CONTENT_H #define DCPOMATIC_CONTENT_H @@ -26,7 +30,9 @@ #include #include #include +#include #include "types.h" +#include "dcpomatic_time.h" namespace cxml { class Node; @@ -45,13 +51,16 @@ public: static int const TRIM_END; }; +/** @class Content + * @brief A piece of content represented by one or more files on disk. + */ class Content : public boost::enable_shared_from_this, public boost::noncopyable { public: Content (boost::shared_ptr); Content (boost::shared_ptr, DCPTime); Content (boost::shared_ptr, boost::filesystem::path); - Content (boost::shared_ptr, boost::shared_ptr); + Content (boost::shared_ptr, cxml::ConstNodePtr); Content (boost::shared_ptr, std::vector >); virtual ~Content () {} @@ -120,7 +129,7 @@ public: } DCPTime end () const { - return position() + length_after_trim() - 1; + return position() + length_after_trim(); } DCPTime length_after_trim () const; @@ -129,6 +138,10 @@ public: _change_signals_frequent = f; } + boost::shared_ptr film () const { + return _film.lock (); + } + boost::signals2::signal, int, bool)> Changed; protected: @@ -137,8 +150,8 @@ protected: boost::weak_ptr _film; /** _mutex which should be used to protect accesses, as examine - jobs can update content state in threads other than the main one. - */ + * jobs can update content state in threads other than the main one. + */ mutable boost::mutex _mutex; /** Paths of our data files */