Various hacks.
[dcpomatic.git] / src / lib / content.cc
index 9c3bcd39dcf6cd5585c20d7e9d70a4d8f52cb9c9..43d0ef958c08bd7ca93ff772133242de018240da 100644 (file)
@@ -1,3 +1,5 @@
+/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */
+
 /*
     Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
 
 
 using std::string;
 using boost::shared_ptr;
+using boost::lexical_cast;
+
+Content::Content (Time s)
+       : _start (s)
+{
+
+}
 
 Content::Content (boost::filesystem::path f)
        : _file (f)
+       , _start (0)
 {
 
 }
@@ -36,12 +46,14 @@ Content::Content (shared_ptr<const cxml::Node> node)
 {
        _file = node->string_child ("File");
        _digest = node->string_child ("Digest");
+       _start = node->number_child<Time> ("Start");
 }
 
 Content::Content (Content const & o)
        : boost::enable_shared_from_this<Content> (o)
        , _file (o._file)
        , _digest (o._digest)
+       , _start (o._start)
 {
 
 }
@@ -52,10 +64,11 @@ Content::as_xml (xmlpp::Node* node) const
        boost::mutex::scoped_lock lm (_mutex);
        node->add_child("File")->add_child_text (_file.string());
        node->add_child("Digest")->add_child_text (_digest);
+       node->add_child("Start")->add_child_text (lexical_cast<string> (_start));
 }
 
 void
-Content::examine (shared_ptr<Film>, shared_ptr<Job>, bool)
+Content::examine (shared_ptr<Film>, shared_ptr<Job>)
 {
        string const d = md5_digest (_file);
        boost::mutex::scoped_lock lm (_mutex);