سؤال

I searched all over the web and this site to understand how to get the artwork of the current iTunes track. any suggestion? thanks

هل كانت مفيدة؟

المحلول

You can generate iTunes.h using the following command:

sdef /Applications/iTunes.app | sdp -fh --basename iTunes

You can then use iTunes to get the current playing track:

#import "iTunes.h"

iTunesApplication *app = [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"];
iTunesTrack *currentTrack = app.currentTrack;

Then get the album artwork for the current track:

SBElementArray *artworks = [currentTrack artworks];
iTunesArtwork *artwork = artworks[0];
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top