reveal search box

EyeTunes framework

EyeTunes.framework is a Cocoa Framework that abstracts away all the ugly Carbon Apple Events magic and allows you to directly control iTunes from any Cocoa Application.

Features

  • Get all references to iTunes playlists, tracks and album art.
  • Set any writable fields that iTunes exposes such as Track name, artwork and much more.
  • Control iTunes and select playlists and tracks by using either track filenames or database ids.
  • Search the iTunes library just like the search box does.
  • Extract persistent ID and fetch tracks using such ids.

Example

To grab an NSImage from the current playing track (say you're implementing some new album art viewier), you can use this simple snippet:

#import <EyeTunes/EyeTunes.h>

- (NSImage *) getArtworkOfPlayingSong {
    EyeTunes *eyetunes = [EyeTunes sharedInstance];
    ETTrack *currentTrack = [eyetunes currentTrack];
    if (!currentTrack)
       return nil;

    return [[currentTrack artwork] objectAtIndex:0];
 }

Project Page

For instructions on how to use it, please go to the EyeTunes project page

Contact

For bug reports, please file them at the EyeTunes project page. Contact alastair@liquidx.net for anything else.

add commentAdd a comment
Alastair Tse says
12
Frederik,

I've just committed a fix that was contributed by Simon Haertel to the code. You can see the diff here:

http://code.google.com/p/eyetunes/source/detail?r=260

I've moved the repository to google code at the same time today too, but I'll make sure this patch goes into the svn.liquidx.net repository too.
  • 5 days, 19 hours ago (03/08/2008)
Frederik says
11
Looks like iTunes 7.7.1 broke some things with getting infos on tracks by persistent ID:
When I get a song with [ETPlaylist trackWithPersistentIdString:] and then do [song name] or similar, I get a errAEDescNotFound when getting AESizeOfParam() on the replyEvent in getPropertyAsStringForDesc.

Any idea on what might cause this and how to fix?
  • 5 days, 23 hours ago (02/08/2008)
Ariel says
10
thanks mr. gecko! your comment really helped me!
  • 2 months ago (04/06/2008)
Mr. Gecko says
9
I just came out with my app it is called iTunesMenu and it uses EyeTunes to control itunes/receive info from itunes.
You can download it here.
www.macupdate.com/info.php/id/27612/itunesmenu
  • 2 months, 1 week ago (30/05/2008)
Mr. Gecko says
8
Oh yeah! One last thing.
Add this to EyeTunesEventCodes.h
#define ET_APP_PLAYER_VOLUME 'pVol'
(I added This into // --- itunes application parameters start --- but it does not matter)

And that is it.

Hope you enjoy it.
  • 2 months, 2 weeks ago (24/05/2008)
Mr. Gecko says
7
If you want to change the volume just add this to ETEyeTunes.h
- (int)playerVolume;
- (void)setPlayerVolume:(int)volume;
(I added it in // state info sessions but it does not matter)
and add this to ETEyeTunes.m
- (int)playerVolume {
return (int)[self getPropertyAsIntegerForDesc:ET_APP_PLAYER_VOLUME];
}

- (void)setPlayerVolume:(int)volume {
[self setPropertyWithInteger:volume forDesc:ET_APP_PLAYER_VOLUME];
}
(I added this to #pragma mark iTunes Properties but it does not matter)
and you are able to get the volume from itunes with playerVolume and set the volume with setPlayerVolume:(0-100)
  • 2 months, 2 weeks ago (23/05/2008)
Alastair Tse says
6
It should be back up now -- but that should spur me on to start moving all this to googlecode so I don't have to worry about it!
  • 4 months, 2 weeks ago (22/03/2008)
Mime says
5
Hello, http://www.liquidx.net/mac is actually down for days.

You can delete this comment after having fixed it.
  • 4 months, 2 weeks ago (21/03/2008)
Manni says
4
Hi!

This framework works really great! Thank you very much for it!

I've already built a small application which can control iTunes.
But it is missing a volime slider.
I haven't found a way to control the volume of iTunes with the eyeTunes framework.
Can anybody help me how to do this?

Thanks
  • 11 months, 3 weeks ago (20/08/2007)
David says
3
I have had very inconsistant success when using with ETTrack persistentId, and persistentIdAsString. These methods only worked on one out of four computers I tested on. I have no idea why.

I have never been able to get -(ETTrack *)trackWithPersistentId:(long long int)persistentId; or - (ETTrack *)trackWithPersistentIdString:(NSString *)persistentId; to work.

If anyone has any ideas on this, that would be great.

Thanks
  • 12 months ago (14/08/2007)
Vincent says
2
Hello,(sry for my english)

I have a problem with this library. A thread check all the seconds if a track has been changed or if a song has been delete/added. But when I close iTunes when the thread is running and I restart iTunes. The thread is blocked at a line like
ETPlaylist * libraryPlaylist = [eyeTunes libraryPlaylist];
approximately 5 minutes later, the thread can run again.

Someone have a solution?

Thx
  • 12 months ago (13/08/2007)
Luke Sheridan says
1
I couldn't find where you had implemented getting the current player position so I added it

EyeTunes class
-(int) position;
- (int) position
{
return [self getPropertyAsIntegerForDesc:ET_APP_PLAYER_POSITION];
}

EventCode

#define ET_APP_PLAYER_POSITION 'pPos'
  • 1 year, 8 months ago (02/12/2006)
Older comments may be hidden from this page ..