• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
MPMusicPlayerController playbackState
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MPMusicPlayerController playbackState


  • Subject: MPMusicPlayerController playbackState
  • From: Phillip Mills <email@hidden>
  • Date: Wed, 20 Apr 2011 08:29:08 -0400

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@hidden)

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:

This email sent to email@hidden

  • Prev by Date: NSScroller: Hiding the knob
  • Next by Date: Re: NSScroller: Hiding the knob
  • Previous by thread: Re: NSScroller: Hiding the knob
  • Next by thread: Re: MPMusicPlayerController playbackState
  • Index(es):
    • Date
    • Thread