summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorritsuka <[email protected]>2014-09-19 07:32:35 +0000
committerritsuka <[email protected]>2014-09-19 07:32:35 +0000
commit3923d87e8387902f7d7d0014ff272d769e510ceb (patch)
tree1219d5325acae969b3000b380415cd1a6dee19a8
parentd1fdbb2b1d62cf2b667169f2dd7444d9d5ea791d (diff)
MacGui: when a live preview is cancelled, wait for libhb to end its work before reverting back the hud.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6418 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--macosx/HBPreviewController.m10
-rw-r--r--macosx/HBPreviewGenerator.h2
-rw-r--r--macosx/HBPreviewGenerator.m4
3 files changed, 14 insertions, 2 deletions
diff --git a/macosx/HBPreviewController.m b/macosx/HBPreviewController.m
index c92bc4e8f..43128ac20 100644
--- a/macosx/HBPreviewController.m
+++ b/macosx/HBPreviewController.m
@@ -232,6 +232,7 @@ typedef enum ViewMode : NSUInteger {
{
_title = title;
+ self.generator.delegate = nil;
[self.generator cancel];
self.generator = nil;
@@ -244,6 +245,7 @@ typedef enum ViewMode : NSUInteger {
[fPictureSlider setMaxValue: self.generator.imagesCount - 1.0];
[fPictureSlider setNumberOfTickMarks: self.generator.imagesCount];
+ [self switchViewToMode:ViewModePicturePreview];
[self displayPreview];
}
}
@@ -466,7 +468,6 @@ typedef enum ViewMode : NSUInteger {
{
if (self.currentViewMode == ViewModeEncoding)
{
- [self.generator cancel];
[self toggleBoxes:@[fPictureControlBox, fEncodingControlBox]
usingIndexes:[NSIndexSet indexSetWithIndex:0]];
[fMovieCreationProgressIndicator stopAnimation:self];
@@ -858,6 +859,11 @@ typedef enum ViewMode : NSUInteger {
[fMovieCreationProgressIndicator setDoubleValue: progress];
}
+- (void)didCancelMovieCreation
+{
+ [self switchViewToMode:ViewModePicturePreview];
+}
+
- (void) didCreateMovieAtURL: (NSURL *) fileURL
{
/* Load the new movie into fMovieView */
@@ -919,7 +925,7 @@ typedef enum ViewMode : NSUInteger {
- (IBAction) cancelCreateMoviePreview: (id) sender
{
- [self switchViewToMode:ViewModePicturePreview];
+ [self.generator cancel];
}
- (IBAction) createMoviePreview: (id) sender
diff --git a/macosx/HBPreviewGenerator.h b/macosx/HBPreviewGenerator.h
index 438d078aa..72e3b5153 100644
--- a/macosx/HBPreviewGenerator.h
+++ b/macosx/HBPreviewGenerator.h
@@ -10,6 +10,8 @@
@protocol HBPreviewGeneratorDelegate <NSObject>
- (void) didCreateMovieAtURL: (NSURL *) fileURL;
+- (void) didCancelMovieCreation;
+
- (void) updateProgress: (double) progress info: (NSString *) progressInfo;
@end
diff --git a/macosx/HBPreviewGenerator.m b/macosx/HBPreviewGenerator.m
index 64effac2c..dce77e1aa 100644
--- a/macosx/HBPreviewGenerator.m
+++ b/macosx/HBPreviewGenerator.m
@@ -390,6 +390,10 @@ typedef enum EncodeState : NSUInteger {
{
[self.delegate didCreateMovieAtURL:self.fileURL];
}
+ else
+ {
+ [self.delegate didCancelMovieCreation];
+ }
self.encodeState = EncodeStateIdle;