Add a bodge so playback status bar doesn't pop in and out repeatedly on manual track changes

This commit is contained in:
Christopher Snowhill 2021-01-06 00:39:12 -08:00
parent 002fa3b63e
commit 97fee7e486
3 changed files with 11 additions and 1 deletions

View file

@ -590,6 +590,14 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe)
DLog(@"PLAYING!"); DLog(@"PLAYING!");
[self setSeekable:YES]; [self setSeekable:YES];
} }
if (status == kCogStatusStopped) {
status = kCogStatusStopping;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 3 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
if ([self playbackStatus] == kCogStatusStopping)
[self setPlaybackStatus:kCogStatusStopped];
});
}
[self setPlaybackStatus:status]; [self setPlaybackStatus:status];
} }

View file

@ -12,4 +12,5 @@ enum
kCogStatusStopped = 0, kCogStatusStopped = 0,
kCogStatusPaused, kCogStatusPaused,
kCogStatusPlaying, kCogStatusPlaying,
kCogStatusStopping,
}; };

View file

@ -21,7 +21,8 @@ class PlaybackStatusToHiddenTransformer : ValueTransformer {
case kCogStatusStopped as Int: case kCogStatusStopped as Int:
return true return true
case kCogStatusPaused as Int, case kCogStatusPaused as Int,
kCogStatusPlaying as Int: kCogStatusPlaying as Int,
kCogStatusStopping as Int:
return false return false
case .none: case .none:
return true return true