#include <libdcp/exceptions.h>
#include "job.h"
#include "util.h"
+#include "cross.h"
#include "i18n.h"
set_state (FINISHED_ERROR);
set_error (
e.what (),
- _("It is not known what caused this error. The best idea is to report the problem to the DVD-o-matic mailing list (dvdomatic@carlh.net)")
+ _("It is not known what caused this error. The best idea is to report the problem to the DCP-o-matic mailing list (dcpomatic@carlh.net)")
);
} catch (...) {
set_state (FINISHED_ERROR);
set_error (
_("Unknown error"),
- _("It is not known what caused this error. The best idea is to report the problem to the DVD-o-matic mailing list (dvdomatic@carlh.net)")
+ _("It is not known what caused this error. The best idea is to report the problem to the DCP-o-matic mailing list (dcpomatic@carlh.net)")
);
}
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 ()) {
+ dcpomatic_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);
+ }
+}