35@interface OOMusicController (Private)
37- (void) playiTunesPlaylist:(NSString *)playlistName;
73 NSString *modeString = [[NSUserDefaults standardUserDefaults] stringForKey:@"music mode"];
74 if ([modeString isEqualToString:
@"off"]) _mode =
kOOMusicOff;
75 else if ([modeString isEqualToString:
@"iTunes"]) _mode =
kOOMusicITunes;
81 [
self setMissionMusic:@"OoliteTheme.ogg"];
88- (void) playMusicNamed:(NSString *)name loop:(BOOL)loop
90 [
self playMusicNamed:name loop:loop gain:OO_DEFAULT_SOUNDSOURCE_GAIN];
94- (void) playMusicNamed:(NSString *)name loop:(BOOL)loop gain:(
float)gain
96 if ([
self isPlaying] && [name isEqual:[
self playingMusic]])
return;
109 _current = [music retain];
115- (void) playThemeMusic
118 [
self playMusicNamed:@"OoliteTheme.ogg" loop:YES];
122- (void) playDockingMusic
128 [
self playiTunesPlaylist:@"Oolite-Docking"];
132 [
self playMusicNamed:@"BlueDanube.ogg" loop:YES];
137- (void) playDockedMusic
143 [
self playiTunesPlaylist:@"Oolite-Docked"];
147 [
self playMusicNamed:@"OoliteDocked.ogg" loop:NO];
152- (void) setMissionMusic:(NSString *)missionMusicName
154 [_missionMusic autorelease];
155 _missionMusic = [missionMusicName copy];
159- (void) playMissionMusic
161 if (_missionMusic !=
nil)
164 [
self playMusicNamed:_missionMusic loop:NO];
185 [
self playiTunesPlaylist:@"Oolite-Inflight"];
190- (void) stopMusicNamed:(NSString *)name
192 if ([name isEqual:[
self playingMusic]]) [
self stop];
196- (void) stopThemeMusic
201 [
self playDockedMusic];
206- (void) stopDockingMusic
212- (void) stopMissionMusic
218- (void) toggleDockingMusic
222 if (![
self isPlaying]) [
self playDockingMusic];
229 return [_current musicSoundSource];
233- (NSString *) playingMusic
235 return [_current name];
241 return [_current isPlaying];
259 else switch (_special)
266 [
self playThemeMusic];
270 [
self playDockedMusic];
274 [
self playDockingMusic];
278 [
self playMissionMusic];
282 NSString *modeString =
nil;
289 [[NSUserDefaults standardUserDefaults] setObject:modeString forKey:@"music mode"];
297@implementation OOMusicController (Singleton)
306+ (id) allocWithZone:(NSZone *)inZone