XML metadata and some other bits.
[dcpomatic.git] / src / lib / content.h
1 #ifndef DVDOMATIC_CONTENT_H
2 #define DVDOMATIC_CONTENT_H
3
4 #include <boost/filesystem.hpp>
5 #include <boost/signals2.hpp>
6 #include <boost/thread/mutex.hpp>
7 #include <libxml++/libxml++.h>
8
9 namespace cxml {
10         class Node;
11 }
12
13 class Job;
14 class Film;
15
16 class Content
17 {
18 public:
19         Content (boost::filesystem::path);
20         Content (boost::shared_ptr<const cxml::Node>);
21         
22         virtual void examine (boost::shared_ptr<Film>, boost::shared_ptr<Job>, bool);
23         virtual std::string summary () const = 0;
24         virtual void as_xml (xmlpp::Node *) const;
25         
26         boost::filesystem::path file () const {
27                 boost::mutex::scoped_lock lm (_mutex);
28                 return _file;
29         }
30
31         boost::signals2::signal<void (int)> Changed;
32
33 protected:
34         mutable boost::mutex _mutex;
35
36 private:
37         boost::filesystem::path _file;
38         std::string _digest;
39 };
40
41 #endif