[vlc-commits] macosx: fix audio device selection visuals and remove fake 'Default' item now that auhal handles it

Felix Paul Kühne git at videolan.org
Sat Feb 16 23:50:42 CET 2013


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sat Feb 16 23:50:36 2013 +0100| [6d85209c9f4d75478f96aa982255ebcac35cf93e] | committer: Felix Paul Kühne

macosx: fix audio device selection visuals and remove fake 'Default' item now that auhal handles it

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6d85209c9f4d75478f96aa982255ebcac35cf93e
---

 modules/gui/macosx/MainMenu.m |   13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/modules/gui/macosx/MainMenu.m b/modules/gui/macosx/MainMenu.m
index 1f67adf..b664e2f 100644
--- a/modules/gui/macosx/MainMenu.m
+++ b/modules/gui/macosx/MainMenu.m
@@ -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 */
     }
 



More information about the vlc-commits mailing list