#include <libdcp/exceptions.h>
#include "job.h"
#include "util.h"
+#include "cross.h"
#include "i18n.h"
return _state == FINISHED_CANCELLED;
}
+bool
+Job::paused () const
+{
+ boost::mutex::scoped_lock lm (_state_mutex);
+ return _state == PAUSED;
+}
+
/** Set the state of this job.
* @param s New state.
*/
_progress_unknown = false;
_stack.back().normalised = p;
boost::this_thread::interruption_point ();
+
+ if (paused ()) {
+ dvdomatic_sleep (1);
+ }
}
/** @return fractional overall progress, or -1 if not known */
_thread->interrupt ();
_thread->join ();
}
+
+void
+Job::pause ()
+{
+ if (running ()) {
+ set_state (PAUSED);
+ }
+}
+
+void
+Job::resume ()
+{
+ if (paused ()) {
+ set_state (RUNNING);
+ }
+}