-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathSSYAlertSounder (original).h
45 lines (34 loc) · 1.31 KB
/
SSYAlertSounder (original).h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#import <Cocoa/Cocoa.h>
/*
Use this if you need to keep a process running long enough for your
sound to complete playing. This is an integer so that it can be
used as a parameters to functions that require integers, like sleep().
*/
#define SECONDS_NEEDED_FOR_ONE_ALERT_SOUND 1
/*!
@brief This is a quick hacky wrapper on Audio Services
to play an alert sound cheaply and reliably (in contrast to NSSound)
@details Requires System/Library/Frameworks/AudioToolbox.framework,
which is Mac OS 10.5 or later.
In the earlier System Sound API, for these sounds to play, it was required
that, in System Preferences > Sound > Play User Interface Sound Effects
be enabled. But this appears to work without it.
*/
__attribute__((visibility("default"))) @interface SSYAlertSounder : NSObject {
NSMutableDictionary* m_soundIds ;
}
/*!
@brief Plays a desired sound
@details
@param name The name of a sound file, not including the .aiff extension,
or nil to no-op
*/
- (void)playAlertSoundNamed:(NSString*)name ;
/*!
@brief Returns an array, localizedly sorted, containing all of the names
of the sounds which are available for use by -playAlertSoundNamed, provided
that none of the underlying files disappear in the meantime
*/
- (NSArray*)availableSoundsSorted ;
+ (SSYAlertSounder*)sharedSounder ;
@end