update to support juce 6.1. added mute audio while processing capture option. added a mac specific priority fix. use async popup menus and browsers where needed.

This commit is contained in:
essej
2022-04-02 12:45:02 -04:00
parent 86f1a8c594
commit 8c4a20ecd6
10 changed files with 188 additions and 81 deletions

View File

@ -0,0 +1,46 @@
// SPDX-License-Identifier: GPLv3-or-later WITH Appstore-exception
// Copyright (C) 2020 Jesse Chappell
#include "CrossPlatformUtils.h"
//#include "../JuceLibraryCode/JuceHeader.h"
#define JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED 1
#include <juce_core/system/juce_TargetPlatform.h>
#if JUCE_MAC
//#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
void getSafeAreaInsets(void * component, float & top, float & bottom, float & left, float & right)
{
top = bottom = left = right = 0;
}
void disableAppNap() {
// Does the App Nap API even exist on this Mac?
if ([[NSProcessInfo processInfo] respondsToSelector:@selector(beginActivityWithOptions:reason:)]) {
// If the API exists, then disable App Nap...
// From NSProcessInfo.h:
// NSActivityIdleSystemSleepDisabled = (1ULL << 20),
// NSActivityUserInitiated = (0x00FFFFFFULL | NSActivityIdleSystemSleepDisabled),
// NSActivityLatencyCritical = 0xFF00000000ULL
uint64_t options = (0x00FFFFFFULL | (1ULL << 20)) | 0xFF00000000ULL;
// NSActivityLatencyCritical | NSActivityUserInitiated
[[NSProcessInfo processInfo] beginActivityWithOptions:options
reason:@"avoiding audio hiccups and reducing latency"];
}
}
#endif