I know you can use [iTunesDNC addObserver:self selector:@selector(updateInfo:) name:@"com.apple.iTunes.playerInfo" object:nil];
to get a notification every time the player changes song/stops/plays/etc. But what I need is a notification every time information is changed on iTunes (ex. song title changed, lyrics changed, artist, etc)
Any suggestions? Im pretty sure I just need to change com.apple.iTunes.playerInfo to something else that is not playerInfo.
I know it should be posible, because there is an app called SongGenie that will change its info if you edit a song's ID3 tags on iTunes or add lyrics.
Thank you!
Yes, there is a way. Every time song info is changed iTunes posts a "com.apple.iTunes.sourceSaved" notification whose userInfo dictionary is the user's library.
You can check out this and other notifications that iTunes sends by listening to every notificaion posted to the Distributed Notification Center.
[[NSDistributedNotificationCenter defaultCenter] addObserver:self
selector:@selector(allDistributedNotifications:)
name:nil
object:nil];
- (void) allDistributedNotifications:(NSNotification *)note
{
NSString *object = [note object];
NSString *name = [note name];
NSDictionary *userInfo = [note userInfo];
NSLog(@"<%p>%s: object: %@ name: %@ userInfo: %@", self, __PRETTY_FUNCTION__, object, name, userInfo);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With