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 a comment
michael dubuisson says
16
as a blind person, I am having trouble registering into your website.
- 5 months, 2 weeks ago (20/08/2011)
Headbonk says
15
I discovered while trying to use this library that it was pretty much made obsolete by the Apple Scripting Bridge http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ScriptingBridgeConcepts/UsingScriptingBridge/UsingScriptingBridge.html
Apple Scripting Bridge does a similar thing to what EyeTunes was doing - hooking into the scripting system at the lower Apple Event level - but in a more general and automatic method that works with all scriptable apps.
If you are interested in what EyeTunes delivers I suggest that you also investigate Apple Scripting Bridge.
Apple Scripting Bridge does a similar thing to what EyeTunes was doing - hooking into the scripting system at the lower Apple Event level - but in a more general and automatic method that works with all scriptable apps.
If you are interested in what EyeTunes delivers I suggest that you also investigate Apple Scripting Bridge.
- 10 months, 3 weeks ago (18/03/2011)
euefuf says
14
Hi.
May I add track into library (and playlists) with EyeTunes framework?
May I add track into library (and playlists) with EyeTunes framework?
- 1 year, 8 months ago (04/06/2010)
morgan says
13
can we download music from here to our phone
- 3 years, 4 months ago (18/09/2008)
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.
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.
- 3 years, 6 months 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?
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?
- 3 years, 6 months ago (02/08/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
You can download it here.
www.macupdate.com/info.php/id/27612/itunesmenu
- 3 years, 8 months 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.
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.
- 3 years, 8 months 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)
- (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)
- 3 years, 8 months 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!
- 3 years, 10 months 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.
You can delete this comment after having fixed it.
- 3 years, 10 months 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
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
- 4 years, 5 months 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
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
- 4 years, 5 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
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
- 4 years, 5 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'
EyeTunes class
-(int) position;
- (int) position
{
return [self getPropertyAsIntegerForDesc:ET_APP_PLAYER_POSITION];
}
EventCode
#define ET_APP_PLAYER_POSITION 'pPos'
- 5 years, 2 months ago (02/12/2006)

Atom Feed for the Blog Entries