/* HBJob.h $ This file is part of the HandBrake source code. Homepage: . It may be used under the terms of the GNU General Public License. */ #import @class HBPreset; @class HBMutablePreset; @class HBTitle; #import "HBRange.h" #import "HBVideo.h" #import "HBPicture.h" #import "HBFilters.h" #import "HBAudio.h" #import "HBSubtitles.h" #import "HBChapter.h" #import "HBDistributedArray.h" NS_ASSUME_NONNULL_BEGIN extern NSString *HBContainerChangedNotification; extern NSString *HBChaptersChangedNotification; /** * A flag to indicate the job's state */ typedef NS_ENUM(NSUInteger, HBJobState){ HBJobStateReady, HBJobStateWorking, HBJobStateCompleted, HBJobStateCanceled, HBJobStateFailed }; /** * HBJob */ @interface HBJob : NSObject - (instancetype)initWithTitle:(HBTitle *)title andPreset:(HBPreset *)preset; - (void)applyPreset:(HBPreset *)preset; /// Current state of the job. @property (nonatomic, readwrite) HBJobState state; @property (nonatomic, readwrite, weak, nullable) HBTitle *title; @property (nonatomic, readonly) int titleIdx; @property (nonatomic, readwrite, copy) NSString *presetName; /// The file URL of the source. @property (nonatomic, readonly) NSURL *fileURL; /// The file URL at which the new file will be created. @property (nonatomic, readwrite, copy, nullable) NSURL *outputURL; /// The name of the new file that will be created. @property (nonatomic, readwrite, copy, nullable) NSString *outputFileName; /// The URL at which the new file will be created. @property (nonatomic, readonly, nullable) NSURL *completeOutputURL; // Job settings @property (nonatomic, readwrite) int container; @property (nonatomic, readwrite) int angle; @property (nonatomic, readwrite) BOOL mp4HttpOptimize; @property (nonatomic, readwrite) BOOL mp4iPodCompatible; @property (nonatomic, readonly) HBRange *range; @property (nonatomic, readonly) HBVideo *video; @property (nonatomic, readonly) HBPicture *picture; @property (nonatomic, readonly) HBFilters *filters; @property (nonatomic, readonly) HBAudio *audio; @property (nonatomic, readonly) HBSubtitles *subtitles; @property (nonatomic, readwrite) BOOL chaptersEnabled; @property (nonatomic, readonly) NSArray *chapterTitles; @property (nonatomic, readwrite, weak, nullable) NSUndoManager *undo; /* Given a HBJob created by NSSecureCoding, make the resource referenced by the job accessible to the process. */ - (BOOL)startAccessingSecurityScopedResource; /* Revokes the access granted to the url by a prior successful call to startAccessingSecurityScopedResource. */ - (void)stopAccessingSecurityScopedResource; @end NS_ASSUME_NONNULL_END