Skip to content

Commit e712cb5

Browse files
committed
changes
1 parent 12b990c commit e712cb5

18 files changed

Lines changed: 786 additions & 644 deletions

native/driver/Driver.xcodeproj/project.pbxproj

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 52;
6+
objectVersion = 47;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -20,9 +20,12 @@
2020
78A804D726C4903E0021981C /* EQMDriver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78A804D626C4903E0021981C /* EQMDriver.swift */; };
2121
78A804DD26C563860021981C /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78A804DC26C563860021981C /* Constants.swift */; };
2222
78A804E026C5676D0021981C /* EQMPlugIn.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78A804DF26C5676D0021981C /* EQMPlugIn.swift */; };
23-
78A804E426C58F3C0021981C /* Atomics in Frameworks */ = {isa = PBXBuildFile; productRef = 78A804E326C58F3C0021981C /* Atomics */; };
2423
78A804E726C595D80021981C /* EQMBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78A804E626C595D80021981C /* EQMBox.swift */; };
2524
78A804EA26C596080021981C /* EQMDevice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78A804E926C596080021981C /* EQMDevice.swift */; };
25+
78E8F7CE26D12B4C00B6B969 /* Volume.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78E8F7CD26D12B4C00B6B969 /* Volume.swift */; };
26+
78E8F7D226D12BD500B6B969 /* AtomicCounter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78E8F7D126D12BD500B6B969 /* AtomicCounter.swift */; };
27+
78E8F7D526D12C0100B6B969 /* EQMObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78E8F7D426D12C0100B6B969 /* EQMObject.swift */; };
28+
78E8F7D926D166D800B6B969 /* EQMInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78E8F7D826D166D800B6B969 /* EQMInterface.swift */; };
2629
E01A29F82456E50500369F41 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E01A29F72456E50500369F41 /* CoreFoundation.framework */; };
2730
E0DAAFBD21FE545F00DCCCEC /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = E0DAAFBC21FE545F00DCCCEC /* icon.icns */; };
2831
/* End PBXBuildFile section */
@@ -47,6 +50,10 @@
4750
78A804DF26C5676D0021981C /* EQMPlugIn.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EQMPlugIn.swift; sourceTree = "<group>"; };
4851
78A804E626C595D80021981C /* EQMBox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EQMBox.swift; sourceTree = "<group>"; };
4952
78A804E926C596080021981C /* EQMDevice.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EQMDevice.swift; sourceTree = "<group>"; };
53+
78E8F7CD26D12B4C00B6B969 /* Volume.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Volume.swift; path = ../shared/Volume.swift; sourceTree = "<group>"; };
54+
78E8F7D126D12BD500B6B969 /* AtomicCounter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AtomicCounter.swift; path = ../shared/AtomicCounter.swift; sourceTree = "<group>"; };
55+
78E8F7D426D12C0100B6B969 /* EQMObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EQMObject.swift; sourceTree = "<group>"; };
56+
78E8F7D826D166D800B6B969 /* EQMInterface.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EQMInterface.swift; sourceTree = "<group>"; };
5057
E01A29F72456E50500369F41 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
5158
E0DAAFBC21FE545F00DCCCEC /* icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = icon.icns; sourceTree = "<group>"; };
5259
/* End PBXFileReference section */
@@ -57,7 +64,6 @@
5764
buildActionMask = 2147483647;
5865
files = (
5966
E01A29F82456E50500369F41 /* CoreFoundation.framework in Frameworks */,
60-
78A804E426C58F3C0021981C /* Atomics in Frameworks */,
6167
);
6268
runOnlyForDeploymentPostprocessing = 0;
6369
};
@@ -89,6 +95,8 @@
8995
78A8049C26C486350021981C /* Bridge */,
9096
78A804DC26C563860021981C /* Constants.swift */,
9197
78A804D626C4903E0021981C /* EQMDriver.swift */,
98+
78E8F7D826D166D800B6B969 /* EQMInterface.swift */,
99+
78E8F7D426D12C0100B6B969 /* EQMObject.swift */,
92100
78A804DF26C5676D0021981C /* EQMPlugIn.swift */,
93101
78A804E626C595D80021981C /* EQMBox.swift */,
94102
78A804E926C596080021981C /* EQMDevice.swift */,
@@ -117,6 +125,8 @@
117125
7838E34E26C897560039D466 /* SharedConstants.swift */,
118126
7838E35026C897560039D466 /* StringExtensions.swift */,
119127
7838E35E26C8A4190039D466 /* Utilities.swift */,
128+
78E8F7CD26D12B4C00B6B969 /* Volume.swift */,
129+
78E8F7D126D12BD500B6B969 /* AtomicCounter.swift */,
120130
);
121131
name = Shared;
122132
sourceTree = "<group>";
@@ -156,7 +166,6 @@
156166
);
157167
name = eqMac;
158168
packageProductDependencies = (
159-
78A804E326C58F3C0021981C /* Atomics */,
160169
);
161170
productName = EQMDriver;
162171
productReference = 1CB8B3641BBBB78D000E2DD1 /* eqMac.driver */;
@@ -189,7 +198,6 @@
189198
);
190199
mainGroup = 1CB8B3591BBBB69C000E2DD1;
191200
packageReferences = (
192-
78A804E226C58F3C0021981C /* XCRemoteSwiftPackageReference "swift-atomics" */,
193201
);
194202
productRefGroup = 1CB8B3651BBBB78D000E2DD1 /* Products */;
195203
projectDirPath = "";
@@ -226,10 +234,14 @@
226234
78A804E026C5676D0021981C /* EQMPlugIn.swift in Sources */,
227235
7838E35226C897560039D466 /* SharedConstants.swift in Sources */,
228236
78A804EA26C596080021981C /* EQMDevice.swift in Sources */,
237+
78E8F7D226D12BD500B6B969 /* AtomicCounter.swift in Sources */,
229238
7838E36426C9CC430039D466 /* ArrayExtensions.swift in Sources */,
239+
78E8F7D526D12C0100B6B969 /* EQMObject.swift in Sources */,
240+
78E8F7D926D166D800B6B969 /* EQMInterface.swift in Sources */,
230241
7838E35B26C898F30039D466 /* EQMControl.swift in Sources */,
231242
78A804DD26C563860021981C /* Constants.swift in Sources */,
232243
7838E35526C897560039D466 /* NumericTypesConversions.swift in Sources */,
244+
78E8F7CE26D12B4C00B6B969 /* Volume.swift in Sources */,
233245
78A804E726C595D80021981C /* EQMBox.swift in Sources */,
234246
);
235247
runOnlyForDeploymentPostprocessing = 0;
@@ -392,17 +404,18 @@
392404
CODE_SIGN_IDENTITY = "-";
393405
CODE_SIGN_STYLE = Manual;
394406
COMBINE_HIDPI_IMAGES = YES;
407+
COPY_PHASE_STRIP = NO;
395408
CURRENT_PROJECT_VERSION = 1.2.3;
396409
DEAD_CODE_STRIPPING = NO;
397-
DEBUG_INFORMATION_FORMAT = dwarf;
410+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
398411
DEFINES_MODULE = YES;
399412
DEVELOPMENT_TEAM = "";
400413
ENABLE_NS_ASSERTIONS = YES;
401414
GCC_C_LANGUAGE_STANDARD = gnu11;
402415
GCC_DYNAMIC_NO_PIC = NO;
403416
GCC_ENABLE_CPP_RTTI = YES;
404417
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
405-
GCC_PREPROCESSOR_DEFINITIONS = "";
418+
GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1";
406419
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
407420
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
408421
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -413,16 +426,13 @@
413426
INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist";
414427
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Audio/Plug-Ins/HAL";
415428
IPHONEOS_DEPLOYMENT_TARGET = "";
416-
LD_RUNPATH_SEARCH_PATHS = (
417-
"$(inherited)",
418-
"@executable_path/../Frameworks",
419-
"@loader_path/../Frameworks",
420-
);
429+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
421430
MACOSX_DEPLOYMENT_TARGET = 10.10;
422431
MARKETING_VERSION = 1.2.3;
423432
MTL_ENABLE_DEBUG_INFO = YES;
424433
ONLY_ACTIVE_ARCH = YES;
425434
OTHER_CODE_SIGN_FLAGS = "";
435+
OTHER_SWIFT_FLAGS = "-D DEBUG";
426436
PRODUCT_BUNDLE_IDENTIFIER = com.bitgapp.eqmac.driver;
427437
PRODUCT_NAME = "$(TARGET_NAME)";
428438
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -460,6 +470,7 @@
460470
CODE_SIGN_IDENTITY = "Developer ID Application";
461471
CODE_SIGN_STYLE = Manual;
462472
COMBINE_HIDPI_IMAGES = YES;
473+
COPY_PHASE_STRIP = YES;
463474
CURRENT_PROJECT_VERSION = 1.2.3;
464475
DEAD_CODE_STRIPPING = NO;
465476
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
@@ -480,11 +491,7 @@
480491
INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist";
481492
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Audio/Plug-Ins/HAL";
482493
IPHONEOS_DEPLOYMENT_TARGET = "";
483-
LD_RUNPATH_SEARCH_PATHS = (
484-
"$(inherited)",
485-
"@executable_path/../Frameworks",
486-
"@loader_path/../Frameworks",
487-
);
494+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
488495
MACOSX_DEPLOYMENT_TARGET = 10.10;
489496
MARKETING_VERSION = 1.2.3;
490497
MTL_ENABLE_DEBUG_INFO = NO;
@@ -525,25 +532,6 @@
525532
defaultConfigurationName = Release;
526533
};
527534
/* End XCConfigurationList section */
528-
529-
/* Begin XCRemoteSwiftPackageReference section */
530-
78A804E226C58F3C0021981C /* XCRemoteSwiftPackageReference "swift-atomics" */ = {
531-
isa = XCRemoteSwiftPackageReference;
532-
repositoryURL = "https://github.com/apple/swift-atomics.git";
533-
requirement = {
534-
kind = upToNextMajorVersion;
535-
minimumVersion = 0.0.3;
536-
};
537-
};
538-
/* End XCRemoteSwiftPackageReference section */
539-
540-
/* Begin XCSwiftPackageProductDependency section */
541-
78A804E326C58F3C0021981C /* Atomics */ = {
542-
isa = XCSwiftPackageProductDependency;
543-
package = 78A804E226C58F3C0021981C /* XCRemoteSwiftPackageReference "swift-atomics" */;
544-
productName = Atomics;
545-
};
546-
/* End XCSwiftPackageProductDependency section */
547535
};
548536
rootObject = 1CB8B35A1BBBB69C000E2DD1 /* Project object */;
549537
}

