X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcontent.h;h=9cf6d866ab04906b3288188792c66f9403b8592e;hb=2d5b8cdde08044d323aa7193dfac6c9f8bca7131;hp=c066c61e036a047813ecde76a71c2a9d1c9552b6;hpb=5d65df7ebdc96c658a6b7042e639cb395f91bfeb;p=dcpomatic.git diff --git a/src/lib/content.h b/src/lib/content.h index c066c61e0..9cf6d866a 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -48,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); @@ -64,12 +66,24 @@ public: boost::shared_ptr clone () const; void set_path (boost::filesystem::path); - - boost::filesystem::path path () const { + + 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 _path; + return _paths.size (); } + boost::filesystem::path path (size_t i) const { + boost::mutex::scoped_lock lm (_mutex); + return _paths[i]; + } + bool path_valid () const; /** @return MD5 digest of the content's file(s) */ @@ -103,7 +117,7 @@ public: } Time end () const { - return position() + length_after_trim(); + return position() + length_after_trim() - 1; } Time length_after_trim () const; @@ -126,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;