#import "open.h"
#import "output.h"
#import "eyetv.h"
+#import "misc.h"
#import <vlc_url.h>
[o_capture_width_lbl setStringValue: [NSString stringWithFormat:@"%@:",_NS("Image width")]];
[o_capture_height_lbl setStringValue: [NSString stringWithFormat:@"%@:",_NS("Image height")]];
+ // setup start / stop time fields
+ [o_file_starttime_fld setFormatter:[[[PositionFormatter alloc] init] autorelease]];
+ [o_file_stoptime_fld setFormatter:[[[PositionFormatter alloc] init] autorelease]];
+
[self qtkvideoDevices];
[o_qtk_video_device_pop removeAllItems];
msg_Dbg(VLCIntf, "Found %lu video capture devices", [qtkvideoDevices count]);
p_item->list.i[[o_file_sub_size_pop indexOfSelectedItem]]]];
}
}
- NSArray * components = [[o_file_starttime_fld stringValue] componentsSeparatedByString:@":"];
- NSUInteger componentCount = [components count];
- NSInteger tempValue;
- if (componentCount == 1)
- tempValue = 1000000 * ([[components objectAtIndex:0] intValue]);
- else if (componentCount == 2)
- tempValue = 1000000 * ([[components objectAtIndex:0] intValue] * 60 + [[components objectAtIndex:1] intValue]);
- else if (componentCount == 3)
- tempValue = 1000000 * ([[components objectAtIndex:0] intValue] * 3600 + [[components objectAtIndex:1] intValue] * 60 + [[components objectAtIndex:2] intValue]);
- if (tempValue > 0)
- [o_options addObject: [NSString stringWithFormat:@"start-time=%li", tempValue]];
- components = [[o_file_stoptime_fld stringValue] componentsSeparatedByString:@":"];
- componentCount = [components count];
- if (componentCount == 1)
- tempValue = 1000000 * ([[components objectAtIndex:0] intValue]);
- else if (componentCount == 2)
- tempValue = 1000000 * ([[components objectAtIndex:0] intValue] * 60 + [[components objectAtIndex:1] intValue]);
- else if (componentCount == 3)
- tempValue = 1000000 * ([[components objectAtIndex:0] intValue] * 3600 + [[components objectAtIndex:1] intValue] * 60 + [[components objectAtIndex:2] intValue]);
- if (tempValue > 0)
- [o_options addObject: [NSString stringWithFormat:@"stop-time=%li", tempValue]];
+ if ([o_file_custom_timing_ckb state] == NSOnState) {
+ NSArray * components = [[o_file_starttime_fld stringValue] componentsSeparatedByString:@":"];
+ NSUInteger componentCount = [components count];
+ NSInteger tempValue;
+ if (componentCount == 1)
+ tempValue = [[components objectAtIndex:0] intValue];
+ else if (componentCount == 2)
+ tempValue = [[components objectAtIndex:0] intValue] * 60 + [[components objectAtIndex:1] intValue];
+ else if (componentCount == 3)
+ tempValue = [[components objectAtIndex:0] intValue] * 3600 + [[components objectAtIndex:1] intValue] * 60 + [[components objectAtIndex:2] intValue];
+ if (tempValue > 0)
+ [o_options addObject: [NSString stringWithFormat:@"start-time=%li", tempValue]];
+ components = [[o_file_stoptime_fld stringValue] componentsSeparatedByString:@":"];
+ componentCount = [components count];
+ if (componentCount == 1)
+ tempValue = [[components objectAtIndex:0] intValue];
+ else if (componentCount == 2)
+ tempValue = [[components objectAtIndex:0] intValue] * 60 + [[components objectAtIndex:1] intValue];
+ else if (componentCount == 3)
+ tempValue = [[components objectAtIndex:0] intValue] * 3600 + [[components objectAtIndex:1] intValue] * 60 + [[components objectAtIndex:2] intValue];
+ if (tempValue > 0)
+ [o_options addObject: [NSString stringWithFormat:@"stop-time=%li", tempValue]];
+ }
if ([o_output_ckbox state] == NSOnState) {
NSArray * soutMRL = [o_sout_options soutMRL];
NSUInteger count = [soutMRL count];
for (NSUInteger i = 0 ; i < count ; i++)
- [o_options addObject: [NSString stringWithString: [soutMRL objectAtIndex: i]]];
+ [o_options addObject: [NSString stringWithString: [soutMRL objectAtIndex:i]]];
}
if ([o_file_slave_ckbox state] && o_file_slave_path)
[o_options addObject: [NSString stringWithFormat: @"input-slave=%@", o_file_slave_path]];
{
NSInteger i_selectedDevice = [o_qtk_video_device_pop indexOfSelectedItem];
if ([qtkvideoDevices count] >= 1) {
- NSValue *sizes = [[[[qtkvideoDevices objectAtIndex:i_selectedDevice] formatDescriptions] objectAtIndex: 0] attributeForKey: QTFormatDescriptionVideoEncodedPixelsSizeAttribute];
+ NSValue *sizes = [[[[qtkvideoDevices objectAtIndex:i_selectedDevice] formatDescriptions] objectAtIndex:0] attributeForKey: QTFormatDescriptionVideoEncodedPixelsSizeAttribute];
[o_capture_width_fld setIntValue: [sizes sizeValue].width];
[o_capture_height_fld setIntValue: [sizes sizeValue].height];
NSMutableArray *o_values = [NSMutableArray arrayWithCapacity:count];
NSMutableArray *o_array = [NSMutableArray arrayWithCapacity:count];
for (NSUInteger i = 0; i < count; i++)
- [o_values addObject: [[o_urls objectAtIndex: i] path]];
+ [o_values addObject: [[o_urls objectAtIndex:i] path]];
[o_values sortUsingSelector:@selector(caseInsensitiveCompare:)];
for (NSUInteger i = 0; i < count; i++) {
if (returnCode == NSFileHandlingPanelOKButton) {
if (o_file_path)
[o_file_path release];
- o_file_path = [[[o_open_panel URLs] objectAtIndex: 0] path];
+ o_file_path = [[[o_open_panel URLs] objectAtIndex:0] path];
[o_file_path retain];
[self openFilePathChanged: nil];
}
if ([o_open_panel runModal] == NSOKButton) {
if (o_file_slave_path)
[o_file_slave_path release];
- o_file_slave_path = [[[o_open_panel URLs] objectAtIndex: 0] path];
+ o_file_slave_path = [[[o_open_panel URLs] objectAtIndex:0] path];
[o_file_slave_path retain];
}
}
NSUInteger count = [o_allMediaDevices count];
if (count > 0) {
for (NSUInteger i = 0; i < count ; i++) {
- NSDictionary *o_dict = [o_allMediaDevices objectAtIndex: i];
+ NSDictionary *o_dict = [o_allMediaDevices objectAtIndex:i];
[o_disc_selector_pop addItemWithTitle: [[NSFileManager defaultManager] displayNameAtPath:[o_dict objectForKey:@"path"]]];
}
- (IBAction)discSelectorChanged:(id)sender
{
- NSDictionary *o_dict = [o_allMediaDevices objectAtIndex: [o_disc_selector_pop indexOfSelectedItem]];
+ NSDictionary *o_dict = [o_allMediaDevices objectAtIndex:[o_disc_selector_pop indexOfSelectedItem]];
[self showOpticalAtPath:o_dict];
}
[o_open_panel setAllowedFileTypes:@[@"public.directory"]];
if ([o_open_panel runModal] == NSOKButton) {
- NSString *o_path = [[[o_open_panel URLs] objectAtIndex: 0] path];
+ NSString *o_path = [[[o_open_panel URLs] objectAtIndex:0] path];
if ([o_path length] > 0) {
[NSThread detachNewThreadSelector:@selector(scanSpecialPath:) toTarget:self withObject:o_path];
}
- (IBAction)dvdreadOptionChanged:(id)sender
{
- NSDictionary *o_dict = [o_allMediaDevices objectAtIndex: [o_disc_selector_pop indexOfSelectedItem]];
+ NSDictionary *o_dict = [o_allMediaDevices objectAtIndex:[o_disc_selector_pop indexOfSelectedItem]];
NSString *o_device_path = [o_dict objectForKey:@"devicePath"];
if (sender == o_disc_dvdwomenus_enablemenus_btn) {
if (sender == o_disc_vcd_chapter_stp)
[o_disc_vcd_chapter setIntValue: [o_disc_vcd_chapter_stp intValue]];
- NSString *o_device_path = [[o_allMediaDevices objectAtIndex: [o_disc_selector_pop indexOfSelectedItem]] objectForKey:@"devicePath"];
+ NSString *o_device_path = [[o_allMediaDevices objectAtIndex:[o_disc_selector_pop indexOfSelectedItem]] objectForKey:@"devicePath"];
[self setMRL: [NSString stringWithFormat: @"vcd://%@@%i:%i", o_device_path, [o_disc_vcd_title intValue], [o_disc_vcd_chapter intValue]]];
}
[o_open_panel setPrompt: _NS("Open")];
if ([o_open_panel runModal] == NSOKButton) {
- o_sub_path = [[[o_open_panel URLs] objectAtIndex: 0] path];
+ o_sub_path = [[[o_open_panel URLs] objectAtIndex:0] path];
[o_sub_path retain];
[o_file_subtitles_filename_lbl setStringValue: [[NSFileManager defaultManager] displayNameAtPath:o_sub_path]];
[o_file_sub_path_fld setStringValue: [o_file_subtitles_filename_lbl stringValue]];