Fix send to queue optimise action.
This commit is contained in:
5 files changed
+23
-2
No files matched your search
@@ -207,7 +207,7 @@ import IOKit.pwr_mgt
|
||||
let queue = SBQueueController.sharedManager
|
||||
if mp4.hasFileRepresentation {
|
||||
let item = SBQueueItem(mp4: mp4)
|
||||
queue.add(item)
|
||||
queue.add(item, preset: true)
|
||||
close()
|
||||
}
|
||||
else {
|
||||
@@ -217,7 +217,7 @@ import IOKit.pwr_mgt
|
||||
let handler = { (response: NSApplication.ModalResponse) in
|
||||
if response == NSApplication.ModalResponse.OK, let url = panel.url {
|
||||
let options = self.saveOptions()
|
||||
let item = SBQueueItem(mp4: self.mp4, destinationURL: url, attributes: options)
|
||||
let item = SBQueueItem(mp4: self.mp4, destinationURL: url, attributes: options, optimize: self.optimize)
|
||||
queue.add(item)
|
||||
self.releaseSavePanel()
|
||||
self.close()
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class SBQueueItem;
|
||||
@class SBQueuePreferences;
|
||||
|
||||
@interface SBQueueController : NSWindowController
|
||||
|
||||
@@ -23,6 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (void)addItemsFromURLs:(NSArray<NSURL *> *)URLs atIndex:(NSInteger)index;
|
||||
- (void)addItem:(SBQueueItem *)item;
|
||||
- (void)addItem:(SBQueueItem *)item preset:(BOOL)preset;
|
||||
- (void)editItem:(SBQueueItem *)item;
|
||||
|
||||
- (IBAction)start:(id)sender;
|
||||
|
||||
@@ -319,6 +319,11 @@ static void *SBQueueContex = &SBQueueContex;
|
||||
[self updateUI];
|
||||
}
|
||||
|
||||
- (void)addItem:(SBQueueItem *)item preset:(BOOL)preset {
|
||||
[item addAction:[[SBQueueOptimizeAction alloc] init]];
|
||||
[self addItem:item];
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an array of SBQueueItem to the queue.
|
||||
* Implements the undo manager.
|
||||
|
||||
@@ -58,6 +58,7 @@ typedef NS_ENUM(NSUInteger, SBQueueItemStatus) {
|
||||
|
||||
+ (instancetype)itemWithMP4:(MP42File *)MP4;
|
||||
+ (instancetype)itemWithMP4:(MP42File *)MP4 destinationURL:(NSURL *)destURL attributes:(NSDictionary *)dict;
|
||||
+ (instancetype)itemWithMP4:(MP42File *)MP4 destinationURL:(NSURL *)destURL attributes:(NSDictionary *)dict optimize:(BOOL)optimize;
|
||||
|
||||
- (void)addAction:(id<SBQueueActionProtocol>)action;
|
||||
- (void)removeAction:(id<SBQueueActionProtocol>)action;
|
||||
|
||||
@@ -119,6 +119,19 @@
|
||||
return [[SBQueueItem alloc] initWithMP4:MP4 url:destURL attributes:dict];
|
||||
}
|
||||
|
||||
- (instancetype)initWithMP4:(MP42File *)MP4 destinationURL:(NSURL *)destURL attributes:(NSDictionary *)dict optimize:(BOOL)optimize {
|
||||
if (self = [self initWithMP4:MP4 url:destURL attributes:dict]) {
|
||||
if (optimize) {
|
||||
[_actionsInternal addObject:[[SBQueueOptimizeAction alloc] init]];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (instancetype)itemWithMP4:(MP42File *)MP4 destinationURL:(NSURL *)destURL attributes:(NSDictionary *)dict optimize:(BOOL)optimize {
|
||||
return [[SBQueueItem alloc] initWithMP4:MP4 destinationURL:destURL attributes:dict optimize:optimize];
|
||||
}
|
||||
|
||||
#pragma mark KVO
|
||||
|
||||
+ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)theKey {
|
||||
|
||||
Reference in new issue
Block a user