diff --git a/PinConfigurator.xcodeproj/project.pbxproj b/PinConfigurator.xcodeproj/project.pbxproj index f9161ed..99c5f5e 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 = 0219; + CURRENT_PROJECT_VERSION = 0220; 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.8; - MARKETING_VERSION = 2.1.9; + MARKETING_VERSION = 2.2.0; 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 = 0219; + CURRENT_PROJECT_VERSION = 0220; 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.8; - MARKETING_VERSION = 2.1.9; + MARKETING_VERSION = 2.2.0; 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 5628dd0..6e2e1e7 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/AppDelegate.m b/PinConfigurator/AppDelegate.m index 454500c..ad932f4 100755 --- a/PinConfigurator/AppDelegate.m +++ b/PinConfigurator/AppDelegate.m @@ -658,6 +658,7 @@ - (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTab else if (outlineView == [self importIORegOutlineView]) { AudioDevice *audioDevice = item; + NSString *deviceName = (audioDevice.codecID != 0 ? audioDevice.codecName : audioDevice.deviceName); switch ([[tableColumn identifier] intValue]) { @@ -683,7 +684,7 @@ - (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTab [cell setStringValue:(audioDevice.codecID != 0 ? [NSString stringWithFormat:@"0x%04X", audioDevice.codecRevisionID & 0xFFFF] : @"-")]; break; case 7: - [cell setStringValue:(audioDevice.codecID != 0 ? audioDevice.codecName : audioDevice.deviceName)]; + [cell setStringValue:(audioDevice.audioDeviceModelID != 0 ? audioDevice.audioDeviceName : deviceName)]; break; } } diff --git a/PinConfigurator/AudioDevice.h b/PinConfigurator/AudioDevice.h index fe809d5..8867da0 100755 --- a/PinConfigurator/AudioDevice.h +++ b/PinConfigurator/AudioDevice.h @@ -26,8 +26,13 @@ @property uint32_t codecAddress; @property uint32_t codecID; @property uint32_t codecRevisionID; +@property uint32_t audioDeviceModelID; +@property (nonatomic, retain) NSString *audioDeviceName; +@property (nonatomic, retain) NSString *audioDeviceManufacturerName; @property (nonatomic, retain) NSString *vendorName; @property (nonatomic, retain) NSString *deviceName; +@property (nonatomic, retain) NSString *subVendorName; +@property (nonatomic, retain) NSString *subDeviceName; @property (nonatomic, retain) NSString *codecVendorName; @property (nonatomic, retain) NSString *codecName; @property (nonatomic, retain) NSMutableArray *layoutIDArray; @@ -37,7 +42,7 @@ @property uint32_t minKernel; @property uint32_t maxKernel; --(id) initWithDeviceBundleID:(NSString *)bundleID deviceClass:(NSString *)deviceClass deviceName:(NSString *)deviceName deviceID:(uint32_t)deviceID revisionID:(uint32_t)revisionID alcLayoutID:(uint32_t)alcLayoutID subDeviceID:(uint32_t)subDeviceID; +-(id) initWithDeviceBundleID:(NSString *)bundleID deviceClass:(NSString *)deviceClass audioDeviceName:(NSString *)audioDeviceName audioDeviceManufacturerName:(NSString *)audioDeviceManufacturerName audioDeviceModelID:(uint32_t)audioDeviceModelID deviceID:(uint32_t)deviceID revisionID:(uint32_t)revisionID alcLayoutID:(uint32_t)alcLayoutID subDeviceID:(uint32_t)subDeviceID; @end diff --git a/PinConfigurator/AudioDevice.m b/PinConfigurator/AudioDevice.m index 548c1ba..1ec9a1f 100755 --- a/PinConfigurator/AudioDevice.m +++ b/PinConfigurator/AudioDevice.m @@ -10,13 +10,15 @@ @implementation AudioDevice --(id) initWithDeviceBundleID:(NSString *)bundleID deviceClass:(NSString *)deviceClass deviceName:(NSString *)deviceName deviceID:(uint32_t)deviceID revisionID:(uint32_t)revisionID alcLayoutID:(uint32_t)alcLayoutID subDeviceID:(uint32_t)subDeviceID +-(id) initWithDeviceBundleID:(NSString *)bundleID deviceClass:(NSString *)deviceClass audioDeviceName:(NSString *)audioDeviceName audioDeviceManufacturerName:(NSString *)audioDeviceManufacturerName audioDeviceModelID:(uint32_t)audioDeviceModelID deviceID:(uint32_t)deviceID revisionID:(uint32_t)revisionID alcLayoutID:(uint32_t)alcLayoutID subDeviceID:(uint32_t)subDeviceID { if (self = [super init]) { self.bundleID = bundleID; self.deviceClass = deviceClass; - self.deviceName = deviceName; + self.audioDeviceName = audioDeviceName; + self.audioDeviceManufacturerName = audioDeviceManufacturerName; + self.audioDeviceModelID = audioDeviceModelID; self.deviceID = deviceID; self.revisionID = revisionID; self.alcLayoutID = alcLayoutID; diff --git a/PinConfigurator/IORegTools.m b/PinConfigurator/IORegTools.m index 553b47e..66d987b 100755 --- a/PinConfigurator/IORegTools.m +++ b/PinConfigurator/IORegTools.m @@ -120,7 +120,30 @@ bool getIORegAudioDeviceArray(NSMutableArray **audioDeviceArray) NSMutableDictionary *propertyDictionary = (__bridge NSMutableDictionary *)propertyDictionaryRef; NSString *bundleID = [propertyDictionary objectForKey:@"CFBundleIdentifier"]; - NSString *deviceName = [propertyDictionary objectForKey:@"IOAudioDeviceName"]; + NSString *audioDeviceName = [propertyDictionary objectForKey:@"IOAudioDeviceName"]; + NSString *audioDeviceModelID = [propertyDictionary objectForKey:@"IOAudioDeviceModelID"]; + NSString *audioDeviceManufacturerName = [propertyDictionary objectForKey:@"IOAudioDeviceManufacturerName"]; + uint32_t audioDeviceDeviceID = 0, audioDeviceVendorID = 0; + uint32_t audioDeviceDeviceIDNew = 0; + + if (audioDeviceModelID != nil) + { + NSArray *modelIDArray = [audioDeviceModelID componentsSeparatedByString:@":"]; + + if ([modelIDArray count] == 3) + { + NSScanner *deviceIDScanner = [NSScanner scannerWithString:[modelIDArray objectAtIndex:1]]; + NSScanner *productIDScanner = [NSScanner scannerWithString:[modelIDArray objectAtIndex:2]]; + + [deviceIDScanner setScanLocation:0]; + [deviceIDScanner scanHexInt:&audioDeviceVendorID]; + + [productIDScanner setScanLocation:0]; + [productIDScanner scanHexInt:&audioDeviceDeviceID]; + + audioDeviceDeviceIDNew = (audioDeviceVendorID << 16) | audioDeviceDeviceID; + } + } io_service_t parentDevice; @@ -144,7 +167,7 @@ bool getIORegAudioDeviceArray(NSMutableArray **audioDeviceArray) uint32_t deviceIDNew = (vendorID << 16) | deviceID; uint32_t subDeviceIDNew = (subSystemVendorID << 16) | subSystemID; - AudioDevice *audioDevice = [[AudioDevice alloc] initWithDeviceBundleID:bundleID deviceClass:[NSString stringWithUTF8String:className] deviceName:deviceName deviceID:deviceIDNew revisionID:revisionID alcLayoutID:alcLayoutID subDeviceID:subDeviceIDNew]; + 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;