time remaining works now.
authorKent Sutherland <ksuther@ithinksw.com>
Fri, 7 Feb 2003 10:43:20 +0000 (10:43 +0000)
committerKent Sutherland <ksuther@ithinksw.com>
Fri, 7 Feb 2003 10:43:20 +0000 (10:43 +0000)
iTunesRemote.m

index 8886102..83045cc 100755 (executable)
 
 - (NSString *)currentSongRemaining
 {
-    NSString* duration = [[ITAppleEventCenter sharedCenter]
-                        sendTwoTierAEWithRequestedKey:@"pDur"
+    long duration = [[ITAppleEventCenter sharedCenter]
+                        sendTwoTierAEWithRequestedKeyForNumber:@"pDur"
                         fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd"
                         appPSN:[self iTunesPSN]];
-    NSString* current = [[ITAppleEventCenter sharedCenter]
-                        sendAEWithRequestedKey:@"pPos"
+    long current = [[ITAppleEventCenter sharedCenter]
+                        sendAEWithRequestedKeyForNumber:@"pPos"
                         eventClass:@"core" eventID:@"getd"
                         appPSN:[self iTunesPSN]];
-    NSLog(@"%@ %@", duration, current);
-    //return [[NSNumber numberWithInt:duration - current] stringValue];
-    return nil;
+    
+    return [[NSNumber numberWithLong:duration - current] stringValue];
 }
 
 - (NSArray *)eqPresets;
 {
     [[ITAppleEventCenter sharedCenter] sendAEWithEventClass:@"hook" eventID:@"Next"
             appPSN:[self iTunesPSN]];
+    
     return YES;
 }