diff options
author | Damiano Galassi <[email protected]> | 2017-11-12 12:41:42 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2017-11-12 12:41:42 +0100 |
commit | 2ce11e0c322fe78c0d7c62ac4b7a00178fd6ae46 (patch) | |
tree | c06a9794e8803fb77f3084893fdd07b06368e46f /macosx/HBSummaryViewController.m | |
parent | 2c750474608acba5da55f76b518f45f83d9757cb (diff) |
MacGui: show a preview image in the summary tab.
Diffstat (limited to 'macosx/HBSummaryViewController.m')
-rw-r--r-- | macosx/HBSummaryViewController.m | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/macosx/HBSummaryViewController.m b/macosx/HBSummaryViewController.m index e8101692f..ae5e69f42 100644 --- a/macosx/HBSummaryViewController.m +++ b/macosx/HBSummaryViewController.m @@ -5,18 +5,40 @@ It may be used under the terms of the GNU General Public License. */ #import "HBSummaryViewController.h" +#import "HBPreviewView.h" +#import "HBPreviewGenerator.h" -@import HandBrakeKit.HBJob; +@import HandBrakeKit; @interface HBSummaryViewController () +@property (strong) IBOutlet HBPreviewView *previewView; + @end @implementation HBSummaryViewController - (void)loadView { [super loadView]; - // Do view setup here. + self.previewView.showShadow = NO; +} + +- (void)setGenerator:(HBPreviewGenerator *)generator +{ + _generator = generator; + + if (generator) + { + NSUInteger index = generator.imagesCount > 1 ? 1 : 0; + CGImageRef fPreviewImage = [generator copyImageAtIndex:index shouldCache:NO]; + self.previewView.image = fPreviewImage; + CFRelease(fPreviewImage); + } + else + { + self.previewView.image = nil; + } } + @end |