Add an event posting on track change notification
This event should be helpful for implementing a Last.FM API into the player once again. Signed-off-by: Christopher Snowhill <kode54@gmail.com>lastfm
parent
c54062f4bf
commit
05a5c95106
|
@ -32,6 +32,8 @@ NSString *CogPlaybackDidPauseNotficiation = @"CogPlaybackDidPauseNotficiation";
|
|||
NSString *CogPlaybackDidResumeNotficiation = @"CogPlaybackDidResumeNotficiation";
|
||||
NSString *CogPlaybackDidStopNotficiation = @"CogPlaybackDidStopNotficiation";
|
||||
|
||||
NSString *CogPlaybackDidChangeTrackNotification = @"CogPlaybackDidChangeTrackNotification";
|
||||
|
||||
@synthesize playbackStatus;
|
||||
|
||||
@synthesize progressOverall;
|
||||
|
@ -621,6 +623,19 @@ NSDictionary *makeRGInfo(PlaylistEntry *pe) {
|
|||
[self removeHDCD:nil];
|
||||
});
|
||||
|
||||
if(playlistController.currentEntry) {
|
||||
NSDictionary *info;
|
||||
if(pe) {
|
||||
info = @{ @"previous": playlistController.currentEntry,
|
||||
@"playPosition": @(playlistController.currentEntry.currentPosition),
|
||||
@"current": pe };
|
||||
} else {
|
||||
info = @{ @"previous": playlistController.currentEntry,
|
||||
@"playPosition": @(playlistController.currentEntry.currentPosition) };
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:CogPlaybackDidChangeTrackNotification object:info];
|
||||
}
|
||||
|
||||
if(pe) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:CogPlaybackDidBeginNotficiation object:pe];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue