From 84f02ecb20bc560845994b666cf00a5eb3fbf8d9 Mon Sep 17 00:00:00 2001 From: dynaflash Date: Sun, 30 Nov 2008 04:09:33 +0000 Subject: [PATCH] MacGui: Implement variable number of preview frames - Set in Preferences -> Advanced and defaulted to 10 - Allows for up to 20 previews per title for now. git-svn-id: svn://localhost/HandBrake/trunk@1972 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/Controller.mm | 10 +- macosx/English.lproj/Preferences.xib | 213 +++++++++++++++++++++++++++++++---- macosx/HBPreferencesController.m | 1 + macosx/PictureController.h | 2 +- macosx/PictureController.mm | 9 ++ 5 files changed, 212 insertions(+), 23 deletions(-) diff --git a/macosx/Controller.mm b/macosx/Controller.mm index aba74610..b2ddff7a 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -1404,8 +1404,9 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It { [self writeToActivityLog: "scanning specifically for title: %d", scanTitleNum]; } - - hb_scan( fHandle, [path UTF8String], scanTitleNum ); + /* We use our advance pref to determine how many previews to scan */ + int hb_num_previews = [[[NSUserDefaults standardUserDefaults] objectForKey:@"PreviewsNumber"] intValue]; + hb_scan( fHandle, [path UTF8String], scanTitleNum, hb_num_previews, 1 ); [fSrcDVD2Field setStringValue:@"Scanning new source ..."]; } } @@ -2144,8 +2145,11 @@ fWorkingCount = 0; { [self writeToActivityLog: "scanning specifically for title: %d", scanTitleNum]; } + [self writeToActivityLog: "performNewQueueScan currentQueueEncodeIndex is: %d", currentQueueEncodeIndex]; - hb_scan( fQueueEncodeLibhb, [path UTF8String], scanTitleNum ); + /* We use our advance pref to determine how many previews to scan */ + int hb_num_previews = [[[NSUserDefaults standardUserDefaults] objectForKey:@"PreviewsNumber"] intValue]; + hb_scan( fQueueEncodeLibhb, [path UTF8String], scanTitleNum, hb_num_previews, 0 ); } } diff --git a/macosx/English.lproj/Preferences.xib b/macosx/English.lproj/Preferences.xib index c6bcf1ac..c2fd24cd 100644 --- a/macosx/English.lproj/Preferences.xib +++ b/macosx/English.lproj/Preferences.xib @@ -3,14 +3,11 @@ 1050 9F33 - 672 + 670 949.34 352.00 YES - - - @@ -53,7 +50,7 @@ YES - + 256 YES @@ -352,12 +349,11 @@ {492, 189} - NSView NSControl - + 256 YES @@ -409,12 +405,11 @@ {496, 82} - NSView NSResponder - + 256 YES @@ -718,7 +713,6 @@ {500, 82} - NSView @@ -732,7 +726,7 @@ 256 - {{84, 44}, {367, 18}} + {{84, 85}, {367, 18}} YES @@ -753,7 +747,7 @@ 256 - {{40, 45}, {41, 17}} + {{40, 86}, {41, 17}} YES @@ -766,10 +760,26 @@ + + + 256 + {{40, 31}, {257, 17}} + + YES + + 67239424 + 272629760 + Number of picture previews to scan: + + + + + + 256 - {{49, 20}, {32, 17}} + {{49, 61}, {32, 17}} YES @@ -785,7 +795,7 @@ 256 - {{84, 18}, {367, 18}} + {{84, 59}, {367, 18}} YES @@ -803,8 +813,77 @@ 25 + + + 268 + {{274, 26}, {66, 22}} + + YES + + -2076049856 + 133120 + + LucidaGrande + 1.100000e+01 + 3100 + + + 109199615 + 129 + + + 400 + 75 + + + 10 + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + OtherViews + + YES + + + + 15 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + 20 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + 1 + YES + YES + 2 + + - {492, 82} + {486, 123} NSView @@ -1043,6 +1122,22 @@ 349 + + + selectedValue: values.PreviewsNumber + + + + + + selectedValue: values.PreviewsNumber + selectedValue + values.PreviewsNumber + 2 + + + 358 + @@ -1246,6 +1341,8 @@ + + Advanced @@ -1448,6 +1545,64 @@ + + 352 + + + YES + + + + + + 353 + + + YES + + + + + + 354 + + + YES + + + + + + + + 355 + + + + + 356 + + + + + 357 + + + + + 359 + + + YES + + + + + + 360 + + + @@ -1499,6 +1654,7 @@ 280.ImportedFromIB2 289.IBPluginDependency 289.ImportedFromIB2 + 290.IBEditorWindowLastContentRect 290.IBPluginDependency 290.ImportedFromIB2 291.IBPluginDependency @@ -1521,6 +1677,15 @@ 347.ImportedFromIB2 350.IBPluginDependency 350.ImportedFromIB2 + 352.IBPluginDependency + 353.IBPluginDependency + 354.IBEditorWindowLastContentRect + 354.IBPluginDependency + 355.IBPluginDependency + 356.IBPluginDependency + 357.IBPluginDependency + 359.IBPluginDependency + 359.ImportedFromIB2 5.IBPluginDependency 5.ImportedFromIB2 5.windowTemplate.hasMaxSize @@ -1536,7 +1701,7 @@ YES com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{418, 501}, {492, 189}} + {{220, 300}, {492, 189}} com.apple.InterfaceBuilder.CocoaPlugin {{0, 636}, {500, 209}} @@ -1544,10 +1709,10 @@ com.apple.InterfaceBuilder.CocoaPlugin {{0, 726}, {500, 108}} - {{73, 902}, {500, 82}} + {{73, 774}, {500, 82}} com.apple.InterfaceBuilder.CocoaPlugin - {{110, 774}, {492, 82}} + {{349, 526}, {486, 123}} com.apple.InterfaceBuilder.CocoaPlugin {{0, 650}, {500, 184}} @@ -1579,6 +1744,7 @@ com.apple.InterfaceBuilder.CocoaPlugin + {{314, 193}, {234, 123}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1602,6 +1768,15 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{454, 586}, {77, 54}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin @@ -1633,7 +1808,7 @@ - 351 + 360 diff --git a/macosx/HBPreferencesController.m b/macosx/HBPreferencesController.m index 758b8b71..7f2bc40f 100644 --- a/macosx/HBPreferencesController.m +++ b/macosx/HBPreferencesController.m @@ -56,6 +56,7 @@ @"1", @"LoggingLevel", @"4:10:15:9:10:35:9", @"DecombCustomString", @"NO", @"EncodeLogLocation", + @"10", @"PreviewsNumber", nil]]; } diff --git a/macosx/PictureController.h b/macosx/PictureController.h index d2a3bc8f..6aa03f1a 100644 --- a/macosx/PictureController.h +++ b/macosx/PictureController.h @@ -10,7 +10,7 @@ /* Needed for Quicktime movie previews */ #import -#define HB_NUM_HBLIB_PICTURES 10 // hbilb generates 10 preview pictures +#define HB_NUM_HBLIB_PICTURES 20 // # of preview pictures libhb should generate @interface PictureController : NSWindowController { diff --git a/macosx/PictureController.mm b/macosx/PictureController.mm index 6888e55f..7ba284f8 100644 --- a/macosx/PictureController.mm +++ b/macosx/PictureController.mm @@ -91,6 +91,12 @@ [fPreviewMovieLengthPopUp addItemWithTitle: @"55"]; [fPreviewMovieLengthPopUp addItemWithTitle: @"60"]; + /* adjust the preview slider length */ + /* We use our advance pref to determine how many previews we scanned */ + int hb_num_previews = [[[NSUserDefaults standardUserDefaults] objectForKey:@"PreviewsNumber"] intValue]; + [fPictureSlider setMaxValue: hb_num_previews - 1.0]; + [fPictureSlider setNumberOfTickMarks: hb_num_previews]; + if ([[NSUserDefaults standardUserDefaults] objectForKey:@"PreviewLength"]) { [fPreviewMovieLengthPopUp selectItemWithTitle:[[NSUserDefaults standardUserDefaults] objectForKey:@"PreviewLength"]]; @@ -571,7 +577,10 @@ are maintained across different sources */ /* We now direct our preview encode to fPreviewMoviePath */ fTitle->job->file = [fPreviewMoviePath UTF8String]; + /* We use our advance pref to determine how many previews to scan */ + int hb_num_previews = [[[NSUserDefaults standardUserDefaults] objectForKey:@"PreviewsNumber"] intValue]; job->start_at_preview = fPicture + 1; + job->seek_points = hb_num_previews; /* we use the preview duration popup to get the specified * number of seconds for the preview encode. -- 2.11.0