using std::cout;
using boost::shared_ptr;
+#define LOG_ERROR_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_ERROR);
+
Job::Job (shared_ptr<const Film> f)
: _film (f)
, _thread (0)
set_error (
e.what (),
- _("It is not known what caused this error. Please report the problem to the DCP-o-matic author (carl@dcpomatic.com).")
+ string (_("It is not known what caused this error.")) + " " + REPORT_PROBLEM
);
set_progress (1);
set_error (
_("Unknown error"),
- _("It is not known what caused this error. Please report the problem to the DCP-o-matic author (carl@dcpomatic.com).")
+ string (_("It is not known what caused this error.")) + " " + REPORT_PROBLEM
);
set_progress (1);
_progress = p;
boost::this_thread::interruption_point ();
- if (paused ()) {
- dcpomatic_sleep (1);
+ boost::mutex::scoped_lock lm2 (_state_mutex);
+ while (_state == PAUSED) {
+ _pause_changed.wait (lm2);
}
if (ui_signaller) {
void
Job::set_error (string s, string d)
{
+ LOG_ERROR_NC (s);
+ LOG_ERROR_NC (d);
+
_film->log()->log (String::compose ("Error in job: %1 (%2)", s, d), Log::TYPE_ERROR);
boost::mutex::scoped_lock lm (_state_mutex);
_error_summary = s;
{
if (running ()) {
set_state (PAUSED);
+ _pause_changed.notify_all ();
}
}
{
if (paused ()) {
set_state (RUNNING);
+ _pause_changed.notify_all ();
}
}