diff options
author | Damiano Galassi <[email protected]> | 2016-02-26 09:50:16 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2016-03-11 13:51:17 +0100 |
commit | 7481df6459c9ab20c6aa68159243f492d113736b (patch) | |
tree | d09e6cc962458cd5f7c1f72c1b532bcc9bc63247 /macosx/HBPreviewGenerator.m | |
parent | d5535297783e8728e45c1d79e973287fead81788 (diff) |
MacGui: move the objc libhb wrapper to a separate framework.
Diffstat (limited to 'macosx/HBPreviewGenerator.m')
-rw-r--r-- | macosx/HBPreviewGenerator.m | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/macosx/HBPreviewGenerator.m b/macosx/HBPreviewGenerator.m index bf27b10e7..a12dbe5fb 100644 --- a/macosx/HBPreviewGenerator.m +++ b/macosx/HBPreviewGenerator.m @@ -6,12 +6,8 @@ // #import "HBPreviewGenerator.h" -#import "HBUtilities.h" -#import "HBCore.h" -#import "HBJob.h" -#import "HBStateFormatter.h" -#import "HBPicture+UIAdditions.h" +@import HandBrakeKit; @interface HBPreviewGenerator () @@ -177,12 +173,12 @@ NSURL *destURL = nil; // Generate the file url and directories. - if (self.job.container & HB_MUX_MASK_MP4) + if (self.job.container & 0x030000 /*HB_MUX_MASK_MP4*/) { // we use .m4v for our mp4 files so that ac3 and chapters in mp4 will play properly. destURL = [HBPreviewGenerator generateFileURLForType:@"m4v"]; } - else if (self.job.container & HB_MUX_MASK_MKV) + else if (self.job.container & 0x300000 /*HB_MUX_MASK_MKV*/) { destURL = [HBPreviewGenerator generateFileURLForType:@"mkv"]; } @@ -216,12 +212,13 @@ HBStateFormatter *formatter = [[HBStateFormatter alloc] init]; formatter.twoLines = NO; formatter.showPassNumber = NO; + formatter.title = NSLocalizedString(@"preview", nil); // start the actual encode [self.core encodeJob:job - progressHandler:^(HBState state, hb_state_t hb_state) { - [self.delegate updateProgress:[formatter stateToPercentComplete:hb_state] - info:[formatter stateToString:hb_state title:@"preview"]]; + progressHandler:^(HBState state, HBProgress progress, NSString *info) { + [self.delegate updateProgress:progress.percent + info:info]; } completionHandler:^(HBCoreResult result) { // Encode done, call the delegate and close libhb handle |