Optimize automation-event process splitting
[ardour.git] / gtk2_ardour / cocoacarbon.mm
index 65648439726ddc3f870b1d5493f3240d5e7f2583..f73488ea52e9fc9072aa9be515c341099e4c036f 100644 (file)
 using namespace std;
 using namespace PBD;
 
-void
-ARDOUR_UI::platform_specific ()
-{
-       gtk_application_ready ();
-
-       if (!ARDOUR_COMMAND_LINE::finder_invoked_ardour) {
-               
-               /* if invoked from the command line, make sure we're visible */
-               
-               [NSApp activateIgnoringOtherApps:1];
-       } 
-}
-
-void
-ARDOUR_UI::platform_setup ()
-{
-}
-
 bool
 cocoa_open_url (const char* uri)
 {
@@ -124,3 +106,19 @@ set_language_preference ()
         setenv ("LANG", [nslocale UTF8String], 0);
        CFRelease (cflocale);
 }
+
+       /* Prevent "App Nap" */
+
+void
+no_app_nap ()
+{
+
+#ifndef NSActivityLatencyCritical
+#define NSActivityLatencyCritical 0xFF00000000ULL
+#endif
+
+       if ( [ [ NSProcessInfo processInfo ] respondsToSelector:@selector(beginActivityWithOptions:reason:) ] ) {
+               cout << "Disabling MacOS AppNap\n";
+               [ [ NSProcessInfo processInfo] beginActivityWithOptions:NSActivityLatencyCritical reason:@"realtime audio" ];
+       }
+}