X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic_batch.cc;h=1e383b39a5ecdafc516532308c85fc0638f4acf0;hb=5860273b39a34605f2e2ee09810beaa0496d2314;hp=dc092bf8ca1c06976a769cbc128daf22a6e0fcc6;hpb=96f50dd5e600925488fdd9db1580aa01b026269b;p=dcpomatic.git diff --git a/src/tools/dcpomatic_batch.cc b/src/tools/dcpomatic_batch.cc index dc092bf8c..1e383b39a 100644 --- a/src/tools/dcpomatic_batch.cc +++ b/src/tools/dcpomatic_batch.cc @@ -22,6 +22,7 @@ #include "wx/about_dialog.h" #include "wx/dcpomatic_button.h" #include "wx/full_config_dialog.h" +#include "wx/id.h" #include "wx/job_manager_view.h" #include "wx/servers_list_dialog.h" #include "wx/wx_ptr.h" @@ -31,6 +32,9 @@ #include "lib/config.h" #include "lib/dcpomatic_socket.h" #include "lib/film.h" +#ifdef DCPOMATIC_GROK +#include "lib/grok/context.h" +#endif #include "lib/job.h" #include "lib/job_manager.h" #include "lib/make_dcp.h" @@ -71,7 +75,7 @@ static list films_to_load; enum { - ID_file_add_film = 1, + ID_file_add_film = DCPOMATIC_MAIN_MENU, ID_tools_encoding_servers, ID_help_about }; @@ -89,7 +93,7 @@ setup_menu (wxMenuBar* m) #endif #ifdef DCPOMATIC_OSX - file->Append (wxID_PREFERENCES, _("&Preferences...\tCtrl-P")); + file->Append(wxID_PREFERENCES, _("&Preferences...\tCtrl-,")); #else auto edit = new wxMenu; edit->Append (wxID_PREFERENCES, _("&Preferences...\tCtrl-P")); @@ -288,6 +292,7 @@ private: } ev.Skip (); + JobManager::drop (); } void file_add_film () @@ -377,6 +382,12 @@ private: ); } } + +#ifdef DCPOMATIC_GROK + if (what == Config::GROK) { + setup_grok_library_path(); + } +#endif } boost::optional _last_parent; @@ -402,12 +413,14 @@ public: void handle (shared_ptr socket) override { try { - int const length = socket->read_uint32 (); - scoped_array buffer(new char[length]); - socket->read (reinterpret_cast(buffer.get()), length); - string s (buffer.get()); - emit(boost::bind(boost::ref(StartJob), s)); - socket->write (reinterpret_cast("OK"), 3); + auto const length = socket->read_uint32(); + if (length < 65536) { + scoped_array buffer(new char[length]); + socket->read(reinterpret_cast(buffer.get()), length); + string s(buffer.get()); + emit(boost::bind(boost::ref(StartJob), s)); + socket->write (reinterpret_cast("OK"), 3); + } } catch (...) { } @@ -495,6 +508,11 @@ class App : public wxApp } } +#ifdef DCPOMATIC_GROK + grk_plugin::setMessengerLogger(new grk_plugin::GrokLogger("[GROK] ")); + setup_grok_library_path(); +#endif + return true; }