equal
deleted
inserted
replaced
77 ALog(@"Failed to init class (%@) with AVAudioPlayer instance, use initFadeWithAudioPlayer:",[self class]); |
77 ALog(@"Failed to init class (%@) with AVAudioPlayer instance, use initFadeWithAudioPlayer:",[self class]); |
78 return nil; |
78 return nil; |
79 } |
79 } |
80 |
80 |
81 - (void)main { |
81 - (void)main { |
82 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
82 @autoreleasepool { |
|
83 |
83 [NSThread sleepForTimeInterval:_delay]; |
84 [NSThread sleepForTimeInterval:_delay]; |
84 if ([self.audioPlayer isKindOfClass:[AVAudioPlayer class]]) { |
85 if ([self.audioPlayer isKindOfClass:[AVAudioPlayer class]]) { |
85 [self beginFadeOperation]; |
86 [self beginFadeOperation]; |
86 } |
87 } |
87 else { |
88 else { |
88 ALog(@"AudioPlayerFadeOperation began with invalid AVAudioPlayer"); |
89 ALog(@"AudioPlayerFadeOperation began with invalid AVAudioPlayer"); |
89 } |
90 } |
90 |
91 |
91 [pool release]; |
92 } |
92 } |
93 } |
93 |
94 |
94 - (void)beginFadeOperation { |
95 - (void)beginFadeOperation { |
95 if (![self.audioPlayer isPlaying] && _playBeforeFade) [self.audioPlayer play]; |
96 if (![self.audioPlayer isPlaying] && _playBeforeFade) [self.audioPlayer play]; |
96 |
97 |