From 65530e3b2e9612238bfffe8201095d0982c95693 Mon Sep 17 00:00:00 2001 From: Zettt Date: Mon, 15 Jun 2009 12:13:07 +0200 Subject: [PATCH] playSuccessSound method added. (Call via [self playSuccessSound:Y/N] --- AppController.m | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/AppController.m b/AppController.m index 1a0b760..2950635 100644 --- a/AppController.m +++ b/AppController.m @@ -353,6 +353,18 @@ - (IBAction)openHelp:(id)sender } +# pragma mark successful/failed sounds +- (void)playSuccessSound:(BOOL)success +{ + // system sounds in /Library/Sounds and ~/Library/Sounds will be played automatically when NSSound is used + if (success == YES) { + NSSound *successSound = [NSSound soundNamed:@"complete"]; + [successSound play]; + } else if (success == NO) { + NSSound *successSound = [NSSound soundNamed:@"Basso"]; + [successSound play]; + } +} -@end +@end \ No newline at end of file