It's just around the world la la la la la!!!!!!
authorKent Sutherland <ksuther@ithinksw.com>
Wed, 26 Nov 2003 14:02:37 +0000 (14:02 +0000)
committerKent Sutherland <ksuther@ithinksw.com>
Wed, 26 Nov 2003 14:02:37 +0000 (14:02 +0000)
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.

English.lproj/Localizable.strings
English.lproj/Preferences.nib/info.nib
English.lproj/Preferences.nib/keyedobjects.nib
MainController.m
MenuController.m
iTunesRemote.m
libValidate.a

index b501a3f..c8ac213 100755 (executable)
@@ -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
index 33cecb8..7c74c67 100755 (executable)
@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
        <key>IBDocumentLocation</key>
-       <string>39 237 356 240 0 0 1056 770 </string>
+       <string>44 226 356 240 0 0 1152 746 </string>
        <key>IBEditorPositions</key>
        <dict>
                <key>634</key>
@@ -19,8 +19,8 @@
        </array>
        <key>IBOpenObjects</key>
        <array>
-               <integer>6</integer>
                <integer>793</integer>
+               <integer>6</integer>
        </array>
        <key>IBSystem Version</key>
        <string>7C107</string>
index ca7a082..f24b487 100755 (executable)
Binary files a/English.lproj/Preferences.nib/keyedobjects.nib and b/English.lproj/Preferences.nib/keyedobjects.nib differ
index 5b85436..065659a 100755 (executable)
@@ -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];
index 088d337..f360033 100755 (executable)
     NSMenu *playlistsMenu = [[NSMenu alloc] initWithTitle:@""];
     NSArray *playlists;
     NSMenuItem *tempItem;
+    ITMTRemotePlayerSource source = [[[MainController sharedController] currentRemote] currentSource];
     int i;
     
     NS_DURING
         [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");
index 9ac0c15..68890d3 100755 (executable)
 
 - (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
             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;
index 600c085..ca66985 100755 (executable)
Binary files a/libValidate.a and b/libValidate.a differ