native/driver/Driver.xcodeproj/xcshareddata/xcschemes/Driver - Debug.xcscheme

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3636
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
3737
debugAsWhichUser = "root"
38-
launchStyle = "0"
38+
launchStyle = "1"
3939
useCustomWorkingDirectory = "NO"
4040
ignoresPersistentStateOnLaunch = "NO"
4141
debugDocumentVersioning = "YES"
@@ -46,7 +46,7 @@
4646
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
4747
<ActionContent
4848
title = "Run Script"
49-
scriptText = "export SUDO_ASKPASS=~/askpass.sh&#10;&#10;# Unload CoreAudio&#10;sudo -A launchctl unload /System/Library/LaunchDaemons/com.apple.audio.coreaudiod.plist&#10;&#10;# Uninstall any new driver leftovers&#10;sudo -A rm -rf /Library/Audio/Plug-Ins/HAL/eqMac.driver/&#10;# Install the new driver&#10;sudo -A cp -f -r &quot;$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME&quot; /Library/Audio/Plug-Ins/HAL/&#10;&#10;# Load CoreAudio&#10;#sudo -A launchctl load /System/Library/LaunchDaemons/com.apple.audio.coreaudiod.plist&#10;"
49+
scriptText = "export SUDO_ASKPASS=~/askpass.sh&#10;&#10;# Unload CoreAudio&#10;sudo -A launchctl unload /System/Library/LaunchDaemons/com.apple.audio.coreaudiod.plist&#10;&#10;# Uninstall any new driver leftovers&#10;sudo -A rm -rf /Library/Audio/Plug-Ins/HAL/eqMac.driver/&#10;# Install the new driver&#10;sudo -A cp -f -r &quot;$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME&quot; /Library/Audio/Plug-Ins/HAL/&#10;"
5050
shellToInvoke = "/bin/sh">
5151
<EnvironmentBuildable>
5252
<BuildableReference

