diff options
author | Damiano Galassi <[email protected]> | 2017-01-05 10:14:58 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2017-01-09 08:50:17 +0100 |
commit | c2f0e643984ab65471deaf007b9d7560a00a22af (patch) | |
tree | f837875e7c8b02d54dab44c6f2891ebade6f9030 /macosx/HBQueueController.m | |
parent | 74e17f2b6695720ca5c1982cff19c87aed4c0510 (diff) |
MacGui: prevent sleep at queue start, and reallow it at the end of the queue..
(cherry picked from commit 62f25f927c61969deb6a063448b9fb2c2295391a)
Diffstat (limited to 'macosx/HBQueueController.m')
-rw-r--r-- | macosx/HBQueueController.m | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/macosx/HBQueueController.m b/macosx/HBQueueController.m index 318233714..190749d55 100644 --- a/macosx/HBQueueController.m +++ b/macosx/HBQueueController.m @@ -70,6 +70,7 @@ // Init a separate instance of libhb for the queue _core = [[HBCore alloc] initWithLogLevel:loggingLevel name:@"QueueCore"]; + _core.automaticallyPreventSleep = NO; // Load the queue from disk. _jobs = [[HBDistributedArray alloc] initWithURL:queueURL]; @@ -573,7 +574,10 @@ // since we have completed an encode, we go to the next if (self.stop) { + [HBUtilities writeToActivityLog:"Queue manually stopped"]; + self.stop = NO; + [self.core allowSleep]; } else { @@ -617,6 +621,8 @@ // Since there are no more items to encode, go to queueCompletedAlerts // for user specified alerts after queue completed [self queueCompletedAlerts]; + + [self.core allowSleep]; } } [self.jobs commit]; @@ -1125,6 +1131,7 @@ // or shut down when encoding is finished [self remindUserOfSleepOrShutdown]; + [self.core preventSleep]; [self encodeNextQueueItem]; } } @@ -1201,10 +1208,12 @@ if (s == HBStatePaused) { [self.core resume]; + [self.core preventSleep]; } else if (s == HBStateWorking || s == HBStateMuxing) { [self.core pause]; + [self.core allowSleep]; } } |