X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fjob.h;h=9b8b14a93a2efc434b70297b9a2dbd51773e895a;hb=290daefb79ec399cf7ba54968fc7e92e375e98d6;hp=37fa56d2082e83e4b6ea49c484152d8b75142e11;hpb=db0ad7242d39f0fbae04bb6983021c60d57fdcf5;p=dcpomatic.git diff --git a/src/lib/job.h b/src/lib/job.h index 37fa56d20..9b8b14a93 100644 --- a/src/lib/job.h +++ b/src/lib/job.h @@ -21,8 +21,8 @@ * @brief A parent class to represent long-running tasks which are run in their own thread. */ -#ifndef DVDOMATIC_JOB_H -#define DVDOMATIC_JOB_H +#ifndef DCPOMATIC_JOB_H +#define DCPOMATIC_JOB_H #include #include @@ -35,10 +35,10 @@ class Film; /** @class Job * @brief A parent class to represent long-running tasks which are run in their own thread. */ -class Job : public boost::enable_shared_from_this +class Job : public boost::enable_shared_from_this, public boost::noncopyable { public: - Job (boost::shared_ptr s); + Job (boost::shared_ptr); virtual ~Job() {} /** @return user-readable name of this job */ @@ -70,8 +70,12 @@ public: void ascend (); void descend (float); float overall_progress () const; + bool progress_unknown () const { + return _progress_unknown; + } - /** Emitted by the JobManagerView from the UI thread */ + boost::signals2::signal Progress; + /** Emitted from the UI thread when the job is finished */ boost::signals2::signal Finished; protected: @@ -80,10 +84,10 @@ protected: /** Description of a job's state */ enum State { - NEW, ///< the job hasn't been started yet - RUNNING, ///< the job is running - PAUSED, ///< the job has been paused - FINISHED_OK, ///< the job has finished successfully + NEW, ///< the job hasn't been started yet + RUNNING, ///< the job is running + PAUSED, ///< the job has been paused + FINISHED_OK, ///< the job has finished successfully FINISHED_ERROR, ///< the job has finished in error FINISHED_CANCELLED ///< the job was cancelled }; @@ -91,8 +95,7 @@ protected: void set_state (State); void set_error (std::string s, std::string d); - /** Film for this job */ - boost::shared_ptr _film; + boost::shared_ptr _film; private: @@ -126,6 +129,8 @@ private: /** true if this job's progress will always be unknown */ bool _progress_unknown; + float _last_set; + int _ran_for; };