X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fcocoacarbon.mm;h=f73488ea52e9fc9072aa9be515c341099e4c036f;hb=6b1b72a247bf04c81292fc41af4f69c9b7f90379;hp=76b92cb91fa9b8a89366511de173e96d13fadb2c;hpb=650964f3203319b013c49a286b5fc5fc203f3bbb;p=ardour.git diff --git a/gtk2_ardour/cocoacarbon.mm b/gtk2_ardour/cocoacarbon.mm index 76b92cb91f..f73488ea52 100644 --- a/gtk2_ardour/cocoacarbon.mm +++ b/gtk2_ardour/cocoacarbon.mm @@ -25,6 +25,9 @@ #undef check #undef YES #undef NO +#ifdef verify +#undef verify +#endif #include "ardour_ui.h" #include "actions.h" @@ -38,24 +41,6 @@ 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) { @@ -75,14 +60,6 @@ set_language_preference () { gtk_disable_setlocale (); - if (g_getenv ("LANGUAGE") || g_getenv ("LC_ALL") || g_getenv ("LANG")) { - return; - } - - if (g_getenv ("ARDOUR_EN")) { - return; - } - /* the gettext manual is potentially misleading about the utility of LANGUAGE. It notes that if LANGUAGE is set to include a dialect/region-free language code, like "it", it will assume that you mean the main @@ -126,6 +103,22 @@ set_language_preference () */ cout << "LANG set to " << [nslocale UTF8String] << endl; - setenv ("LANG", [nslocale UTF8String], 0); + 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" ]; + } +}