I have a simple program that uses code such as:
MPMusicPlayerController *player = [MPMusicPlayerController
applicationMusicPlayer];
[player setQueueWithQuery:entityQuery];
[player beginGeneratingPlaybackNotifications];
[player play];
In case it matters, 'entityQuery' always references a single item.
What then happens is that my
MPMusicPlayerControllerPlaybackStateDidChangeNotification handler gets called
twice with (playbackState == MPMusicPlaybackStatePlaying). There are no
intervening calls, which first got me wondering how 'playing' to 'playing' can
be defined as a state change. Some debugging revealed that userInfo for the
notification contains a MPMusicPlayerControllerPlaybackStateKey item which is 0
on the first call and 1 on the second.
Assuming (at least somewhat reasonably) that the userInfo code should match the
advertised state and checking the associated enum, it seems as if the first
call should have reported 'Stopped' rather than 'Playing'.
Anyone have any better information on this? If there's documentation on when
and why notifications are sent (and the expected state transitions) beyond the
implications in their names, I haven't been able to find it.
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]