From f1dab1fe48ecf40759172769c9ef9131846ccd0c Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Tue, 11 Mar 2014 20:57:57 +0100 Subject: [PATCH] Connect SBQueueController to the new SBQueue instance. --- Classes/SBQueue.h | 5 + Classes/SBQueue.m | 74 +- Classes/SBQueueController.h | 44 +- Classes/SBQueueController.m | 560 ++--------- English.lproj/Queue.xib | 1835 ++++++----------------------------- 5 files changed, 454 insertions(+), 2064 deletions(-) diff --git a/Classes/SBQueue.h b/Classes/SBQueue.h index e5e7e34..0578690 100644 --- a/Classes/SBQueue.h +++ b/Classes/SBQueue.h @@ -21,6 +21,11 @@ typedef NS_ENUM(NSUInteger, SBQueueStatus) { SBQueueStatusCancelled, }; +extern NSString *SBQueueWorkingNotification; +extern NSString *SBQueueCompletedNotification; +extern NSString *SBQueueFailedNotification; +extern NSString *SBQueueCancelledNotification; + @interface SBQueue : NSObject { @private dispatch_queue_t _queue; diff --git a/Classes/SBQueue.m b/Classes/SBQueue.m index 6813920..1608977 100644 --- a/Classes/SBQueue.m +++ b/Classes/SBQueue.m @@ -18,6 +18,11 @@ static NSString *fileType = @"mp4"; +NSString *SBQueueWorkingNotification = @"SBQueueWorkingNotification"; +NSString *SBQueueCompletedNotification = @"SBQueueCompletedNotification"; +NSString *SBQueueFailedNotification = @"SBQueueFailedNotification"; +NSString *SBQueueCancelledNotification = @"SBQueueCancelledNotification"; + @interface SBQueue () @property (atomic) SBQueueStatus status; @@ -39,7 +44,6 @@ static NSString *fileType = @"mp4"; self = [super init]; if (self) { _queue = dispatch_queue_create("org.subler.Queue", NULL); - _URL = [queueURL copy]; if ([[NSFileManager defaultManager] fileExistsAtPath:[queueURL path]]) { @@ -80,8 +84,7 @@ static NSString *fileType = @"mp4"; #pragma mark - item management -- (void)addItem:(SBQueueItem *)item -{ +- (void)addItem:(SBQueueItem *)item { [self.items addObject:item]; } @@ -94,6 +97,7 @@ static NSString *fileType = @"mp4"; for (SBQueueItem *item in self.items) if ([item status] != SBQueueItemStatusCompleted) count++; + return count; } @@ -135,8 +139,7 @@ static NSString *fileType = @"mp4"; #pragma mark - item preprocessing -- (NSArray *)loadSubtitles:(NSURL *)url -{ +- (NSArray *)loadSubtitles:(NSURL *)url { NSError *outError; NSMutableArray *tracksArray = [[NSMutableArray alloc] init]; NSArray *directory = [[NSFileManager defaultManager] contentsOfDirectoryAtURL:[url URLByDeletingLastPathComponent] @@ -171,8 +174,7 @@ static NSString *fileType = @"mp4"; return [tracksArray autorelease]; } -- (MP42Image *)loadArtwork:(NSURL *)url -{ +- (MP42Image *)loadArtwork:(NSURL *)url { NSData *artworkData = [MetadataImporter downloadDataFromURL:url withCachePolicy:SBDefaultPolicy]; if (artworkData && [artworkData length]) { MP42Image *artwork = [[MP42Image alloc] initWithData:artworkData type:MP42_ART_JPEG]; @@ -184,8 +186,7 @@ static NSString *fileType = @"mp4"; return nil; } -- (MP42Metadata *)searchMetadataForFile:(NSURL *)url -{ +- (MP42Metadata *)searchMetadataForFile:(NSURL *)url { id currentSearcher = nil; MP42Metadata *metadata = nil; @@ -350,6 +351,7 @@ static NSString *fileType = @"mp4"; break; } + [self handleSBStatusWorking]; noErr = [self processItem:item error:&outError]; // Check results @@ -387,13 +389,21 @@ static NSString *fileType = @"mp4"; } } + // Save to disk + [self saveQueueToDisk]; + // Disable sleep assertion [self enableSleep]; + [self handleSBStatusCompleted]; }); } -- (BOOL)processItem:(SBQueueItem *)item error:(NSError **)outError{ + +/** + * Processes a SBQueueItem. + */ +- (BOOL)processItem:(SBQueueItem *)item error:(NSError **)outError { NSMutableDictionary *attributes = [[NSMutableDictionary alloc] init]; if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"chaptersPreviewTrack"] boolValue]) [attributes setObject:@YES forKey:MP42GenerateChaptersPreviewTrack]; @@ -408,14 +418,6 @@ static NSString *fileType = @"mp4"; _currentMP4 = [item mp4File]; [_currentMP4 setDelegate:self]; - // Update the UI - dispatch_async(dispatch_get_main_queue(), ^{ - /*NSInteger itemIndex = [filesArray indexOfObject:item]; - [countLabel setStringValue:[NSString stringWithFormat:@"Processing file %ld of %lu.",(long)itemIndex + 1, (unsigned long)[filesArray count]]]; - [[NSApp dockTile] setBadgeLabel:[NSString stringWithFormat:@"%lu", (unsigned long)[filesArray count] - itemIndex]]; - [tableView reloadDataForRowIndexes:[NSIndexSet indexSetWithIndex:itemIndex] columnIndexes:[NSIndexSet indexSetWithIndex:0]];*/ - }); - // Set the destination url if (![item destURL]) { if (!_currentMP4 && self.destination /*&& customDestination*/) { @@ -426,8 +428,9 @@ static NSString *fileType = @"mp4"; } // The file has been added directly to the queue - if (!_currentMP4 && item.URL) + if (!_currentMP4 && item.URL) { _currentMP4 = [self prepareQueueItem:item.URL error:outError]; + } NSDictionary *dict = [[NSFileManager defaultManager] attributesOfFileSystemForPath:[_currentMP4.URL path] error:NULL]; NSNumber *freeSpace = [dict objectForKey:NSFileSystemFreeSize]; @@ -458,9 +461,40 @@ static NSString *fileType = @"mp4"; } - (void)stop { - + _cancelled = YES; } +/** + * Processes SBQueueStatusWorking state information. Current implementation just + * sends SBQueueWorkingNotification. + */ +- (void)handleSBStatusWorking { + [[NSNotificationCenter defaultCenter] postNotificationName:SBQueueWorkingNotification object:self]; +} + +/** + * Processes SBQueueStatusCompleted state information. Current implementation just + * sends SBQueueCompletedNotification. + */ +- (void)handleSBStatusCompleted { + [[NSNotificationCenter defaultCenter] postNotificationName:SBQueueCompletedNotification object:self]; +} + +/** + * Processes SBQueueStatusFailed state information. Current implementation just + * sends SBQueueFailedNotification. + */ +- (void)handleSBStatusFailed { + [[NSNotificationCenter defaultCenter] postNotificationName:SBQueueFailedNotification object:self]; +} + +/** + * Processes SBQueueStatusCancelled state information. Current implementation just + * sends SBQueueCancelledNotification. + */ +- (void)handleSBStatusCancelled { + [[NSNotificationCenter defaultCenter] postNotificationName:SBQueueCancelledNotification object:self]; +} - (void)dealloc { dispatch_release(_queue); diff --git a/Classes/SBQueueController.h b/Classes/SBQueueController.h index fb60d66..22cd415 100755 --- a/Classes/SBQueueController.h +++ b/Classes/SBQueueController.h @@ -9,49 +9,37 @@ #import #import +#import "SBQueue.h" + @class SBQueueItem; @class SBTableView; @class MP42File; -typedef enum SBQueueStatus : NSUInteger { - SBQueueStatusUnknown = 0, - SBQueueStatusWorking, - SBQueueStatusCompleted, - SBQueueStatusFailed, - SBQueueStatusCancelled, -} SBQueueStatus; - @interface SBQueueController : NSWindowController { - IBOutlet NSButton *start; - IBOutlet NSButton *open; + IBOutlet NSButton *_start; + IBOutlet NSButton *_open; - IBOutlet NSTextField *countLabel; - IBOutlet NSProgressIndicator *progressIndicator; + IBOutlet NSTextField *_countLabel; + IBOutlet NSProgressIndicator *_progressIndicator; - IBOutlet NSButton *OptimizeOption; - IBOutlet NSButton *MetadataOption; - IBOutlet NSButton *ITunesGroupsOption; - IBOutlet NSButton *AutoStartOption; - IBOutlet NSBox *optionsBox; - BOOL optionsStatus; + IBOutlet NSButton *_optimizeOption; + IBOutlet NSButton *_metadataOption; + IBOutlet NSButton *_organizeGroupsOption; + IBOutlet NSButton *_autoStartOption; + IBOutlet NSBox *_optionsBox; + BOOL _optionsStatus; IBOutlet NSScrollView *tableScrollView; IBOutlet SBTableView *tableView; - NSURL *destination; - BOOL customDestination; IBOutlet NSPopUpButton *destButton; NSImage *docImg; - dispatch_queue_t queue; - MP42File *_currentMP4; + NSURL *destination; + BOOL customDestination; - NSMutableArray *filesArray; - SBQueueStatus status; - - IOPMAssertionID _assertionID; - BOOL _cancelled; + SBQueue *_queue; } @property(readonly) SBQueueStatus status; @@ -61,7 +49,7 @@ typedef enum SBQueueStatus : NSUInteger { - (void)start:(id)sender; - (void)stop:(id)sender; -- (void)addItem:(SBQueueItem*)item; +- (void)addItem:(SBQueueItem *)item; - (BOOL)saveQueueToDisk; diff --git a/Classes/SBQueueController.m b/Classes/SBQueueController.m index 53fb8e9..014b454 100755 --- a/Classes/SBQueueController.m +++ b/Classes/SBQueueController.m @@ -12,18 +12,16 @@ #import "SBTableView.h" #import "MetadataImporter.h" -#import -#import -#import #import #define SublerBatchTableViewDataType @"SublerBatchTableViewDataType" #define kOptionsPanelHeight 88 -static NSString *fileType = @"mp4"; +@interface SBQueueController () + +@property (readonly) SBQueue *queue; -@interface SBQueueController () - (void)updateUI; - (void)updateDockTile; - (NSURL *)queueURL; @@ -32,49 +30,28 @@ static NSString *fileType = @"mp4"; - (void)addItems:(NSArray *)items atIndexes:(NSIndexSet *)indexes; - (void)removeItems:(NSArray *)items; + @end @implementation SBQueueController -@synthesize status; - +@synthesize queue = _queue; + (SBQueueController *)sharedManager { static dispatch_once_t pred; static SBQueueController *sharedManager = nil; - + dispatch_once(&pred, ^{ sharedManager = [[self alloc] init]; }); return sharedManager; } - (id)init { - if (self = [super initWithWindowNibName:@"Queue"]) - { - queue = dispatch_queue_create("org.subler.Queue", NULL); - - NSURL *queueURL = [self queueURL]; - - if ([[NSFileManager defaultManager] fileExistsAtPath:[queueURL path]]) { - @try { - filesArray = [[NSKeyedUnarchiver unarchiveObjectWithFile:[queueURL path]] retain]; - } - @catch (NSException *exception) { - [[NSFileManager defaultManager] removeItemAtURL:queueURL error:nil]; - filesArray = nil; - } - - for (SBQueueItem *item in filesArray) - if ([item status] == SBQueueItemStatusWorking) - [item setStatus:SBQueueItemStatusFailed]; - - } - - if (!filesArray) - filesArray = [[NSMutableArray alloc] init]; - + if (self = [super initWithWindowNibName:@"Queue"]) { + _queue = [[SBQueue alloc] initWithURL:[self queueURL]]; + [self removeCompletedItems:self]; [self updateDockTile]; } @@ -83,8 +60,8 @@ static NSString *fileType = @"mp4"; - (void)awakeFromNib { - [progressIndicator setHidden:YES]; - [countLabel setStringValue:@"Empty"]; + [_progressIndicator setHidden:YES]; + [_countLabel setStringValue:@"Empty"]; NSRect frame = [[self window] frame]; frame.size.height += kOptionsPanelHeight; @@ -97,47 +74,65 @@ static NSString *fileType = @"mp4"; frame.origin.y += kOptionsPanelHeight; [tableScrollView setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin]; - [optionsBox setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin]; + [_optionsBox setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin]; [[self window] setFrame:frame display:YES animate:NO]; [tableScrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; - [optionsBox setAutoresizingMask:NSViewWidthSizable | NSViewMaxYMargin]; + [_optionsBox setAutoresizingMask:NSViewWidthSizable | NSViewMaxYMargin]; docImg = [[[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode('MOOV')] retain]; [docImg setSize:NSMakeSize(16, 16)]; [self prepareDestPopup]; - [self updateUI]; } - (void)windowDidLoad { [super windowDidLoad]; - [self removeCompletedItems:self]; [tableView registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType, SublerBatchTableViewDataType, nil]]; + + NSOperationQueue *mainQueue = [NSOperationQueue mainQueue]; + + [[NSNotificationCenter defaultCenter] addObserverForName:SBQueueWorkingNotification object:nil queue:mainQueue usingBlock:^(NSNotification *note) { + [_countLabel setStringValue:@"Working"]; + }]; + + [[NSNotificationCenter defaultCenter] addObserverForName:SBQueueCompletedNotification object:nil queue:mainQueue usingBlock:^(NSNotification *note) { + [_progressIndicator setHidden:YES]; + [_progressIndicator stopAnimation:self]; + [_progressIndicator setDoubleValue:0]; + [_start setTitle:@"Start"]; + [_countLabel setStringValue:@"Done"]; + + [self updateDockTile]; + [self updateUI]; + }]; + + [self updateUI]; } -- (NSURL*)queueURL +- (NSURL *)queueURL { NSURL *appSupportURL = nil; - NSArray *allPaths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); if ([allPaths count]) { appSupportURL = [NSURL fileURLWithPath:[[[allPaths lastObject] stringByAppendingPathComponent:@"Subler"] stringByAppendingPathComponent:@"queue.sbqueue"] isDirectory:YES]; - return appSupportURL; - } - else + } else { return nil; + } } -- (BOOL)saveQueueToDisk -{ - return [NSKeyedArchiver archiveRootObject:filesArray toFile:[[self queueURL] path]]; +- (SBQueueStatus)status { + return self.queue.status; +} + +- (BOOL)saveQueueToDisk { + return [self.queue saveQueueToDisk]; } - (NSMenuItem *)prepareDestPopupItem:(NSURL*) dest @@ -145,7 +140,7 @@ static NSString *fileType = @"mp4"; NSMenuItem *folderItem = [[NSMenuItem alloc] initWithTitle:[dest lastPathComponent] action:@selector(destination:) keyEquivalent:@""]; [folderItem setTag:10]; - NSImage* menuItemIcon = [[NSWorkspace sharedWorkspace] iconForFile:[dest path]]; + NSImage *menuItemIcon = [[NSWorkspace sharedWorkspace] iconForFile:[dest path]]; [menuItemIcon setSize:NSMakeSize(16, 16)]; [folderItem setImage:menuItemIcon]; @@ -203,8 +198,7 @@ static NSString *fileType = @"mp4"; if ([sender tag] == 10) { customDestination = YES; [[NSUserDefaults standardUserDefaults] setValue:@"YES" forKey:@"SBQueueDestinationSelected"]; - } - else { + } else { customDestination = NO; [[NSUserDefaults standardUserDefaults] setValue:nil forKey:@"SBQueueDestinationSelected"]; } @@ -212,10 +206,7 @@ static NSString *fileType = @"mp4"; - (void)updateDockTile { - int count = 0; - for (SBQueueItem *item in filesArray) - if ([item status] != SBQueueItemStatusCompleted) - count++; + NSUInteger count = [self.queue readyCount]; if (count) [[NSApp dockTile] setBadgeLabel:[NSString stringWithFormat:@"%d", count]]; @@ -226,369 +217,42 @@ static NSString *fileType = @"mp4"; - (void)updateUI { [tableView reloadData]; - if (status != SBQueueStatusWorking) { - [countLabel setStringValue:[NSString stringWithFormat:@"%lu files in queue.", (unsigned long)[filesArray count]]]; + if (self.queue.status != SBQueueStatusWorking) { + [_countLabel setStringValue:[NSString stringWithFormat:@"%lu files in queue.", (unsigned long)[self.queue count]]]; [self updateDockTile]; } } -- (NSArray *)loadSubtitles:(NSURL*)url -{ - NSError *outError; - NSMutableArray *tracksArray = [[NSMutableArray alloc] init]; - NSArray *directory = [[NSFileManager defaultManager] contentsOfDirectoryAtURL:[url URLByDeletingLastPathComponent] - includingPropertiesForKeys:nil - options:NSDirectoryEnumerationSkipsSubdirectoryDescendants | - NSDirectoryEnumerationSkipsHiddenFiles | - NSDirectoryEnumerationSkipsPackageDescendants - error:nil]; - - for (NSURL *dirUrl in directory) { - if ([[dirUrl pathExtension] isEqualToString:@"srt"]) { - NSComparisonResult result; - NSString *movieFilename = [[url URLByDeletingPathExtension] lastPathComponent]; - NSString *subtitleFilename = [[dirUrl URLByDeletingPathExtension] lastPathComponent]; - NSRange range = { 0, [movieFilename length] }; - - if ([movieFilename length] <= [subtitleFilename length]) { - result = [subtitleFilename compare:movieFilename options:NSCaseInsensitiveSearch range:range]; - - if (result == NSOrderedSame) { - MP42FileImporter *fileImporter = [[[MP42FileImporter alloc] initWithURL:dirUrl - error:&outError] autorelease]; - - for (MP42Track *track in fileImporter.tracks) { - [tracksArray addObject:track]; - } - } - } - } - } - - return [tracksArray autorelease]; -} - -- (MP42Image *)loadArtwork:(NSURL*)url -{ - NSData *artworkData = [MetadataImporter downloadDataFromURL:url withCachePolicy:SBDefaultPolicy]; - if (artworkData && [artworkData length]) { - MP42Image *artwork = [[MP42Image alloc] initWithData:artworkData type:MP42_ART_JPEG]; - if (artwork != nil) { - return [artwork autorelease]; - } - } - - return nil; -} - -- (MP42Metadata *)searchMetadataForFile:(NSURL*) url -{ - id currentSearcher = nil; - MP42Metadata *metadata = nil; - - // Parse FileName and search for metadata - NSDictionary *parsed = [MetadataImporter parseFilename:[url lastPathComponent]]; - NSString *type = (NSString *)[parsed valueForKey:@"type"]; - if ([@"movie" isEqualToString:type]) { - currentSearcher = [MetadataImporter defaultMovieProvider]; - NSString *language = [MetadataImporter defaultMovieLanguage]; - NSArray *results = [currentSearcher searchMovie:[parsed valueForKey:@"title"] language:language]; - if ([results count]) - metadata = [currentSearcher loadMovieMetadata:[results objectAtIndex:0] language:language]; - } else if ([@"tv" isEqualToString:type]) { - currentSearcher = [MetadataImporter defaultTVProvider]; - NSString *language = [MetadataImporter defaultTVLanguage]; - NSArray *results = [currentSearcher searchTVSeries:[parsed valueForKey:@"seriesName"] - language:language seasonNum:[parsed valueForKey:@"seasonNum"] - episodeNum:[parsed valueForKey:@"episodeNum"]]; - if ([results count]) - metadata = [currentSearcher loadTVMetadata:[results objectAtIndex:0] language:language]; - } - - if (metadata.artworkThumbURLs && [metadata.artworkThumbURLs count]) { - NSURL *artworkURL = nil; - if ([type isEqualToString:@"movie"]) { - artworkURL = [metadata.artworkFullsizeURLs objectAtIndex:0]; - } else if ([type isEqualToString:@"tv"]) { - if ([metadata.artworkFullsizeURLs count] > 1) { - int i = 0; - for (NSString *artworkProviderName in metadata.artworkProviderNames) { - NSArray *a = [artworkProviderName componentsSeparatedByString:@"|"]; - if ([a count] > 1 && ![[a objectAtIndex:1] isEqualToString:@"episode"]) { - artworkURL = [metadata.artworkFullsizeURLs objectAtIndex:i]; - break; - } - i++; - } - } else { - artworkURL = [metadata.artworkFullsizeURLs objectAtIndex:0]; - } - } - - MP42Image *artwork = [self loadArtwork:artworkURL]; - - if (artwork) - [metadata.artworks addObject:artwork]; - } - - return metadata; -} - -- (MP42File *)prepareQueueItem:(NSURL*)url error:(NSError**)outError { - NSString *type; - MP42File *mp4File = nil; - - [url getResourceValue:&type forKey:NSURLTypeIdentifierKey error:outError]; - - if ([type isEqualToString:@"com.apple.m4a-audio"] || [type isEqualToString:@"com.apple.m4v-video"] || [type isEqualToString:@"public.mpeg-4"]) { - mp4File = [[MP42File alloc] initWithExistingFile:url andDelegate:self]; - } else { - mp4File = [[MP42File alloc] initWithDelegate:self]; - MP42FileImporter *fileImporter = [[MP42FileImporter alloc] initWithURL:url - error:outError]; - - for (MP42Track *track in fileImporter.tracks) { - if ([track.format isEqualToString:MP42AudioFormatAC3]) { - if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"SBAudioConvertAC3"] boolValue]) { - if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"SBAudioKeepAC3"] boolValue] || - ![(MP42AudioTrack *)track fallbackTrack]) { - MP42AudioTrack *copy = [track copy]; - [copy setNeedConversion:YES]; - [copy setMixdownType:SBDolbyPlIIMixdown]; - - [(MP42AudioTrack *)track setFallbackTrack:copy]; - - [mp4File addTrack:copy]; - - [copy release]; - } - else - track.needConversion = YES; - } - } - - if ([track.format isEqualToString:MP42AudioFormatDTS] || - ([track.format isEqualToString:MP42SubtitleFormatVobSub] && [[[NSUserDefaults standardUserDefaults] valueForKey:@"SBSubtitleConvertBitmap"] boolValue])) - track.needConversion = YES; - - if (isTrackMuxable(track.format) || trackNeedConversion(track.format)) - [mp4File addTrack:track]; - } - [fileImporter release]; - } - - // Search for external subtitles files - NSArray *subtitles = [self loadSubtitles:url]; - for (MP42SubtitleTrack *subTrack in subtitles) { - [mp4File addTrack:subTrack]; - } - - // Search for metadata - if ([MetadataOption state]) { - MP42Metadata *metadata = [self searchMetadataForFile:url]; - - for (MP42Track *track in mp4File.tracks) - if ([track isKindOfClass:[MP42VideoTrack class]]) { - int hdVideo = isHdVideo([((MP42VideoTrack *) track) trackWidth], [((MP42VideoTrack *) track) trackHeight]); - - if (hdVideo) - [mp4File.metadata setTag:@(hdVideo) forKey:@"HD Video"]; - } - - [[mp4File metadata] mergeMetadata:metadata]; - } - - if ([ITunesGroupsOption state]) - [mp4File organizeAlternateGroups]; - - return [mp4File autorelease]; -} - -- (SBQueueItem *)firstItemInQueue -{ - for (SBQueueItem *item in filesArray) - if (([item status] != SBQueueItemStatusCompleted) && ([item status] != SBQueueItemStatusFailed)) - return item; - - return nil; -} - - (void)start:(id)sender { - if (status == SBQueueStatusWorking) + if (self.queue.status == SBQueueStatusWorking) return; - status = SBQueueStatusWorking; + [_start setTitle:@"Stop"]; + [_countLabel setStringValue:@"Working."]; + [_progressIndicator setHidden:NO]; + [_progressIndicator startAnimation:self]; - [start setTitle:@"Stop"]; - [countLabel setStringValue:@"Working."]; - [progressIndicator setHidden:NO]; - [progressIndicator startAnimation:self]; - - NSMutableDictionary * attributes = [[NSMutableDictionary alloc] init]; - if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"chaptersPreviewTrack"] boolValue]) - [attributes setObject:@YES forKey:MP42GenerateChaptersPreviewTrack]; - - // Enable sleep assertion - CFStringRef reasonForActivity= CFSTR("Subler Queue Started"); - IOReturn io_success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, - kIOPMAssertionLevelOn, reasonForActivity, &_assertionID); - - dispatch_async(queue, ^{ - NSError *outError = nil; - BOOL success = NO; - -#ifdef SB_SANDBOX - if([destination respondsToSelector:@selector(startAccessingSecurityScopedResource)]) - [destination startAccessingSecurityScopedResource]; -#endif - - for (;;) { - @autoreleasepool { - __block SBQueueItem *item = nil; - - // Get the first item available in the queue - dispatch_sync(dispatch_get_main_queue(), ^{ - item = [self firstItemInQueue]; - [item retain]; - [item setStatus:SBQueueItemStatusWorking]; - }); - - if (item == nil) - break; - - _currentMP4 = [item mp4File]; - [_currentMP4 setDelegate:self]; - - // Update the UI - dispatch_async(dispatch_get_main_queue(), ^{ - NSInteger itemIndex = [filesArray indexOfObject:item]; - [countLabel setStringValue:[NSString stringWithFormat:@"Processing file %ld of %lu.",(long)itemIndex + 1, (unsigned long)[filesArray count]]]; - [[NSApp dockTile] setBadgeLabel:[NSString stringWithFormat:@"%lu", (unsigned long)[filesArray count] - itemIndex]]; - [tableView reloadDataForRowIndexes:[NSIndexSet indexSetWithIndex:itemIndex] columnIndexes:[NSIndexSet indexSetWithIndex:0]]; - }); - - // Set the destination url - if (![item destURL]) { - if (!_currentMP4 && destination && customDestination) - item.destURL = [[[destination URLByAppendingPathComponent:[item.URL lastPathComponent]] URLByDeletingPathExtension] URLByAppendingPathExtension:fileType]; - else - item.destURL = [[item.URL URLByDeletingPathExtension] URLByAppendingPathExtension:fileType]; - } - - // The file has been added directly to the queue - if (!_currentMP4 && item.URL) - _currentMP4 = [self prepareQueueItem:item.URL error:&outError]; - - // We have an existing mp4 file, update it - if (!_cancelled) { - if ([_currentMP4 hasFileRepresentation]) - success = [_currentMP4 updateMP4FileWithAttributes:attributes error:&outError]; - // Write the new file to disk - else if (_currentMP4 && item.destURL) { - [attributes addEntriesFromDictionary:[item attributes]]; - success = [_currentMP4 writeToUrl:[item destURL] - withAttributes:attributes - error:&outError]; - } - } - - // Check results - if (_cancelled) { - [item setStatus:SBQueueItemStatusCancelled]; - status = SBQueueStatusCancelled; - } - else if (success) { - if ([OptimizeOption state]) { - // Update the UI - dispatch_async(dispatch_get_main_queue(), ^{ - NSInteger itemIndex = [filesArray indexOfObject:item]; - [countLabel setStringValue:[NSString stringWithFormat:@"Optimizing file %ld of %lu.",(long)itemIndex + 1, (unsigned long)[filesArray count]]]; - }); - - success = [_currentMP4 optimize]; - } - } - - if (success) - [item setStatus:SBQueueItemStatusCompleted]; - else { - [item setStatus:SBQueueItemStatusFailed]; - if (outError) { - dispatch_async(dispatch_get_main_queue(), ^{ - [NSApp presentError:outError]; - }); - } - } - - // Update the UI - dispatch_async(dispatch_get_main_queue(), ^{ - NSInteger itemIndex = [filesArray indexOfObject:item]; - [tableView reloadDataForRowIndexes:[NSIndexSet indexSetWithIndex:itemIndex] columnIndexes:[NSIndexSet indexSetWithIndex:0]]; - [self saveQueueToDisk]; - }); - - [item release]; - } - - if (status == SBQueueStatusCancelled) - break; - } - -#ifdef SB_SANDBOX - if([destination respondsToSelector:@selector(stopAccessingSecurityScopedResource)]) - [destination stopAccessingSecurityScopedResource]; -#endif - - // Disable sleep assertion - if (io_success == kIOReturnSuccess) - IOPMAssertionRelease(_assertionID); - - dispatch_async(dispatch_get_main_queue(), ^{ - _currentMP4 = nil; - - if (status == SBQueueStatusCancelled) { - [countLabel setStringValue:@"Cancelled."]; - status = SBQueueStatusCancelled; - _cancelled = NO; - } - else { - [countLabel setStringValue:@"Done."]; - status = SBQueueStatusCompleted; - } - - [progressIndicator setHidden:YES]; - [progressIndicator stopAnimation:self]; - [progressIndicator setDoubleValue:0]; - [start setTitle:@"Start"]; - - [self updateDockTile]; - [self saveQueueToDisk]; - }); - }); - - [attributes release]; + [self.queue start]; } - (void)progressStatus: (CGFloat)progress { dispatch_async(dispatch_get_main_queue(), ^{ - [progressIndicator setIndeterminate:NO]; - [progressIndicator setDoubleValue:progress]; + [_progressIndicator setIndeterminate:NO]; + [_progressIndicator setDoubleValue:progress]; }); } - (void)stop:(id)sender { - _cancelled = YES; - [_currentMP4 cancel]; + [self.queue stop]; } - (IBAction)toggleStartStop:(id)sender { - if (status == SBQueueStatusWorking) { + if (self.queue.status == SBQueueStatusWorking) { [self stop:sender]; - } - else { + } else { [self start:sender]; } } @@ -596,13 +260,13 @@ static NSString *fileType = @"mp4"; - (IBAction)toggleOptions:(id)sender { NSInteger value = 0; - if (optionsStatus) { + if (_optionsStatus) { value = -kOptionsPanelHeight; - optionsStatus = NO; + _optionsStatus = NO; } else { value = kOptionsPanelHeight; - optionsStatus = YES; + _optionsStatus = YES; } NSRect frame = [[self window] frame]; @@ -610,12 +274,12 @@ static NSString *fileType = @"mp4"; frame.origin.y -= value; [tableScrollView setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin]; - [optionsBox setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin]; + [_optionsBox setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin]; [[self window] setFrame:frame display:YES animate:YES]; [tableScrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; - [optionsBox setAutoresizingMask:NSViewWidthSizable | NSViewMaxYMargin]; + [_optionsBox setAutoresizingMask:NSViewWidthSizable | NSViewMaxYMargin]; } #pragma mark Open methods @@ -640,7 +304,7 @@ static NSString *fileType = @"mp4"; [self updateUI]; - if ([AutoStartOption state]) + if ([_autoStartOption state]) [self start:self]; } }]; @@ -693,16 +357,16 @@ static NSString *fileType = @"mp4"; - (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView { - return [filesArray count]; + return [self.queue count]; } - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { if ([aTableColumn.identifier isEqualToString:@"nameColumn"]) - return [[[filesArray objectAtIndex:rowIndex] URL] lastPathComponent]; + return [[[self.queue itemAtIndex:rowIndex] URL] lastPathComponent]; if ([aTableColumn.identifier isEqualToString:@"statusColumn"]) { - SBQueueItemStatus batchStatus = [(SBQueueItem *)[filesArray objectAtIndex:rowIndex] status]; + SBQueueItemStatus batchStatus = [[self.queue itemAtIndex:rowIndex] status]; if (batchStatus == SBQueueItemStatusCompleted) return [NSImage imageNamed:@"EncodeComplete"]; else if (batchStatus == SBQueueItemStatusWorking) @@ -719,22 +383,22 @@ static NSString *fileType = @"mp4"; - (void)_deleteSelectionFromTableView:(NSTableView *)aTableView { NSMutableIndexSet *rowIndexes = [[aTableView selectedRowIndexes] mutableCopy]; + NSInteger clickedRow = [aTableView clickedRow]; NSUInteger selectedIndex = -1; if ([rowIndexes count]) selectedIndex = [rowIndexes firstIndex]; - NSInteger clickedRow = [aTableView clickedRow]; if (clickedRow != -1 && ![rowIndexes containsIndex:clickedRow]) { [rowIndexes removeAllIndexes]; [rowIndexes addIndex:clickedRow]; } - NSArray *array = [filesArray objectsAtIndexes:rowIndexes]; - + NSArray *array = [self.queue itemsAtIndexes:rowIndexes]; + // A item with a status of SBQueueItemStatusWorking can not be removed for (SBQueueItem *item in array) if ([item status] == SBQueueItemStatusWorking) - [rowIndexes removeIndex:[filesArray indexOfObject:item]]; + [rowIndexes removeIndex:[self.queue indexOfItem:item]]; if ([rowIndexes count]) { if ([NSTableView instancesRespondToSelector:@selector(beginUpdates)]) { @@ -752,8 +416,8 @@ static NSString *fileType = @"mp4"; [aTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:selectedIndex] byExtendingSelection:NO]; } - if (status != SBQueueStatusWorking) { - [countLabel setStringValue:[NSString stringWithFormat:@"%lu files in queue.", (unsigned long)[filesArray count]]]; + if (self.queue.status != SBQueueStatusWorking) { + [_countLabel setStringValue:[NSString stringWithFormat:@"%lu files in queue.", (unsigned long)[self.queue count]]]; [self updateDockTile]; } } @@ -762,7 +426,7 @@ static NSString *fileType = @"mp4"; - (IBAction)edit:(id)sender { - SBQueueItem *item = [[filesArray objectAtIndex:[tableView clickedRow]] retain]; + /*SBQueueItem *item = [[self.queue itemAtIndex:[tableView clickedRow]] retain]; [self removeItems:[NSArray arrayWithObject:item]]; [self updateUI]; @@ -775,12 +439,12 @@ static NSString *fileType = @"mp4"; SBDocument *doc = [[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:NULL]; [doc setMp4File:mp4]; - [item release]; + [item release];*/ } - (IBAction)showInFinder:(id)sender { - SBQueueItem *item = [filesArray objectAtIndex:[tableView clickedRow]]; + SBQueueItem *item = [self.queue itemAtIndex:[tableView clickedRow]]; [[NSWorkspace sharedWorkspace] selectFile:[item.destURL path] inFileViewerRootedAtPath:nil]; } @@ -791,35 +455,24 @@ static NSString *fileType = @"mp4"; - (IBAction)removeCompletedItems:(id)sender { - NSMutableIndexSet *indexes = [[NSMutableIndexSet alloc] init]; - - for (SBQueueItem *item in filesArray) - if ([item status] == SBQueueItemStatusCompleted) - [indexes addIndex:[filesArray indexOfObject:item]]; + NSIndexSet *indexes = [self.queue removeCompletedItems]; if ([indexes count]) { if ([NSTableView instancesRespondToSelector:@selector(beginUpdates)]) { #if __MAC_OS_X_VERSION_MAX_ALLOWED > 1060 [tableView beginUpdates]; [tableView removeRowsAtIndexes:indexes withAnimation:NSTableViewAnimationEffectFade]; - NSArray* items = [filesArray objectsAtIndexes:indexes]; - [self removeItems:items]; [tableView endUpdates]; #endif - } - else { - NSArray *items = [filesArray objectsAtIndexes:indexes]; - [self removeItems:items]; + } else { [tableView reloadData]; } - if (status != SBQueueStatusWorking) { - [countLabel setStringValue:[NSString stringWithFormat:@"%lu files in queue.", (unsigned long)[filesArray count]]]; + if (self.queue.status != SBQueueStatusWorking) { + [_countLabel setStringValue:[NSString stringWithFormat:@"%lu files in queue.", (unsigned long)[self.queue count]]]; [self updateDockTile]; } } - - [indexes release]; } - (BOOL)validateUserInterfaceItem:(id < NSValidatedUserInterfaceItem >)anItem @@ -832,7 +485,7 @@ static NSString *fileType = @"mp4"; if (action == @selector(showInFinder:)) { if ([tableView clickedRow] != -1) { - SBQueueItem *item = [filesArray objectAtIndex:[tableView clickedRow]]; + SBQueueItem *item = [self.queue itemAtIndex:[tableView clickedRow]]; if ([item status] == SBQueueItemStatusCompleted) return YES; } @@ -872,12 +525,11 @@ static NSString *fileType = @"mp4"; if (nil == [info draggingSource]) { // From other application [view setDropRow: row dropOperation: NSTableViewDropAbove]; return NSDragOperationCopy; - } - else if (view == [info draggingSource] && operation == NSTableViewDropAbove) { // From self + } else if (view == [info draggingSource] && operation == NSTableViewDropAbove) { // From self return NSDragOperationEvery; - } - else + } else { return NSDragOperationNone; + } } - (BOOL)tableView:(NSTableView *)view @@ -888,16 +540,16 @@ static NSString *fileType = @"mp4"; NSPasteboard *pboard = [info draggingPasteboard]; if (tableView == [info draggingSource]) { // From self - NSData* rowData = [pboard dataForType:SublerBatchTableViewDataType]; - NSIndexSet* rowIndexes = [NSKeyedUnarchiver unarchiveObjectWithData:rowData]; + NSData *rowData = [pboard dataForType:SublerBatchTableViewDataType]; + NSIndexSet *rowIndexes = [NSKeyedUnarchiver unarchiveObjectWithData:rowData]; NSUInteger i = [rowIndexes countOfIndexesInRange:NSMakeRange(0, row)]; row -= i; - NSArray *objects = [filesArray objectsAtIndexes:rowIndexes]; - [filesArray removeObjectsAtIndexes:rowIndexes]; + NSArray *objects = [self.queue itemsAtIndexes:rowIndexes]; + [self.queue removeItemsAtIndexes:rowIndexes]; for (id object in [objects reverseObjectEnumerator]) - [filesArray insertObject:object atIndex:row]; + [self.queue insertItem:object atIndex:row]; NSIndexSet *selectionSet = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(row, [rowIndexes count])]; @@ -905,15 +557,14 @@ static NSString *fileType = @"mp4"; [view selectRowIndexes:selectionSet byExtendingSelection:NO]; return YES; - } - else { // From other documents - if ( [[pboard types] containsObject:NSURLPboardType] ) { - NSArray * items = [pboard readObjectsForClasses: + } else { // From other documents + if ([[pboard types] containsObject:NSURLPboardType] ) { + NSArray *items = [pboard readObjectsForClasses: [NSArray arrayWithObject: [NSURL class]] options: nil]; NSMutableArray *queueItems = [[NSMutableArray alloc] init]; NSMutableIndexSet *indexes = [[NSMutableIndexSet alloc] init]; - for (NSURL * url in items) { + for (NSURL *url in items) { [queueItems addObject:[SBQueueItem itemWithURL:url]]; [indexes addIndex:row]; } @@ -924,7 +575,7 @@ static NSString *fileType = @"mp4"; [indexes release]; [self updateUI]; - if ([AutoStartOption state]) + if ([_autoStartOption state]) [self start:self]; return YES; @@ -937,30 +588,29 @@ static NSString *fileType = @"mp4"; - (void)addItem:(SBQueueItem *)item { [self addItems:[NSArray arrayWithObject:item] atIndexes:nil]; - [self updateUI]; - if ([AutoStartOption state]) + if ([_autoStartOption state]) [self start:self]; } - (void)addItems:(NSArray *)items atIndexes:(NSIndexSet *)indexes; { NSMutableIndexSet *mutableIndexes = [indexes mutableCopy]; - if ([indexes count] == [items count]) + if ([indexes count] == [items count]) { for (id item in [items reverseObjectEnumerator]) { - [filesArray insertObject:item atIndex:[mutableIndexes firstIndex]]; + [self.queue insertItem:item atIndex:[mutableIndexes firstIndex]]; [mutableIndexes removeIndexesInRange:NSMakeRange(0, 1)]; } - else if ([indexes count] == 1) { + } else if ([indexes count] == 1) { for (id item in [items reverseObjectEnumerator]) { - [filesArray insertObject:item atIndex:[mutableIndexes firstIndex]]; + [self.queue insertItem:item atIndex:[mutableIndexes firstIndex]]; + } + } else { + for (id item in [items reverseObjectEnumerator]) { + [self.queue addItem:item]; } } - else - for (id item in [items reverseObjectEnumerator]) { - [filesArray addObject:item]; - } NSUndoManager *undo = [[self window] undoManager]; [[undo prepareWithInvocationTarget:self] removeItems:items]; @@ -971,7 +621,7 @@ static NSString *fileType = @"mp4"; if ([undo isUndoing] || [undo isRedoing]) [self updateUI]; - if ([AutoStartOption state]) + if ([_autoStartOption state]) [self start:self]; [mutableIndexes release]; @@ -982,8 +632,8 @@ static NSString *fileType = @"mp4"; NSMutableIndexSet *indexes = [[NSMutableIndexSet alloc] init]; for (id item in items) { - [indexes addIndex:[filesArray indexOfObject:item]]; - [filesArray removeObject:item]; + [indexes addIndex:[self.queue indexOfItem:item]]; + [self.queue removeItem:item]; } NSUndoManager *undo = [[self window] undoManager]; diff --git a/English.lproj/Queue.xib b/English.lproj/Queue.xib index 2cb482f..50bb1ea 100755 --- a/English.lproj/Queue.xib +++ b/English.lproj/Queue.xib @@ -1,1561 +1,274 @@ - - - - 1060 - 12F30 - 4504 - 1187.39 - 626.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 4504 - - - NSBox - NSButton - NSButtonCell - NSCustomObject - NSImageCell - NSMenu - NSMenuItem - NSPopUpButton - NSPopUpButtonCell - NSProgressIndicator - NSScrollView - NSScroller - NSTableColumn - NSTableView - NSTextField - NSTextFieldCell - NSUserDefaultsController - NSView - NSWindowTemplate - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - SBQueueController - - - FirstResponder - - - NSApplication - - - 15 - 2 - {{233, 759}, {488, 421}} - 1618477056 - Queue - NSWindow - - - {434, 200} - - - 256 - - - - 274 - - - - 2322 - - - - 256 - {488, 285} - - - - _NS:1197 - YES - NO - YES - - - -2147483392 - {{224, 0}, {16, 17}} - _NS:1202 - - - - statusColumn - 20 - 20 - 20 - - 75497536 - 2048 - - - LucidaGrande - 11 - 3100 - - - 6 - System - headerColor - - 3 - MQA - - - - 6 - System - headerTextColor - - 3 - MAA - - - - - 67108864 - 33554432 - - NSImage - NSFollowLinkFreestandingTemplate - - - LucidaGrande - 13 - 1044 - - _NS:4045 - 0 - 0 - 0 - NO - - 3 - YES - YES - - - - nameColumn - 462 - 40 - 1000 - - 75497536 - 2048 - - - - 3 - MC4zMzMzMzI5ODU2AA - - - - - 337641536 - 2048 - Text Cell - - - - 6 - System - controlBackgroundColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - - - 1 - YES - - - - 3 - 2 - - - 6 - System - gridColor - - 3 - MC41AA - - - 17 - -624951296 - - - 4 - 15 - 0 - YES - 0 - 1 - - - {{1, 1}, {488, 285}} - - - - _NS:1195 - - - 4 - - - - -2147483392 - {{543, 1}, {15, 275}} - - - _NS:1214 - NO - - _doScroller: - 0.99646643109540634 - - - - -2147483392 - {{1, 271}, {488, 15}} - - - - _NS:1216 - NO - 1 - - _doScroller: - 0.87612208258527824 - - - {{-1, 135}, {490, 287}} - - - - _NS:1193 - 133682 - - - - QSAAAEEgAABBmAAAQZgAAA - 0.25 - 4 - 1 - - - - 34 - - - - 274 - - - - 294 - {{16, 133}, {186, 17}} - - - - _NS:3936 - YES - - 68157504 - 272630784 - Queue items - - _NS:3936 - - - 6 - System - controlColor - - - - - NO - - - - 289 - {{349, 123}, {70, 32}} - - - - _NS:161 - YES - - 67108864 - 134217728 - Start - - _NS:161 - - -2038022144 - 129 - - - 200 - 25 - - NO - - - - 289 - {{415, 123}, {38, 32}} - - - - _NS:161 - YES - - 67108864 - 134217728 - + - - Helvetica - 16 - 16 - - _NS:161 - - -2038022144 - 129 - - LucidaGrande - 16 - 16 - - - - 200 - 25 - - NO - - - - 34 - - - - 274 - - - - 268 - {{32, 83}, {80, 18}} - - - - _NS:239 - YES - - -2080374784 - 0 - Optimize - - _NS:239 - - 1211912448 - 2 - - NSImage - NSSwitch - - - NSSwitch - - - - 200 - 25 - - NO - - - - 268 - {{116, 83}, {118, 18}} - - - - _NS:239 - YES - - -2080374784 - 0 - Fetch Metadata - - _NS:239 - - 1211912448 - 2 - - - - - 200 - 25 - - NO - - - - 268 - {{355, 83}, {89, 18}} - - - - _NS:239 - YES - - -2080374784 - 0 - Auto-Start - - _NS:239 - - 1211912448 - 2 - - - - - 200 - 25 - - NO - - - - 268 - {{238, 83}, {113, 18}} - - - - _NS:239 - YES - - -2080374784 - 0 - iTunes groups - - _NS:239 - - 1211912448 - 2 - - - - - 200 - 25 - - NO - - - - 268 - {{227, 44}, {180, 26}} - - - - _NS:815 - YES - - -2076180416 - 2048 - - _NS:815 - - 109199360 - 129 - - - 400 - 75 - - - Same as file - - 1048576 - 2147483647 - 1 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - _popUpItemAction: - - - YES - - OtherViews - - - - - YES - YES - - - 2147483647 - - - _popUpItemAction: - - - - - Other… - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - - 1 - YES - YES - 2 - - NO - - - - 268 - {{113, 50}, {109, 17}} - - - - _NS:3983 - YES - - 68157504 - 272630784 - Default location: - - _NS:3983 - - - - - NO - - - {{1, 1}, {519, 117}} - - - - _NS:632 - - - {{-12, -3}, {521, 133}} - - - - _NS:630 - {0, 0} - - 67108864 - 0 - - - - 6 - System - textBackgroundColor - - - - 3 - MCAwLjgwMDAwMDAxMTkAA - - - - 1 - 0 - 2 - NO - - - - 289 - {{451, 127}, {29, 26}} - - - - _NS:4005 - YES - - 67108864 - 134217728 - - - _NS:4005 - - 918831104 - 166 - - - 400 - 75 - - NO - - - - 290 - {{197, 130}, {150, 20}} - - - - _NS:9 - {250, 250} - 16399 - 100 - - - {496, 151} - - - - _NS:632 - - - {{-4, -30}, {496, 166}} - - - - _NS:630 - {0, 0} - - 67108864 - 0 - - - - - 3 - MCAwLjgwMDAwMDAxMTkAA - - - - 0 - 0 - 2 - NO - - - {488, 421} - - - - - {{0, 0}, {2560, 1418}} - {434, 222} - {10000000000000, 10000000000000} - SBQueuePosition - YES - - - - - - - Remove from queue - - 2147483647 - - - - - - Remove completed items - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Reveal in Finder - - 2147483647 - - - - - - - YES - - - - NO - - - - start - - - - 18 - - - - open: - - - - 19 - - - - countLabel - - - - 21 - - - - window - - - - 25 - - - - open - - - - 29 - - - - toggleStartStop: - - - - 33 - - - - OptimizeOption - - - - 43 - - - - MetadataOption - - - - 44 - - - - AutoStartOption - - - - 45 - - - - toggleOptions: - - - - 55 - - - - tableScrollView - - - - 58 - - - - optionsBox - - - - 59 - - - - chooseDestination: - - - - 75 - - - - destButton - - - - 76 - - - - destination: - - - - 77 - - - - removeSelectedItems: - - - - 85 - - - - removeCompletedItems: - - - - 88 - - - - progressIndicator - - - - 92 - - - - ITunesGroupsOption - - - - 98 - - - - tableView - - - - 28 - - - - showInFinder: - - - - sto-w3-Igj - - - - dataSource - - - - 26 - - - - menu - - - - 83 - - - - delegate - - - - 27 - - - - value: values.SBQueueOptimize - - - - - - value: values.SBQueueOptimize - value - values.SBQueueOptimize - 2 - - - 48 - - - - value: values.SBQueueMetadata - - - - - - value: values.SBQueueMetadata - value - values.SBQueueMetadata - 2 - - - 50 - - - - value: values.SBQueueAutoStart - - - - - - value: values.SBQueueAutoStart - value - values.SBQueueAutoStart - 2 - - - 52 - - - - delegate - - - - 84 - - - - value: values.SBQueueITunesGroups - - - - - - value: values.SBQueueITunesGroups - value - values.SBQueueITunesGroups - 2 - - - 96 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 1 - - - - - - - - 2 - - - - - - - - - 3 - - - - - - - - - - 4 - - - - - 6 - - - - - 46 - - - - - 78 - - - - - - - - - - - 79 - - - - - 86 - - - - - 57 - - - - - - - - - - - - - 34 - - - - - - - - - - - - - 72 - - - - - - - - 73 - - - - - 66 - - - - - - - - 67 - - - - - - - - 68 - - - - - - - - - - 74 - - - - - 70 - - - - - 69 - - - - - 37 - - - - - - - - 38 - - - - - 39 - - - - - - - - 40 - - - - - 41 - - - - - - - - 42 - - - - - 53 - - - - - - - - 54 - - - - - 14 - - - - - - - - 15 - - - - - 12 - - - - - - - - 13 - - - - - 91 - - - - - 16 - - - - - - - - 17 - - - - - 93 - - - - - - - - 94 - - - - - 7 - - - - - - - - - 8 - - - - - - - - 30 - - - - - - - - 32 - - - - - 11 - - - - - 8gi-57-i6u - - - - - U9H-ZG-j7u - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{357, 418}, {480, 270}} - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - SBTableView - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - - - - - SBQueueController - NSWindowController - - id - id - id - id - id - id - id - id - id - - - - chooseDestination: - id - - - destination: - id - - - edit: - id - - - open: - id - - - removeCompletedItems: - id - - - removeSelectedItems: - id - - - showInFinder: - id - - - toggleOptions: - id - - - toggleStartStop: - id - - - - NSButton - NSButton - NSButton - NSButton - NSTextField - NSPopUpButton - NSButton - NSBox - NSProgressIndicator - NSButton - NSScrollView - SBTableView - - - - AutoStartOption - NSButton - - - ITunesGroupsOption - NSButton - - - MetadataOption - NSButton - - - OptimizeOption - NSButton - - - countLabel - NSTextField - - - destButton - NSPopUpButton - - - open - NSButton - - - optionsBox - NSBox - - - progressIndicator - NSProgressIndicator - - - start - NSButton - - - tableScrollView - NSScrollView - - - tableView - SBTableView - - - - IBProjectSource - ./Classes/SBQueueController.h - - - - SBTableView - NSTableView - - id - id - id - id - - - - copy: - id - - - cut: - id - - - delete: - id - - - paste: - id - - - - IBProjectSource - ./Classes/SBTableView.h - - - - - 0 - IBCocoaFramework - YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - {10, 10} - {11, 11} - {10, 3} - {15, 15} - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +