* 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
p_list = [NSMutableArray arrayWithCapacity: 1];
next_media = IOIteratorNext( media_iterator );
- if( next_media != nil )
+ if( next_media )
{
char psz_buf[0x32];
size_t dev_path_length;
sizeof(psz_buf) - dev_path_length,
kCFStringEncodingASCII ) )
{
- [p_list addObject: [NSString stringWithCString: psz_buf]];
+ [p_list addObject: [NSString stringWithUTF8String: psz_buf]];
}
CFRelease( str_bsd_path );
IOObjectRelease( next_media );
- } while( ( next_media = IOIteratorNext( media_iterator ) ) != nil );
+ } while( ( next_media = IOIteratorNext( media_iterator ) ) );
}
IOObjectRelease( media_iterator );
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 )
{
- [o_eyetv_tabView selectTabViewItemWithIdentifier:@"eyetvup"];
- [self setupChannelInfo];
+ if( [[[VLCMain sharedInstance] getEyeTVController] isDeviceConnected] == YES )
+ {
+ [o_eyetv_tabView selectTabViewItemWithIdentifier:@"eyetvup"];
+ [self setupChannelInfo];
+ }
+ else
+ [o_eyetv_tabView selectTabViewItemWithIdentifier:@"nodevice"];
}
-
+ else
+ [o_eyetv_tabView selectTabViewItemWithIdentifier:@"noeyetv"];
+
[[NSDistributedNotificationCenter defaultCenter] addObserver: self
selector: @selector(eyetvChanged:)
name: NULL
i_index++ )
{
[o_file_sub_encoding_pop addItemWithTitle:
- [NSString stringWithCString:
- p_item->ppsz_list[i_index]]];
+ [NSString stringWithUTF8String: p_item->ppsz_list[i_index]]];
}
[o_file_sub_encoding_pop selectItemWithTitle:
- [NSString stringWithCString:
- p_item->value.psz]];
+ [NSString stringWithUTF8String: p_item->value.psz]];
}
p_item = config_FindConfig( VLC_OBJECT(p_intf), "subsdec-align" );
{
[self openNetInfoChanged: nil];
}
+ else if( [o_label isEqualToString: _NS("EyeTV")] )
+ {
+ [o_mrl setStringValue: @"eyetv://"];
+ }
}
- (void)openFileGeneric
NSString *o_mrl_string;
NSString *o_filename = [o_file_path stringValue];
NSString *o_ext = [o_filename pathExtension];
- vlc_bool_t b_stream = [o_file_stream state];
+ bool b_stream = [o_file_stream state];
BOOL b_dir = NO;
[[NSFileManager defaultManager] fileExistsAtPath:o_filename isDirectory:&b_dir];
- (IBAction)eyetvSwitchChannel:(id)sender
{
if( sender == o_eyetv_nextProgram_btn )
- [[[VLCMain sharedInstance] getEyeTVController] switchChannelUp: YES];
+ {
+ 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 )
- [[[VLCMain sharedInstance] getEyeTVController] switchChannelUp: NO];
+ {
+ 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 )
- [[[VLCMain sharedInstance] getEyeTVController] selectChannel:
- [sender indexOfSelectedItem]];
+ {
+ 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" );
}
[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: @""] setTag:x++];
+ [[[o_eyetv_channels_pop menu] addItemWithTitle: _NS("S-Video input")
action: nil
- keyEquivalent: @""];
- x += 1;
+ 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 */