pictureFrame:(HBPicture *)frame
deinterlace:(BOOL)deinterlace CF_RETURNS_RETAINED;
+/**
+ * Returns the counts of the available previews images.
+ */
+- (NSUInteger)imagesCountForTitle:(HBTitle *)title;
+
/**
* Initiates an asynchronous encode operation and returns immediately.
*
return img;
}
+- (NSUInteger)imagesCountForTitle:(HBTitle *)title
+{
+ return title.hb_title->preview_count;
+}
+
#pragma mark - Encodes
- (void)encodeJob:(HBJob *)job progressHandler:(HBCoreProgressHandler)progressHandler completionHandler:(HBCoreCompletionHandler)completionHandler;
[fPictureSlider setMaxValue: generator.imagesCount - 1.0];
[fPictureSlider setNumberOfTickMarks: generator.imagesCount];
+ if (self.pictureIndex > generator.imagesCount)
+ {
+ self.pictureIndex = generator.imagesCount - 1;
+ }
+
[self switchViewToMode:ViewModePicturePreview];
[self displayPreview];
}
// Limit the cache to 60 1080p previews, the cost is in pixels
_picturePreviews.totalCostLimit = 60 * 1920 * 1080;
- _imagesCount = [[[NSUserDefaults standardUserDefaults] objectForKey:@"PreviewsNumber"] intValue];
+ _imagesCount = [_scanCore imagesCountForTitle:self.job.title];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(imagesSettingsDidChange) name:HBPictureChangedNotification object:job.picture];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(imagesSettingsDidChange) name:HBFiltersChangedNotification object:job.filters];