Cleanup: handle Filter objects by value rather than by reference.
[dcpomatic.git] / src / lib / job.h
index dc5f7bc34074041b85536978aa8554dc336a9db4..7814e0c2d75452f84912854df972a29162a9e548 100644 (file)
@@ -99,6 +99,8 @@ public:
 
        void when_finished(boost::signals2::connection& connection, std::function<void(Result)> finished);
 
+       void set_rate_limit_progress(bool rate_limit);
+
        boost::signals2::signal<void()> Progress;
        /** Emitted from the UI thread when the job is finished */
        boost::signals2::signal<void (Result)> Finished;
@@ -159,6 +161,11 @@ private:
        boost::optional<float> _progress;
        boost::optional<struct timeval> _last_progress_update;
 
+       /** true to limit emissions of the progress signal so that they don't
+        *  come too often.
+        */
+       boost::atomic<bool> _rate_limit_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.
        */