#include "dcpomatic_log.h"
#include "config.h"
#include "exceptions.h"
+#include "warnings.h"
#include <dcp/raw_convert.h>
#include <glib.h>
extern "C" {
#if BOOST_VERSION >= 106100
#include <boost/dll/runtime_symbol_info.hpp>
#endif
+#include <ApplicationServices/ApplicationServices.h>
#include <sys/sysctl.h>
#include <mach-o/dyld.h>
#include <IOKit/pwr_mgt/IOPMLib.h>
Waker::Waker ()
{
boost::mutex::scoped_lock lm (_mutex);
- /* We should use this */
- // IOPMAssertionCreateWithName (kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, CFSTR ("Encoding DCP"), &_assertion_id);
- /* but it's not available on 10.5, so we use this */
- IOPMAssertionCreate (kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, &_assertion_id);
+ IOPMAssertionCreateWithName (kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, CFSTR ("Encoding DCP"), &_assertion_id);
}
Waker::~Waker ()
}
+
+void
+make_foreground_application ()
+{
+ ProcessSerialNumber serial;
+DCPOMATIC_DISABLE_WARNINGS
+ GetCurrentProcess (&serial);
+DCPOMATIC_ENABLE_WARNINGS
+ TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+}
+