- for (i = 0; i < numPresets; i++) {
- NSString *theObj = [[ITAppleEventCenter sharedCenter] sendAEWithSendString:[NSString stringWithFormat:@"'----':obj { form:'prop', want:type('prop'), seld:type('pnam'), from:obj { form:'indx', want:type('cEQP'), seld:%d, from:'null'() } }",i] eventClass:@"core" eventID:@"getd" appPSN:[self iTunesPSN]];
- [presets addObject:theObj];
- }
- return [presets autorelease];
+- (BOOL)setCurrentSongRating:(float)rating
+{
+ [[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;
+}
+
+- (BOOL)setEqualizerEnabled:(BOOL)enabled
+{
+ return NO;
+}
+
+- (NSArray *)eqPresets
+{
+ int i;
+ long numPresets = [[ITAppleEventCenter sharedCenter] sendAEWithSendStringForNumber:@"kocl:type('cEQP'), '----':(), &subj:()" eventClass:@"core" eventID:@"cnte" appPSN:iTunesPSN];
+ NSMutableArray *presets = [[NSMutableArray alloc] initWithCapacity:numPresets];
+
+ for (i = 1; i <= numPresets; i++) {
+ NSString *theObj = [[ITAppleEventCenter sharedCenter] sendAEWithSendString:[NSString stringWithFormat:@"'----':obj { form:'prop', want:type('prop'), seld:type('pnam'), from:obj { form:'indx', want:type('cEQP'), seld:long(%lu), from:'null'() } }",i] eventClass:@"core" eventID:@"getd" appPSN:iTunesPSN];
+ if (theObj) {
+ [presets addObject:theObj];
+ }
+ }
+ return [presets autorelease];