native/driver/Source/Constants.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
import Foundation
1010
import CoreAudio.AudioServerPlugIn
1111

12+
#if DEBUG
13+
let DEBUG = true
14+
#else
15+
let DEBUG = false
16+
#endif
17+
1218
let kAudioServerPluginTypeUUID = CFUUIDGetConstantUUIDWithBytes(nil, 0x44, 0x3A, 0xBA, 0xB8, 0xE7, 0xB3, 0x49, 0x1A, 0xB9, 0x85, 0xBE, 0xB9, 0x18, 0x70, 0x30, 0xDB)!
1319
let kAudioServerPluginDriverInterfaceUUID = CFUUIDGetConstantUUIDWithBytes(nil, 0xEE, 0xA5, 0x77, 0x3D, 0xCC, 0x43, 0x49, 0xF1, 0x8E, 0x00, 0x8F, 0x96, 0xE7, 0xD2, 0x3B, 0x17)!
1420
let IUnknownUUID = CFUUIDGetConstantUUIDWithBytes(kCFAllocatorSystemDefault, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4)!
@@ -21,9 +27,10 @@ let kDataSource_NumberItems: UInt32 = 1
2127

2228
let kDeviceName = "eqMac"
2329
let kDeviceManufacturer = "Bitgapp Ltd"
30+
let kBoxDefaultName = "eqMac Box"
2431

