diff --git a/Application/PlaybackController.h b/Application/PlaybackController.h index 88c52d842..c6c81db43 100644 --- a/Application/PlaybackController.h +++ b/Application/PlaybackController.h @@ -30,6 +30,7 @@ int playbackStatus; double position; BOOL seekable; + BOOL fading; AudioScrobbler *scrobbler; diff --git a/Application/PlaybackController.m b/Application/PlaybackController.m index 385ab8f4a..188f50b31 100644 --- a/Application/PlaybackController.m +++ b/Application/PlaybackController.m @@ -24,6 +24,9 @@ if (self) { [self initDefaults]; + + seekable = NO; + fading = NO; audioPlayer = [[AudioPlayer alloc] init]; [audioPlayer setDelegate:self]; @@ -276,7 +279,8 @@ [audioPlayer setVolume:originalVolume]; [volumeSlider setDoubleValue: logarithmicToLinear(originalVolume)]; [audioTimer invalidate]; - [self setPlaybackStatus: kCogStatusPaused]; + + fading = NO; } } @@ -300,7 +304,8 @@ { [volumeSlider setDoubleValue: logarithmicToLinear(originalVolume)]; [audioTimer invalidate]; - [self setPlaybackStatus: kCogStatusPlaying]; + + fading = NO; } } @@ -310,8 +315,9 @@ double time = 0.1; // we can not allow multiple fade timers to be registered - if (playbackStatus == kCogStatusFading) + if (YES == fading) return; + fading = YES; NSNumber *originalVolume = [NSNumber numberWithDouble: [audioPlayer volume]]; NSTimer *fadeTimer; @@ -335,9 +341,6 @@ [[NSRunLoop currentRunLoop] addTimer:fadeTimer forMode:NSRunLoopCommonModes]; [self pauseResume:self]; } - - [self setPlaybackStatus: kCogStatusFading]; - } - (IBAction)skipToNextAlbum:(id)sender diff --git a/Audio/Status.h b/Audio/Status.h index 7e9fbcc6e..0d9df755b 100644 --- a/Audio/Status.h +++ b/Audio/Status.h @@ -12,8 +12,4 @@ enum kCogStatusStopped = 0, kCogStatusPaused, kCogStatusPlaying, - kCogStatusFading, -// kCogStatusEndOfFile, -// kCogStatusEndOfPlaylist, -// kCogStatusPlaybackEnded }; diff --git a/Window/PlaybackButtons.m b/Window/PlaybackButtons.m index e9ecfe258..09b6885f1 100644 --- a/Window/PlaybackButtons.m +++ b/Window/PlaybackButtons.m @@ -45,7 +45,7 @@ static NSString *PlaybackButtonsPlaybackStatusObservationContext = @"PlaybackBut NSImage *image = nil; - if (playbackStatus == kCogStatusPlaying || playbackStatus == kCogStatusFading) { + if (playbackStatus == kCogStatusPlaying) { image = [NSImage imageNamed:@"pause"]; } else {