#import "output.h"
#import "eyetv.h"
+#include <vlc_url.h>
+
#define setEyeTVUnconnected \
[o_capture_lbl setStringValue: _NS("No device connected")]; \
[o_capture_long_lbl setStringValue: _NS("VLC could not detect any EyeTV compatible device.\n\nCheck the device's connection, make sure that the latest EyeTV software is installed and try again.")]; \
return _o_sharedMainInstance;
}
+- (void)dealloc
+{
+ if( o_file_slave_path )
+ [o_file_slave_path release];
+ [super dealloc];
+}
+
- (void)awakeFromNib
{
[o_panel setTitle: _NS("Open Source")];
[o_file_btn_browse setTitle: _NS("Browse...")];
[o_file_stream setTitle: _NS("Treat as a pipe rather than as a file")];
+ [o_file_slave_ckbox setTitle: _NS("Play another media synchronously")];
+ [o_file_slave_select_btn setTitle: _NS("Choose...")];
+ [o_file_slave_filename_txt setStringValue: @""];
[o_disc_device_lbl setStringValue: _NS("Device name")];
[o_disc_title_lbl setStringValue: _NS("Title")];
[o_net_udpm_addr_lbl setStringValue: _NS("IP Address")];
[o_net_udpm_port_lbl setStringValue: _NS("Port")];
[o_net_http_url_lbl setStringValue: _NS("URL")];
- [o_net_help_lbl setStringValue: _NS("To Open a usual network stream (HTTP, RTSP, MMS, FTP, etc.), just enter the URL in the field above. If you want to open a RTP or UDP stream, press the button below.")];
+ [o_net_help_lbl setStringValue: _NS("To Open a usual network stream (HTTP, RTSP, RTMP, MMS, FTP, etc.), just enter the URL in the field above. If you want to open a RTP or UDP stream, press the button below.")];
[o_net_help_udp_lbl setStringValue: _NS("If you want to open a multicast stream, enter the respective IP address given by the stream provider. In unicast mode, VLC will use your machine's IP automatically.\n\nTo open a stream using a different protocol, just press Cancel to close this sheet.")];
[o_net_udp_cancel_btn setTitle: _NS("Cancel")];
[o_net_udp_ok_btn setTitle: _NS("Open")];
[o_screen_top_lbl setStringValue: _NS("Subscreen top:")];
[o_screen_width_lbl setStringValue: _NS("Subscreen width:")];
[o_screen_height_lbl setStringValue: _NS("Subscreen height:")];
+ [o_screen_follow_mouse_ckb setTitle: _NS("Follow the mouse")];
[o_eyetv_currentChannel_lbl setStringValue: _NS("Current channel:")];
[o_eyetv_previousProgram_btn setTitle: _NS("Previous Channel")];
[o_eyetv_nextProgram_btn setTitle: _NS("Next Channel")];
}
if( [o_output_ckbox state] == NSOnState )
{
- for (i = 0 ; i < [[o_sout_options getMRL] count] ; i++)
+ for (i = 0 ; i < [[o_sout_options mrl] count] ; i++)
{
[o_options addObject: [NSString stringWithString:
- [[(VLCOutput *)o_sout_options getMRL] objectAtIndex: i]]];
+ [[(VLCOutput *)o_sout_options mrl] objectAtIndex: i]]];
}
}
+ if( [o_file_slave_ckbox state] && o_file_slave_path )
+ [o_options addObject: [NSString stringWithFormat: @"input-slave=%@", o_file_slave_path]];
if( [[[o_tabview selectedTabViewItem] label] isEqualToString: _NS("Capture")] )
{
if( [[[o_capture_mode_pop selectedItem] title] isEqualToString: _NS("Screen")] )
[o_panel displayIfNeeded];
}
+- (IBAction)inputSlaveAction:(id)sender
+{
+ if( sender == o_file_slave_ckbox )
+ [o_file_slave_select_btn setEnabled: [o_file_slave_ckbox state]];
+ else
+ {
+ NSOpenPanel *o_open_panel;
+ o_open_panel = [NSOpenPanel openPanel];
+ [o_open_panel setCanChooseFiles: YES];
+ [o_open_panel setCanChooseDirectories: NO];
+ if( [o_open_panel runModalForDirectory: nil file: nil types: nil] == NSOKButton )
+ {
+ if( o_file_slave_path )
+ [o_file_slave_path release];
+ o_file_slave_path = [[o_open_panel filenames] objectAtIndex: 0];
+ [o_file_slave_path retain];
+ }
+ else
+ [o_file_slave_filename_txt setStringValue: @""];
+ }
+ if( o_file_slave_path )
+ {
+ NSFileWrapper *o_file_wrapper;
+ o_file_wrapper = [[NSFileWrapper alloc] initWithPath: o_file_slave_path];
+ [o_file_slave_filename_txt setStringValue: [NSString stringWithFormat: @"\"%@\"", [o_file_wrapper preferredFilename]]];
+ [o_file_wrapper release];
+ }
+}
+
- (void)openFileGeneric
{
[self openFilePathChanged: nil];
- (void)openFilePathChanged:(NSNotification *)o_notification
{
- NSString *o_mrl_string;
NSString *o_filename = [o_file_path stringValue];
- NSString *o_ext = [o_filename pathExtension];
bool b_stream = [o_file_stream state];
BOOL b_dir = NO;
-
+
[[NSFileManager defaultManager] fileExistsAtPath:o_filename isDirectory:&b_dir];
+ char *psz_uri = make_URI([o_filename UTF8String]);
+ if( !psz_uri ) return;
+
+ NSMutableString *o_mrl_string = [NSMutableString stringWithUTF8String: psz_uri ];
+ NSRange offile = [o_mrl_string rangeOfString:@"file"];
+ free( psz_uri );
+
if( b_dir )
{
- o_mrl_string = [NSString stringWithFormat: @"directory://%@/", o_filename];
+ [o_mrl_string replaceCharactersInRange:offile withString: @"directory"];
}
- else if( [o_ext isEqualToString: @"bin"] ||
- [o_ext isEqualToString: @"cue"] ||
- [o_ext isEqualToString: @"vob"] ||
- [o_ext isEqualToString: @"iso"] )
- {
- o_mrl_string = o_filename;
- }
- else
+ else if( b_stream )
{
- o_mrl_string = [NSString stringWithFormat: @"%s://%@",
- b_stream ? "stream" : "file",
- o_filename];
+ [o_mrl_string replaceCharactersInRange:offile withString: @"stream"];
}
[o_mrl setStringValue: o_mrl_string];
}
o_type = [[o_disc_type selectedCell] title];
- if ( [o_type isEqualToString: _NS("VIDEO_TS directory")] )
+ if ( [o_type isEqualToString: _NS("VIDEO_TS folder")] )
{
b_device = NO; b_no_menus = YES;
}
NSString *o_url = [o_net_http_url stringValue];
if ( ![o_url hasPrefix:@"http:"] && ![o_url hasPrefix:@"ftp:"]
- && ![o_url hasPrefix:@"mms"] && ![o_url hasPrefix:@"rtsp"] )
+ && ![o_url hasPrefix:@"mms"] && ![o_url hasPrefix:@"rtsp"] && ![o_url hasPrefix:@"rtmp"] )
o_mrl_string = [NSString stringWithFormat: @"http://%@", o_url];
else
o_mrl_string = o_url;
{
if( [[[o_capture_mode_pop selectedItem] title] isEqualToString: @"EyeTV"] )
{
- if( [[[VLCMain sharedInstance] getEyeTVController] isEyeTVrunning] == YES )
+ if( [[[VLCMain sharedInstance] eyeTVController] isEyeTVrunning] == YES )
{
- if( [[[VLCMain sharedInstance] getEyeTVController] isDeviceConnected] == YES )
+ if( [[[VLCMain sharedInstance] eyeTVController] isDeviceConnected] == YES )
{
[self showCaptureView: o_eyetv_running_view];
[self setupChannelInfo];
{
if( sender == o_eyetv_nextProgram_btn )
{
- int chanNum = [[[VLCMain sharedInstance] getEyeTVController] switchChannelUp: YES];
+ int chanNum = [[[VLCMain sharedInstance] eyeTVController] 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];
+ int chanNum = [[[VLCMain sharedInstance] eyeTVController] 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];
+ [[[VLCMain sharedInstance] eyeTVController] selectChannel:chanNum];
[o_mrl setStringValue: [NSString stringWithFormat:@"eyetv:// :eyetv-channel=%d", chanNum]];
}
else
- (IBAction)eyetvLaunch:(id)sender
{
- [[[VLCMain sharedInstance] getEyeTVController] launchEyeTV];
+ [[[VLCMain sharedInstance] eyeTVController] launchEyeTV];
}
- (IBAction)eyetvGetPlugin:(id)sender
[o_eyetv_chn_status_txt setHidden: NO];
/* retrieve info */
- NSEnumerator *channels = [[[VLCMain sharedInstance] getEyeTVController] allChannels];
+ NSEnumerator *channels = [[[VLCMain sharedInstance] eyeTVController] allChannels];
int x = -2;
[[[o_eyetv_channels_pop menu] addItemWithTitle: _NS("Composite input")
action: nil
keyEquivalent: @""] setTag:++x];
}
/* make Tuner the default */
- [o_eyetv_channels_pop selectItemWithTag:[[[VLCMain sharedInstance] getEyeTVController] currentChannel]];
+ [o_eyetv_channels_pop selectItemWithTag:[[[VLCMain sharedInstance] eyeTVController] currentChannel]];
}
/* clean up GUI */