Be more careful about allowing possibly-trouble-causing characters in DCP filenames.
[dcpomatic.git] / src / lib / job_manager.h
index 70ac00b37bc4b86747639548601384a31059a0ec..c623b6ef98d7f7fd5831b9644281a10946b58084 100644 (file)
@@ -32,7 +32,7 @@ class Job;
 class Film;
 class Playlist;
 
-extern void wait_for_jobs ();
+extern bool wait_for_jobs ();
 
 /** @class JobManager
  *  @brief A simple scheduler for jobs.
@@ -40,11 +40,12 @@ extern void wait_for_jobs ();
 class JobManager : public Signaller, public boost::noncopyable
 {
 public:
-
        boost::shared_ptr<Job> add (boost::shared_ptr<Job>);
        std::list<boost::shared_ptr<Job> > get () const;
        bool work_to_do () const;
        bool errors () const;
+       void increase_priority (boost::shared_ptr<Job>);
+       void decrease_priority (boost::shared_ptr<Job>);
 
        void analyse_audio (
                boost::shared_ptr<const Film> film,
@@ -54,6 +55,7 @@ public:
                );
 
        boost::signals2::signal<void (boost::weak_ptr<Job>)> JobAdded;
+       boost::signals2::signal<void ()> JobsReordered;
        boost::signals2::signal<void (boost::optional<std::string>, boost::optional<std::string>)> ActiveJobsChanged;
 
        static JobManager* instance ();
@@ -61,14 +63,16 @@ public:
 
 private:
        /* This function is part of the test suite */
-       friend void ::wait_for_jobs ();
+       friend bool ::wait_for_jobs ();
 
        JobManager ();
        ~JobManager ();
        void scheduler ();
        void start ();
+       void priority_changed ();
 
        mutable boost::mutex _mutex;
+       /** List of jobs in the order that they will be executed */
        std::list<boost::shared_ptr<Job> > _jobs;
        bool _terminate;