Merge branch 'master' into speed-up
[dcpomatic.git] / src / lib / job.h
index 802bf468da24d71a723fc31929d1fcdd0810cca0..41cefb9bee113a2ba322f06845fb4e02cf3daca0 100644 (file)
 #include <string>
 #include <boost/thread/mutex.hpp>
 #include <boost/enable_shared_from_this.hpp>
-#include <sigc++/sigc++.h>
+#include <boost/signals2.hpp>
 
-class Log;
-class FilmState;
+class Film;
 class Options;
 
 /** @class Job
@@ -39,7 +38,8 @@ class Options;
 class Job : public boost::enable_shared_from_this<Job>
 {
 public:
-       Job (boost::shared_ptr<const FilmState> s, boost::shared_ptr<const Options> o, Log* l);
+       Job (boost::shared_ptr<Film> s, boost::shared_ptr<Job> req);
+       virtual ~Job() {}
 
        /** @return user-readable name of this job */
        virtual std::string name () const = 0;
@@ -48,6 +48,7 @@ public:
        
        void start ();
 
+       bool is_new () const;
        bool running () const;
        bool finished () const;
        bool finished_ok () const;
@@ -64,10 +65,11 @@ public:
        void descend (float);
        float overall_progress () const;
 
-       void emit_finished ();
+       boost::shared_ptr<Job> required () const {
+               return _required;
+       }
 
-       /** Emitted from the GUI thread */
-       sigc::signal0<void> Finished;
+       boost::signals2::signal<void()> Finished;
 
 protected:
 
@@ -84,17 +86,15 @@ protected:
        void set_state (State);
        void set_error (std::string e);
 
-       /** FilmState for this job */
-       boost::shared_ptr<const FilmState> _fs;
-       /** options in use for this job */
-       boost::shared_ptr<const Options> _opt;
-       /** a log that this job can write to */
-       Log* _log;
+       /** Film for this job */
+       boost::shared_ptr<Film> _film;
 
 private:
 
        void run_wrapper ();
 
+       boost::shared_ptr<Job> _required;
+
        /** mutex for _state and _error */
        mutable boost::mutex _state_mutex;
        /** current state of the job */