Remove tick/no_tick icons which I believe are no longer used.
[dcpomatic.git] / src / tools / dcpomatic_batch.cc
index b73d0a4184cefd39ad2ecaed34ea50178115df85..3114768aca497c5f03bd8ebc4845b239ffb6b2b9 100644 (file)
@@ -37,6 +37,7 @@
 #include "lib/transcode_job.h"
 #include "lib/util.h"
 #include "lib/version.h"
+#include <dcp/filesystem.h>
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <wx/aboutdlg.h>
@@ -129,7 +130,7 @@ public:
                        if (filenames.GetCount() == 1) {
                                /* Try to load a directory */
                                auto path = boost::filesystem::path(wx_to_std(filenames[0]));
-                               if (boost::filesystem::is_directory(path)) {
+                               if (dcp::filesystem::is_directory(path)) {
                                        _frame->start_job(wx_to_std(filenames[0]));
                                        return true;
                                }
@@ -391,30 +392,30 @@ static const wxCmdLineEntryDesc command_line_description[] = {
 };
 
 
-class JobServer : public Server
+class JobServer : public Server, public Signaller
 {
 public:
-       explicit JobServer (DOMFrame* frame)
+       JobServer()
                : Server (BATCH_JOB_PORT)
-               , _frame (frame)
        {}
 
        void handle (shared_ptr<Socket> socket) override
        {
                try {
-                       int const length = socket->read_uint32 ();
-                       scoped_array<char> buffer(new char[length]);
-                       socket->read (reinterpret_cast<uint8_t*>(buffer.get()), length);
-                       string s (buffer.get());
-                       _frame->start_job (s);
-                       socket->write (reinterpret_cast<uint8_t const *>("OK"), 3);
+                       auto const length = socket->read_uint32();
+                       if (length < 65536) {
+                               scoped_array<char> buffer(new char[length]);
+                               socket->read(reinterpret_cast<uint8_t*>(buffer.get()), length);
+                               string s(buffer.get());
+                               emit(boost::bind(boost::ref(StartJob), s));
+                               socket->write (reinterpret_cast<uint8_t const *>("OK"), 3);
+                       }
                } catch (...) {
 
                }
        }
 
-private:
-       DOMFrame* _frame;
+       boost::signals2::signal<void(std::string)> StartJob;
 };
 
 
@@ -469,7 +470,8 @@ class App : public wxApp
                _frame->Show ();
 
                try {
-                       auto server = new JobServer (_frame);
+                       auto server = new JobServer();
+                       server->StartJob.connect(bind(&DOMFrame::start_job, _frame, _1));
                        new thread (boost::bind (&JobServer::run, server));
                } catch (boost::system::system_error& e) {
                        error_dialog(_frame, _("Could not listen for new batch jobs.  Perhaps another instance of the DCP-o-matic Batch Converter is running."));
@@ -480,7 +482,7 @@ class App : public wxApp
 
                shared_ptr<Film> film;
                for (auto i: films_to_load) {
-                       if (boost::filesystem::is_directory(i)) {
+                       if (dcp::filesystem::is_directory(i)) {
                                try {
                                        film = make_shared<Film>(i);
                                        film->read_metadata ();