Skip to content

Commit

Permalink
Implemented system sounds lookup, fixes psychs#156, supersedes psychs…
Browse files Browse the repository at this point in the history
  • Loading branch information
Hummer12007 committed Mar 27, 2016
1 parent ce502fa commit 52169bb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Classes/Dialogs/Preferences/PreferencesController.m
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,14 @@ - (NSArray*)availableSounds
{
static NSArray* ary;
if (!ary) {
ary = [NSArray arrayWithObjects:@"-", @"Beep", @"Basso", @"Blow", @"Bottle", @"Frog", @"Funk", @"Glass", @"Hero", @"Morse", @"Ping", @"Pop", @"Purr", @"Sosumi", @"Submarine", @"Tink", nil];
NSMutableArray* arr = [NSMutableArray arrayWithObject:@"-"];
for (NSString *path in [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
NSAllDomainsMask, YES) objectEnumerator])
for (NSString *soundFile in [[NSFileManager defaultManager]
enumeratorAtPath:[path stringByAppendingPathComponent:@"Sounds"]])
if ([NSSound soundNamed:[soundFile stringByDeletingPathExtension]])
[arr addObject:[soundFile stringByDeletingPathExtension]];
ary = [arr copy];
}
return ary;
}
Expand Down

0 comments on commit 52169bb

Please sign in to comment.