summaryrefslogtreecommitdiffstats
path: root/macosx/HBQueueController.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2017-01-05 10:14:58 +0100
committerDamiano Galassi <[email protected]>2017-01-05 10:14:58 +0100
commit62f25f927c61969deb6a063448b9fb2c2295391a (patch)
tree69d2fb1d4b09e6550e906ed6abd5ab30ed501e5b /macosx/HBQueueController.m
parent2bf8ccc610d4df61660cd3efafd6b81fa5936c43 (diff)
MacGui: prevent sleep at queue start, and reallow it at the end of the queue..
Diffstat (limited to 'macosx/HBQueueController.m')
-rw-r--r--macosx/HBQueueController.m9
1 files changed, 9 insertions, 0 deletions
diff --git a/macosx/HBQueueController.m b/macosx/HBQueueController.m
index 8dfef4e26..31320cacf 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 class:[HBJob class]];
@@ -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];
}
}