Skip to content

Commit

Permalink
Renamed and refactored playSuccessSound to playSound
Browse files Browse the repository at this point in the history
  • Loading branch information
halbtuerke committed Jun 19, 2009
1 parent 5f3b9a6 commit 574d5cf
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions AppController.m
Expand Up @@ -296,13 +296,13 @@ -(void)taskTerminated:(NSNotification *)note
[alert setAlertStyle:NSInformationalAlertStyle];
conversionSuccessful = YES;
}

[self playSound:conversionSuccessful];
[alert beginSheetModalForWindow:mainWindow modalDelegate:self didEndSelector:nil contextInfo:nil];

[task release];
task = nil;

conversionSuccessful = NO;
[startTranscodeButton setState:0];
[startTranscodeButton setEnabled: NO];
Expand Down Expand Up @@ -340,7 +340,7 @@ - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filenam

# pragma mark Open PDF for Help

- (IBAction)openHelp:(id)sender
-(IBAction)openHelp:(id)sender
{
// get path of bundle
NSBundle *bundle = [NSBundle mainBundle];
Expand All @@ -359,16 +359,18 @@ - (IBAction)openHelp:(id)sender

# pragma mark successful/failed sounds

- (void)playSuccessSound:(BOOL)success
-(void)playSound:(BOOL)success
{
// system sounds in /Library/Sounds and ~/Library/Sounds will be played automatically when NSSound is used
NSSound *successSound;

// 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];
successSound = [NSSound soundNamed:@"complete"];
} else if (success == NO) {
NSSound *successSound = [NSSound soundNamed:@"Basso"];
[successSound play];
successSound = [NSSound soundNamed:@"Basso"];
}

[successSound play];
}

@end

0 comments on commit 574d5cf

Please sign in to comment.