diff --git a/TAAESample.xcodeproj/project.pbxproj b/TAAESample.xcodeproj/project.pbxproj index 17698dd..7b09f24 100644 --- a/TAAESample.xcodeproj/project.pbxproj +++ b/TAAESample.xcodeproj/project.pbxproj @@ -188,6 +188,7 @@ 4CDCACBD1CA25AA8008AAEF1 /* Products */, ); sourceTree = ""; + usesTabs = 0; }; 4CDCACBD1CA25AA8008AAEF1 /* Products */ = { isa = PBXGroup; diff --git a/TAAESample/Platform/macOS/Classes/AppDelegate.swift b/TAAESample/Platform/macOS/Classes/AppDelegate.swift index 3ef5bc2..8f384b5 100644 --- a/TAAESample/Platform/macOS/Classes/AppDelegate.swift +++ b/TAAESample/Platform/macOS/Classes/AppDelegate.swift @@ -17,7 +17,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { self.audio = AEAudioController(); do { try self.audio!.start(); - if let viewController = NSApplication.sharedApplication().mainWindow?.contentViewController as? ViewController { + if let viewController = NSApplication.shared.mainWindow?.contentViewController as? ViewController { viewController.audio = self.audio } } catch { diff --git a/TAAESample/Platform/macOS/Classes/ViewController.swift b/TAAESample/Platform/macOS/Classes/ViewController.swift index 87c49d2..64a40d1 100644 --- a/TAAESample/Platform/macOS/Classes/ViewController.swift +++ b/TAAESample/Platform/macOS/Classes/ViewController.swift @@ -18,7 +18,7 @@ class ViewController: NSViewController { // Do any additional setup after loading the view. } - override var representedObject: AnyObject? { + override var representedObject: Any? { didSet { // Update the view, if already loaded. } diff --git a/TheAmazingAudioEngine.xcodeproj/project.pbxproj b/TheAmazingAudioEngine.xcodeproj/project.pbxproj index 29d1cba..7479696 100644 --- a/TheAmazingAudioEngine.xcodeproj/project.pbxproj +++ b/TheAmazingAudioEngine.xcodeproj/project.pbxproj @@ -529,6 +529,7 @@ 4CDCAC991CA25A29008AAEF1 /* Products */, ); sourceTree = ""; + usesTabs = 0; }; 4CDCAC991CA25A29008AAEF1 /* Products */ = { isa = PBXGroup; @@ -1188,6 +1189,7 @@ isa = XCBuildConfiguration; buildSettings = { COMBINE_HIDPI_IMAGES = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -1198,6 +1200,7 @@ isa = XCBuildConfiguration; buildSettings = { COMBINE_HIDPI_IMAGES = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; diff --git a/TheAmazingAudioEngine/Modules/Processing/AEDynamicsProcessorModule.m b/TheAmazingAudioEngine/Modules/Processing/AEDynamicsProcessorModule.m index 01e53ba..5f2bafd 100644 --- a/TheAmazingAudioEngine/Modules/Processing/AEDynamicsProcessorModule.m +++ b/TheAmazingAudioEngine/Modules/Processing/AEDynamicsProcessorModule.m @@ -61,7 +61,12 @@ - (double)releaseTime { } - (double)masterGain { - return [self getParameterValueForId:kDynamicsProcessorParam_OverallGain]; + if ( @available(iOS 15.0, macOS 12.0, *) ) { + return [self getParameterValueForId:6]; + } + else { + return [self getParameterValueForId:kDynamicsProcessorParam_MasterGain]; + } } - (double)compressionAmount { @@ -110,8 +115,14 @@ - (void)setReleaseTime:(double)releaseTime { } - (void)setMasterGain:(double)masterGain { - [self setParameterValue: masterGain - forId: kDynamicsProcessorParam_OverallGain]; + if ( @available(iOS 15.0, macOS 12.0, *) ) { + [self setParameterValue: masterGain + forId: 6]; + } + else { + [self setParameterValue: masterGain + forId: kDynamicsProcessorParam_MasterGain]; + } } @end diff --git a/TheAmazingAudioEngine/Outputs/AEAudioUnitOutput.m b/TheAmazingAudioEngine/Outputs/AEAudioUnitOutput.m index e27cc74..9a35cc8 100644 --- a/TheAmazingAudioEngine/Outputs/AEAudioUnitOutput.m +++ b/TheAmazingAudioEngine/Outputs/AEAudioUnitOutput.m @@ -259,7 +259,7 @@ static void AEAudioUnitOutputReportRenderTime(__unsafe_unretained AEAudioUnitOut if ( now - THIS->_firstReportTime > kRenderBudgetWarningInitialDelay && renderTime > bufferDuration * kRenderBudgetWarningThreshold ) { - if ( @available(iOS 12, *) ) { + if ( @available(iOS 12, macOS 10.14, *) ) { os_signpost_event_emit(THIS->_log, OS_SIGNPOST_ID_EXCLUSIVE, "Overrun"); } dispatch_async(dispatch_get_main_queue(), ^{ diff --git a/TheAmazingAudioEngine/Utilities/AEIOAudioUnit.m b/TheAmazingAudioEngine/Utilities/AEIOAudioUnit.m index e0c0e2c..b17807a 100644 --- a/TheAmazingAudioEngine/Utilities/AEIOAudioUnit.m +++ b/TheAmazingAudioEngine/Utilities/AEIOAudioUnit.m @@ -39,7 +39,9 @@ NSString * const AEIOAudioUnitSessionInterruptionBeganNotification = @"AEIOAudioUnitSessionInterruptionBeganNotification"; NSString * const AEIOAudioUnitSessionInterruptionEndedNotification = @"AEIOAudioUnitSessionInterruptionEndedNotification"; +#if TARGET_OS_IPHONE static const double kAVAudioSession0dBGain = 0.75; +#endif @interface AEIOAudioUnit () @property (nonatomic, strong) AEManagedValue * renderBlockValue;