diff --git a/PinConfigurator.xcodeproj/project.xcworkspace/xcuserdata/headsoft.xcuserdatad/UserInterfaceState.xcuserstate b/PinConfigurator.xcodeproj/project.xcworkspace/xcuserdata/headsoft.xcuserdatad/UserInterfaceState.xcuserstate index b5828a9..f390499 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 ad17805..1a6c79f 100755 --- a/PinConfigurator/AppDelegate.m +++ b/PinConfigurator/AppDelegate.m @@ -835,6 +835,20 @@ - (uint32_t)getPinDefault return ((port << 30) | (location << 24) | (device << 20) | (connector << 16) | (color << 12) | (misc << 8) | (group << 4) | index); } +- (void)showSelectCodec:(NSString *)configString +{ + [_hdaCodecString release]; + + _hdaCodecString = [configString retain]; + + [_selectCodecOutlineView reloadData]; + + NSIndexSet *indexSet = [NSIndexSet indexSetWithIndex:0]; + [[self selectCodecOutlineView] selectRowIndexes:indexSet byExtendingSelection:NO]; + + [NSApp beginSheet:_selectCodecPanel modalForWindow:[self mainWindow] modalDelegate:0 didEndSelector:0 contextInfo:0]; +} + - (void)parseCodec:(HdaCodec *)hdaCodec { _nodeArray = [[NSMutableArray alloc] init]; @@ -867,19 +881,14 @@ - (void)parseCodec:(HdaCodec *)hdaCodec - (void)parseConfigString:(NSString *)configString { - int result = 0; + int codecCount = 0; [self clear]; - if ((result = [HdaCodec parseHdaCodecString:configString index:0 hdaCodec:&_hdaCodec hdaCodecArray:&_selectCodecArray])) + if ((codecCount = [HdaCodec parseHdaCodecString:configString index:0 hdaCodec:&_hdaCodec hdaCodecArray:&_selectCodecArray])) { - if (result == 2) - { - [_hdaCodecString release]; - _hdaCodecString = [configString retain]; - [_selectCodecOutlineView reloadData]; - [NSApp beginSheet:_selectCodecPanel modalForWindow:[self mainWindow] modalDelegate:0 didEndSelector:0 contextInfo:0]; - } + if (codecCount > 1) + [self showSelectCodec:configString]; else [self parseCodec:_hdaCodec]; } diff --git a/PinConfigurator/HdaCodec.h b/PinConfigurator/HdaCodec.h index 72c1b77..2b6aed6 100755 --- a/PinConfigurator/HdaCodec.h +++ b/PinConfigurator/HdaCodec.h @@ -105,7 +105,7 @@ - (NSMutableString *)codecString; + (bool)getHdaCodecArray_Linux:(NSString *)hdaCodecString hdaCodecArray:(NSMutableArray **)hdaCodecArray; + (bool)parseHdaCodecString_Linux:(NSString *)hdaCodecString index:(uint32_t)index hdaCodec:(HdaCodec *)hdaCodec; -+ (int)parseHdaCodecString:(NSString *)hdaCodecString index:(uint32_t)index hdaCodec:(HdaCodec **)hdaCodec hdaCodecArray:(NSMutableArray **)hdaCodecArray; ++ (uint32_t)parseHdaCodecString:(NSString *)hdaCodecString index:(uint32_t)index hdaCodec:(HdaCodec **)hdaCodec hdaCodecArray:(NSMutableArray **)hdaCodecArray; + (bool)parseHdaCodecData:(uint8_t *)hdaCodecData length:(uint32_t)length hdaCodec:(HdaCodec **)hdaCodec; + (bool)getWidget:(NSArray *)widgets nodeID:(uint8_t)nodeID hdaWidget:(HdaWidget **)hdaWidget; + (void)createPlatformsXml:(HdaCodec *)hdaCodec; diff --git a/PinConfigurator/HdaCodec.m b/PinConfigurator/HdaCodec.m index e10c6f8..18e5a71 100755 --- a/PinConfigurator/HdaCodec.m +++ b/PinConfigurator/HdaCodec.m @@ -1082,7 +1082,7 @@ + (bool)parseHdaCodecString_Linux:(NSString *)hdaCodecString index:(uint32_t)ind return true; } -+ (int)parseHdaCodecString:(NSString *)hdaCodecString index:(uint32_t)index hdaCodec:(HdaCodec **)hdaCodec hdaCodecArray:(NSMutableArray **)hdaCodecArray ++ (uint32_t)parseHdaCodecString:(NSString *)hdaCodecString index:(uint32_t)index hdaCodec:(HdaCodec **)hdaCodec hdaCodecArray:(NSMutableArray **)hdaCodecArray { *hdaCodec = [[HdaCodec alloc] init]; @@ -1096,7 +1096,7 @@ + (int)parseHdaCodecString:(NSString *)hdaCodecString index:(uint32_t)index hdaC [HdaCodec getHdaCodecArray_Linux:hdaCodecString hdaCodecArray:hdaCodecArray]; if ([*hdaCodecArray count] > 1) - return 2; + return (uint32_t)[*hdaCodecArray count]; return [HdaCodec parseHdaCodecString_Linux:hdaCodecString index:index hdaCodec:*hdaCodec]; }