diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-12-06 23:43:42 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-12-11 11:56:50 +0000 |
| commit | 9af73fe2b9ea2ef82d641d44a995c110f8e61693 (patch) | |
| tree | b688c996abce413184469d75d9e072e3b9bbaff3 /src/lib | |
| parent | 18f65c026edc1ad49cf433f8b07db3a7c9838e9f (diff) | |
Basics of send-to-batch-converter; not tested on Windows nor OS X.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/config.h | 2 | ||||
| -rw-r--r-- | src/lib/cross.cc | 26 | ||||
| -rw-r--r-- | src/lib/cross.h | 1 |
3 files changed, 28 insertions, 1 deletions
diff --git a/src/lib/config.h b/src/lib/config.h index 7cc3cf7e4..664020a2a 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -471,7 +471,7 @@ private: /** default directory to put new films in */ boost::filesystem::path _default_directory; /** base port number to use for J2K encoding servers; - * this port and the one above it will be used. + * this port and the two above it will be used. */ int _server_port_base; /** true to broadcast on the `any' address to look for servers */ diff --git a/src/lib/cross.cc b/src/lib/cross.cc index 24abf2c0a..6398e3676 100644 --- a/src/lib/cross.cc +++ b/src/lib/cross.cc @@ -353,3 +353,29 @@ Waker::~Waker () IOPMAssertionRelease (_assertion_id); #endif } + +void +start_batch_converter (boost::filesystem::path dcpomatic) +{ +#if defined(DCPOMATIC_LINUX) || defined(DCPOMATIC_WINDOWS) + boost::filesystem::path batch = dcpomatic.parent_path() / "dcpomatic2_batch"; +#endif + +#ifdef DCPOMATIC_OSX + boost::filesystem::patch batch = dcpomatic.parent_path (); + batch = batch.parent_path (); // MacOS + batch = batch.parent_path (); // Contents + batch = batch.parent_path (); // DCP-o-matic.app + batch = batch.parent_path (); // Applications + batch /= "DCP-o-matic 2 Batch Converter.app" / "Contents" / "MacOS" / "dcpomatic2_batch"; +#endif + +#ifdef DCPOMATIC_LINUX + pid_t pid = fork (); + if (pid == 0) { + int const r = system (batch.string().c_str ()); + exit (WEXITSTATUS (r)); + } +#endif + +} diff --git a/src/lib/cross.h b/src/lib/cross.h index fee68cedc..4c9b93fde 100644 --- a/src/lib/cross.h +++ b/src/lib/cross.h @@ -46,6 +46,7 @@ extern boost::filesystem::path app_contents (); extern boost::filesystem::path shared_path (); extern FILE * fopen_boost (boost::filesystem::path, std::string); extern int dcpomatic_fseek (FILE *, int64_t, int); +extern void start_batch_converter (boost::filesystem::path dcpomatic); /** @class Waker * @brief A class which tries to keep the computer awake on various operating systems. |
