summaryrefslogtreecommitdiffstats
path: root/macosx/HBQueue.h
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2020-04-11 12:19:17 +0200
committerDamiano Galassi <[email protected]>2020-04-11 12:19:17 +0200
commit21982a4e674d3382b13f30546f6e699bdfc5cafe (patch)
tree7da62e5317024d9e77d062678097a2eb2286c6fe /macosx/HBQueue.h
parentc3b2645cb09b48443bdd0e2670be6866d34b0dae (diff)
MacGui: enhance the queue to allow up to 4 simultaneous encodes. Add a preference to set the number of queue workers.
Diffstat (limited to 'macosx/HBQueue.h')
-rw-r--r--macosx/HBQueue.h31
1 files changed, 12 insertions, 19 deletions
diff --git a/macosx/HBQueue.h b/macosx/HBQueue.h
index 2612ee3fa..ad8e6517a 100644
--- a/macosx/HBQueue.h
+++ b/macosx/HBQueue.h
@@ -7,11 +7,10 @@
#import <Foundation/Foundation.h>
#import "HBQueueItem.h"
+#import "HBQueueWorker.h"
NS_ASSUME_NONNULL_BEGIN
-extern NSString * const HBQueueDidChangeStateNotification;
-
extern NSString * const HBQueueDidAddItemNotification;
extern NSString * const HBQueueDidRemoveItemNotification;
extern NSString * const HBQueueDidChangeItemNotification;
@@ -21,19 +20,11 @@ extern NSString * const HBQueueDidMoveItemNotification;
extern NSString * const HBQueueItemNotificationSourceIndexesKey; // NSArray<NSNumber *>
extern NSString * const HBQueueItemNotificationTargetIndexesKey; // NSArray<NSNumber *>
-extern NSString * const HBQueueReloadItemsNotification;
-
extern NSString * const HBQueueLowSpaceAlertNotification;
-extern NSString * const HBQueueProgressNotification;
-extern NSString * const HBQueueProgressNotificationPercentKey; // NSNumber - double
-extern NSString * const HBQueueProgressNotificationHoursKey; // NSNumber - double
-extern NSString * const HBQueueProgressNotificationMinutesKey; // NSNumber - double
-extern NSString * const HBQueueProgressNotificationSecondsKey; // NSNumber - double
-extern NSString * const HBQueueProgressNotificationInfoKey; // NSString
-
extern NSString * const HBQueueDidStartNotification;
extern NSString * const HBQueueDidCompleteNotification;
+extern NSString * const HBQueueDidChangeStateNotification;
extern NSString * const HBQueueDidStartItemNotification;
extern NSString * const HBQueueDidCompleteItemNotification;
@@ -46,11 +37,12 @@ extern NSString * const HBQueueItemNotificationItemKey; // HBQueueI
@property (nonatomic, readonly) NSArray<HBQueueItem *> *items;
-@property (nonatomic, nullable) HBQueueItem *currentItem;
+@property (nonatomic, readonly) NSUInteger pendingItemsCount;
+@property (nonatomic, readonly) NSUInteger failedItemsCount;
+@property (nonatomic, readonly) NSUInteger completedItemsCount;
+@property (nonatomic, readonly) NSUInteger workingItemsCount;
-@property (nonatomic) NSUInteger pendingItemsCount;
-@property (nonatomic) NSUInteger failedItemsCount;
-@property (nonatomic) NSUInteger completedItemsCount;
+@property (nonatomic, readonly) NSUInteger workersCount;
@property (nonatomic) NSUndoManager *undoManager;
@@ -72,15 +64,14 @@ extern NSString * const HBQueueItemNotificationItemKey; // HBQueueI
- (void)resetAllItems;
- (void)resetFailedItems;
-- (void)setEncodingJobsAsPending;
-
@property (nonatomic, readonly) BOOL canEncode;
@property (nonatomic, readonly) BOOL isEncoding;
- (void)start;
-- (void)cancelCurrentItemAndContinue;
+- (void)cancelCurrentAndContinue;
+- (void)cancelCurrentAndStop;
- (void)finishCurrentAndStop;
-- (void)cancelCurrentItemAndStop;
+- (void)cancelItemsAtIndexes:(NSIndexSet *)indexes;
@property (nonatomic, readonly) BOOL canPause;
- (void)pause;
@@ -88,6 +79,8 @@ extern NSString * const HBQueueItemNotificationItemKey; // HBQueueI
@property (nonatomic, readonly) BOOL canResume;
- (void)resume;
+- (nullable HBQueueWorker *)workerForItem:(HBQueueItem *)item;
+
@end
NS_ASSUME_NONNULL_END