From: Kent Sutherland Date: Wed, 26 Nov 2003 14:02:37 +0000 (+0000) Subject: It's just around the world la la la la la!!!!!! X-Git-Tag: v1.2~24 X-Git-Url: http://git.ithinksw.org/MenuTunes.git/commitdiff_plain/c5e27c027b47fbe861953d0c9334c5780a7cf69b It's just around the world la la la la la!!!!!! Changed iTunesRemote -playlists back to how it used to be. Changed MenuController -rebuildPlaylists to show the current source if it's not a playlist Made ShowPlayer hotkey work if the player isn't open, as feature requested. --- diff --git a/English.lproj/Localizable.strings b/English.lproj/Localizable.strings index b501a3f..c8ac213 100755 --- a/English.lproj/Localizable.strings +++ b/English.lproj/Localizable.strings @@ -32,4 +32,9 @@ register = "Register MenuTunes..."; validated_title = "Registration Successful"; validated_msg = "Your license key has been validated and stored. Thank you for your support."; failed_title = "Registration Failed"; -failed_msg = "Your license key could not be validated. Be sure that the name you entered matches the license key."; \ No newline at end of file +failed_msg = "Your license key could not be validated. Be sure that the name you entered matches the license key."; +radio = "Radio"; +genericDevice = "Generic Device"; +iPod = "iPod"; +cd = "CD"; +sharedLibrary = "Shared Library"; \ No newline at end of file diff --git a/English.lproj/Preferences.nib/info.nib b/English.lproj/Preferences.nib/info.nib index 33cecb8..7c74c67 100755 --- a/English.lproj/Preferences.nib/info.nib +++ b/English.lproj/Preferences.nib/info.nib @@ -3,7 +3,7 @@ IBDocumentLocation - 39 237 356 240 0 0 1056 770 + 44 226 356 240 0 0 1152 746 IBEditorPositions 634 @@ -19,8 +19,8 @@ IBOpenObjects - 6 793 + 6 IBSystem Version 7C107 diff --git a/English.lproj/Preferences.nib/keyedobjects.nib b/English.lproj/Preferences.nib/keyedobjects.nib index ca7a082..f24b487 100755 Binary files a/English.lproj/Preferences.nib/keyedobjects.nib and b/English.lproj/Preferences.nib/keyedobjects.nib differ diff --git a/MainController.m b/MainController.m index 5b85436..065659a 100755 --- a/MainController.m +++ b/MainController.m @@ -1070,6 +1070,17 @@ static MainController *sharedController; refreshTimer = nil; [self clearHotKeys]; playerRunningState = ITMTRemotePlayerNotRunning; + + if ([df objectForKey:@"ShowPlayer"] != nil) { + ITHotKey *hotKey; + ITDebugLog(@"Setting up show player hot key."); + hotKey = [[ITHotKey alloc] init]; + [hotKey setName:@"ShowPlayer"]; + [hotKey setKeyCombo:[ITKeyCombo keyComboWithPlistRepresentation:[df objectForKey:@"ShowPlayer"]]]; + [hotKey setTarget:self]; + [hotKey setAction:@selector(showPlayer)]; + [[ITHotKeyCenter sharedCenter] registerHotKey:[hotKey autorelease]]; + } } NS_HANDLER [self networkError:localException]; diff --git a/MenuController.m b/MenuController.m index 088d337..f360033 100755 --- a/MenuController.m +++ b/MenuController.m @@ -532,6 +532,7 @@ NSMenu *playlistsMenu = [[NSMenu alloc] initWithTitle:@""]; NSArray *playlists; NSMenuItem *tempItem; + ITMTRemotePlayerSource source = [[[MainController sharedController] currentRemote] currentSource]; int i; NS_DURING @@ -550,7 +551,17 @@ [tempItem setTarget:self]; } - if (!_playingRadio && _currentPlaylist) { + if (source == ITMTRemoteRadioSource) { + [[playlistsMenu addItemWithTitle:NSLocalizedString(@"radio", @"Radio") action:NULL keyEquivalent:@""] setState:NSOnState]; + } else if (source == ITMTRemoteGenericDeviceSource) { + [[playlistsMenu addItemWithTitle:NSLocalizedString(@"genericDevice", @"Generic Device") action:NULL keyEquivalent:@""] setState:NSOnState]; + } else if (source == ITMTRemoteiPodSource) { + [[playlistsMenu addItemWithTitle:NSLocalizedString(@"iPod", @"iPod") action:NULL keyEquivalent:@""] setState:NSOnState]; + } else if (source == ITMTRemoteCDSource) { + [[playlistsMenu addItemWithTitle:NSLocalizedString(@"cd", @"CD") action:NULL keyEquivalent:@""] setState:NSOnState]; + } else if (source == ITMTRemoteSharedLibrarySource) { + [[playlistsMenu addItemWithTitle:NSLocalizedString(@"sharedLibrary", @"Shared Library") action:NULL keyEquivalent:@""] setState:NSOnState]; + } else if (source == ITMTRemoteLibrarySource && _currentPlaylist) { [[playlistsMenu itemAtIndex:_currentPlaylist - 1] setState:NSOnState]; } ITDebugLog(@"Done Building \"Playlists\" menu"); diff --git a/iTunesRemote.m b/iTunesRemote.m index 9ac0c15..68890d3 100755 --- a/iTunesRemote.m +++ b/iTunesRemote.m @@ -125,21 +125,32 @@ - (NSArray *)playlists { - unsigned long i,k; - const signed long numSources = [[ITAppleEventCenter sharedCenter] sendAEWithSendStringForNumber:@"kocl:type('cSrc'), '----':()" eventClass:@"core" eventID:@"cnte" appPSN:savedPSN]; - NSMutableArray *playlists = [[NSMutableArray alloc] initWithCapacity:1]; + long i = 0; + const signed long numPlaylists = [[ITAppleEventCenter sharedCenter] sendAEWithSendStringForNumber:@"kocl:type('cPly'), '----':()" eventClass:@"core" eventID:@"cnte" appPSN:savedPSN]; + NSMutableArray *playlists = [[NSMutableArray alloc] initWithCapacity:numPlaylists]; - ITDebugLog(@"Getting playlists."); - for (k = 1; k <= numSources ; k++) { - const signed long numPlaylists = [[ITAppleEventCenter sharedCenter] sendAEWithSendStringForNumber:[NSString stringWithFormat:@"kocl:type('cPly'), '----':obj { form:'indx', want:type('cSrc'), seld:long(%u), from:() }",k] eventClass:@"core" eventID:@"cnte" appPSN:savedPSN]; for (i = 1; i <= numPlaylists; i++) { - NSString *sendStr = [NSString stringWithFormat:@"'----':obj { form:'prop', want:type('prop'), seld:type('pnam'), from:obj { form:'indx', want:type('cPly'), seld:long(%u), from:obj { form:'indx', want:type('cSrc'), seld:long(%u), from:() } } }",i,k]; + const long j = i; + NSString *sendStr = [NSString stringWithFormat:@"'----':obj { form:'prop', want:type('prop'), seld:type('pnam'), from:obj { form:'indx', want:type('cPly'), seld:long(%lu), from:'null'() } }",(unsigned long)j]; NSString *theObj = [[ITAppleEventCenter sharedCenter] sendAEWithSendString:sendStr eventClass:@"core" eventID:@"getd" appPSN:savedPSN]; [playlists addObject:theObj]; } + return [playlists autorelease]; + /*unsigned long i,k; + const signed long numSources = [[ITAppleEventCenter sharedCenter] sendAEWithSendStringForNumber:@"kocl:type('cSrc'), '----':()" eventClass:@"core" eventID:@"cnte" appPSN:savedPSN]; + NSMutableArray *playlists = [[NSMutableArray alloc] initWithCapacity:1]; + + ITDebugLog(@"Getting playlists."); + for (k = 1; k <= numSources ; k++) { + const signed long numPlaylists = [[ITAppleEventCenter sharedCenter] sendAEWithSendStringForNumber:[NSString stringWithFormat:@"kocl:type('cPly'), '----':obj { form:'indx', want:type('cSrc'), seld:long(%u), from:() }",k] eventClass:@"core" eventID:@"cnte" appPSN:savedPSN]; + for (i = 1; i <= numPlaylists; i++) { + NSString *sendStr = [NSString stringWithFormat:@"'----':obj { form:'prop', want:type('prop'), seld:type('pnam'), from:obj { form:'indx', want:type('cPly'), seld:long(%u), from:obj { form:'indx', want:type('cSrc'), seld:long(%u), from:() } } }",i,k]; + NSString *theObj = [[ITAppleEventCenter sharedCenter] sendAEWithSendString:sendStr eventClass:@"core" eventID:@"getd" appPSN:savedPSN]; + [playlists addObject:theObj]; + } } ITDebugLog(@"Finished getting playlists."); - return [playlists autorelease]; + return [playlists autorelease];*/ } - (int)numberOfSongsInPlaylistAtIndex:(int)index @@ -176,12 +187,12 @@ ITDebugLog(@"Getting current source done. Source: CD."); return ITMTRemoteCDSource; break; - case 'kUnk': - case 'kLib': case 'kShd': ITDebugLog(@"Getting current source done. Source: Shared Library."); return ITMTRemoteSharedLibrarySource; break; + case 'kUnk': + case 'kLib': default: ITDebugLog(@"Getting current source done. Source: Library."); return ITMTRemoteLibrarySource; diff --git a/libValidate.a b/libValidate.a index 600c085..ca66985 100755 Binary files a/libValidate.a and b/libValidate.a differ