Playback Controller: Fixed title bar updating
This change had several components. For one, the delay of the dispatch was increased from 5 milliseconds to 50 milliseconds. Two, the post to the notification center was included in the delayed dispatch, so that retains the PlaylistEntry object. Finally, the playlistController's currentEntry object is reassigned from the input PlaylistEntry object, which facilitates all watchers which are observing that variable for updates. This final step also retains self for the callback, which should be fine, since it's a quick dispatch with a short delay. Fixes #335 Signed-off-by: Christopher Snowhill <kode54@gmail.com>main
parent
9822dcc4c0
commit
e1fb7b9bd7
|
@ -709,10 +709,11 @@ NSDictionary *makeRGInfo(PlaylistEntry *pe) {
|
|||
[pe setMetadata:info];
|
||||
[playlistView refreshTrack:pe];
|
||||
// Delay the action until this function has returned to the audio thread
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 50 * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{
|
||||
self->playlistController.currentEntry = pe;
|
||||
[self sendMetaData];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:CogPlaybackDidBeginNotficiation object:pe];
|
||||
});
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:CogPlaybackDidBeginNotficiation object:pe];
|
||||
}
|
||||
|
||||
- (void)audioPlayer:(AudioPlayer *)player reportPlayCountForTrack:(id)userInfo {
|
||||
|
|
Loading…
Reference in New Issue