1 /* Copyright (c) 2002 - 2003 by iThink Software. All Rights Reserved. */
3 #import "iTunesPlayer.h"
5 @implementation iTunesPlayer
7 static iTunesPlayer *_sharediTunesPlayer = nil;
9 + (id)sharedPlayerForRemote:(iTunesRemote *)remote {
10 if ( _sharediTunesPlayer ) {
12 return _sharediTunesPlayer;
15 return _sharediTunesPlayer = [[iTunesPlayer alloc] init];
27 - (BOOL)setValue:(id)value forProperty:(ITMTGenericProperty)property {
31 - (id)valueOfProperty:(ITMTGenericProperty)property {
32 if ( ( property == ITMTNameProperty ) {
34 } else if ( ( property == ITMTImageProperty ) {
41 - (NSDictionary *)propertiesAndValues {
42 return [NSDictionary dictionaryWithObjectsAndKeys:@"iTunes",@"ITMTNameProperty",nil,@"ITMTImageProperty"];
45 - (ITMTRemote *)remote {
49 - (ITMTPlaylist *)currentPlaylist {
51 if ( ( tIndex = [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pidx" fromObjectByKey:@"pPla" eventClass:@"core" eventID:@"getd" appPSN:savedPSN] ) ) {
52 return [iTunesPlaylist playlistWithIndex:tIndex];
58 - (ITMTTrack *)currentTrack {
60 if ( ( tDindex = [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pDID" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:savedPSN] ) ) {
61 return [iTunesTrack trackWithDatabaseIndex:tDIndex];
67 - (ITMTEqualizer *)currentEqualizer {
68 // return dynamically from an AE
71 - (NSArray *)playlists {
72 // return dynamically from an AE
76 // return dynamically from an AE
79 - (ITMTPlaylist *)libraryPlaylist {
80 // return dynamically from an AE
83 - (NSArray *)equalizers {
84 // return dynamically from an AE