class Log;
struct AVIOContext;
-void dcpomatic_sleep_seconds (int);
-void dcpomatic_sleep_milliseconds (int);
+extern void dcpomatic_sleep_seconds (int);
+extern void dcpomatic_sleep_milliseconds (int);
extern std::string cpu_info ();
extern void run_ffprobe (boost::filesystem::path, boost::filesystem::path);
extern std::list<std::pair<std::string, std::string> > mount_info ();
extern boost::filesystem::path openssl_path ();
+extern void make_foreground_application ();
#ifdef DCPOMATIC_DISK
extern boost::filesystem::path disk_writer_path ();
#endif
#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);
+}
+
}
for (int i = 0; i < _num_threads; ++i) {
- boost::thread* t = _worker_threads.create_thread (bind(&EncodeServer::worker_thread, this));
#ifdef DCPOMATIC_LINUX
+ boost::thread* t = _worker_threads.create_thread (bind(&EncodeServer::worker_thread, this));
pthread_setname_np (t->native_handle(), "encode-server-worker");
+#else
+ _worker_threads.create_thread (bind(&EncodeServer::worker_thread, this));
#endif
}
if (!Config::instance()->only_servers_encode ()) {
for (int i = 0; i < Config::instance()->master_encoding_threads (); ++i) {
- boost::thread* t = _threads->create_thread(boost::bind(&J2KEncoder::encoder_thread, this, optional<EncodeServerDescription>()));
#ifdef DCPOMATIC_LINUX
+ boost::thread* t = _threads->create_thread(boost::bind(&J2KEncoder::encoder_thread, this, optional<EncodeServerDescription>()));
pthread_setname_np (t->native_handle(), "encode-worker");
#endif
+#ifdef DCPOMATIC_OSX
+ _threads->create_thread(boost::bind(&J2KEncoder::encoder_thread, this, optional<EncodeServerDescription>()));
+#endif
#ifdef DCPOMATIC_WINDOWS
+ boost::thread* t = _threads->create_thread(boost::bind(&J2KEncoder::encoder_thread, this, optional<EncodeServerDescription>()));
if (windows_xp) {
SetThreadAffinityMask (t->native_handle(), 1 << i);
}
JSONServer::JSONServer (int port)
{
- thread* t = new thread (boost::bind (&JSONServer::run, this, port));
#ifdef DCPOMATIC_LINUX
+ thread* t = new thread (boost::bind (&JSONServer::run, this, port));
pthread_setname_np (t->native_handle(), "json-server");
+#else
+ new thread (boost::bind (&JSONServer::run, this, port));
#endif
}
#include "cross.h"
#include "font.h"
#include "dcpomatic_assert.h"
+#include "warnings.h"
#include <dcp/raw_convert.h>
#include <fontconfig/fontconfig.h>
#include <cairomm/cairomm.h>
+DCPOMATIC_DISABLE_WARNINGS
#include <pangomm.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <pango/pangocairo.h>
#ifndef DCPOMATIC_HAVE_SHOW_IN_CAIRO_CONTEXT
#include <pango/pangocairo.h>
#include <boost/range/algorithm/replace_if.hpp>
#include <boost/thread.hpp>
#include <boost/filesystem.hpp>
+DCPOMATIC_DISABLE_WARNINGS
#include <boost/locale.hpp>
+DCPOMATIC_ENABLE_WARNINGS
#ifdef DCPOMATIC_WINDOWS
#include <boost/locale.hpp>
#include <dbghelp.h>
"""
if bld.env.TARGET_OSX:
- obj.framework = ['IOKit', 'Foundation', 'DiskArbitration']
+ obj.framework = ['IOKit', 'Foundation', 'DiskArbitration', 'ApplicationServices']
obj.source = sources + ' version.cc'
#ifdef __WXMSW__
#include <shellapi.h>
#endif
-#ifdef __WXOSX__
-#include <ApplicationServices/ApplicationServices.h>
-#endif
#include <boost/filesystem.hpp>
#include <boost/noncopyable.hpp>
#include <boost/foreach.hpp>
unsetenv ("UBUNTU_MENUPROXY");
#endif
-#ifdef __WXOSX__
- ProcessSerialNumber serial;
- GetCurrentProcess (&serial);
- TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+#ifdef DCPOMATIC_OSX
+ dcpomatic_sleep_seconds (1);
+ make_foreground_application ();
#endif
dcpomatic_setup_path_encoding ();
#include <boost/process/windows.hpp>
#endif
#ifdef DCPOMATIC_OSX
-#include <ApplicationServices/ApplicationServices.h>
#include <notify.h>
#endif
unsetenv ("UBUNTU_MENUPROXY");
#endif
-#ifdef __WXOSX__
- ProcessSerialNumber serial;
- GetCurrentProcess (&serial);
- TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+#ifdef DCPOMATIC_OSX
+ make_foreground_application ();
#endif
dcpomatic_setup_path_encoding ();
#include "lib/file_log.h"
#include "lib/dcpomatic_log.h"
#include "lib/nanomsg.h"
+#include "lib/warnings.h"
extern "C" {
#include <lwext4/ext4_mbr.h>
#include <lwext4/ext4_fs.h>
}
#endif
+DCPOMATIC_DISABLE_WARNINGS
#include <glibmm.h>
+DCPOMATIC_ENABLE_WARNINGS
+
#include <unistd.h>
#include <sys/types.h>
#include <boost/filesystem.hpp>
unsetenv ("UBUNTU_MENUPROXY");
#endif
-#ifdef __WXOSX__
- ProcessSerialNumber serial;
- GetCurrentProcess (&serial);
- TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+#ifdef DCPOMATIC_OSX
+ make_foreground_application ();
#endif
dcpomatic_setup_path_encoding ();
#ifdef __WXGTK__
#include <X11/Xlib.h>
#endif
-#ifdef __WXOSX__
-#include <ApplicationServices/ApplicationServices.h>
-#endif
#include <boost/bind.hpp>
#include <boost/algorithm/string.hpp>
#include <iostream>
unsetenv ("UBUNTU_MENUPROXY");
#endif
-#ifdef __WXOSX__
- ProcessSerialNumber serial;
- GetCurrentProcess (&serial);
- TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+#ifdef DCPOMATIC_OSX
+ make_foreground_application ();
#endif
dcpomatic_setup_path_encoding ();
#include <wx/imaglist.h>
#include <wx/spinctrl.h>
#include <wx/preferences.h>
-#ifdef __WXOSX__
-#include <ApplicationServices/ApplicationServices.h>
-#endif
#include <boost/foreach.hpp>
using std::exception;
unsetenv ("UBUNTU_MENUPROXY");
#endif
-#ifdef __WXOSX__
- ProcessSerialNumber serial;
- GetCurrentProcess (&serial);
- TransformProcessType (&serial, kProcessTransformToForegroundApplication);
+#ifdef DCPOMATIC_OSX
+ make_foreground_application ();
#endif
dcpomatic_setup_path_encoding ();
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
+DCPOMATIC_DISABLE_WARNINGS
gluOrtho2D (0, canvas_size.GetWidth(), canvas_size.GetHeight(), 0);
+DCPOMATIC_ENABLE_WARNINGS
check_gl_error ("gluOrtho2d");
glMatrixMode (GL_MODELVIEW);
glLoadIdentity ();
if conf.options.workaround_gssapi:
conf.env.LIB_SSH = ['gssapi_krb5']
else:
- conf.check_cc(fragment="""
+ conf.check_cxx(fragment="""
#include <libssh/libssh.h>\n
int main () {\n
ssh_new ();\n
conf.check_cxx(fragment="""
#include <boost/thread.hpp>\n
- int main() { boost::thread t (); }\n
+ int main() { boost::thread t; }\n
""",
msg='Checking for boost threading library',
libpath='/usr/local/lib',