diff options
author | ritsuka <[email protected]> | 2015-04-30 16:04:37 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2015-04-30 16:04:37 +0000 |
commit | 96bf5cafd9e7891d2ad5741543e6e1e76ae52f77 (patch) | |
tree | 36e14374381e55963fd603bc32c2079fea9d6170 /macosx/HBController.m | |
parent | 1c59ab0f6e1a92c0f79629658302936796c6f7ed (diff) |
MacGui: add a new formatter to convert a hb_state_t to a textual representation.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7134 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBController.m')
-rw-r--r-- | macosx/HBController.m | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/macosx/HBController.m b/macosx/HBController.m index f25b5607d..07086cd2d 100644 --- a/macosx/HBController.m +++ b/macosx/HBController.m @@ -28,6 +28,7 @@ #import "HBCore.h" #import "HBJob.h" +#import "HBStateFormatter.h" @interface HBController () <HBPresetsViewControllerDelegate, HBTitleSelectionDelegate> @@ -678,29 +679,17 @@ int hb_num_previews = [[[NSUserDefaults standardUserDefaults] objectForKey:@"PreviewsNumber"] intValue]; int min_title_duration_seconds = [[[NSUserDefaults standardUserDefaults] objectForKey:@"MinTitleScanSeconds"] intValue]; + HBStateFormatter *formatter = [[HBStateFormatter alloc] init]; + [self.core scanURL:scanURL titleIndex:scanTitleNum previews:hb_num_previews minDuration:min_title_duration_seconds progressHandler:^(HBState state, hb_state_t hb_state) { - #define p hb_state.param.scanning - if (p.preview_cur) - { - fSrcDVD2Field.stringValue = [NSString stringWithFormat: - NSLocalizedString( @"Scanning title %d of %d, preview %d…", @"" ), - p.title_cur, p.title_count, - p.preview_cur]; - } - else - { - fSrcDVD2Field.stringValue = [NSString stringWithFormat: - NSLocalizedString( @"Scanning title %d of %d…", @"" ), - p.title_cur, p.title_count]; - } + fSrcDVD2Field.stringValue = [formatter stateToString:hb_state title:nil]; fScanIndicator.hidden = NO; fScanHorizontalLine.hidden = YES; - fScanIndicator.doubleValue = 100.0 * p.progress; - #undef p + fScanIndicator.doubleValue = [formatter stateToPercentComplete:hb_state]; } completionHandler:^(BOOL success) { |