]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/open.m
* display the GPL in a separate window linked in the About window and the Help menu...
[vlc] / modules / gui / macosx / open.m
index f6a7b5fc8c25adb8ef11c0cf433176b3c30dc96e..d826c64e74016f9b41d556bfe87af23be4c58812 100644 (file)
@@ -8,7 +8,7 @@
  *          Christophe Massiot <massiot@via.ecp.fr>
  *          Derk-Jan Hartman <thedj@users.sourceforge.net>
  *          Benjamin Pracht <bigben at videolan dot org>
- *          Felix K\9fhne <fkuehne at videolan dot org>
+ *          Felix KΓΌhne <fkuehne at videolan dot org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -235,15 +235,17 @@ static VLCOpen *_o_sharedMainInstance = nil;
         name: NSControlTextDidChangeNotification
         object: o_net_http_url];
 
-    /* wake up with the correct GUI */
+    /* wake up with the correct EyeTV GUI */
     if( [[[VLCMain sharedInstance] getEyeTVController] isEyeTVrunning] == YES )
         [o_eyetv_tabView selectTabViewItemWithIdentifier:@"nodevice"];
-    if( [[[VLCMain sharedInstance] getEyeTVController] isDeviceConnected] == YES )
+    else if( [[[VLCMain sharedInstance] getEyeTVController] isDeviceConnected] == YES )
     {
         [o_eyetv_tabView selectTabViewItemWithIdentifier:@"eyetvup"];
         [self setupChannelInfo];
     }
+    else
+        [o_eyetv_tabView selectTabViewItemWithIdentifier:@"noeyetv"];
+
     [[NSDistributedNotificationCenter defaultCenter] addObserver: self
                                                         selector: @selector(eyetvChanged:)
                                                             name: NULL
@@ -797,12 +799,12 @@ static VLCOpen *_o_sharedMainInstance = nil;
 - (IBAction)eyetvSwitchChannel:(id)sender
 {
     if( sender == o_eyetv_nextProgram_btn )
-        [[[VLCMain sharedInstance] getEyeTVController] switchChannelUp: YES];
+        [o_eyetv_channels_pop selectItemWithTag:[[[VLCMain sharedInstance] getEyeTVController] switchChannelUp: YES]];
     else if( sender == o_eyetv_previousProgram_btn )
-        [[[VLCMain sharedInstance] getEyeTVController] switchChannelUp: NO];
+        [o_eyetv_channels_pop selectItemWithTag:[[[VLCMain sharedInstance] getEyeTVController] switchChannelUp: NO]];
     else if( sender == o_eyetv_channels_pop )
         [[[VLCMain sharedInstance] getEyeTVController] selectChannel:
-            [sender indexOfSelectedItem]];
+            [[sender selectedItem] tag]];
     else
         msg_Err( VLCIntf, "eyetvSwitchChannel sent by unknown object" );
 }
@@ -854,21 +856,38 @@ static VLCOpen *_o_sharedMainInstance = nil;
     [o_eyetv_chn_status_txt setHidden: NO];
  
     /* retrieve info */
-    int x = 0;
-    int channelCount = ( [[[VLCMain sharedInstance] getEyeTVController] getNumberOfChannels] + 1 );
-    while( x != channelCount )
-    {
-        /* we have to add items this way, because we accept duplicates
-         * additionally, we save a bit of time */
-        [[o_eyetv_channels_pop menu] addItemWithTitle: [[[VLCMain sharedInstance] getEyeTVController] getNameOfChannel: x]
+    NSEnumerator *channels = [[[VLCMain sharedInstance] getEyeTVController] allChannels];
+    int x = -2;
+    [[[o_eyetv_channels_pop menu] addItemWithTitle: _NS("Composite input")
                                                action: nil
-                                        keyEquivalent: @""];
-        x += 1;
+                                        keyEquivalent: @""] setTag:x++];
+    [[[o_eyetv_channels_pop menu] addItemWithTitle: _NS("S-Video input")
+                                               action: nil
+                                        keyEquivalent: @""] setTag:x++];
+    if( channels ) 
+    {
+        NSString *channel;
+        [[[o_eyetv_channels_pop menu] addItemWithTitle: _NS("Tuner")
+                                                   action: nil
+                                            keyEquivalent: @""] setTag:x++];
+        [[o_eyetv_channels_pop menu] addItem: [NSMenuItem separatorItem]];
+        while( channel = [channels nextObject] )
+        {
+            /* we have to add items this way, because we accept duplicates
+             * additionally, we save a bit of time */
+            [[[o_eyetv_channels_pop menu] addItemWithTitle: channel
+                                                   action: nil
+                                            keyEquivalent: @""] setTag:x++];
+        }
+        /* make Tuner the default */
+        [o_eyetv_channels_pop selectItemWithTag:[[[VLCMain sharedInstance] getEyeTVController] currentChannel]];
     }
  
     /* clean up GUI */
     [o_eyetv_chn_bgbar setHidden: YES];
     [o_eyetv_chn_status_txt setHidden: YES];
+
+    [o_mrl setStringValue: @"eyetv:"];
 }
 
 - (IBAction)subsChanged:(id)sender