diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-09-10 18:43:18 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-09-10 18:43:18 +0000 |
| commit | 4b4f074b6659f33b4f9e1c9784861409d8debd97 (patch) | |
| tree | 0fbd7f1ea28c9431cd8bafbaaac5d689d55d5dd6 /macosx/plugins/DFSound/macsrc | |
| parent | a3ac4842bd5c7058b1363f7d3307f61724fc7178 (diff) | |
| download | pcsxr-4b4f074b6659f33b4f9e1c9784861409d8debd97.tar.gz | |
Convert Objective-C code to modern syntax, mainly for the NSDictionaries.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@87115 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/DFSound/macsrc')
| -rwxr-xr-x | macosx/plugins/DFSound/macsrc/NamedSlider.m | 2 | ||||
| -rwxr-xr-x | macosx/plugins/DFSound/macsrc/PluginController.m | 74 |
2 files changed, 35 insertions, 41 deletions
diff --git a/macosx/plugins/DFSound/macsrc/NamedSlider.m b/macosx/plugins/DFSound/macsrc/NamedSlider.m index 90a89eb5..1529471f 100755 --- a/macosx/plugins/DFSound/macsrc/NamedSlider.m +++ b/macosx/plugins/DFSound/macsrc/NamedSlider.m @@ -9,7 +9,7 @@ NSInteger index = [self integerValue]; if (index >= 0 && index < [strings count]) - return [strings objectAtIndex:index]; + return strings[index]; if (!pluginClass) { return @"(Unknown)"; diff --git a/macosx/plugins/DFSound/macsrc/PluginController.m b/macosx/plugins/DFSound/macsrc/PluginController.m index 12a2b3d7..d57e63f2 100755 --- a/macosx/plugins/DFSound/macsrc/PluginController.m +++ b/macosx/plugins/DFSound/macsrc/PluginController.m @@ -72,14 +72,12 @@ void DoAbout() [icon setSize:size]; NSDictionary *infoPaneDict = - [[NSDictionary alloc] initWithObjectsAndKeys: - [bundle objectForInfoDictionaryKey:@"CFBundleName"], @"ApplicationName", - icon, @"ApplicationIcon", - [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"], @"ApplicationVersion", - [bundle objectForInfoDictionaryKey:@"CFBundleVersion"], @"Version", - [bundle objectForInfoDictionaryKey:@"NSHumanReadableCopyright"], @"Copyright", - credits, @"Credits", - nil]; + @{@"ApplicationName": [bundle objectForInfoDictionaryKey:@"CFBundleName"], + @"ApplicationIcon": icon, + @"ApplicationVersion": [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"], + @"Version": [bundle objectForInfoDictionaryKey:@"CFBundleVersion"], + @"Copyright": [bundle objectForInfoDictionaryKey:@"NSHumanReadableCopyright"], + @"Credits": credits}; dispatch_async(dispatch_get_main_queue(), ^{ [NSApp orderFrontStandardAboutPanelWithOptions:infoPaneDict]; }); @@ -109,29 +107,25 @@ void ReadConfig(void) { NSDictionary *keyValues; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - [defaults registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys: - [NSDictionary dictionaryWithObjectsAndKeys: - @YES, @"High Compatibility Mode", - @YES, @"SPU IRQ Wait", - @NO, @"XA Pitch", - @NO, @"Mono Sound Output", - @0, @"Interpolation Quality", - @1, @"Reverb Quality", - @3, @"Volume", - nil], PrefsKey, - nil]]; + [defaults registerDefaults:@{PrefsKey: @{@"High Compatibility Mode": @YES, + @"SPU IRQ Wait": @YES, + @"XA Pitch": @NO, + @"Mono Sound Output": @NO, + @"Interpolation Quality": @0, + @"Reverb Quality": @1, + @"Volume": @3}}]; keyValues = [defaults dictionaryForKey:PrefsKey]; - iUseTimer = [[keyValues objectForKey:@"High Compatibility Mode"] boolValue] ? 2 : 0; - iSPUIRQWait = [[keyValues objectForKey:@"SPU IRQ Wait"] boolValue]; - iDisStereo = [[keyValues objectForKey:@"Mono Sound Output"] boolValue]; - iXAPitch = [[keyValues objectForKey:@"XA Pitch"] boolValue]; + iUseTimer = [keyValues[@"High Compatibility Mode"] boolValue] ? 2 : 0; + iSPUIRQWait = [keyValues[@"SPU IRQ Wait"] boolValue]; + iDisStereo = [keyValues[@"Mono Sound Output"] boolValue]; + iXAPitch = [keyValues[@"XA Pitch"] boolValue]; - iUseInterpolation = [[keyValues objectForKey:@"Interpolation Quality"] intValue]; - iUseReverb = [[keyValues objectForKey:@"Reverb Quality"] intValue]; + iUseInterpolation = [keyValues[@"Interpolation Quality"] intValue]; + iUseReverb = [keyValues[@"Reverb Quality"] intValue]; - iVolume = 5 - [[keyValues objectForKey:@"Volume"] intValue]; + iVolume = 5 - [keyValues[@"Volume"] intValue]; } @implementation PluginController @@ -146,15 +140,15 @@ void ReadConfig(void) NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSMutableDictionary *writeDic = [NSMutableDictionary dictionaryWithDictionary:self.keyValues]; - [writeDic setObject:([hiCompBox intValue] ? @YES : @NO) forKey:@"High Compatibility Mode"]; - [writeDic setObject:([irqWaitBox intValue] ? @YES : @NO) forKey:@"SPU IRQ Wait"]; - [writeDic setObject:([monoSoundBox intValue] ? @YES : @NO) forKey:@"Mono Sound Output"]; - [writeDic setObject:([xaSpeedBox intValue] ? @YES : @NO) forKey:@"XA Pitch"]; + writeDic[@"High Compatibility Mode"] = ([hiCompBox intValue] ? @YES : @NO); + writeDic[@"SPU IRQ Wait"] = ([irqWaitBox intValue] ? @YES : @NO); + writeDic[@"Mono Sound Output"] = ([monoSoundBox intValue] ? @YES : @NO); + writeDic[@"XA Pitch"] = ([xaSpeedBox intValue] ? @YES : @NO); - [writeDic setObject:@([interpolValue intValue]) forKey:@"Interpolation Quality"]; - [writeDic setObject:@([reverbValue intValue]) forKey:@"Reverb Quality"]; + writeDic[@"Interpolation Quality"] = @([interpolValue intValue]); + writeDic[@"Reverb Quality"] = @([reverbValue intValue]); - [writeDic setObject:@([volumeValue intValue]) forKey:@"Volume"]; + writeDic[@"Volume"] = @([volumeValue intValue]); // write to defaults [defaults setObject:writeDic forKey:PrefsKey]; @@ -182,14 +176,14 @@ void ReadConfig(void) /* load from preferences */ self.keyValues = [NSMutableDictionary dictionaryWithDictionary:[defaults dictionaryForKey:PrefsKey]]; - [hiCompBox setIntValue:[[keyValues objectForKey:@"High Compatibility Mode"] boolValue]]; - [irqWaitBox setIntValue:[[keyValues objectForKey:@"SPU IRQ Wait"] boolValue]]; - [monoSoundBox setIntValue:[[keyValues objectForKey:@"Mono Sound Output"] boolValue]]; - [xaSpeedBox setIntValue:[[keyValues objectForKey:@"XA Pitch"] boolValue]]; + [hiCompBox setIntValue:[keyValues[@"High Compatibility Mode"] boolValue]]; + [irqWaitBox setIntValue:[keyValues[@"SPU IRQ Wait"] boolValue]]; + [monoSoundBox setIntValue:[keyValues[@"Mono Sound Output"] boolValue]]; + [xaSpeedBox setIntValue:[keyValues[@"XA Pitch"] boolValue]]; - [interpolValue setIntValue:[[keyValues objectForKey:@"Interpolation Quality"] intValue]]; - [reverbValue setIntValue:[[keyValues objectForKey:@"Reverb Quality"] intValue]]; - [volumeValue setIntValue:[[keyValues objectForKey:@"Volume"] intValue]]; + [interpolValue setIntValue:[keyValues[@"Interpolation Quality"] intValue]]; + [reverbValue setIntValue:[keyValues[@"Reverb Quality"] intValue]]; + [volumeValue setIntValue:[keyValues[@"Volume"] intValue]]; } - (void)awakeFromNib |
