From e306359cc457dfbe5200e6485596e9c9901aae19 Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Tue, 22 Feb 2011 02:03:02 +0000 Subject: -dfsound (macosx): added volume adjustment/muting support. -peopsxgl (macosx): removed powerpc from deployment configuration as the plugin is not big-endian compatible. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@63687 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/plugins/DFSound/macsrc/PluginController.m | 34 ++++++++++++++++-------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'macosx/plugins/DFSound/macsrc/PluginController.m') diff --git a/macosx/plugins/DFSound/macsrc/PluginController.m b/macosx/plugins/DFSound/macsrc/PluginController.m index ec671f70..19b30134 100644 --- a/macosx/plugins/DFSound/macsrc/PluginController.m +++ b/macosx/plugins/DFSound/macsrc/PluginController.m @@ -48,13 +48,13 @@ long DoConfiguration() pluginController = [[PluginController alloc] initWithWindowNibName:@"NetSfPeopsSpuPluginMain"]; } window = [pluginController window]; - + /* load values */ [pluginController loadValues]; - + [window center]; [window makeKeyAndOrderFront:nil]; - + return 0; } @@ -69,6 +69,7 @@ void ReadConfig(void) [NSNumber numberWithBool:NO], @"XA Pitch", [NSNumber numberWithInt:0], @"Interpolation Quality", [NSNumber numberWithInt:1], @"Reverb Quality", + [NSNumber numberWithInt:3], @"Volume", nil], PrefsKey, nil]]; @@ -82,7 +83,7 @@ void ReadConfig(void) iUseInterpolation = [[keyValues objectForKey:@"Interpolation Quality"] intValue]; iUseReverb = [[keyValues objectForKey:@"Reverb Quality"] intValue]; - iVolume=1; + iVolume = 5 - [[keyValues objectForKey:@"Volume"] intValue]; } @implementation PluginController @@ -95,7 +96,7 @@ void ReadConfig(void) - (IBAction)ok:(id)sender { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - + NSMutableDictionary *writeDic = [NSMutableDictionary dictionaryWithDictionary:keyValues]; [writeDic setObject:[NSNumber numberWithInt:[hiCompBox intValue]] forKey:@"High Compatibility Mode"]; [writeDic setObject:[NSNumber numberWithInt:[irqWaitBox intValue]] forKey:@"SPU IRQ Wait"]; @@ -104,14 +105,16 @@ void ReadConfig(void) [writeDic setObject:[NSNumber numberWithInt:[interpolValue intValue]] forKey:@"Interpolation Quality"]; [writeDic setObject:[NSNumber numberWithInt:[reverbValue intValue]] forKey:@"Reverb Quality"]; - + + [writeDic setObject:[NSNumber numberWithInt:[volumeValue intValue]] forKey:@"Volume"]; + // write to defaults [defaults setObject:writeDic forKey:PrefsKey]; [defaults synchronize]; - + // and set global values accordingly ReadConfig(); - + [self close]; } @@ -125,13 +128,13 @@ void ReadConfig(void) - (void)loadValues { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - + ReadConfig(); - + /* load from preferences */ [keyValues release]; keyValues = [[defaults dictionaryForKey:PrefsKey] retain]; - + [hiCompBox setIntValue:[[keyValues objectForKey:@"High Compatibility Mode"] intValue]]; [irqWaitBox setIntValue:[[keyValues objectForKey:@"SPU IRQ Wait"] intValue]]; [monoSoundBox setIntValue:[[keyValues objectForKey:@"Mono Sound Output"] intValue]]; @@ -139,6 +142,7 @@ void ReadConfig(void) [interpolValue setIntValue:[[keyValues objectForKey:@"Interpolation Quality"] intValue]]; [reverbValue setIntValue:[[keyValues objectForKey:@"Reverb Quality"] intValue]]; + [volumeValue setIntValue:[[keyValues objectForKey:@"Volume"] intValue]]; } - (void)awakeFromNib @@ -155,6 +159,14 @@ void ReadConfig(void) @"(Simple Reverb)", @"(PSX Reverb)", nil]]; + + [volumeValue setStrings:[NSArray arrayWithObjects: + @"(Muted)", + @"(Low)", + @"(Medium)", + @"(Loud)", + @"(Loudest)", + nil]]; } @end -- cgit v1.2.3