Fixed the F13 key equivalent. Was showing up as F3
[MenuTunes.git] / iTunesRemote.m
index d501091..a312eba 100755 (executable)
 
 - (NSString *)currentSongLength
 {
 
 - (NSString *)currentSongLength
 {
-    NSString *temp1;
+    int temp1;
+    NSString *temp2;
     ITDebugLog(@"Getting current song length.");
     ITDebugLog(@"Getting current song length.");
-    temp1 = [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKey:@"pTim" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:savedPSN];
-    if ( [self currentPlaylistClass] == ITMTRemotePlayerRadioPlaylist ) { temp1 = nil; }
+    temp1 = [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pcls" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:savedPSN];
+    temp2 = [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKey:@"pTim" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:savedPSN];
+    if ( ([self currentPlaylistClass] == ITMTRemotePlayerRadioPlaylist) || (temp1 == 'cURT') ) { temp2 = @"Continuous"; }
     ITDebugLog(@"Getting current song length done.");
     ITDebugLog(@"Getting current song length done.");
-    return temp1;
+    return temp2;
 }
 
 - (NSString *)currentSongRemaining
 }
 
 - (NSString *)currentSongRemaining
                         sendAEWithRequestedKeyForNumber:@"pPos" eventClass:@"core" eventID:@"getd" appPSN:savedPSN];
                         
     finalString = [self formatTimeInSeconds:final];
                         sendAEWithRequestedKeyForNumber:@"pPos" eventClass:@"core" eventID:@"getd" appPSN:savedPSN];
                         
     finalString = [self formatTimeInSeconds:final];
-    if ( [self currentPlaylistClass] == ITMTRemotePlayerRadioPlaylist ) { finalString = nil; }
     ITDebugLog(@"Getting current song elapsed time done.");
     return finalString;
 }
     ITDebugLog(@"Getting current song elapsed time done.");
     return finalString;
 }