From 8ddfb81148ca578bc89aa7d5eb0f693d00229541 Mon Sep 17 00:00:00 2001 From: Kyle Neideck Date: Thu, 31 Mar 2022 15:29:25 +1100 Subject: [PATCH] Fix compiler warnings in Xcode 13.2. --- BGMApp/BGMApp/BGMAppVolumes.m | 2 ++ BGMApp/BGMApp/BGMAudioDevice.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/BGMApp/BGMApp/BGMAppVolumes.m b/BGMApp/BGMApp/BGMAppVolumes.m index 6035bf8..34b16b5 100644 --- a/BGMApp/BGMApp/BGMAppVolumes.m +++ b/BGMApp/BGMApp/BGMAppVolumes.m @@ -281,9 +281,11 @@ static NSString* const kMoreAppsMenuTitle = @"More Apps"; [((NSRunningApplication*)menuItem.representedObject).localizedName UTF8String]; // Using this function (instead of just ==) shouldn't be necessary, but just in case. +#if DEBUG BOOL(^nearEnough)(CGFloat x, CGFloat y) = ^BOOL(CGFloat x, CGFloat y) { return fabs(x - y) < 0.01; // We don't need much precision. }; +#endif bool allSubviewsShowing = true; for (NSView* subview in menuItem.view.subviews) { diff --git a/BGMApp/BGMApp/BGMAudioDevice.cpp b/BGMApp/BGMApp/BGMAudioDevice.cpp index 439e7ae..5010ac2 100644 --- a/BGMApp/BGMApp/BGMAudioDevice.cpp +++ b/BGMApp/BGMApp/BGMAudioDevice.cpp @@ -81,7 +81,7 @@ bool BGMAudioDevice::HasSettableMasterVolume(AudioObjectPropertyScope inScope bool BGMAudioDevice::HasSettableVirtualMasterVolume(AudioObjectPropertyScope inScope) const { AudioObjectPropertyAddress virtualMasterVolumeAddress = { - kAudioHardwareServiceDeviceProperty_VirtualMasterVolume, + kAudioHardwareServiceDeviceProperty_VirtualMainVolume, inScope, kAudioObjectPropertyElementMaster }; @@ -220,7 +220,7 @@ bool BGMAudioDevice::GetVirtualMasterVolumeScalar(AudioObjectPropertyScope in Float32& outVirtualMasterVolume) const { AudioObjectPropertyAddress virtualMasterVolumeAddress = { - kAudioHardwareServiceDeviceProperty_VirtualMasterVolume, + kAudioHardwareServiceDeviceProperty_VirtualMainVolume, inScope, kAudioObjectPropertyElementMaster }; @@ -265,7 +265,7 @@ bool BGMAudioDevice::SetVirtualMasterVolumeScalar(AudioObjectPropertyScope in bool didGetVirtualMasterBalance = GetVirtualMasterBalance(inScope, virtualMasterBalance); AudioObjectPropertyAddress virtualMasterVolumeAddress = { - kAudioHardwareServiceDeviceProperty_VirtualMasterVolume, + kAudioHardwareServiceDeviceProperty_VirtualMainVolume, inScope, kAudioObjectPropertyElementMaster }; @@ -277,7 +277,7 @@ bool BGMAudioDevice::SetVirtualMasterVolumeScalar(AudioObjectPropertyScope in // Reset the balance AudioObjectPropertyAddress virtualMasterBalanceAddress = { - kAudioHardwareServiceDeviceProperty_VirtualMasterBalance, + kAudioHardwareServiceDeviceProperty_VirtualMainBalance, inScope, kAudioObjectPropertyElementMaster }; @@ -310,7 +310,7 @@ bool BGMAudioDevice::GetVirtualMasterBalance(AudioObjectPropertyScope inScope Float32& outVirtualMasterBalance) const { AudioObjectPropertyAddress virtualMasterBalanceAddress = { - kAudioHardwareServiceDeviceProperty_VirtualMasterBalance, + kAudioHardwareServiceDeviceProperty_VirtualMainBalance, inScope, kAudioObjectPropertyElementMaster };