More noncopyable.
[dcpomatic.git] / src / lib / content.cc
index 395359fa7d498dbb28a4cd56297ac762b14807dc..b49ea431659bc805ecae527cc5369132bf136127 100644 (file)
@@ -1,5 +1,3 @@
-/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */
-
 /*
     Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
 
 #include "util.h"
 
 using std::string;
+using std::set;
 using boost::shared_ptr;
 using boost::lexical_cast;
 
+int const ContentProperty::START = 400;
+int const ContentProperty::LENGTH = 401;
+
 Content::Content (shared_ptr<const Film> f, Time s)
        : _film (f)
        , _start (s)
+       , _change_signals_frequent (false)
 {
 
 }
@@ -40,28 +43,20 @@ Content::Content (shared_ptr<const Film> f, boost::filesystem::path p)
        : _film (f)
        , _file (p)
        , _start (0)
+       , _change_signals_frequent (false)
 {
 
 }
 
 Content::Content (shared_ptr<const Film> f, shared_ptr<const cxml::Node> node)
        : _film (f)
+       , _change_signals_frequent (false)
 {
        _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)
-       , _film (o._film)
-       , _file (o._file)
-       , _digest (o._digest)
-       , _start (o._start)
-{
-
-}
-
 void
 Content::as_xml (xmlpp::Node* node) const
 {
@@ -82,5 +77,16 @@ Content::examine (shared_ptr<Job>)
 void
 Content::signal_changed (int p)
 {
-       Changed (shared_from_this (), p);
+       Changed (shared_from_this (), p, _change_signals_frequent);
+}
+
+void
+Content::set_start (Time s)
+{
+       {
+               boost::mutex::scoped_lock lm (_mutex);
+               _start = s;
+       }
+
+       signal_changed (ContentProperty::START);
 }