* 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
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
- (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" );
}
[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