summaryrefslogtreecommitdiffstats
path: root/macosx/HBQueueWorker.h
blob: 340016fb8330cab637ff50e7019151a5abd50c12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*  HBQueueWorker.h

 This file is part of the HandBrake source code.
 Homepage: <http://handbrake.fr/>.
 It may be used under the terms of the GNU General Public License. */

#import <Foundation/Foundation.h>

#import "HBQueueItem.h"

NS_ASSUME_NONNULL_BEGIN

extern NSString * const HBQueueWorkerDidChangeStateNotification;

extern NSString * const HBQueueWorkerProgressNotification;
extern NSString * const HBQueueWorkerProgressNotificationPercentKey;       // NSNumber - double
extern NSString * const HBQueueWorkerProgressNotificationHoursKey;         // NSNumber - double
extern NSString * const HBQueueWorkerProgressNotificationMinutesKey;       // NSNumber - double
extern NSString * const HBQueueWorkerProgressNotificationSecondsKey;       // NSNumber - double
extern NSString * const HBQueueWorkerProgressNotificationInfoKey;          // NSString

extern NSString * const HBQueueWorkerDidStartItemNotification;
extern NSString * const HBQueueWorkerDidCompleteItemNotification;
extern NSString * const HBQueueWorkerItemNotificationItemKey;              // HBQueueItem

@interface HBQueueWorker : NSObject

- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithXPCServiceName:(NSString *)serviceName;

@property (nonatomic, nullable, readonly) HBQueueItem *item;

- (void)encodeItem:(HBQueueItem *)item;
- (void)cancel;

@property (nonatomic, readonly) BOOL canEncode;
@property (nonatomic, readonly) BOOL isEncoding;

@property (nonatomic, readonly) BOOL canPause;
- (void)pause;

@property (nonatomic, readonly) BOOL canResume;
- (void)resume;

@end

NS_ASSUME_NONNULL_END