summaryrefslogtreecommitdiff
path: root/src/tools/dcpomatic_batch.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-08-16 23:14:57 +0100
committerCarl Hetherington <cth@carlh.net>2018-08-16 23:14:57 +0100
commitbb990ccc49ee724a8af2ad80bde066374af4b68a (patch)
tree4893842f188db4f268def9a2a518bc7858a099b0 /src/tools/dcpomatic_batch.cc
parent773346b1518c68dc7533b381a90e77ae276ae6bc (diff)
Add pause/resume to the batch converter (#1248).
Add some missing locking to JobManager::decrease_priority.
Diffstat (limited to 'src/tools/dcpomatic_batch.cc')
-rw-r--r--src/tools/dcpomatic_batch.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/tools/dcpomatic_batch.cc b/src/tools/dcpomatic_batch.cc
index 6d4490ad7..ac57baf4b 100644
--- a/src/tools/dcpomatic_batch.cc
+++ b/src/tools/dcpomatic_batch.cc
@@ -30,6 +30,7 @@
#include "lib/util.h"
#include "lib/film.h"
#include "lib/job_manager.h"
+#include "lib/job.h"
#include "lib/dcpomatic_socket.h"
#include <wx/aboutdlg.h>
#include <wx/stdpaths.h>
@@ -121,6 +122,14 @@ public:
wxButton* add = new wxButton (panel, wxID_ANY, _("Add Film..."));
add->Bind (wxEVT_BUTTON, boost::bind (&DOMFrame::add_film, this));
buttons->Add (add, 1, wxALL, 6);
+ _pause = new wxButton (panel, wxID_ANY, _("Pause"));
+ _pause->Bind (wxEVT_BUTTON, boost::bind(&DOMFrame::pause, this));
+ buttons->Add (_pause, 1, wxALL, 6);
+ _resume = new wxButton (panel, wxID_ANY, _("Resume"));
+ _resume->Bind (wxEVT_BUTTON, boost::bind(&DOMFrame::resume, this));
+ buttons->Add (_resume, 1, wxALL, 6);
+
+ setup_sensitivity ();
_sizer->Add (buttons, 0, wxALL, 6);
@@ -130,6 +139,24 @@ public:
Bind (wxEVT_SIZE, boost::bind (&DOMFrame::sized, this, _1));
}
+ void setup_sensitivity ()
+ {
+ _pause->Enable (!JobManager::instance()->paused());
+ _resume->Enable (JobManager::instance()->paused());
+ }
+
+ void pause ()
+ {
+ JobManager::instance()->pause ();
+ setup_sensitivity ();
+ }
+
+ void resume ()
+ {
+ JobManager::instance()->resume ();
+ setup_sensitivity ();
+ }
+
void start_job (boost::filesystem::path path)
{
try {
@@ -274,6 +301,8 @@ private:
wxSizer* _sizer;
wxPreferencesEditor* _config_dialog;
ServersListDialog* _servers_list_dialog;
+ wxButton* _pause;
+ wxButton* _resume;
};
static const wxCmdLineEntryDesc command_line_description[] = {