X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=macosx%2FHBQueueController.mm;h=9f7ce38a054dd4038d431911c322e57f39bba2d4;hb=4f0019f03c2e85e8634150ff0c9a31bee6d35ce5;hp=bcc6adaf6ea76cf12d9e4c3566d9a3f41ade5886;hpb=55c1b151f41e337f46abe34b6f1029e69ef0316f;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/macosx/HBQueueController.mm b/macosx/HBQueueController.mm index bcc6adaf..9f7ce38a 100644 --- a/macosx/HBQueueController.mm +++ b/macosx/HBQueueController.mm @@ -75,8 +75,6 @@ return fIsDragging; } - - @end #pragma mark Toolbar Identifiers @@ -254,7 +252,7 @@ static NSString* HBQueuePauseResumeToolbarIdentifier = @"HBQueuePauseRe if( ![[self window] setFrameUsingName:@"Queue"] ) [[self window] center]; [self setWindowFrameAutosaveName:@"Queue"]; - [[self window] setExcludedFromWindowsMenu:YES]; + //[[self window] setExcludedFromWindowsMenu:YES]; /* lets setup our queue list outline view for drag and drop here */ [fOutlineView registerForDraggedTypes: [NSArray arrayWithObject:DragDropSimplePboardType] ]; @@ -598,9 +596,53 @@ static NSString* HBQueuePauseResumeToolbarIdentifier = @"HBQueuePauseRe } } -#pragma mark - + +//------------------------------------------------------------------------------------ +// Send the selected queue item back to the main window for rescan and possible edit. +//------------------------------------------------------------------------------------ +- (IBAction)editSelectedQueueItem: (id)sender +{ + NSIndexSet * selectedRows = [fOutlineView selectedRowIndexes]; + NSUInteger row = [selectedRows firstIndex]; + if( row == NSNotFound ) + return; + /* if this is a currently encoding job, we need to be sure to alert the user, + * to let them decide to cancel it first, then if they do, we can come back and + * remove it */ + + if ([[[fJobGroups objectAtIndex:row] objectForKey:@"Status"] integerValue] == 1) + { + /* We pause the encode here so that it doesn't finish right after and then + * screw up the sync while the window is open + */ + [fHBController Pause:NULL]; + NSString * alertTitle = [NSString stringWithFormat:NSLocalizedString(@"Stop This Encode and Remove It ?", nil)]; + // Which window to attach the sheet to? + NSWindow * docWindow = nil; + if ([sender respondsToSelector: @selector(window)]) + docWindow = [sender window]; + + + NSBeginCriticalAlertSheet( + alertTitle, + NSLocalizedString(@"Keep Encoding", nil), + nil, + NSLocalizedString(@"Stop Encoding and Delete", nil), + docWindow, self, + nil, @selector(didDimissCancelCurrentJob:returnCode:contextInfo:), nil, + NSLocalizedString(@"Your movie will be lost if you don't continue encoding.", nil)); + + } + else + { + /* since we are not a currently encoding item, we can just be cancelled */ + [fHBController rescanQueueItemToMainWindow:[[fJobGroups objectAtIndex:row] objectForKey:@"SourcePath"] scanTitleNum:[[[fJobGroups objectAtIndex:row] objectForKey:@"TitleNumber"] integerValue] selectedQueueItem:row]; + + } +} +#pragma mark - #pragma mark Animate Endcoding Item @@ -922,11 +964,7 @@ return ![(HBQueueOutlineView*)outlineView isDragging]; if ([[tableColumn identifier] isEqualToString:@"desc"]) { - /* This should have caused the description we wanted to show*/ - //return [item objectForKey:@"SourceName"]; - /* code to build the description as per old queue */ - //return [self formatEncodeItemDescription:item]; /* Below should be put into a separate method but I am way too f'ing lazy right now */ NSMutableAttributedString * finalString = [[[NSMutableAttributedString alloc] initWithString: @""] autorelease]; @@ -963,9 +1001,24 @@ return ![(HBQueueOutlineView*)outlineView isDragging]; NSString * titleString = [NSString stringWithFormat:@"Title %d", [[item objectForKey:@"TitleNumber"] intValue]]; - NSString * chapterString = ([[item objectForKey:@"ChapterStart"] intValue] == [[item objectForKey:@"ChapterEnd"] intValue]) ? - [NSString stringWithFormat:@"Chapter %d", [[item objectForKey:@"ChapterStart"] intValue]] : - [NSString stringWithFormat:@"Chapters %d through %d", [[item objectForKey:@"ChapterStart"] intValue], [[item objectForKey:@"ChapterEnd"] intValue]]; + NSString * startStopString = @""; + if ([[item objectForKey:@"fEncodeStartStop"] intValue] == 0) + { + /* Start Stop is chapters */ + startStopString = ([[item objectForKey:@"ChapterStart"] intValue] == [[item objectForKey:@"ChapterEnd"] intValue]) ? + [NSString stringWithFormat:@"Chapter %d", [[item objectForKey:@"ChapterStart"] intValue]] : + [NSString stringWithFormat:@"Chapters %d through %d", [[item objectForKey:@"ChapterStart"] intValue], [[item objectForKey:@"ChapterEnd"] intValue]]; + } + else if ([[item objectForKey:@"fEncodeStartStop"] intValue] == 1) + { + /* Start Stop is seconds */ + startStopString = [NSString stringWithFormat:@"Seconds %d through %d", [[item objectForKey:@"StartSeconds"] intValue], [[item objectForKey:@"StartSeconds"] intValue] + [[item objectForKey:@"StopSeconds"] intValue]]; + } + else if ([[item objectForKey:@"fEncodeStartStop"] intValue] == 2) + { + /* Start Stop is Frames */ + startStopString = [NSString stringWithFormat:@"Frames %d through %d", [[item objectForKey:@"StartFrame"] intValue], [[item objectForKey:@"StartFrame"] intValue] + [[item objectForKey:@"StopFrame"] intValue]]; + } NSString * passesString = @""; /* check to see if our first subtitle track is Foreign Language Search, in which case there is an in depth scan */ @@ -994,7 +1047,7 @@ return ![(HBQueueOutlineView*)outlineView isDragging]; /* lets add the output file name to the title string here */ NSString * outputFilenameString = [[item objectForKey:@"DestinationPath"] lastPathComponent]; - summaryInfo = [NSString stringWithFormat: @" (%@, %@, %@) -> %@", titleString, chapterString, passesString, outputFilenameString]; + summaryInfo = [NSString stringWithFormat: @" (%@, %@, %@) -> %@", titleString, startStopString, passesString, outputFilenameString]; [finalString appendString:[NSString stringWithFormat:@"%@\n", summaryInfo] withAttributes:detailAttr]; @@ -1023,7 +1076,7 @@ return ![(HBQueueOutlineView*)outlineView isDragging]; [item objectForKey:@"Audio1Samplerate"], [item objectForKey:@"Audio1Bitrate"]]; - if ([[item objectForKey:@"Audio1TrackDRCSlider"] floatValue] > 1.00) + if ([[item objectForKey:@"Audio1TrackDRCSlider"] floatValue] > 0.00) { audioDetail1 = [NSString stringWithFormat:@"%@, DRC: %@",audioDetail1,[item objectForKey:@"Audio1TrackDRCSlider"]]; } @@ -1043,7 +1096,7 @@ return ![(HBQueueOutlineView*)outlineView isDragging]; [item objectForKey:@"Audio2Samplerate"], [item objectForKey:@"Audio2Bitrate"]]; - if ([[item objectForKey:@"Audio2TrackDRCSlider"] floatValue] > 1.00) + if ([[item objectForKey:@"Audio2TrackDRCSlider"] floatValue] > 0.00) { audioDetail2 = [NSString stringWithFormat:@"%@, DRC: %@",audioDetail2,[item objectForKey:@"Audio2TrackDRCSlider"]]; } @@ -1063,7 +1116,7 @@ return ![(HBQueueOutlineView*)outlineView isDragging]; [item objectForKey:@"Audio3Samplerate"], [item objectForKey:@"Audio3Bitrate"]]; - if ([[item objectForKey:@"Audio3TrackDRCSlider"] floatValue] > 1.00) + if ([[item objectForKey:@"Audio3TrackDRCSlider"] floatValue] > 0.00) { audioDetail3 = [NSString stringWithFormat:@"%@, DRC: %@",audioDetail3,[item objectForKey:@"Audio3TrackDRCSlider"]]; } @@ -1083,7 +1136,7 @@ return ![(HBQueueOutlineView*)outlineView isDragging]; [item objectForKey:@"Audio4Samplerate"], [item objectForKey:@"Audio4Bitrate"]]; - if ([[item objectForKey:@"Audio4TrackDRCSlider"] floatValue] > 1.00) + if ([[item objectForKey:@"Audio4TrackDRCSlider"] floatValue] > 0.00) { audioDetail4 = [NSString stringWithFormat:@"%@, DRC: %@",audioDetail4,[item objectForKey:@"Audio4TrackDRCSlider"]]; } @@ -1136,6 +1189,7 @@ return ![(HBQueueOutlineView*)outlineView isDragging]; [finalString appendString: @"Destination: " withAttributes:detailBoldAttr]; [finalString appendString: [item objectForKey:@"DestinationPath"] withAttributes:detailAttr]; [finalString appendString:@"\n" withAttributes:detailAttr]; + /* Fifth Line Picture Details*/ NSString * pictureInfo; pictureInfo = [NSString stringWithFormat:@"%@", [item objectForKey:@"PictureSizingSummary"]]; @@ -1143,6 +1197,7 @@ return ![(HBQueueOutlineView*)outlineView isDragging]; { pictureInfo = [pictureInfo stringByAppendingString:@" Keep Aspect Ratio"]; } + if ([[item objectForKey:@"VideoGrayScale"] intValue] == 1) { pictureInfo = [pictureInfo stringByAppendingString:@", Grayscale"];