From 77fcca750711207d8a493d227f61bf6b6fc5ecc1 Mon Sep 17 00:00:00 2001 From: Kent Sutherland Date: Fri, 2 Jul 2004 03:41:30 +0000 Subject: [PATCH] Stream track title change will trigger the status window. Play count won't show up in radio stream status windows. --- MainController.h | 2 +- MainController.m | 10 +++++++--- iTunesRemote.m | 7 ++++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/MainController.h b/MainController.h index f5c0834..e1ad2a4 100755 --- a/MainController.h +++ b/MainController.h @@ -43,7 +43,7 @@ MTBlingController *bling; NSTimer *registerTimer; - BOOL timerUpdating, _checkingForServer; + BOOL timerUpdating, _checkingForServer, _popped; BOOL blinged; NSLock *_serverCheckLock; } diff --git a/MainController.m b/MainController.m index 2517c39..7c60fb0 100755 --- a/MainController.m +++ b/MainController.m @@ -930,7 +930,7 @@ static MainController *sharedController; } } - if ( [df boolForKey:@"showPlayCount"] ) { + if ( [df boolForKey:@"showPlayCount"] && ![self radioIsPlaying] ) { NS_DURING playCount = [[self currentRemote] currentSongPlayCount]; NS_HANDLER @@ -991,8 +991,12 @@ static MainController *sharedController; - (void)popupMenu { - NSMenu *menu = [menuController menu]; - [(NSCarbonMenuImpl *)[menu _menuImpl] popUpMenu:menu atLocation:[NSEvent mouseLocation] width:1 forView:nil withSelectedItem:-30 withFont:[NSFont menuFontOfSize:32]]; + if (!_popped) { + NSMenu *menu = [menuController menu]; + _popped = YES; + [(NSCarbonMenuImpl *)[menu _menuImpl] popUpMenu:menu atLocation:[NSEvent mouseLocation] width:1 forView:nil withSelectedItem:-30 withFont:[NSFont menuFontOfSize:32]]; + _popped = NO; + } } - (void)incrementVolume diff --git a/iTunesRemote.m b/iTunesRemote.m index 8bc60c0..41afb6d 100755 --- a/iTunesRemote.m +++ b/iTunesRemote.m @@ -342,7 +342,12 @@ { NSString *temp1; ITDebugLog(@"Getting current unique identifier."); - temp1 = [NSString stringWithFormat:@"%i-%i", [self currentPlaylistIndex], [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pDID" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:savedPSN]]; + int cls = [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pcls" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:savedPSN]; + if ( ([self currentPlaylistClass] == ITMTRemotePlayerRadioPlaylist) || (cls == 'cURT') ) { + temp1 = [[ITAppleEventCenter sharedCenter] sendAEWithRequestedKey:@"pStT" eventClass:@"core" eventID:@"getd" appPSN:savedPSN]; + } else { + temp1 = [NSString stringWithFormat:@"%i-%i", [self currentPlaylistIndex], [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pDID" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:savedPSN]]; + } ITDebugLog(@"Getting current unique identifier done."); return ( ([temp1 length]) ? temp1 : nil ) ; } -- 2.20.1