Skip to content

Commit

Permalink
fix: resolve deprecated warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng authored and Jerry23011 committed Jan 7, 2024
1 parent bc61d62 commit f89615c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Easydict/Feature/Utility/EZAudioUtils/EZAudioUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ + (float)getSystemVolume {
AudioObjectPropertyAddress address = {
kAudioDevicePropertyVolumeScalar,
kAudioDevicePropertyScopeOutput,
kAudioObjectPropertyElementMaster};
kAudioObjectPropertyElementMain};

if (!AudioObjectHasProperty(outputDeviceID, &address)) {
NSLog(@"No volume returned for device 0x%0x", outputDeviceID);
Expand Down Expand Up @@ -72,7 +72,7 @@ + (void)setSystemVolume:(float)volume {
AudioObjectPropertyAddress address = {
kAudioDevicePropertyVolumeScalar,
kAudioDevicePropertyScopeOutput,
kAudioObjectPropertyElementMaster};
kAudioObjectPropertyElementMain};

if (!AudioObjectHasProperty(outputDeviceID, &address)) {
NSLog(@"No volume returned for device 0x%0x", outputDeviceID);
Expand All @@ -92,7 +92,7 @@ + (AudioDeviceID)getDefaultOutputDeviceID {
AudioObjectPropertyAddress address = {
kAudioHardwarePropertyDefaultOutputDevice,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster};
kAudioObjectPropertyElementMain};

UInt32 dataSize = sizeof(AudioDeviceID);
OSStatus status = AudioObjectGetPropertyData(kAudioObjectSystemObject, &address, 0, NULL, &dataSize, &outputDeviceID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ + (NSString *)getDeviceModel {

/// Get device UUID, 4F07896A-1580-5270-A0E8-D7FA9DFA6868
+ (NSString *)getDeviceUUID {
io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice"));
io_service_t platformExpert = IOServiceGetMatchingService(kIOMainPortDefault, IOServiceMatching("IOPlatformExpertDevice"));
CFStringRef uuidString = (CFStringRef)IORegistryEntryCreateCFProperty(platformExpert, CFSTR("IOPlatformUUID"), kCFAllocatorDefault, 0);
NSString *uuid = (__bridge NSString *)(uuidString);
IOObjectRelease(platformExpert);
Expand Down

0 comments on commit f89615c

Please sign in to comment.