equal
deleted
inserted
replaced
9 #import "CommodityFunctions.h" |
9 #import "CommodityFunctions.h" |
10 #import <sys/types.h> |
10 #import <sys/types.h> |
11 #import <sys/sysctl.h> |
11 #import <sys/sysctl.h> |
12 #import <mach/mach.h> |
12 #import <mach/mach.h> |
13 #import <mach/mach_host.h> |
13 #import <mach/mach_host.h> |
|
14 #import "AudioToolbox/AudioToolbox.h" |
14 |
15 |
15 void createTeamNamed (NSString *nameWithoutExt) { |
16 void createTeamNamed (NSString *nameWithoutExt) { |
16 NSString *teamsDirectory = TEAMS_DIRECTORY(); |
17 NSString *teamsDirectory = TEAMS_DIRECTORY(); |
17 |
18 |
18 if (![[NSFileManager defaultManager] fileExistsAtPath: teamsDirectory]) { |
19 if (![[NSFileManager defaultManager] fileExistsAtPath: teamsDirectory]) { |
230 NSString *modelId = [NSString stringWithUTF8String:name]; |
231 NSString *modelId = [NSString stringWithUTF8String:name]; |
231 free(name); |
232 free(name); |
232 |
233 |
233 return modelId; |
234 return modelId; |
234 } |
235 } |
|
236 |
|
237 void playSound (NSString *snd) { |
|
238 //Get the filename of the sound file: |
|
239 NSString *path = [NSString stringWithFormat:@"%@/%@.wav",[[NSBundle mainBundle] resourcePath],snd]; |
|
240 |
|
241 //declare a system sound id |
|
242 SystemSoundID soundID; |
|
243 |
|
244 //Get a URL for the sound file |
|
245 NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO]; |
|
246 |
|
247 //Use audio sevices to create the sound |
|
248 AudioServicesCreateSystemSoundID((CFURLRef)filePath, &soundID); |
|
249 |
|
250 //Use audio services to play the sound |
|
251 AudioServicesPlaySystemSound(soundID); |
|
252 } |