+- (IBAction)screenStepperChanged:(id)sender
+{
+ [o_screen_fps_fld setIntValue: [o_screen_fps_stp intValue]];
+ [o_panel makeFirstResponder: o_screen_fps_fld];
+ [o_mrl setStringValue: [NSString stringWithFormat:@"screen:// :screen-fps=%@", [o_screen_fps_fld stringValue]]];
+}
+
+- (void)screenFPSfieldChanged:(NSNotification *)o_notification
+{
+ [o_screen_fps_stp setIntValue: [o_screen_fps_fld intValue]];
+ if( [[o_screen_fps_fld stringValue] isEqualToString: @""] )
+ [o_screen_fps_fld setIntValue: 1];
+ [o_mrl setStringValue: [NSString stringWithFormat:@"screen:// :screen-fps=%i", [o_screen_fps_fld intValue]]];
+}
+
+- (IBAction)eyetvSwitchChannel:(id)sender
+{
+ if( sender == o_eyetv_nextProgram_btn )
+ {
+ int chanNum = [[[VLCMain sharedInstance] getEyeTVController] switchChannelUp: YES];
+ [o_eyetv_channels_pop selectItemWithTag:chanNum];
+ [o_mrl setStringValue: [NSString stringWithFormat:@"eyetv:// :eyetv-channel=%d", chanNum]];
+ }
+ else if( sender == o_eyetv_previousProgram_btn )
+ {
+ int chanNum = [[[VLCMain sharedInstance] getEyeTVController] switchChannelUp: NO];
+ [o_eyetv_channels_pop selectItemWithTag:chanNum];
+ [o_mrl setStringValue: [NSString stringWithFormat:@"eyetv:// :eyetv-channel=%d", chanNum]];
+ }
+ else if( sender == o_eyetv_channels_pop )
+ {
+ int chanNum = [[sender selectedItem] tag];
+ [[[VLCMain sharedInstance] getEyeTVController] selectChannel:chanNum];
+ [o_mrl setStringValue: [NSString stringWithFormat:@"eyetv:// :eyetv-channel=%d", chanNum]];
+ }
+ else
+ msg_Err( VLCIntf, "eyetvSwitchChannel sent by unknown object" );
+}
+
+- (IBAction)eyetvLaunch:(id)sender
+{
+ [[[VLCMain sharedInstance] getEyeTVController] launchEyeTV];
+}
+
+- (void)eyetvChanged:(NSNotification *)o_notification
+{
+ if( [[o_notification name] isEqualToString: @"DeviceAdded"] )
+ {
+ msg_Dbg( VLCIntf, "eyetv device was added" );
+ [self showCaptureView: o_eyetv_running_view];
+ [self setupChannelInfo];
+ }
+ else if( [[o_notification name] isEqualToString: @"DeviceRemoved"] )
+ {
+ /* leave the channel selection like that,
+ * switch to our "no device" tab */
+ msg_Dbg( VLCIntf, "eyetv device was removed" );
+ setEyeTVUnconnected;
+ }
+ else if( [[o_notification name] isEqualToString: @"PluginQuit"] )
+ {
+ /* switch to the "launch eyetv" tab */
+ msg_Dbg( VLCIntf, "eyetv was terminated" );
+ [self showCaptureView: o_eyetv_notLaunched_view];
+ }
+ else if( [[o_notification name] isEqualToString: @"PluginInit"] )
+ {
+ /* we got no device yet */
+ msg_Dbg( VLCIntf, "eyetv was launched, no device yet" );
+ setEyeTVUnconnected;
+ }
+ else
+ msg_Warn( VLCIntf, "unknown external notify '%s' received", [[o_notification name] UTF8String] );
+}
+
+/* little helper method, since this code needs to be run by multiple objects */
+- (void)setupChannelInfo
+{
+ /* set up channel selection */
+ [o_eyetv_channels_pop removeAllItems];
+ [o_eyetv_chn_bgbar setHidden: NO];
+ [o_eyetv_chn_bgbar animate: self];
+ [o_eyetv_chn_status_txt setStringValue: _NS("Retrieving Channel Info...")];
+ [o_eyetv_chn_status_txt setHidden: NO];
+
+ /* retrieve info */
+ NSEnumerator *channels = [[[VLCMain sharedInstance] getEyeTVController] allChannels];
+ int x = -2;
+ [[[o_eyetv_channels_pop menu] addItemWithTitle: _NS("Composite input")
+ action: nil
+ 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] 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];
+}
+