diff --git a/PinConfigurator.xcodeproj/project.pbxproj b/PinConfigurator.xcodeproj/project.pbxproj index d0a5eec..d76a5cc 100755 --- a/PinConfigurator.xcodeproj/project.pbxproj +++ b/PinConfigurator.xcodeproj/project.pbxproj @@ -364,7 +364,7 @@ CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 0225; + CURRENT_PROJECT_VERSION = 0226; ENABLE_STRICT_OBJC_MSGSEND = NO; INFOPLIST_FILE = PinConfigurator/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -372,7 +372,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 2.2.5; + MARKETING_VERSION = 2.2.6; PRODUCT_BUNDLE_IDENTIFIER = com.Headsoft.PinConfigurator; PRODUCT_NAME = "$(TARGET_NAME)"; }; @@ -388,7 +388,7 @@ CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 0225; + CURRENT_PROJECT_VERSION = 0226; ENABLE_STRICT_OBJC_MSGSEND = NO; INFOPLIST_FILE = PinConfigurator/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -396,7 +396,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 2.2.5; + MARKETING_VERSION = 2.2.6; PRODUCT_BUNDLE_IDENTIFIER = com.Headsoft.PinConfigurator; PRODUCT_NAME = "$(TARGET_NAME)"; }; diff --git a/PinConfigurator.xcodeproj/project.xcworkspace/xcuserdata/headsoft.xcuserdatad/UserInterfaceState.xcuserstate b/PinConfigurator.xcodeproj/project.xcworkspace/xcuserdata/headsoft.xcuserdatad/UserInterfaceState.xcuserstate index 923ae17..93f9745 100755 Binary files a/PinConfigurator.xcodeproj/project.xcworkspace/xcuserdata/headsoft.xcuserdatad/UserInterfaceState.xcuserstate and b/PinConfigurator.xcodeproj/project.xcworkspace/xcuserdata/headsoft.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/PinConfigurator/IORegTools.m b/PinConfigurator/IORegTools.m index 4e28e01..1388d76 100755 --- a/PinConfigurator/IORegTools.m +++ b/PinConfigurator/IORegTools.m @@ -157,65 +157,72 @@ bool getIORegAudioDeviceArray(NSMutableArray **audioDeviceArray) } } - CFMutableDictionaryRef pciDevicePropertyDictionaryRef = 0; - - kr = IORegistryEntryCreateCFProperties(pciDevice, &pciDevicePropertyDictionaryRef, kCFAllocatorDefault, kNilOptions); - - if (kr == KERN_SUCCESS) - { - NSMutableDictionary *pciDevicePropertyDictionary = (__bridge NSMutableDictionary *)pciDevicePropertyDictionaryRef; + io_service_t parentDevice; - uint32_t deviceID = propertyToUInt32([pciDevicePropertyDictionary objectForKey:@"device-id"]); - uint32_t vendorID = propertyToUInt32([pciDevicePropertyDictionary objectForKey:@"vendor-id"]); - uint32_t revisionID = propertyToUInt32([pciDevicePropertyDictionary objectForKey:@"revision-id"]); - uint32_t alcLayoutID = propertyToUInt32([pciDevicePropertyDictionary objectForKey:@"alc-layout-id"]); - uint32_t subSystemID = propertyToUInt32([pciDevicePropertyDictionary objectForKey:@"subsystem-id"]); - uint32_t subSystemVendorID = propertyToUInt32([pciDevicePropertyDictionary objectForKey:@"subsystem-vendor-id"]); + if (getIORegParent(device, @"IOPCIDevice", &parentDevice, true)) + { + CFMutableDictionaryRef parentPropertyDictionaryRef = 0; - uint32_t deviceIDNew = (vendorID << 16) | deviceID; - uint32_t subDeviceIDNew = (subSystemVendorID << 16) | subSystemID; + kr = IORegistryEntryCreateCFProperties(parentDevice, &parentPropertyDictionaryRef, kCFAllocatorDefault, kNilOptions); - AudioDevice *audioDevice = [[AudioDevice alloc] initWithDeviceBundleID:bundleID deviceClass:[NSString stringWithUTF8String:className] audioDeviceName:audioDeviceName audioDeviceManufacturerName:audioDeviceManufacturerName audioDeviceModelID:audioDeviceDeviceIDNew deviceID:deviceIDNew revisionID:revisionID alcLayoutID:alcLayoutID subDeviceID:subDeviceIDNew]; - - io_service_t codecDevice; - - if (getIORegParent(device, @"IOHDACodecDevice", &codecDevice, true)) + if (kr == KERN_SUCCESS) { - CFMutableDictionaryRef codecPropertyDictionaryRef = 0; + NSMutableDictionary *parentPropertyDictionary = (__bridge NSMutableDictionary *)parentPropertyDictionaryRef; + + uint32_t deviceID = propertyToUInt32([parentPropertyDictionary objectForKey:@"device-id"]); + uint32_t vendorID = propertyToUInt32([parentPropertyDictionary objectForKey:@"vendor-id"]); + uint32_t revisionID = propertyToUInt32([parentPropertyDictionary objectForKey:@"revision-id"]); + uint32_t alcLayoutID = propertyToUInt32([parentPropertyDictionary objectForKey:@"alc-layout-id"]); + uint32_t subSystemID = propertyToUInt32([parentPropertyDictionary objectForKey:@"subsystem-id"]); + uint32_t subSystemVendorID = propertyToUInt32([parentPropertyDictionary objectForKey:@"subsystem-vendor-id"]); - kr = IORegistryEntryCreateCFProperties(codecDevice, &codecPropertyDictionaryRef, kCFAllocatorDefault, kNilOptions); + uint32_t deviceIDNew = (vendorID << 16) | deviceID; + uint32_t subDeviceIDNew = (subSystemVendorID << 16) | subSystemID; + + AudioDevice *audioDevice = [[AudioDevice alloc] initWithDeviceBundleID:bundleID deviceClass:[NSString stringWithUTF8String:className] audioDeviceName:audioDeviceName audioDeviceManufacturerName:audioDeviceManufacturerName audioDeviceModelID:audioDeviceDeviceIDNew deviceID:deviceIDNew revisionID:revisionID alcLayoutID:alcLayoutID subDeviceID:subDeviceIDNew]; + + io_service_t codecDevice; - if (kr == KERN_SUCCESS) + if (getIORegParent(device, @"IOHDACodecDevice", &codecDevice, true)) { - NSMutableDictionary *codecPropertyDictionary = (__bridge NSMutableDictionary *)codecPropertyDictionaryRef; + CFMutableDictionaryRef codecPropertyDictionaryRef = 0; - audioDevice.digitalAudioCapabilities = [codecPropertyDictionary objectForKey:@"DigitalAudioCapabilities"]; - audioDevice.codecAddress = propertyToUInt32([codecPropertyDictionary objectForKey:@"IOHDACodecAddress"]); - audioDevice.codecID = propertyToUInt32([codecPropertyDictionary objectForKey:@"IOHDACodecVendorID"]); - audioDevice.revisionID = propertyToUInt32([codecPropertyDictionary objectForKey:@"IOHDACodecRevisionID"]); + kr = IORegistryEntryCreateCFProperties(codecDevice, &codecPropertyDictionaryRef, kCFAllocatorDefault, kNilOptions); + + if (kr == KERN_SUCCESS) + { + NSMutableDictionary *codecPropertyDictionary = (__bridge NSMutableDictionary *)codecPropertyDictionaryRef; + + audioDevice.digitalAudioCapabilities = [codecPropertyDictionary objectForKey:@"DigitalAudioCapabilities"]; + audioDevice.codecAddress = propertyToUInt32([codecPropertyDictionary objectForKey:@"IOHDACodecAddress"]); + audioDevice.codecID = propertyToUInt32([codecPropertyDictionary objectForKey:@"IOHDACodecVendorID"]); + audioDevice.revisionID = propertyToUInt32([codecPropertyDictionary objectForKey:@"IOHDACodecRevisionID"]); + } } - } - - if (getIORegParent(device, @"AppleHDACodec", &codecDevice, true)) - { - CFMutableDictionaryRef codecPropertyDictionaryRef = 0; - kr = IORegistryEntryCreateCFProperties(codecDevice, &codecPropertyDictionaryRef, kCFAllocatorDefault, kNilOptions); - - if (kr == KERN_SUCCESS) + if (getIORegParent(device, @"AppleHDACodec", &codecDevice, true)) { - NSMutableDictionary *codecPropertyDictionary = (__bridge NSMutableDictionary *)codecPropertyDictionaryRef; + CFMutableDictionaryRef codecPropertyDictionaryRef = 0; - NSArray *hdaConfigDefaultArray = [codecPropertyDictionary objectForKey:@"HDAConfigDefault"]; + kr = IORegistryEntryCreateCFProperties(codecDevice, &codecPropertyDictionaryRef, kCFAllocatorDefault, kNilOptions); - if (hdaConfigDefaultArray != nil && [hdaConfigDefaultArray count] > 0) - audioDevice.hdaConfigDefaultDictionary = [hdaConfigDefaultArray objectAtIndex:0]; + if (kr == KERN_SUCCESS) + { + NSMutableDictionary *codecPropertyDictionary = (__bridge NSMutableDictionary *)codecPropertyDictionaryRef; + + NSArray *hdaConfigDefaultArray = [codecPropertyDictionary objectForKey:@"HDAConfigDefault"]; + + if (hdaConfigDefaultArray != nil && [hdaConfigDefaultArray count] > 0) + audioDevice.hdaConfigDefaultDictionary = [hdaConfigDefaultArray objectAtIndex:0]; + } } + + [*audioDeviceArray addObject:audioDevice]; + + [audioDevice release]; } - [*audioDeviceArray addObject:audioDevice]; - - [audioDevice release]; + IOObjectRelease(parentDevice); } } }