summaryrefslogtreecommitdiffstats
path: root/macosx/HBSummaryViewController.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2017-11-12 12:41:42 +0100
committerDamiano Galassi <[email protected]>2017-11-12 12:41:42 +0100
commit2ce11e0c322fe78c0d7c62ac4b7a00178fd6ae46 (patch)
treec06a9794e8803fb77f3084893fdd07b06368e46f /macosx/HBSummaryViewController.m
parent2c750474608acba5da55f76b518f45f83d9757cb (diff)
MacGui: show a preview image in the summary tab.
Diffstat (limited to 'macosx/HBSummaryViewController.m')
-rw-r--r--macosx/HBSummaryViewController.m26
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