W00t Teh Unicode Stars :D
[MenuTunes.git] / MenuTunes.m
index eea31d2..626ad44 100755 (executable)
                     action:nil
                     keyEquivalent:@""];
         } else if ([item isEqualToString:@"Song Rating"]) {
+            unichar fullstar = 0x2605;
+            unichar emptystar = 0x2606;
+            NSString *fullStarChar = [NSString stringWithCharacters:&fullstar length:1];
+            NSString *emptyStarChar = [NSString stringWithCharacters:&emptystar length:1];
             NSMenuItem *item;
             int i;
-            NSString *curTitle = @".....";
+            NSString *curTitle = [NSString stringWithFormat:@"%@%@%@%@%@", emptyStarChar, emptyStarChar, emptyStarChar, emptyStarChar, emptyStarChar];
             
             songRatingMenuItem = [menu addItemWithTitle:@"Song Rating"
                     action:nil
             
             ratingMenu = [[NSMenu alloc] initWithTitle:@""];
             
-            item = [ratingMenu addItemWithTitle:@"....."
+            item = [ratingMenu addItemWithTitle:[NSString stringWithFormat:@"%@%@%@%@%@", emptyStarChar, emptyStarChar, emptyStarChar, emptyStarChar, emptyStarChar]
                             action:@selector(setSongRating:)
                             keyEquivalent:@""];
             [item setTarget:self];
             
             for (i = 1; i < 6; i++) {
                 curTitle = [curTitle substringToIndex:4];
-                curTitle = [@"x" stringByAppendingString:curTitle];
+                curTitle = [fullStarChar stringByAppendingString:curTitle];
                 item = [ratingMenu addItemWithTitle:curTitle
                             action:@selector(setSongRating:)
                             keyEquivalent:@""];
     
     [menu release];
     menu = [[NSMenu alloc] initWithTitle:@""];
-    [menu addItemWithTitle:@"Audio Player" action:NULL keyEquivalent:@""];
-    [menu addItemWithTitle:@"Not Running" action:NULL keyEquivalent:@""];
+    [[menu addItemWithTitle:[NSString stringWithFormat:@"Open %@", [currentRemote playerSimpleName]] action:@selector(showPlayer:) keyEquivalent:@""] setTarget:self];
     [menu addItem:[NSMenuItem separatorItem]];
     [[menu addItemWithTitle:@"Preferences" action:@selector(showPreferences:) keyEquivalent:@""] setTarget:self];
     [[menu addItemWithTitle:@"Quit" action:@selector(quitMenuTunes:) keyEquivalent:@""] setTarget:self];
     prefsController = nil;
 }
 
+- (void)showPlayer:(id)sender
+{
+    if ( ( isAppRunning == ITMTRemotePlayerRunning) ) {
+        [currentRemote showPrimaryInterface];
+    } else {
+        if (![[NSWorkspace sharedWorkspace] launchApplication:[currentRemote playerFullName]]) {
+            NSLog(@"Error Launching Player");
+        }
+    }
+}
+        
+
 //
 //
 // Show Current Track Info And Show Upcoming Songs Floaters