X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcontent.h;h=9cf6d866ab04906b3288188792c66f9403b8592e;hb=2d5b8cdde08044d323aa7193dfac6c9f8bca7131;hp=9c7ad2fc2984df5ff021c2f623634ba96310f6a3;hpb=5072adc82cf6ae088bb6e08af8bbef2d0d49914c;p=dcpomatic.git diff --git a/src/lib/content.h b/src/lib/content.h index 9c7ad2fc2..9cf6d866a 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -38,6 +38,7 @@ class Film; class ContentProperty { public: + static int const PATH; static int const POSITION; static int const LENGTH; static int const TRIM_START; @@ -47,9 +48,11 @@ public: class Content : public boost::enable_shared_from_this, public boost::noncopyable { public: + Content (boost::shared_ptr); Content (boost::shared_ptr, Time); Content (boost::shared_ptr, boost::filesystem::path); Content (boost::shared_ptr, boost::shared_ptr); + Content (boost::shared_ptr, std::vector >); virtual ~Content () {} virtual void examine (boost::shared_ptr); @@ -61,11 +64,27 @@ public: virtual std::string identifier () const; boost::shared_ptr clone () const; - - boost::filesystem::path path () const { + + void set_path (boost::filesystem::path); + + std::string path_summary () const; + + std::vector paths () const { + boost::mutex::scoped_lock lm (_mutex); + return _paths; + } + + size_t number_of_paths () const { + boost::mutex::scoped_lock lm (_mutex); + return _paths.size (); + } + + boost::filesystem::path path (size_t i) const { boost::mutex::scoped_lock lm (_mutex); - return _path; + return _paths[i]; } + + bool path_valid () const; /** @return MD5 digest of the content's file(s) */ std::string digest () const { @@ -98,7 +117,7 @@ public: } Time end () const { - return position() + length_after_trim(); + return position() + length_after_trim() - 1; } Time length_after_trim () const; @@ -121,9 +140,10 @@ protected: */ mutable boost::mutex _mutex; + /** Paths of our data files */ + std::vector _paths; + private: - /** Path of a file or a directory containing files */ - boost::filesystem::path _path; std::string _digest; Time _position; Time _trim_start;