Fixed up timers so they are still in effect while in the tracking runloop mode.
parent
f9c9bfad18
commit
f24afa4c86
|
@ -325,20 +325,23 @@
|
|||
NSNumber *originalVolume = [NSNumber numberWithDouble: [audioPlayer volume]];
|
||||
NSTimer *fadeTimer;
|
||||
|
||||
if (playbackStatus == kCogStatusPlaying)
|
||||
fadeTimer = [NSTimer scheduledTimerWithTimeInterval:time
|
||||
if (playbackStatus == kCogStatusPlaying) {
|
||||
fadeTimer = [NSTimer timerWithTimeInterval:time
|
||||
target:self
|
||||
selector:@selector(audioFadeDown:)
|
||||
userInfo:originalVolume
|
||||
repeats:YES];
|
||||
[[NSRunLoop currentRunLoop] addTimer:fadeTimer forMode:NSRunLoopCommonModes];
|
||||
}
|
||||
else
|
||||
{
|
||||
[audioPlayer setVolume:0];
|
||||
fadeTimer = [NSTimer scheduledTimerWithTimeInterval:time
|
||||
fadeTimer = [NSTimer timerWithTimeInterval:time
|
||||
target:self
|
||||
selector:@selector(audioFadeUp:)
|
||||
userInfo:originalVolume
|
||||
repeats:YES];
|
||||
[[NSRunLoop currentRunLoop] addTimer:fadeTimer forMode:NSRunLoopCommonModes];
|
||||
[self pauseResume:self];
|
||||
}
|
||||
|
||||
|
@ -552,8 +555,10 @@
|
|||
}
|
||||
else if (status == kCogStatusPlaying)
|
||||
{
|
||||
if (!positionTimer)
|
||||
positionTimer = [NSTimer scheduledTimerWithTimeInterval:1.00 target:self selector:@selector(updatePosition:) userInfo:nil repeats:YES];
|
||||
if (!positionTimer) {
|
||||
positionTimer = [NSTimer timerWithTimeInterval:1.00 target:self selector:@selector(updatePosition:) userInfo:nil repeats:YES];
|
||||
[[NSRunLoop currentRunLoop] addTimer:positionTimer forMode:NSRunLoopCommonModes];
|
||||
}
|
||||
|
||||
//Show pause
|
||||
[self changePlayButtonImage:@"pause"];
|
||||
|
|
|
@ -284,12 +284,12 @@
|
|||
mask = NSLeftMouseUpMask | NSLeftMouseDraggedMask |
|
||||
NSRightMouseUpMask | NSRightMouseDraggedMask |
|
||||
NSAppKitDefinedMask | NSFlagsChangedMask |
|
||||
NSScrollWheelMask;
|
||||
NSScrollWheelMask | NSPeriodicMask;
|
||||
|
||||
while (keepOn)
|
||||
{
|
||||
theEvent = [self transmogrify:[self nextEventMatchingMask:mask]];
|
||||
|
||||
NSLog(@"Event: %@", theEvent);
|
||||
switch ([theEvent type])
|
||||
{
|
||||
case NSMouseMoved:
|
||||
|
|
|
@ -103,7 +103,8 @@
|
|||
|
||||
if (closeTimer) { [closeTimer invalidate]; [closeTimer release]; }
|
||||
|
||||
closeTimer = [[NSTimer scheduledTimerWithTimeInterval:duration target:self selector:@selector(close) userInfo:nil repeats:NO] retain];
|
||||
closeTimer = [[NSTimer timerWithTimeInterval:duration target:self selector:@selector(close) userInfo:nil repeats:NO] retain];
|
||||
[[NSRunLoop currentRunLoop] addTimer:closeTimer forMode:NSRunLoopCommonModes];
|
||||
}
|
||||
|
||||
- (void)orderFront
|
||||
|
|
Loading…
Reference in New Issue