From 4ced5045a98009a1dd13bfb883603b4aad50fb66 Mon Sep 17 00:00:00 2001 From: Kent Sutherland Date: Tue, 3 Feb 2004 03:04:23 +0000 Subject: [PATCH] currentSongTitle now returns the stream title of a streaming radio station if applicable. --- iTunesRemote.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/iTunesRemote.m b/iTunesRemote.m index 0a1335e..46a01f3 100755 --- a/iTunesRemote.m +++ b/iTunesRemote.m @@ -322,6 +322,9 @@ { int temp1; ITDebugLog(@"Getting current song index."); + + if ([self currentSource] == ITMTRemoteRadioSource) + temp1 = [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pidx" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:savedPSN]; ITDebugLog(@"Getting current song index done."); return temp1; @@ -331,7 +334,13 @@ { NSString *temp1; ITDebugLog(@"Getting current song title."); - temp1 = [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKey:@"pnam" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:savedPSN]; + + //If we're listening to the radio. + if ([[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pcls" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:savedPSN] == 'cURT') { + temp1 = [[[ITAppleEventCenter sharedCenter] sendAEWithRequestedKey:@"pStT" eventClass:@"core" eventID:@"getd" appPSN:savedPSN] stringByAppendingString:@" (Stream)"]; + } else { + temp1 = [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKey:@"pnam" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:savedPSN]; + } ITDebugLog(@"Getting current song title done."); return ( ([temp1 length]) ? temp1 : nil ) ; } -- 2.20.1