From 9af73fe2b9ea2ef82d641d44a995c110f8e61693 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 6 Dec 2015 23:43:42 +0000 Subject: Basics of send-to-batch-converter; not tested on Windows nor OS X. --- src/lib/cross.cc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/lib/cross.cc') 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 + +} -- cgit v1.2.3