Fixed the url of the files sent to the queue.

This commit is contained in:
Damiano Galassi committed 2014-03-24 13:12:07 +01:00
1 parent 61fd097463
commit 60d6c558a4
2 files changed
+9 -28

No files matched your search

-10
View File
@@ -45,16 +45,6 @@ static void *SBQueueContex = &SBQueueContex;
- (IBAction)open:(id)sender;
- (void)start:(id)sender;
- (void)stop:(id)sender;
- (void)updateUI;
- (void)updateDockTile;
- (NSURL *)queueURL;
- (void)addItems:(NSArray *)items atIndexes:(NSIndexSet *)indexes;
- (void)removeItems:(NSArray *)items;
@end
+9 -18
View File
@@ -67,24 +67,13 @@
return [[[SBQueueItem alloc] initWithURL:URL] autorelease];
}
- (id)initWithMP4:(MP42File*)MP4 {
- (instancetype)initWithMP4:(MP42File *)MP4 {
self = [self init];
if (self) {
_mp4File = [MP4 retain];
if ([MP4 URL]) {
_fileURL = [[MP4 URL] retain];
} else {
for (NSUInteger i = 0; i < [_mp4File tracksCount]; i++) {
MP42Track *track = [_mp4File trackAtIndex:i];
if ([track sourceURL]) {
_fileURL = [[track sourceURL] retain];
break;
}
}
}
_status = SBQueueItemStatusReady;
_fileURL = [[NSURL fileURLWithPath:[MP4.URL path]] retain];
_destURL = [[NSURL fileURLWithPath:[MP4.URL path]] retain];
}
return self;
@@ -94,14 +83,14 @@
return [[[SBQueueItem alloc] initWithMP4:MP4] autorelease];
}
- (id)initWithMP4:(MP42File *)MP4 url:(NSURL *)URL attributes:(NSDictionary *)dict {
- (instancetype)initWithMP4:(MP42File *)MP4 url:(NSURL *)URL attributes:(NSDictionary *)dict {
if (self = [self init]) {
_mp4File = [MP4 retain];
_fileURL = [URL copy];
_destURL = [URL copy];
_attributes = [dict copy];
_status = SBQueueItemStatusReady;
_attributes = [dict copy];
}
return self;
@@ -111,6 +100,8 @@
return [[[SBQueueItem alloc] initWithMP4:MP4 url:URL attributes:dict] autorelease];
}
#pragma mark KVO
+ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)theKey {
BOOL automatic = NO;
if ([theKey isEqualToString:@"actions"]) {
@@ -253,7 +244,7 @@
if (!noErr) {
if (outError) {
NSDictionary *errorDetail = @{ NSLocalizedDescriptionKey : @"The file couldn't be optimized",
NSLocalizedRecoverySuggestionErrorKey : @"An error occurred while optimizing." };
NSLocalizedRecoverySuggestionErrorKey : @"An error occurred while optimizing the file." };
*outError = [NSError errorWithDomain:@"SBQueueItemError" code:11 userInfo:errorDetail];
}
goto bail;