+- (float)volume
+{
+ long vol = [[ITAppleEventCenter sharedCenter] sendAEWithRequestedKeyForNumber:@"pVol" eventClass:@"core" eventID:@"getd" appPSN:[self iTunesPSN]];
+ return vol / 100;
+}
+
+- (BOOL)setVolume:(float)volume
+{
+ [[ITAppleEventCenter sharedCenter] sendAEWithSendString:[NSString stringWithFormat:@"data:long(%lu), '----':obj { form:'prop', want:type('prop'), seld:type('pVol'), from:'null'() }",(long)(volume*100)] eventClass:@"core" eventID:@"setd" appPSN:[self iTunesPSN]];
+ return NO;
+}
+
+- (BOOL)shuffleEnabled
+{
+ int result = [[ITAppleEventCenter sharedCenter]
+ sendTwoTierAEWithRequestedKeyForNumber:@"pShf" fromObjectByKey:@"pPla" eventClass:@"core" eventID:@"getd" appPSN:[self iTunesPSN]];
+ return result;
+}
+
+- (BOOL)setShuffleEnabled:(BOOL)enabled
+{
+ [[ITAppleEventCenter sharedCenter] sendAEWithSendString:[NSString stringWithFormat:@"data:long(%lu) ----:obj { form:'prop', want:type('prop'), seld:type('pShf'), from:obj { form:'prop', want:type('prop'), seld:type('pPla'), from:'null'() } }",enabled] eventClass:@"core" eventID:@"setd" appPSN:[self iTunesPSN]];
+ return YES;
+}
+
+- (ITMTRemotePlayerRepeatMode)repeatMode
+{
+ FourCharCode m00f = 0;
+ int result = 0;
+ m00f = [[ITAppleEventCenter sharedCenter]
+ sendTwoTierAEWithRequestedKeyForNumber:@"pRpt" fromObjectByKey:@"pPla" eventClass:@"core" eventID:@"getd" appPSN:[self iTunesPSN]];
+
+ switch (m00f)
+ {
+ case 'kRp0':
+ result = ITMTRemotePlayerRepeatOff;
+ break;
+ case 'kRp1':
+ result = ITMTRemotePlayerRepeatOne;
+ break;
+ case 'kRpA':
+ result = ITMTRemotePlayerRepeatAll;
+ break;
+ }
+
+ return result;
+}
+
+- (BOOL)setRepeatMode:(ITMTRemotePlayerRepeatMode)repeatMode
+{
+ FourCharCode m00f = 0;
+ switch (repeatMode)
+ {
+ case ITMTRemotePlayerRepeatOff:
+ m00f = 'kRp0';
+ break;
+ case ITMTRemotePlayerRepeatOne:
+ m00f = 'kRp1';
+ break;
+ case ITMTRemotePlayerRepeatAll:
+ m00f = 'kRpA';
+ break;
+ }
+
+ [[ITAppleEventCenter sharedCenter] sendAEWithSendString:[NSString stringWithFormat:@"data:long(%lu) ----:obj { form:'prop', want:type('pRpt'), seld:type('pShf'), from:obj { form:'prop', want:type('prop'), seld:type('pPla'), from:'null'() } }",m00f] eventClass:@"core" eventID:@"setd" appPSN:[self iTunesPSN]];
+ return YES;
+}
+