2532
let kPlugInBundleId = "com.bitgapp.eqmac.driver"
26-
let kBoxUID = "EQMBox"
33+
let kBoxUID = "eqMacBox_UID"
2734
let kDeviceUID = "EQMDevice"
2835
let kDeviceModelUID = "EQMDeviceModelUID"
2936

@@ -61,7 +68,7 @@ extension HRESULT {
6168
static let accessDenied = HRESULT(bitPattern: 0x80000009)
6269
}
6370

64-
let kObjectID_PlugIn: UInt32 = 1
71+
let kObjectID_PlugIn: UInt32 = kAudioObjectPlugInObject
6572
let kObjectID_Box: UInt32 = 2
6673
let kObjectID_Device: UInt32 = 3
6774
let kObjectID_Stream_Input: UInt32 = 4

native/driver/Source/EQMBox.swift

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
import Foundation
1010
import CoreAudio.AudioServerPlugIn
1111

12-
class EQMBox: EQMObjectProtocol {
12+
class EQMBox: EQMObject {
1313
static let id = AudioObjectID(kBoxUID)!
14-
static var name = "eqMac Box"
14+
static var name: String? = kBoxDefaultName
1515
static var acquired = false
1616

1717
static func hasProperty (objectID: AudioObjectID? = nil, address: AudioObjectPropertyAddress) -> Bool {
@@ -77,8 +77,7 @@ class EQMBox: EQMObjectProtocol {
7777
}
7878
}
7979

80-
static func getPropertyData (objectID: AudioObjectID? = nil, address: AudioObjectPropertyAddress) -> EQMObjectProperty? {
81-
80+
static func getPropertyData (objectID: AudioObjectID? = nil, address: AudioObjectPropertyAddress, inData: UnsafeRawPointer?) -> EQMObjectProperty? {
8281
switch address.mSelector {
8382
case kAudioObjectPropertyBaseClass:
8483
// The base class for kAudioBoxClassID is kAudioObjectClassID
@@ -91,7 +90,7 @@ class EQMBox: EQMObjectProtocol {
9190
return .integer(kObjectID_PlugIn)
9291
case kAudioObjectPropertyName:
9392
// This is the human readable name of the maker of the box.
94-
return .string(name as CFString)
93+
return .string((name ?? kBoxDefaultName) as CFString)
9594
case kAudioObjectPropertyModelName:
9695
// This is the human readable name of the maker of the box.
9796
return .string("eqMac Model" as CFString)
@@ -143,7 +142,7 @@ class EQMBox: EQMObjectProtocol {
143142
}
144143
}
145144

146-
static func setPropertyData(objectID: AudioObjectID? = nil, address: AudioObjectPropertyAddress, data: UnsafeRawPointer) -> OSStatus {
145+
static func setPropertyData(objectID: AudioObjectID? = nil, address: AudioObjectPropertyAddress, data: UnsafeRawPointer, changedProperties: inout [AudioObjectPropertyAddress]) -> OSStatus {
147146
switch address.mSelector {
148147
case kAudioObjectPropertyName:
149148
// Boxes should allow their name to be editable
@@ -163,7 +162,37 @@ class EQMBox: EQMObjectProtocol {
163162
if (acquired != wasAcquired) {
164163
// the new value is different from the old value, so save it
165164
acquired = wasAcquired
165+
166+
_ = EQMDriver.host?.pointee.WriteToStorage(EQMDriver.host!, "box acquired" as CFString, acquired ? kCFBooleanTrue : kCFBooleanFalse)
167+
168+
// and it means that this property and the device list property have changed
169+
changedProperties.append(
170+
AudioObjectPropertyAddress(
171+
mSelector: kAudioBoxPropertyAcquired,
172+
mScope: kAudioObjectPropertyScopeGlobal,
173+
mElement: kAudioObjectPropertyElementMaster
174+
)
175+
)
176+
177+
changedProperties.append(
178+
AudioObjectPropertyAddress(
179+
mSelector: kAudioBoxPropertyDeviceList,
180+
mScope: kAudioObjectPropertyScopeGlobal,
181+
mElement: kAudioObjectPropertyElementMaster
182+
)
183+
)
184+
185+
// but it also means that the device list has changed for the plug-in too
186+
DispatchQueue.global(qos: .default).async {
187+
var address = AudioObjectPropertyAddress(
188+
mSelector: kAudioPlugInPropertyDeviceList,
189+
mScope: kAudioObjectPropertyScopeGlobal,
190+
mElement: kAudioObjectPropertyElementMaster
191+
)
192+
_ = EQMDriver.host?.pointee.PropertiesChanged(EQMDriver.host!, kObjectID_PlugIn, 1, &address);
193+
}
166194
}
195+
167196
return noErr
168197
default: return kAudioHardwareUnknownPropertyError
169198
}

native/driver/Source/EQMControl.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import Foundation
1010
import CoreAudio.AudioServerPlugIn
1111

12-
class EQMControl: EQMObjectProtocol {
12+
class EQMControl: EQMObject {
1313
static var outputVolume: Float32 = 1
1414
static var outputMuted = false
1515
static var inputDataSource: UInt32 = 0
@@ -148,7 +148,7 @@ class EQMControl: EQMObjectProtocol {
148148
}
149149
}
150150

151-
static func getPropertyData (objectID: AudioObjectID?, address: AudioObjectPropertyAddress) -> EQMObjectProperty? {
151+
static func getPropertyData (objectID: AudioObjectID?, address: AudioObjectPropertyAddress, inData: UnsafeRawPointer?) -> EQMObjectProperty? {
152152
switch objectID {
153153
case kObjectID_Volume_Input_Master,
154154
kObjectID_Volume_Output_Master:
@@ -185,7 +185,7 @@ class EQMControl: EQMObjectProtocol {
185185
default: return 0
186186
}
187187
})()
188-
return .float32(volumeToScalar(volume))
188+
return .float32(Volume.toScalar(volume))
189189
case kAudioLevelControlPropertyDecibelValue:
190190
// This returns the dB value of the control.
191191
// Note that we need to take the state lock to examine the value.
@@ -196,7 +196,7 @@ class EQMControl: EQMObjectProtocol {
196196
default: return 0
197197
}
198198
})()
199-
return .float32(volumeToDecibel(volume))
199+
return .float32(Volume.toDecibel(volume))
200200
case kAudioLevelControlPropertyDecibelRange:
201201
// This returns the dB range of the control.
202202
return .valueRange(
@@ -311,7 +311,7 @@ class EQMControl: EQMObjectProtocol {
311311
}
312312
}
313313

314-
static func setPropertyData(objectID: AudioObjectID?, address: AudioObjectPropertyAddress, data: UnsafeRawPointer) -> OSStatus {
314+
static func setPropertyData(objectID: AudioObjectID?, address: AudioObjectPropertyAddress, data: UnsafeRawPointer, changedProperties: inout [AudioObjectPropertyAddress]) -> OSStatus {
315315
switch objectID {
316316
case kObjectID_Volume_Input_Master,
317317
kObjectID_Volume_Output_Master:
@@ -323,7 +323,7 @@ class EQMControl: EQMObjectProtocol {
323323
return kAudioHardwareBadPropertySizeError
324324
}
325325

326-
var newVolume = scalarToVolume(scalar)
326+
var newVolume = Volume.fromScalar(scalar)
327327
newVolume = clamp(value: newVolume, min: 0.0, max: 1.0)
328328

329329
switch objectID {
@@ -348,7 +348,7 @@ class EQMControl: EQMObjectProtocol {
348348
}
349349
decibel = clamp(value: decibel, min: kMinVolumeDB, max: kMaxVolumeDB)
350350

351-
var newVolume = decibelToVolume(decibel)
351+
var newVolume = Volume.fromDecibel(decibel)
352352
newVolume = clamp(value: newVolume, min: 0.0, max: 1.0)
353353

354354
switch objectID {

0 commit comments

Comments
 (0)