2

I'm developing a Mac App and I need to check if Itunes (11.0) is shuffling my music so, to check that, I'm using iTunes.h and the following code:

if([iTunes.currentPlaylist shuffle]){
    NSLog(@"yes");
}else{
    NSLog(@"no");
}

Even though I have my iTunes shuffling, it always outputs "no".
Any ideas why is this happening or am I checking it the wrong way?

4

3 回答 3

3

This I know: in iTunes 11 some things changed. One of them is that the "shuffle"-option is playlist-independent...

于 2013-01-08T20:09:12.687 回答
0

Good luck with that.

I reported a bug about a month ago, like tons of other developers.
Didn't hear anything, and probably won't.

Like DigiMonk wrote, it a change in iTunes 11, but they don't update their API.

于 2013-01-08T20:30:29.553 回答
0

A long way around for the time being might be to listen for NSDistributedNotifications and check whether the attributes for the currently playing track match the previous or next one. It's not the cleanest solution, but it should work if what's being shuffled is an album or artist. Just check whether the track numbers go in sequence, or if the artist name is the same, etc.

于 2013-01-08T23:58:45.663 回答