Fix status bar bodge so stopping manually doesn't prevent playback for 3 seconds

CQTexperiment
Christopher Snowhill 2021-01-06 02:18:09 -08:00
parent 41d11bdfa8
commit 0a99093af0
3 changed files with 6 additions and 3 deletions

View File

@ -241,6 +241,9 @@
int lastTrackPlaying = -1;
double lastTrackPosition = 0;
if (currentStatus == kCogStatusStopping)
currentStatus = kCogStatusStopped;
[[NSUserDefaults standardUserDefaults] setInteger:currentStatus forKey:@"lastPlaybackStatus"];
if (currentStatus != kCogStatusStopped)

View File

@ -73,7 +73,7 @@ NSString *CogPlaybackDidStopNotficiation = @"CogPlaybackDidStopNotficiation";
- (IBAction)playPauseResume:(id)sender
{
if (playbackStatus == kCogStatusStopped)
if (playbackStatus == kCogStatusStopped || playbackStatus == kCogStatusStopping)
{
[self play:self];
}
@ -160,7 +160,7 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe)
- (void)playEntry:(PlaylistEntry *)pe startPaused:(BOOL)paused
{
if (playbackStatus != kCogStatusStopped)
if (playbackStatus != kCogStatusStopped && playbackStatus != kCogStatusStopping)
[self stop:self];
DLog(@"PLAYLIST CONTROLLER: %@", [playlistController class]);

View File

@ -389,7 +389,7 @@
return NO;
}
if (action == @selector(scrollToCurrentEntry:) && ([playbackController playbackStatus] == kCogStatusStopped))
if (action == @selector(scrollToCurrentEntry:) && (([playbackController playbackStatus] == kCogStatusStopped) || ([playbackController playbackStatus] == kCogStatusStopping)))
return NO;
return [super validateUserInterfaceItem:anItem];