From 79af64807b6e0499ffce55b4a7e0a07ea2e6cc99 Mon Sep 17 00:00:00 2001 From: Kent Sutherland Date: Thu, 21 Oct 2004 23:28:57 +0000 Subject: [PATCH] Track window doesn't show up again if you have a really long drag in iTunes, or wake from sleep. --- MainController.m | 6 +++--- iTunesRemote.m | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/MainController.m b/MainController.m index 0c19559..93fb677 100755 --- a/MainController.m +++ b/MainController.m @@ -361,7 +361,8 @@ static MainController *sharedController; - (void)timerUpdate { - if ([[self currentRemote] playerStateUniqueIdentifier] == nil) { + NSString *identifier = [[self currentRemote] playerStateUniqueIdentifier]; + if (identifier == nil) { if ([statusItem isEnabled]) { [statusItem setToolTip:@"iTunes not responding."]; [[ITHotKeyCenter sharedCenter] setEnabled:NO]; @@ -403,8 +404,7 @@ static MainController *sharedController; if ( [df boolForKey:@"showSongInfoOnChange"] ) { [self performSelector:@selector(showCurrentTrackInfo) withObject:nil afterDelay:0.0]; } - - [self setLatestSongIdentifier:[[self currentRemote] playerStateUniqueIdentifier]]; + [self setLatestSongIdentifier:identifier]; //Create the tooltip for the status item if ( [df boolForKey:@"showToolTip"] ) { NSString *artist = [[self currentRemote] currentSongArtist]; diff --git a/iTunesRemote.m b/iTunesRemote.m index a5e45be..a741164 100755 --- a/iTunesRemote.m +++ b/iTunesRemote.m @@ -388,8 +388,10 @@ NSString *temp1; ITDebugLog(@"Getting current unique identifier."); NSAppleEventDescriptor *descriptor = ITSendAEWithString(@"'----':obj { form:'prop', want:type('prop'), seld:type('pcls'), from:obj { form:'prop', want:type('prop'), seld:type('pTrk'), from:'null'() } }", 'core', 'getd', &savedPSN); - if ((descriptor == nil) || ([descriptor int32Value] == 'prop')) { + if ([descriptor int32Value] == 'prop') { return @"0-0"; + } else if (descriptor == nil) { + return nil; } SInt32 cls = [descriptor int32Value]; if ( ([self currentPlaylistClass] == ITMTRemotePlayerRadioPlaylist) || (cls == 'cURT') ) { @@ -803,6 +805,7 @@ //Duplicate search results to playlist for (i = 1; i <= [searchResults numberOfItems]; i++) { + //NSLog(@"%@", ITSendAEWithStringAndParameter(@"'----':obj { form:'prop', want:type('prop'), seld:prop('pnam'), from:aevt(@) }", *[[searchResults descriptorAtIndex:i] aeDesc], 'core', 'getd', &savedPSN)); ITSendAEWithStringAndObject(@"insh:obj { form:'name', want:type('cPly'), seld:\"MenuTunes\", from:'null'() }", [[searchResults descriptorAtIndex:i] aeDesc], 'core', 'clon', &savedPSN); } //Reset fixed indexing -- 2.20.1