1 /*****************************************************************************
2 * open.m: MacOS X module for vlc
3 *****************************************************************************
4 * Copyright (C) 2002-2003 VideoLAN
7 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8 * Christophe Massiot <massiot@via.ecp.fr>
9 * Derk-Jan Hartman <thedj@users.sourceforge.net>
10 * Benjamin Pracht <bigben at videolan dot org>
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
25 *****************************************************************************/
27 /*****************************************************************************
29 *****************************************************************************/
30 #include <stdlib.h> /* malloc(), free() */
31 #include <sys/param.h> /* for MAXPATHLEN */
35 #include <IOKit/IOKitLib.h>
36 #include <IOKit/IOBSD.h>
37 #include <IOKit/storage/IOMedia.h>
38 #include <IOKit/storage/IOCDMedia.h>
39 #include <IOKit/storage/IODVDMedia.h>
46 /*****************************************************************************
47 * GetEjectableMediaOfClass
48 *****************************************************************************/
49 NSArray *GetEjectableMediaOfClass( const char *psz_class )
51 io_object_t next_media;
52 mach_port_t master_port;
53 kern_return_t kern_result;
54 NSArray *o_devices = nil;
55 NSMutableArray *p_list = nil;
56 io_iterator_t media_iterator;
57 CFMutableDictionaryRef classes_to_match;
59 kern_result = IOMasterPort( MACH_PORT_NULL, &master_port );
60 if( kern_result != KERN_SUCCESS )
65 classes_to_match = IOServiceMatching( psz_class );
66 if( classes_to_match == NULL )
71 CFDictionarySetValue( classes_to_match, CFSTR( kIOMediaEjectableKey ),
74 kern_result = IOServiceGetMatchingServices( master_port, classes_to_match,
76 if( kern_result != KERN_SUCCESS )
81 p_list = [NSMutableArray arrayWithCapacity: 1];
83 next_media = IOIteratorNext( media_iterator );
84 if( next_media != NULL )
87 size_t dev_path_length;
88 CFTypeRef str_bsd_path;
92 str_bsd_path = IORegistryEntryCreateCFProperty( next_media,
93 CFSTR( kIOBSDNameKey ),
96 if( str_bsd_path == NULL )
98 IOObjectRelease( next_media );
102 snprintf( psz_buf, sizeof(psz_buf), "%s%c", _PATH_DEV, 'r' );
103 dev_path_length = strlen( psz_buf );
105 if( CFStringGetCString( str_bsd_path,
106 (char*)&psz_buf + dev_path_length,
107 sizeof(psz_buf) - dev_path_length,
108 kCFStringEncodingASCII ) )
110 [p_list addObject: [NSString stringWithCString: psz_buf]];
113 CFRelease( str_bsd_path );
115 IOObjectRelease( next_media );
117 } while( ( next_media = IOIteratorNext( media_iterator ) ) != NULL );
120 IOObjectRelease( media_iterator );
122 o_devices = [NSArray arrayWithArray: p_list];
127 /*****************************************************************************
128 * VLCOpen implementation
129 *****************************************************************************/
130 @implementation VLCOpen
134 intf_thread_t * p_intf = VLCIntf;
136 [o_panel setTitle: _NS("Open Source")];
137 [o_mrl_lbl setTitle: _NS("Media Resource Locator (MRL)")];
139 [o_btn_ok setTitle: _NS("OK")];
140 [o_btn_cancel setTitle: _NS("Cancel")];
142 [[o_tabview tabViewItemAtIndex: 0] setLabel: _NS("File")];
143 [[o_tabview tabViewItemAtIndex: 1] setLabel: _NS("Disc")];
144 [[o_tabview tabViewItemAtIndex: 2] setLabel: _NS("Network")];
146 [o_file_btn_browse setTitle: _NS("Browse...")];
147 [o_file_stream setTitle: _NS("Treat as a pipe rather than as a file")];
149 [o_disc_device_lbl setStringValue: _NS("Device name")];
150 [o_disc_title_lbl setStringValue: _NS("Title")];
151 [o_disc_chapter_lbl setStringValue: _NS("Chapter")];
152 [o_disc_videots_btn_browse setTitle: _NS("Browse...")];
153 [o_disc_dvd_menus setTitle: _NS("Use DVD menus")];
155 [[o_disc_type cellAtRow:0 column:0] setTitle: _NS("VIDEO_TS folder")];
156 [[o_disc_type cellAtRow:1 column:0] setTitle: _NS("DVD")];
157 [[o_disc_type cellAtRow:2 column:0] setTitle: _NS("VCD")];
158 [[o_disc_type cellAtRow:3 column:0] setTitle: _NS("Audio CD")];
160 [o_net_udp_port_lbl setStringValue: _NS("Port")];
161 [o_net_udpm_addr_lbl setStringValue: _NS("Address")];
162 [o_net_udpm_port_lbl setStringValue: _NS("Port")];
163 [o_net_http_url_lbl setStringValue: _NS("URL")];
165 [[o_net_mode cellAtRow:0 column:0] setTitle: _NS("UDP/RTP")];
166 [[o_net_mode cellAtRow:1 column:0] setTitle: _NS("UDP/RTP Multicast")];
167 [[o_net_mode cellAtRow:2 column:0] setTitle: _NS("HTTP/FTP/MMS/RTSP")];
169 [o_net_udp_port setIntValue: config_GetInt( p_intf, "server-port" )];
170 [o_net_udp_port_stp setIntValue: config_GetInt( p_intf, "server-port" )];
175 [[NSNotificationCenter defaultCenter] addObserver: self
176 selector: @selector(openFilePathChanged:)
177 name: NSControlTextDidChangeNotification
178 object: o_file_path];
180 [[NSNotificationCenter defaultCenter] addObserver: self
181 selector: @selector(openDiscInfoChanged:)
182 name: NSControlTextDidChangeNotification
183 object: o_disc_device];
184 [[NSNotificationCenter defaultCenter] addObserver: self
185 selector: @selector(openDiscInfoChanged:)
186 name: NSControlTextDidChangeNotification
187 object: o_disc_title];
188 [[NSNotificationCenter defaultCenter] addObserver: self
189 selector: @selector(openDiscInfoChanged:)
190 name: NSControlTextDidChangeNotification
191 object: o_disc_chapter];
192 [[NSNotificationCenter defaultCenter] addObserver: self
193 selector: @selector(openDiscInfoChanged:)
194 name: NSControlTextDidChangeNotification
195 object: o_disc_videots_folder];
197 [[NSNotificationCenter defaultCenter] addObserver: self
198 selector: @selector(openNetInfoChanged:)
199 name: NSControlTextDidChangeNotification
200 object: o_net_udp_port];
201 [[NSNotificationCenter defaultCenter] addObserver: self
202 selector: @selector(openNetInfoChanged:)
203 name: NSControlTextDidChangeNotification
204 object: o_net_udpm_addr];
205 [[NSNotificationCenter defaultCenter] addObserver: self
206 selector: @selector(openNetInfoChanged:)
207 name: NSControlTextDidChangeNotification
208 object: o_net_udpm_port];
209 [[NSNotificationCenter defaultCenter] addObserver: self
210 selector: @selector(openNetInfoChanged:)
211 name: NSControlTextDidChangeNotification
212 object: o_net_http_url];
217 intf_thread_t * p_intf = VLCIntf;
219 module_config_t * p_item;
221 [o_file_sub_ckbox setTitle: _NS("Load subtitles file:")];
222 [o_file_sub_btn_settings setTitle: _NS("Settings...")];
223 [o_file_sub_btn_browse setTitle: _NS("Browse...")];
224 [o_file_sub_override setTitle: _NS("Override")];
225 [o_file_sub_delay_lbl setStringValue: _NS("delay")];
226 [o_file_sub_delay_stp setEnabled: NO];
227 [o_file_sub_fps_lbl setStringValue: _NS("fps")];
228 [o_file_sub_fps_stp setEnabled: NO];
229 [o_file_sub_encoding_lbl setStringValue: _NS("Subtitles encoding")];
230 [o_file_sub_encoding_pop removeAllItems];
231 [o_file_sub_size_lbl setStringValue: _NS("Font size")];
232 [o_file_sub_size_pop removeAllItems];
233 [o_file_sub_align_lbl setStringValue: _NS("Subtitles justification")];
234 [o_file_sub_align_pop removeAllItems];
235 [o_file_sub_ok_btn setStringValue: _NS("OK")];
236 [o_file_sub_font_box setTitle: _NS("Font Properties")];
237 [o_file_sub_file_box setTitle: _NS("Subtitle File")];
239 p_item = config_FindConfig( VLC_OBJECT(p_intf), "subsdec-encoding" );
243 for( i_index = 0; p_item->ppsz_list && p_item->ppsz_list[i_index];
246 [o_file_sub_encoding_pop addItemWithTitle:
247 [NSString stringWithCString:
248 p_item->ppsz_list[i_index]]];
250 [o_file_sub_encoding_pop selectItemWithTitle:
251 [NSString stringWithCString:
255 p_item = config_FindConfig( VLC_OBJECT(p_intf), "subsdec-align" );
259 for ( i_index = 0; i_index < p_item->i_list; i_index++ )
261 [o_file_sub_align_pop addItemWithTitle:
262 [NSString stringWithUTF8String:
263 p_item->ppsz_list_text[i_index]]];
265 [o_file_sub_align_pop selectItemAtIndex: p_item->i_value];
268 p_item = config_FindConfig( VLC_OBJECT(p_intf), "freetype-rel-fontsize" );
272 for ( i_index = 0; i_index < p_item->i_list; i_index++ )
274 [o_file_sub_size_pop addItemWithTitle:
275 [NSString stringWithUTF8String:
276 p_item->ppsz_list_text[i_index]]];
277 if ( p_item->i_value == p_item->pi_list[i_index] )
279 [o_file_sub_size_pop selectItemAtIndex: i_index];
285 - (void)openTarget:(int)i_type
289 [o_tabview selectTabViewItemAtIndex: i_type];
290 [o_file_sub_ckbox setState: NSOffState];
292 i_result = [NSApp runModalForWindow: o_panel];
297 NSMutableDictionary *o_dic;
298 NSMutableArray *o_options = [NSMutableArray array];
301 o_dic = [NSMutableDictionary dictionaryWithObject: [o_mrl stringValue] forKey: @"ITEM_URL"];
302 if( [o_file_sub_ckbox state] == NSOnState )
304 intf_thread_t * p_intf = VLCIntf;
305 module_config_t * p_item;
307 [o_options addObject: [NSString stringWithFormat: @"sub-file=%s", [[o_file_sub_path stringValue] fileSystemRepresentation]]];
308 if( [o_file_sub_override state] == NSOnState )
310 [o_options addObject: [NSString stringWithFormat: @"sub-delay=%i", (int)( [o_file_sub_delay intValue] * 10 )]];
311 [o_options addObject: [NSString stringWithFormat: @"sub-fps=%f", [o_file_sub_fps floatValue]]];
313 [o_options addObject: [NSString stringWithFormat:
314 @"subsdec-encoding=%@",
315 [o_file_sub_encoding_pop titleOfSelectedItem]]];
316 [o_options addObject: [NSString stringWithFormat:
318 [o_file_sub_align_pop indexOfSelectedItem]]];
320 p_item = config_FindConfig( VLC_OBJECT(p_intf),
321 "freetype-rel-fontsize" );
325 [o_options addObject: [NSString stringWithFormat:
326 @"freetype-rel-fontsize=%i",
327 p_item->pi_list[[o_file_sub_size_pop indexOfSelectedItem]]]];
330 if( [o_output_ckbox state] == NSOnState )
332 for (i = 0 ; i < [[o_sout_options getMRL] count] ; i++)
334 [o_options addObject: [NSString stringWithString:
335 [[(VLCOutput *)o_sout_options getMRL] objectAtIndex: i]]];
338 [o_dic setObject: (NSArray *)[o_options copy] forKey: @"ITEM_OPTIONS"];
339 [o_playlist appendArray: [NSArray arrayWithObject: o_dic] atPos: -1 enqueue:NO];
343 - (void)tabView:(NSTabView *)o_tv didSelectTabViewItem:(NSTabViewItem *)o_tvi
345 NSString *o_label = [o_tvi label];
347 if( [o_label isEqualToString: _NS("File")] )
349 [self openFilePathChanged: nil];
351 else if( [o_label isEqualToString: _NS("Disc")] )
353 [self openDiscTypeChanged: nil];
355 else if( [o_label isEqualToString: _NS("Network")] )
357 [self openNetModeChanged: nil];
361 - (IBAction)openFileGeneric:(id)sender
363 [self openFilePathChanged: nil];
364 [self openTarget: 0];
367 - (IBAction)openDisc:(id)sender
369 [self openDiscTypeChanged: nil];
370 [self openTarget: 1];
373 - (IBAction)openNet:(id)sender
375 [self openNetModeChanged: nil];
376 [self openTarget: 2];
379 - (void)openFilePathChanged:(NSNotification *)o_notification
381 NSString *o_mrl_string;
382 NSString *o_filename = [o_file_path stringValue];
383 NSString *o_ext = [o_filename pathExtension];
384 vlc_bool_t b_stream = [o_file_stream state];
387 [[NSFileManager defaultManager] fileExistsAtPath:o_filename isDirectory:&b_dir];
391 o_mrl_string = [NSString stringWithFormat: @"dir:%@", o_filename];
393 else if( [o_ext isEqualToString: @"bin"] ||
394 [o_ext isEqualToString: @"cue"] ||
395 [o_ext isEqualToString: @"vob"] ||
396 [o_ext isEqualToString: @"iso"] )
398 o_mrl_string = o_filename;
402 o_mrl_string = [NSString stringWithFormat: @"%s://%@",
403 b_stream ? "stream" : "file",
406 [o_mrl setStringValue: o_mrl_string];
409 - (IBAction)openFileBrowse:(id)sender
411 NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
413 [o_open_panel setAllowsMultipleSelection: NO];
414 [o_open_panel setCanChooseDirectories: YES];
415 [o_open_panel setTitle: _NS("Open File")];
416 [o_open_panel setPrompt: _NS("Open")];
418 [o_open_panel beginSheetForDirectory:nil
421 modalForWindow:[sender window]
423 didEndSelector: @selector(pathChosenInPanel:
429 - (void)pathChosenInPanel: (NSOpenPanel *) sheet withReturn:(int)returnCode contextInfo:(void *)contextInfo
431 if (returnCode == NSFileHandlingPanelOKButton)
433 NSString *o_filename = [[sheet filenames] objectAtIndex: 0];
434 [o_file_path setStringValue: o_filename];
435 [self openFilePathChanged: nil];
439 - (IBAction)openFileStreamChanged:(id)sender
441 [self openFilePathChanged: nil];
444 - (IBAction)openDiscTypeChanged:(id)sender
447 vlc_bool_t b_device, b_menus, b_title_chapter;
449 [o_disc_device removeAllItems];
450 b_title_chapter = ![o_disc_dvd_menus state];
452 o_type = [[o_disc_type selectedCell] title];
454 if ( [o_type isEqualToString: _NS("VIDEO_TS folder")] )
456 b_device = 0; b_menus = 1;
462 const char *psz_class = NULL;
465 if ( [o_type isEqualToString: _NS("VCD")] )
467 psz_class = kIOCDMediaClass;
469 b_menus = 0; b_title_chapter = 1;
470 [o_disc_dvd_menus setState: FALSE];
472 else if ( [o_type isEqualToString: _NS("Audio CD")])
474 psz_class = kIOCDMediaClass;
476 b_menus = 0; b_title_chapter = 0;
477 [o_disc_dvd_menus setState: FALSE];
481 psz_class = kIODVDMediaClass;
486 o_devices = GetEjectableMediaOfClass( psz_class );
487 if ( o_devices != nil )
489 int i_devices = [o_devices count];
495 for( i = 0; i < i_devices; i++ )
498 addItemWithObjectValue: [o_devices objectAtIndex: i]];
501 [o_disc_device selectItemAtIndex: 0];
505 [o_disc_device setStringValue:
506 [NSString stringWithFormat: _NS("No %@s found"), o_disc]];
511 [o_disc_device setEnabled: b_device];
512 [o_disc_title setEnabled: b_title_chapter];
513 [o_disc_title_stp setEnabled: b_title_chapter];
514 [o_disc_chapter setEnabled: b_title_chapter];
515 [o_disc_chapter_stp setEnabled: b_title_chapter];
516 [o_disc_videots_folder setEnabled: !b_device];
517 [o_disc_videots_btn_browse setEnabled: !b_device];
518 [o_disc_dvd_menus setEnabled: b_menus];
520 [self openDiscInfoChanged: nil];
523 - (IBAction)openDiscStepperChanged:(id)sender
525 int i_tag = [sender tag];
529 [o_disc_title setIntValue: [o_disc_title_stp intValue]];
531 else if( i_tag == 1 )
533 [o_disc_chapter setIntValue: [o_disc_chapter_stp intValue]];
536 [self openDiscInfoChanged: nil];
539 - (void)openDiscInfoChanged:(NSNotification *)o_notification
544 NSString *o_mrl_string;
545 int i_title, i_chapter;
548 o_type = [[o_disc_type selectedCell] title];
549 o_device = [o_disc_device stringValue];
550 i_title = [o_disc_title intValue];
551 i_chapter = [o_disc_chapter intValue];
552 o_videots = [o_disc_videots_folder stringValue];
553 b_menus = [o_disc_dvd_menus state];
555 if ( [o_type isEqualToString: _NS("VCD")] )
557 if ( [o_device isEqualToString:
558 [NSString stringWithFormat: _NS("No %@s found"), o_type]] )
560 o_mrl_string = [NSString stringWithFormat: @"vcd://%@@%i:%i",
561 o_device, i_title, i_chapter];
563 else if ( [o_type isEqualToString: _NS("Audio CD")] )
565 if ( [o_device isEqualToString:
566 [NSString stringWithFormat: _NS("No %@s found"), o_type]] )
568 o_mrl_string = [NSString stringWithFormat: @"cdda://%@",
571 else if ( [o_type isEqualToString: _NS("DVD")] )
573 if ( [o_device isEqualToString:
574 [NSString stringWithFormat: _NS("No %@s found"), o_type]] )
577 o_mrl_string = [NSString stringWithFormat: @"dvdnav://%@",
580 o_mrl_string = [NSString stringWithFormat: @"dvdread://%@@%i:%i",
581 o_device, i_title, i_chapter];
583 else /* VIDEO_TS folder */
586 o_mrl_string = [NSString stringWithFormat: @"dvdnav://%@",
589 o_mrl_string = [NSString stringWithFormat: @"dvdread://%@@%i:%i",
590 o_videots, i_title, i_chapter];
593 [o_mrl setStringValue: o_mrl_string];
596 - (IBAction)openDiscMenusChanged:(id)sender
598 [self openDiscInfoChanged: nil];
599 [self openDiscTypeChanged: nil];
602 - (IBAction)openVTSBrowse:(id)sender
604 NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
606 [o_open_panel setAllowsMultipleSelection: NO];
607 [o_open_panel setCanChooseFiles: NO];
608 [o_open_panel setCanChooseDirectories: YES];
609 [o_open_panel setTitle: _NS("Open VIDEO_TS Directory")];
610 [o_open_panel setPrompt: _NS("Open")];
612 if( [o_open_panel runModalForDirectory: nil
613 file: nil types: nil] == NSOKButton )
615 NSString *o_dirname = [[o_open_panel filenames] objectAtIndex: 0];
616 [o_disc_videots_folder setStringValue: o_dirname];
617 [self openDiscInfoChanged: nil];
621 - (IBAction)openNetModeChanged:(id)sender
628 o_mode = [[o_net_mode selectedCell] title];
630 if( [o_mode isEqualToString: _NS("UDP/RTP")] ) b_udp = TRUE;
631 else if( [o_mode isEqualToString: _NS("UDP/RTP Multicast")] ) b_udpm = TRUE;
632 else if( [o_mode isEqualToString: _NS("HTTP/FTP/MMS/RTSP")] ) b_http = TRUE;
634 [o_net_udp_port setEnabled: b_udp];
635 [o_net_udp_port_stp setEnabled: b_udp];
636 [o_net_udpm_addr setEnabled: b_udpm];
637 [o_net_udpm_port setEnabled: b_udpm];
638 [o_net_udpm_port_stp setEnabled: b_udpm];
639 [o_net_http_url setEnabled: b_http];
641 [self openNetInfoChanged: nil];
644 - (IBAction)openNetStepperChanged:(id)sender
646 int i_tag = [sender tag];
650 [o_net_udp_port setIntValue: [o_net_udp_port_stp intValue]];
652 else if( i_tag == 1 )
654 [o_net_udpm_port setIntValue: [o_net_udpm_port_stp intValue]];
657 [self openNetInfoChanged: nil];
660 - (void)openNetInfoChanged:(NSNotification *)o_notification
663 NSString *o_mrl_string = [NSString string];
664 intf_thread_t * p_intf = VLCIntf;
666 o_mode = [[o_net_mode selectedCell] title];
668 if( [o_mode isEqualToString: _NS("UDP/RTP")] )
670 int i_port = [o_net_udp_port intValue];
672 o_mrl_string = [NSString stringWithString: @"udp://"];
674 if( i_port != config_GetInt( p_intf, "server-port" ) )
677 [o_mrl_string stringByAppendingFormat: @"@:%i", i_port];
680 else if( [o_mode isEqualToString: _NS("UDP/RTP Multicast")] )
682 NSString *o_addr = [o_net_udpm_addr stringValue];
683 int i_port = [o_net_udpm_port intValue];
685 o_mrl_string = [NSString stringWithFormat: @"udp://@%@", o_addr];
687 if( i_port != config_GetInt( p_intf, "server-port" ) )
690 [o_mrl_string stringByAppendingFormat: @":%i", i_port];
693 else if( [o_mode isEqualToString: _NS("HTTP/FTP/MMS/RTSP")] )
695 NSString *o_url = [o_net_http_url stringValue];
697 if ( ![o_url hasPrefix:@"http:"] && ![o_url hasPrefix:@"ftp:"]
698 && ![o_url hasPrefix:@"mms"] && ![o_url hasPrefix:@"rtsp"] )
699 o_mrl_string = [NSString stringWithFormat: @"http://%@", o_url];
701 o_mrl_string = o_url;
704 [o_mrl setStringValue: o_mrl_string];
707 - (IBAction)openFile:(id)sender
709 NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
712 [o_open_panel setAllowsMultipleSelection: YES];
713 [o_open_panel setCanChooseDirectories: YES];
714 [o_open_panel setTitle: _NS("Open File")];
715 [o_open_panel setPrompt: _NS("Open")];
717 if( [o_open_panel runModalForDirectory: nil
718 file: nil types: nil] == NSOKButton )
720 NSArray *o_array = [NSArray array];
721 NSArray *o_values = [[o_open_panel filenames]
722 sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
724 for( i = 0; i < (int)[o_values count]; i++)
727 o_dic = [NSDictionary dictionaryWithObject:[o_values objectAtIndex:i] forKey:@"ITEM_URL"];
728 o_array = [o_array arrayByAddingObject: o_dic];
730 [o_playlist appendArray: o_array atPos: -1 enqueue:NO];
734 - (IBAction)subsChanged:(id)sender
736 if ([o_file_sub_ckbox state] == NSOnState)
738 [o_file_sub_btn_settings setEnabled:YES];
742 [o_file_sub_btn_settings setEnabled:NO];
746 - (IBAction)subSettings:(id)sender
748 [NSApp beginSheet: o_file_sub_sheet
749 modalForWindow: [sender window]
755 - (IBAction)subFileBrowse:(id)sender
757 NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
759 [o_open_panel setAllowsMultipleSelection: NO];
760 [o_open_panel setTitle: _NS("Open File")];
761 [o_open_panel setPrompt: _NS("Open")];
763 if( [o_open_panel runModalForDirectory: nil
764 file: nil types: nil] == NSOKButton )
766 NSString *o_filename = [[o_open_panel filenames] objectAtIndex: 0];
767 [o_file_sub_path setStringValue: o_filename];
771 - (IBAction)subOverride:(id)sender
773 BOOL b_state = [o_file_sub_override state];
774 [o_file_sub_delay setEnabled: b_state];
775 [o_file_sub_delay_stp setEnabled: b_state];
776 [o_file_sub_fps setEnabled: b_state];
777 [o_file_sub_fps_stp setEnabled: b_state];
780 - (IBAction)subDelayStepperChanged:(id)sender
782 [o_file_sub_delay setIntValue: [o_file_sub_delay_stp intValue]];
785 - (IBAction)subFpsStepperChanged:(id)sender;
787 [o_file_sub_fps setFloatValue: [o_file_sub_fps_stp floatValue]];
790 - (IBAction)subCloseSheet:(id)sender
792 [o_file_sub_sheet orderOut:sender];
793 [NSApp endSheet: o_file_sub_sheet];
796 - (IBAction)panelCancel:(id)sender
798 [NSApp stopModalWithCode: 0];
801 - (IBAction)panelOk:(id)sender
803 if( [[o_mrl stringValue] length] )
805 [NSApp stopModalWithCode: 1];