Tons of changes. Fixed the iPod problem finally. Added composer to
[MenuTunes.git] / iTunesRemote.m
index d11a29a..bf672e1 100755 (executable)
         unsigned long class;
         if (sourceName) {
             NSMutableArray *aSource = [[NSMutableArray alloc] init];
-            [aSource addObject:[[sourceName copy] autorelease]];
+            [aSource addObject:sourceName];
             switch (fourcc) {
                 case 'kTun':
                     class = ITMTRemoteRadioSource;
                 NSString *theObj = [[ITAppleEventCenter sharedCenter] sendAEWithSendString:sendStr eventClass:@"core" eventID:@"getd" appPSN:savedPSN];
                 ITDebugLog(@" - Adding playlist %@", theObj);
                 if (theObj) {
-                    [aSource addObject:[[theObj copy] autorelease]];
+                    [aSource addObject:theObj];
                 }
             }
             [allSources addObject:[aSource autorelease]];
     return ( ([temp1 length]) ? temp1 : nil ) ;
 }
 
+- (NSString *)currentSongComposer
+{
+    NSString *temp1;
+    ITDebugLog(@"Getting current song artist.");
+    if ( [self currentPlaylistClass] != ITMTRemotePlayerRadioPlaylist ) {
+        temp1 = [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKey:@"pCmp" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:savedPSN];
+    } else {
+        temp1 = @"";
+    }
+    ITDebugLog(@"Getting current song artist done.");
+    return ( ([temp1 length]) ? temp1 : nil ) ;
+}
+
 - (NSString *)currentSongAlbum
 {
     NSString *temp1;