Fix status bar bodge so stopping manually doesn't prevent playback for 3 seconds
This commit is contained in:
parent
41d11bdfa8
commit
0a99093af0
3 changed files with 6 additions and 3 deletions
|
@ -241,6 +241,9 @@
|
||||||
int lastTrackPlaying = -1;
|
int lastTrackPlaying = -1;
|
||||||
double lastTrackPosition = 0;
|
double lastTrackPosition = 0;
|
||||||
|
|
||||||
|
if (currentStatus == kCogStatusStopping)
|
||||||
|
currentStatus = kCogStatusStopped;
|
||||||
|
|
||||||
[[NSUserDefaults standardUserDefaults] setInteger:currentStatus forKey:@"lastPlaybackStatus"];
|
[[NSUserDefaults standardUserDefaults] setInteger:currentStatus forKey:@"lastPlaybackStatus"];
|
||||||
|
|
||||||
if (currentStatus != kCogStatusStopped)
|
if (currentStatus != kCogStatusStopped)
|
||||||
|
|
|
@ -73,7 +73,7 @@ NSString *CogPlaybackDidStopNotficiation = @"CogPlaybackDidStopNotficiation";
|
||||||
|
|
||||||
- (IBAction)playPauseResume:(id)sender
|
- (IBAction)playPauseResume:(id)sender
|
||||||
{
|
{
|
||||||
if (playbackStatus == kCogStatusStopped)
|
if (playbackStatus == kCogStatusStopped || playbackStatus == kCogStatusStopping)
|
||||||
{
|
{
|
||||||
[self play:self];
|
[self play:self];
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe)
|
||||||
|
|
||||||
- (void)playEntry:(PlaylistEntry *)pe startPaused:(BOOL)paused
|
- (void)playEntry:(PlaylistEntry *)pe startPaused:(BOOL)paused
|
||||||
{
|
{
|
||||||
if (playbackStatus != kCogStatusStopped)
|
if (playbackStatus != kCogStatusStopped && playbackStatus != kCogStatusStopping)
|
||||||
[self stop:self];
|
[self stop:self];
|
||||||
|
|
||||||
DLog(@"PLAYLIST CONTROLLER: %@", [playlistController class]);
|
DLog(@"PLAYLIST CONTROLLER: %@", [playlistController class]);
|
||||||
|
|
|
@ -389,7 +389,7 @@
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action == @selector(scrollToCurrentEntry:) && ([playbackController playbackStatus] == kCogStatusStopped))
|
if (action == @selector(scrollToCurrentEntry:) && (([playbackController playbackStatus] == kCogStatusStopped) || ([playbackController playbackStatus] == kCogStatusStopping)))
|
||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
return [super validateUserInterfaceItem:anItem];
|
return [super validateUserInterfaceItem:anItem];
|
||||||
|
|
Loading…
Reference in a new issue