]> git.sesse.net Git - vlc/commitdiff
macosx: fix audio device selection visuals and remove fake 'Default' item now that...
authorFelix Paul Kühne <fkuehne@videolan.org>
Sat, 16 Feb 2013 22:50:36 +0000 (23:50 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sat, 16 Feb 2013 22:50:36 +0000 (23:50 +0100)
modules/gui/macosx/MainMenu.m

index 1f67adf82fe192555822f355e5772ce3304cd042..b664e2f33702d37eae7143580ab248ec5ab9bbc1 100644 (file)
@@ -734,24 +734,17 @@ static VLCMainMenu *_o_sharedInstance = nil;
         return;
 
     currentDevice = aout_DeviceGet(p_aout);
-
     NSMenuItem * o_mi_tmp;
-    o_mi_tmp = [o_mu_device addItemWithTitle:_NS("Default") action:@selector(toggleAudioDevice:) keyEquivalent:@""];
-    [o_mi_tmp setTarget:self];
-    if (!currentDevice)
-        [o_mi_tmp setState:NSOnState];
 
     for (NSUInteger x = 0; x < n; x++) {
         o_mi_tmp = [o_mu_device addItemWithTitle:[NSString stringWithFormat:@"%s", names[x]] action:@selector(toggleAudioDevice:) keyEquivalent:@""];
         [o_mi_tmp setTarget:self];
         [o_mi_tmp setTag:[[NSString stringWithFormat:@"%s", ids[x]] intValue]];
-        if (currentDevice) {
-            if (!strcmp(ids[x], currentDevice))
-                [o_mi_tmp setState: NSOnState];
-        }
     }
     vlc_object_release(p_aout);
 
+    [[o_mu_device itemWithTag:[[NSString stringWithFormat:@"%s", currentDevice] intValue]] setState:NSOnState];
+
     for (NSUInteger x = 0; x < n; x++) {
         free(ids[x]);
         free(names[x]);
@@ -1366,7 +1359,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
                 vlc_object_release(p_vout);
             }
         }
-        
+
         [self setupMenus]; /* Make sure video menu is up to date */
     }