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")];
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 text 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")];
237 p_item = config_FindConfig( VLC_OBJECT(p_intf), "subsdec-encoding" );
241 for( i_index = 0; p_item->ppsz_list && p_item->ppsz_list[i_index];
244 [o_file_sub_encoding_pop addItemWithTitle:
245 [NSString stringWithCString:
246 p_item->ppsz_list[i_index]]];
248 [o_file_sub_encoding_pop selectItemWithTitle:
249 [NSString stringWithCString:
253 p_item = config_FindConfig( VLC_OBJECT(p_intf), "subsdec-align" );
257 for ( i_index = 0; i_index < p_item->i_list; i_index++ )
259 [o_file_sub_align_pop addItemWithTitle:
260 [NSString stringWithUTF8String:
261 p_item->ppsz_list_text[i_index]]];
263 [o_file_sub_align_pop selectItemAtIndex: p_item->i_value];
266 p_item = config_FindConfig( VLC_OBJECT(p_intf), "freetype-rel-fontsize" );
270 for ( i_index = 0; i_index < p_item->i_list; i_index++ )
272 [o_file_sub_size_pop addItemWithTitle:
273 [NSString stringWithUTF8String:
274 p_item->ppsz_list_text[i_index]]];
275 if ( p_item->i_value == p_item->pi_list[i_index] )
277 [o_file_sub_size_pop selectItemAtIndex: i_index];
283 - (void)openTarget:(int)i_type
287 [o_tabview selectTabViewItemAtIndex: i_type];
288 [o_file_sub_ckbox setState: NSOffState];
290 i_result = [NSApp runModalForWindow: o_panel];
295 NSMutableDictionary *o_dic;
296 NSMutableArray *o_options = [NSMutableArray array];
299 o_dic = [NSMutableDictionary dictionaryWithObject: [o_mrl stringValue] forKey: @"ITEM_URL"];
300 if( [o_file_sub_ckbox state] == NSOnState )
302 intf_thread_t * p_intf = VLCIntf;
303 module_config_t * p_item;
305 [o_options addObject: [NSString stringWithFormat: @"sub-file=%s", [[o_file_sub_path stringValue] fileSystemRepresentation]]];
306 if( [o_file_sub_override state] == NSOnState )
308 [o_options addObject: [NSString stringWithFormat: @"sub-delay=%i", (int)( [o_file_sub_delay intValue] * 10 )]];
309 [o_options addObject: [NSString stringWithFormat: @"sub-fps=%f", [o_file_sub_fps floatValue]]];
311 [o_options addObject: [NSString stringWithFormat:
312 @"subsdec-encoding=%@",
313 [o_file_sub_encoding_pop titleOfSelectedItem]]];
314 [o_options addObject: [NSString stringWithFormat:
316 [o_file_sub_align_pop indexOfSelectedItem]]];
318 p_item = config_FindConfig( VLC_OBJECT(p_intf),
319 "freetype-rel-fontsize" );
323 [o_options addObject: [NSString stringWithFormat:
324 @"freetype-rel-fontsize=%i",
325 p_item->pi_list[[o_file_sub_size_pop indexOfSelectedItem]]]];
328 if( [o_output_ckbox state] == NSOnState )
330 for (i = 0 ; i < [[o_sout_options getMRL] count] ; i++)
332 [o_options addObject: [NSString stringWithString:
333 [[(VLCOutput *)o_sout_options getMRL] objectAtIndex: i]]];
336 [o_dic setObject: (NSArray *)[o_options copy] forKey: @"ITEM_OPTIONS"];
337 [o_playlist appendArray: [NSArray arrayWithObject: o_dic] atPos: -1 enqueue:NO];
341 - (void)tabView:(NSTabView *)o_tv didSelectTabViewItem:(NSTabViewItem *)o_tvi
343 NSString *o_label = [o_tvi label];
345 if( [o_label isEqualToString: _NS("File")] )
347 [self openFilePathChanged: nil];
349 else if( [o_label isEqualToString: _NS("Disc")] )
351 [self openDiscTypeChanged: nil];
353 else if( [o_label isEqualToString: _NS("Network")] )
355 [self openNetModeChanged: nil];
359 - (IBAction)openFileGeneric:(id)sender
361 [self openFilePathChanged: nil];
362 [self openTarget: 0];
365 - (IBAction)openDisc:(id)sender
367 [self openDiscTypeChanged: nil];
368 [self openTarget: 1];
371 - (IBAction)openNet:(id)sender
373 [self openNetModeChanged: nil];
374 [self openTarget: 2];
377 - (void)openFilePathChanged:(NSNotification *)o_notification
379 NSString *o_mrl_string;
380 NSString *o_filename = [o_file_path stringValue];
381 NSString *o_ext = [o_filename pathExtension];
382 vlc_bool_t b_stream = [o_file_stream state];
385 [[NSFileManager defaultManager] fileExistsAtPath:o_filename isDirectory:&b_dir];
389 o_mrl_string = [NSString stringWithFormat: @"dir:%@", o_filename];
391 else if( [o_ext isEqualToString: @"bin"] ||
392 [o_ext isEqualToString: @"cue"] ||
393 [o_ext isEqualToString: @"vob"] ||
394 [o_ext isEqualToString: @"iso"] )
396 o_mrl_string = o_filename;
400 o_mrl_string = [NSString stringWithFormat: @"%s://%@",
401 b_stream ? "stream" : "file",
404 [o_mrl setStringValue: o_mrl_string];
407 - (IBAction)openFileBrowse:(id)sender
409 NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
411 [o_open_panel setAllowsMultipleSelection: NO];
412 [o_open_panel setCanChooseDirectories: YES];
413 [o_open_panel setTitle: _NS("Open File")];
414 [o_open_panel setPrompt: _NS("Open")];
416 [o_open_panel beginSheetForDirectory:nil
419 modalForWindow:[sender window]
421 didEndSelector: @selector(pathChosenInPanel:
427 - (void)pathChosenInPanel: (NSOpenPanel *) sheet withReturn:(int)returnCode contextInfo:(void *)contextInfo
429 if (returnCode == NSFileHandlingPanelOKButton)
431 NSString *o_filename = [[sheet filenames] objectAtIndex: 0];
432 [o_file_path setStringValue: o_filename];
433 [self openFilePathChanged: nil];
437 - (IBAction)openFileStreamChanged:(id)sender
439 [self openFilePathChanged: nil];
442 - (IBAction)openDiscTypeChanged:(id)sender
445 vlc_bool_t b_device, b_menus, b_title_chapter;
447 [o_disc_device removeAllItems];
448 b_title_chapter = ![o_disc_dvd_menus state];
450 o_type = [[o_disc_type selectedCell] title];
452 if ( [o_type isEqualToString: _NS("VIDEO_TS folder")] )
454 b_device = 0; b_menus = 1;
460 const char *psz_class = NULL;
463 if ( [o_type isEqualToString: _NS("VCD")] )
465 psz_class = kIOCDMediaClass;
467 b_menus = 0; b_title_chapter = 1;
468 [o_disc_dvd_menus setState: FALSE];
470 else if ( [o_type isEqualToString: _NS("Audio CD")])
472 psz_class = kIOCDMediaClass;
474 b_menus = 0; b_title_chapter = 0;
475 [o_disc_dvd_menus setState: FALSE];
479 psz_class = kIODVDMediaClass;
484 o_devices = GetEjectableMediaOfClass( psz_class );
485 if ( o_devices != nil )
487 int i_devices = [o_devices count];
493 for( i = 0; i < i_devices; i++ )
496 addItemWithObjectValue: [o_devices objectAtIndex: i]];
499 [o_disc_device selectItemAtIndex: 0];
503 [o_disc_device setStringValue:
504 [NSString stringWithFormat: _NS("No %@s found"), o_disc]];
509 [o_disc_device setEnabled: b_device];
510 [o_disc_title setEnabled: b_title_chapter];
511 [o_disc_title_stp setEnabled: b_title_chapter];
512 [o_disc_chapter setEnabled: b_title_chapter];
513 [o_disc_chapter_stp setEnabled: b_title_chapter];
514 [o_disc_videots_folder setEnabled: !b_device];
515 [o_disc_videots_btn_browse setEnabled: !b_device];
516 [o_disc_dvd_menus setEnabled: b_menus];
518 [self openDiscInfoChanged: nil];
521 - (IBAction)openDiscStepperChanged:(id)sender
523 int i_tag = [sender tag];
527 [o_disc_title setIntValue: [o_disc_title_stp intValue]];
529 else if( i_tag == 1 )
531 [o_disc_chapter setIntValue: [o_disc_chapter_stp intValue]];
534 [self openDiscInfoChanged: nil];
537 - (void)openDiscInfoChanged:(NSNotification *)o_notification
542 NSString *o_mrl_string;
543 int i_title, i_chapter;
546 o_type = [[o_disc_type selectedCell] title];
547 o_device = [o_disc_device stringValue];
548 i_title = [o_disc_title intValue];
549 i_chapter = [o_disc_chapter intValue];
550 o_videots = [o_disc_videots_folder stringValue];
551 b_menus = [o_disc_dvd_menus state];
553 if ( [o_type isEqualToString: _NS("VCD")] )
555 if ( [o_device isEqualToString:
556 [NSString stringWithFormat: _NS("No %@s found"), o_type]] )
558 o_mrl_string = [NSString stringWithFormat: @"vcd://%@@%i,%i",
559 o_device, i_title, i_chapter];
561 else if ( [o_type isEqualToString: _NS("Audio CD")] )
563 if ( [o_device isEqualToString:
564 [NSString stringWithFormat: _NS("No %@s found"), o_type]] )
566 o_mrl_string = [NSString stringWithFormat: @"cdda://%@",
569 else if ( [o_type isEqualToString: _NS("DVD")] )
571 if ( [o_device isEqualToString:
572 [NSString stringWithFormat: _NS("No %@s found"), o_type]] )
575 o_mrl_string = [NSString stringWithFormat: @"dvdnav://%@",
578 o_mrl_string = [NSString stringWithFormat: @"dvdread://%@@%i,%i",
579 o_device, i_title, i_chapter];
581 else /* VIDEO_TS folder */
584 o_mrl_string = [NSString stringWithFormat: @"dvdnav://%@",
587 o_mrl_string = [NSString stringWithFormat: @"dvdread://%@@%i,%i",
588 o_videots, i_title, i_chapter];
591 [o_mrl setStringValue: o_mrl_string];
594 - (IBAction)openDiscMenusChanged:(id)sender
596 [self openDiscInfoChanged: nil];
597 [self openDiscTypeChanged: nil];
600 - (IBAction)openVTSBrowse:(id)sender
602 NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
604 [o_open_panel setAllowsMultipleSelection: NO];
605 [o_open_panel setCanChooseFiles: NO];
606 [o_open_panel setCanChooseDirectories: YES];
607 [o_open_panel setTitle: _NS("Open VIDEO_TS Directory")];
608 [o_open_panel setPrompt: _NS("Open")];
610 if( [o_open_panel runModalForDirectory: nil
611 file: nil types: nil] == NSOKButton )
613 NSString *o_dirname = [[o_open_panel filenames] objectAtIndex: 0];
614 [o_disc_videots_folder setStringValue: o_dirname];
615 [self openDiscInfoChanged: nil];
619 - (IBAction)openNetModeChanged:(id)sender
626 o_mode = [[o_net_mode selectedCell] title];
628 if( [o_mode isEqualToString: _NS("UDP/RTP")] ) b_udp = TRUE;
629 else if( [o_mode isEqualToString: _NS("UDP/RTP Multicast")] ) b_udpm = TRUE;
630 else if( [o_mode isEqualToString: _NS("HTTP/FTP/MMS")] ) b_http = TRUE;
632 [o_net_udp_port setEnabled: b_udp];
633 [o_net_udp_port_stp setEnabled: b_udp];
634 [o_net_udpm_addr setEnabled: b_udpm];
635 [o_net_udpm_port setEnabled: b_udpm];
636 [o_net_udpm_port_stp setEnabled: b_udpm];
637 [o_net_http_url setEnabled: b_http];
639 [self openNetInfoChanged: nil];
642 - (IBAction)openNetStepperChanged:(id)sender
644 int i_tag = [sender tag];
648 [o_net_udp_port setIntValue: [o_net_udp_port_stp intValue]];
650 else if( i_tag == 1 )
652 [o_net_udpm_port setIntValue: [o_net_udpm_port_stp intValue]];
655 [self openNetInfoChanged: nil];
658 - (void)openNetInfoChanged:(NSNotification *)o_notification
661 NSString *o_mrl_string = [NSString string];
662 intf_thread_t * p_intf = VLCIntf;
664 o_mode = [[o_net_mode selectedCell] title];
666 if( [o_mode isEqualToString: _NS("UDP/RTP")] )
668 int i_port = [o_net_udp_port intValue];
670 o_mrl_string = [NSString stringWithString: @"udp://"];
672 if( i_port != config_GetInt( p_intf, "server-port" ) )
675 [o_mrl_string stringByAppendingFormat: @"@:%i", i_port];
678 else if( [o_mode isEqualToString: _NS("UDP/RTP Multicast")] )
680 NSString *o_addr = [o_net_udpm_addr stringValue];
681 int i_port = [o_net_udpm_port intValue];
683 o_mrl_string = [NSString stringWithFormat: @"udp://@%@", o_addr];
685 if( i_port != config_GetInt( p_intf, "server-port" ) )
688 [o_mrl_string stringByAppendingFormat: @":%i", i_port];
691 else if( [o_mode isEqualToString: _NS("HTTP/FTP/MMS")] )
693 NSString *o_url = [o_net_http_url stringValue];
695 if ( ![o_url hasPrefix:@"http:"] && ![o_url hasPrefix:@"ftp:"]
696 && ![o_url hasPrefix:@"mms"] )
697 o_mrl_string = [NSString stringWithFormat: @"http://%@", o_url];
699 o_mrl_string = o_url;
702 [o_mrl setStringValue: o_mrl_string];
705 - (IBAction)openFile:(id)sender
707 NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
710 [o_open_panel setAllowsMultipleSelection: YES];
711 [o_open_panel setCanChooseDirectories: YES];
712 [o_open_panel setTitle: _NS("Open File")];
713 [o_open_panel setPrompt: _NS("Open")];
715 if( [o_open_panel runModalForDirectory: nil
716 file: nil types: nil] == NSOKButton )
718 NSArray *o_array = [NSArray array];
719 NSArray *o_values = [[o_open_panel filenames]
720 sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
722 for( i = 0; i < (int)[o_values count]; i++)
725 o_dic = [NSDictionary dictionaryWithObject:[o_values objectAtIndex:i] forKey:@"ITEM_URL"];
726 o_array = [o_array arrayByAddingObject: o_dic];
728 [o_playlist appendArray: o_array atPos: -1 enqueue:NO];
732 - (IBAction)subsChanged:(id)sender
734 if ([o_file_sub_ckbox state] == NSOnState)
736 [o_file_sub_btn_settings setEnabled:YES];
740 [o_file_sub_btn_settings setEnabled:NO];
744 - (IBAction)subSettings:(id)sender
746 [NSApp beginSheet: o_file_sub_sheet
747 modalForWindow: [sender window]
753 - (IBAction)subFileBrowse:(id)sender
755 NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
757 [o_open_panel setAllowsMultipleSelection: NO];
758 [o_open_panel setTitle: _NS("Open File")];
759 [o_open_panel setPrompt: _NS("Open")];
761 if( [o_open_panel runModalForDirectory: nil
762 file: nil types: nil] == NSOKButton )
764 NSString *o_filename = [[o_open_panel filenames] objectAtIndex: 0];
765 [o_file_sub_path setStringValue: o_filename];
769 - (IBAction)subOverride:(id)sender
771 BOOL b_state = [o_file_sub_override state];
772 [o_file_sub_delay setEnabled: b_state];
773 [o_file_sub_delay_stp setEnabled: b_state];
774 [o_file_sub_fps setEnabled: b_state];
775 [o_file_sub_fps_stp setEnabled: b_state];
778 - (IBAction)subDelayStepperChanged:(id)sender
780 [o_file_sub_delay setIntValue: [o_file_sub_delay_stp intValue]];
783 - (IBAction)subFpsStepperChanged:(id)sender;
785 [o_file_sub_fps setFloatValue: [o_file_sub_fps_stp floatValue]];
788 - (IBAction)subCloseSheet:(id)sender
790 [o_file_sub_sheet orderOut:sender];
791 [NSApp endSheet: o_file_sub_sheet];
794 - (IBAction)panelCancel:(id)sender
796 [NSApp stopModalWithCode: 0];
799 - (IBAction)panelOk:(id)sender
801 if( [[o_mrl stringValue] length] )
803 [NSApp stopModalWithCode: 1];