Changes to libdcp API.
[dcpomatic.git] / src / lib / job.h
index 489464558764bc348d85f741f0ddd634ddbdb9b0..f6120f1289458814d3569970a177ab5257a884b6 100644 (file)
 #ifndef DCPOMATIC_JOB_H
 #define DCPOMATIC_JOB_H
 
-#include <string>
 #include <boost/thread/mutex.hpp>
 #include <boost/enable_shared_from_this.hpp>
 #include <boost/signals2.hpp>
 #include <boost/thread.hpp>
+#include <string>
 
 class Film;
 
@@ -43,7 +43,6 @@ public:
 
        /** @return user-readable name of this job */
        virtual std::string name () const = 0;
-       virtual std::string json_name () const = 0;
        /** Run this job in the current thread. */
        virtual void run () = 0;
        
@@ -65,7 +64,6 @@ public:
 
        int elapsed_time () const;
        virtual std::string status () const;
-       std::string json_status () const;
        std::string sub_name () const {
                return _sub_name;
        }
@@ -73,9 +71,10 @@ public:
        void set_progress_unknown ();
        void set_progress (float, bool force = false);
        void sub (std::string);
-       float progress () const;
-       bool progress_unknown () const {
-               return !_progress;
+       boost::optional<float> progress () const;
+
+       boost::shared_ptr<const Film> film () const {
+               return _film;
        }
 
        boost::signals2::signal<void()> Progress;
@@ -123,6 +122,11 @@ private:
        mutable boost::mutex _progress_mutex;
        boost::optional<float> _progress;
 
+       /** condition to signal changes to pause/resume so that we know when to wake;
+           this could be a general _state_change if it made more sense.
+       */
+       boost::condition_variable _pause_changed;
+
        int _ran_for;
 };