X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcontent.h;h=e33f517abf1f9e6205a208ccc44539c6b592f7ed;hb=01791aac0b11e9f296cd31a7803e287203bd8355;hp=d39fc9e1ac99d3ca1de4ebd2ad4ab6b475567f5a;hpb=f861018389acd9d277fe34d7621182b9b54f977f;p=dcpomatic.git diff --git a/src/lib/content.h b/src/lib/content.h index d39fc9e1a..e33f517ab 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -25,6 +25,7 @@ #include #include #include +#include "types.h" namespace cxml { class Node; @@ -33,19 +34,28 @@ namespace cxml { class Job; class Film; +class ContentProperty +{ +public: + static int const START; + static int const LENGTH; +}; + class Content : public boost::enable_shared_from_this { public: - Content (boost::filesystem::path); - Content (boost::shared_ptr); + Content (boost::shared_ptr, Time); + Content (boost::shared_ptr, boost::filesystem::path); + Content (boost::shared_ptr, boost::shared_ptr); Content (Content const &); - virtual void examine (boost::shared_ptr, boost::shared_ptr, bool); + virtual void examine (boost::shared_ptr); virtual std::string summary () const = 0; virtual std::string information () const = 0; virtual void as_xml (xmlpp::Node *) const; virtual boost::shared_ptr clone () const = 0; - + virtual Time length () const = 0; + boost::filesystem::path file () const { boost::mutex::scoped_lock lm (_mutex); return _file; @@ -56,16 +66,29 @@ public: return _digest; } + void set_start (Time); + + Time start () const { + boost::mutex::scoped_lock lm (_mutex); + return _start; + } + + Time end () const { + return start() + length(); + } + boost::signals2::signal, int)> Changed; protected: void signal_changed (int); - + + boost::weak_ptr _film; mutable boost::mutex _mutex; private: boost::filesystem::path _file; std::string _digest; + Time _start; }; #endif