nil];
}
+- (BOOL)showPrimaryInterface
+{
+ return NO;
+}
+
- (ITMTRemotePlayerRunningState)playerRunningState
{
NSArray *apps = [[NSWorkspace sharedWorkspace] launchedApplications];
return [[ITAppleEventCenter sharedCenter] sendAEWithSendStringForNumber:[NSString stringWithFormat:@"kocl:type('cTrk'), '----':obj { form:'indx', want:type('cPly'), seld:long(%lu), from:'null'() }",index] eventClass:@"core" eventID:@"cnte" appPSN:iTunesPSN];
}
-- (NSString *)classOfPlaylistAtIndex:(int)index
+- (ITMTRemotePlayerPlaylistClass)classOfPlaylistAtIndex:(int)index
{
int realResult = [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pcls" fromObjectByKey:@"pPla" eventClass:@"core" eventID:@"getd" appPSN:iTunesPSN];
+
switch (realResult)
{
+ case 'cLiP':
+ return ITMTRemotePlayerLibraryPlaylist;
+ break;
case 'cRTP':
- return @"radio tuner playlist";
+ return ITMTRemotePlayerRadioPlaylist;
break;
default:
- return @"playlist";
+ return ITMTRemotePlayerPlaylist;
}
}
- (int)currentPlaylistIndex
{
- int result;
- result = [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pidx" fromObjectByKey:@"pPla" eventClass:@"core" eventID:@"getd" appPSN:iTunesPSN];
- return result;
+ return [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pidx" fromObjectByKey:@"pPla" eventClass:@"core" eventID:@"getd" appPSN:iTunesPSN];
}
- (NSString *)songTitleAtIndex:(int)index
- (int)currentSongIndex
{
- int result;
- result = [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pidx" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:iTunesPSN];
- return result;
+ return [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pidx" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:iTunesPSN];
}
- (NSString *)currentSongTitle
- (float)currentSongRating
{
- int realResult = [[ITAppleEventCenter sharedCenter]
- sendTwoTierAEWithRequestedKeyForNumber:@"pRte" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:iTunesPSN];
-
- return realResult / 100;
+ return [[ITAppleEventCenter sharedCenter]
+ sendTwoTierAEWithRequestedKeyForNumber:@"pRte" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:iTunesPSN] / 100;
}
- (BOOL)setCurrentSongRating:(float)rating
{
- [[ITAppleEventCenter sharedCenter] sendAEWithSendString:[NSString stringWithFormat:@"data:long(%lu), ----:obj { form:'prop', want:type('prop'), seld:type('pRte'), from:obj { form:'indx', want:type('cTrk'), seld:long(%lu), from:obj { form:'indx', want:type('cPly'), seld:long(%lu), from:'null'() } } }",(long)rating*100,[self currentSongIndex],[self currentPlaylistIndex]] eventClass:@"core" eventID:@"setd" appPSN:iTunesPSN];
+ [[ITAppleEventCenter sharedCenter] sendAEWithSendString:[NSString stringWithFormat:@"data:long(%lu) ----:obj { form:'prop', want:type('prop'), seld:type('pRte'), from:obj { form:'prop', want:type('prop'), seld:type('pTrk'), from:'null'() } }",(long)rating*100] eventClass:@"core" eventID:@"setd" appPSN:iTunesPSN];
return YES;
}
- (BOOL)equalizerEnabled
{
- return NO;
+ return [[ITAppleEventCenter sharedCenter]
+ sendAEWithRequestedKeyForNumber:@"pEQ " eventClass:@"core" eventID:@"getd" appPSN:iTunesPSN];
}
- (BOOL)setEqualizerEnabled:(BOOL)enabled
{
- return NO;
+[[ITAppleEventCenter sharedCenter] sendAEWithSendString:[NSString stringWithFormat:@"data:long(%lu) ----:obj { form:'prop', want:type('prop'), seld:type('pEQ '), from:obj { form:'prop', want:type('prop'), seld:type('pPla'), from:'null'() } }",enabled] eventClass:@"core" eventID:@"setd" appPSN:iTunesPSN];
}
- (NSArray *)eqPresets