Modernize the code a bit, fix the help url and improve the dts options

This commit is contained in:
Damiano Galassi committed 2015-08-19 19:28:00 +02:00
1 parent e161718557
commit b005cd7d1d
26 files changed
+355 -214

No files matched your search

+20 -13
View File
@@ -10,6 +10,8 @@
@class MP42Metadata;
NS_ASSUME_NONNULL_BEGIN
@interface MetadataImporter : NSObject {
@private
BOOL _isCancelled;
@@ -27,9 +29,9 @@ typedef enum SBCachePolicy : NSUInteger {
+ (NSData *)downloadDataFromURL:(NSURL *)url withCachePolicy:(SBCachePolicy)policy;
#pragma mark Class methods
+ (NSArray *) movieProviders;
+ (NSArray *) tvProviders;
+ (NSArray *) languagesForProvider:(NSString *)aProvider;
+ (NSArray<NSString *> *) movieProviders;
+ (NSArray<NSString *> *) tvProviders;
+ (NSArray<NSString *> *) languagesForProvider:(NSString *)aProvider;
+ (instancetype) importerForProvider:(NSString *)aProviderName;
+ (instancetype) defaultMovieProvider;
+ (instancetype) defaultTVProvider;
@@ -39,21 +41,26 @@ typedef enum SBCachePolicy : NSUInteger {
+ (NSString *) defaultLanguageForProvider:(NSString *)provider;
#pragma mark Asynchronous searching
- (void) searchTVSeries:(NSString *)aSeries language:(NSString *)aLanguage completionHandler:(void(^)(NSArray *results))handler;
- (void) searchTVSeries:(NSString *)aSeries language:(NSString *)aLanguage seasonNum:(NSString *)aSeasonNum episodeNum:(NSString *)aEpisodeNum completionHandler:(void(^)(NSArray *results))handler;
- (void) searchTVSeries:(NSString *)aSeries language:(NSString *)aLanguage completionHandler:(void(^)(NSArray<MP42Metadata *> * _Nullable results))handler;
- (void) searchTVSeries:(NSString *)aSeries language:(NSString *)aLanguage seasonNum:(NSString *)aSeasonNum episodeNum:(NSString *)aEpisodeNum completionHandler:(void(^)(NSArray<MP42Metadata *> * _Nullable results))handler;
- (void) searchMovie:(NSString *)aMovieTitle language:(NSString *)aLanguage completionHandler:(void(^)(NSArray *results))handler;
- (void) searchMovie:(NSString *)aMovieTitle language:(NSString *)aLanguage completionHandler:(void(^)(NSArray<MP42Metadata *> * _Nullable results))handler;
- (void) loadFullMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage completionHandler:(void(^)(MP42Metadata *metadata))handler;
- (void) loadFullMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage completionHandler:(void(^)(MP42Metadata * _Nullable metadata))handler;
- (void) cancel;
#pragma Methods to be overridden
- (NSArray *) languages;
- (NSArray *) searchTVSeries:(NSString *)aSeriesName language:(NSString *)aLanguage;
- (NSArray *) searchTVSeries:(NSString *)aSeriesName language:(NSString *)aLanguage seasonNum:(NSString *)aSeasonNum episodeNum:(NSString *)aEpisodeNum;
- (NSArray *) searchMovie:(NSString *)aMovieTitle language:(NSString *)aLanguage;
- (MP42Metadata*) loadTVMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage;
- (MP42Metadata*) loadMovieMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage;
- (NSArray<NSString *> *) languages;
- (NSArray<MP42Metadata *> * _Nullable) searchTVSeries:(NSString *)aSeriesName language:(NSString *)aLanguage;
- (NSArray<MP42Metadata *> * _Nullable) searchTVSeries:(NSString *)aSeriesName language:(NSString *)aLanguage seasonNum:(NSString * _Nullable)aSeasonNum episodeNum:(NSString * _Nullable)aEpisodeNum;
- (NSArray<MP42Metadata *> * _Nullable) searchMovie:(NSString *)aMovieTitle language:(NSString *)aLanguage;
- (MP42Metadata * _Nullable) loadTVMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage;
- (MP42Metadata * _Nullable) loadMovieMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage;
@end
NS_ASSUME_NONNULL_END
+5 -5
View File
@@ -225,7 +225,7 @@
}
#pragma mark Asynchronous searching
- (void) searchTVSeries:(NSString *)aSeries language:(NSString *)aLanguage completionHandler:(void(^)(NSArray *results))handler {
- (void) searchTVSeries:(NSString *)aSeries language:(NSString *)aLanguage completionHandler:(void(^)(NSArray<MP42Metadata *> * _Nullable results))handler {
dispatch_async(dispatch_get_global_queue(0, 0), ^{
NSArray *results = [self searchTVSeries:aSeries language:aLanguage];
dispatch_async(dispatch_get_main_queue(), ^{
@@ -236,7 +236,7 @@
});
}
- (void) searchTVSeries:(NSString *)aSeries language:(NSString *)aLanguage seasonNum:(NSString *)aSeasonNum episodeNum:(NSString *)aEpisodeNum completionHandler:(void(^)(NSArray *results))handler {
- (void) searchTVSeries:(NSString *)aSeries language:(NSString *)aLanguage seasonNum:(NSString *)aSeasonNum episodeNum:(NSString *)aEpisodeNum completionHandler:(void(^)(NSArray<MP42Metadata *> * _Nullable results))handler {
dispatch_async(dispatch_get_global_queue(0, 0), ^{
NSArray *results = [self searchTVSeries:aSeries language:aLanguage seasonNum:aSeasonNum episodeNum:aEpisodeNum];
dispatch_async(dispatch_get_main_queue(), ^{
@@ -247,7 +247,7 @@
});
}
- (void) searchMovie:(NSString *)aMovieTitle language:(NSString *)aLanguage completionHandler:(void(^)(NSArray *results))handler {
- (void) searchMovie:(NSString *)aMovieTitle language:(NSString *)aLanguage completionHandler:(void(^)(NSArray<MP42Metadata *> * _Nullable results))handler {
dispatch_async(dispatch_get_global_queue(0, 0), ^{
NSArray *results = [self searchMovie:aMovieTitle language:aLanguage];
dispatch_async(dispatch_get_main_queue(), ^{
@@ -258,7 +258,7 @@
});
}
- (void) loadFullMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage completionHandler:(void(^)(MP42Metadata *metadata))handler {
- (void) loadFullMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage completionHandler:(void(^)(MP42Metadata * _Nullable metadata))handler {
dispatch_async(dispatch_get_global_queue(0, 0), ^{
if (aMetadata.mediaKind == 9) {
[self loadMovieMetadata:aMetadata language:aLanguage];
@@ -279,7 +279,7 @@
#pragma mark Methods to be overridden
- (NSArray *) languages {
- (NSArray<NSString *> *) languages {
@throw [NSException exceptionWithName:NSInternalInconsistencyException
reason:[NSString stringWithFormat:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)]
userInfo:nil];
+2 -3
View File
@@ -171,8 +171,7 @@
- (IBAction) help:(id)sender
{
[[NSWorkspace sharedWorkspace] openURL: [NSURL
URLWithString:@"http://code.google.com/p/subler/wiki/Documentation"]];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://bitbucket.org/galad87/subler/wiki/Home"]];
}
- (IBAction) linkDonate:(id)sender
@@ -207,7 +206,7 @@
SBDocument *doc = [self openUntitledDocumentAndDisplay:displayDocument error:&outError];
[doc performSelectorOnMainThread:@selector(showImportSheet:) withObject:[NSArray arrayWithObject:url] waitUntilDone:NO];
completionHandler(doc, NO, NULL);
completionHandler(doc, NO, outError);
});
}
else {
+3 -3
View File
@@ -20,13 +20,13 @@
IBOutlet NSSlider *slider;
IBOutlet NSButton *addArtworkButton;
IBOutlet NSButton *loadMoreArtworkButton;
NSMutableArray *imageURLsUnloaded;
NSMutableArray<NSURL *> *imageURLsUnloaded;
NSMutableArray *images;
NSArray *artworkProviderNames;
NSArray<NSString *> *artworkProviderNames;
}
#pragma mark Initialization
- (instancetype)initWithDelegate:(id <SBArtworkSelectorDelegate>)del imageURLs:(NSArray *)imageURLs artworkProviderNames:(NSArray *)artworkProviderNames;
- (instancetype)initWithDelegate:(id <SBArtworkSelectorDelegate>)del imageURLs:(NSArray<NSURL *> *)imageURLs artworkProviderNames:(NSArray<NSString *> *)artworkProviderNames;
#pragma mark Load images
- (IBAction) loadMoreArtwork:(id)sender;
+4
View File
@@ -8,6 +8,8 @@
#import <Cocoa/Cocoa.h>
NS_ASSUME_NONNULL_BEGIN
@class MP42File;
@interface SBDocument : NSDocument {
@@ -72,3 +74,5 @@
- (void)showImportSheet:(NSArray *)fileURLs;
@end
NS_ASSUME_NONNULL_END
+54 -45
View File
@@ -59,12 +59,11 @@
languages = [[[MP42Languages defaultManager] languages] retain];
_optimize = NO;
[self tableViewSelectionDidChange:nil];
[self reloadPropertyView];
[sendToQueue setImage:[NSImage imageNamed:NSImageNameShareTemplate]];
[fileTracksTable registerForDraggedTypes:[NSArray arrayWithObjects:SublerTableViewDataType, nil]];
[documentWindow registerForDraggedTypes:[NSArray arrayWithObjects:
NSColorPboardType, NSFilenamesPboardType, nil]];
[fileTracksTable registerForDraggedTypes:@[SublerTableViewDataType]];
[documentWindow registerForDraggedTypes:@[NSFilenamesPboardType]];
}
@@ -86,6 +85,9 @@
return self;
}
#pragma mark Read methods
+ (BOOL)canConcurrentlyReadDocumentsOfType:(NSString *)type
{
return YES;
@@ -96,15 +98,13 @@
return NO;
}
#pragma mark Read methods
- (void)reloadFile:(NSURL *)absoluteURL
{
if (absoluteURL) {
self.mp4 = [[[MP42File alloc] initWithExistingFile:absoluteURL andDelegate:self] autorelease];
[fileTracksTable reloadData];
[self tableViewSelectionDidChange:nil];
[self reloadPropertyView];
if (!self.mp4) {
[self close];
@@ -130,7 +130,7 @@
self.mp4 = [[[MP42File alloc] initWithExistingFile:absoluteURL andDelegate:self] autorelease];
[fileTracksTable reloadData];
[self tableViewSelectionDidChange:nil];
[self reloadPropertyView];
[self updateChangeCount:NSChangeCleared];
if (outError != NULL && !self.mp4) {
@@ -174,11 +174,6 @@
return YES;
}
- (void)saveToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation completionHandler:(void (^)(NSError * _Nullable))completionHandler
{
[super saveToURL:url ofType:typeName forSaveOperation:saveOperation completionHandler:completionHandler];
}
- (BOOL)writeSafelyToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation error:(NSError * _Nullable *)outError
{
NSMutableDictionary * attributes = [[NSMutableDictionary alloc] init];
@@ -187,8 +182,6 @@
if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"SBOrganizeAlternateGroups"] boolValue])
[attributes setObject:@YES forKey:MP42OrganizeAlternateGroups];
[self unblockUserInteraction];
dispatch_async(dispatch_get_main_queue(), ^{
[optBar setIndeterminate:YES];
[optBar startAnimation:self];
@@ -197,6 +190,7 @@
modalDelegate:nil didEndSelector:NULL contextInfo:nil];
});
[self unblockUserInteraction];
IOPMAssertionID assertionID;
// Enable sleep assertion
@@ -249,14 +243,17 @@
[savePanel setExtensionHidden:NO];
[savePanel setAccessoryView:saveView];
NSArray *formats = [self writableTypesForSaveOperation:NSSaveAsOperation];
NSArray<NSString *> *formats = [self writableTypesForSaveOperation:NSSaveAsOperation];
[fileFormat removeAllItems];
for (id format in formats)
for (NSString *format in formats) {
[fileFormat addItemWithTitle:format];
}
[fileFormat selectItemAtIndex:[[[NSUserDefaults standardUserDefaults] valueForKey:@"defaultSaveFormat"] integerValue]];
if ([[NSUserDefaults standardUserDefaults] valueForKey:@"SBSaveFormat"])
[_currentSavePanel setAllowedFileTypes:[NSArray arrayWithObject:[[NSUserDefaults standardUserDefaults] valueForKey:@"SBSaveFormat"]]];
if ([[NSUserDefaults standardUserDefaults] valueForKey:@"SBSaveFormat"]) {
_currentSavePanel.allowedFileTypes = @[[[NSUserDefaults standardUserDefaults] valueForKey:@"SBSaveFormat"]];
}
NSString *filename = nil;
for (MP42Track *track in self.mp4.tracks) {
@@ -266,11 +263,13 @@
}
}
if (filename)
if (filename) {
[savePanel performSelector:@selector(setNameFieldStringValue:) withObject:filename];
}
if (self.mp4.dataSize > 4200000000)
if (self.mp4.dataSize > 4200000000) {
[_64bit_data setState:NSOnState];
}
return YES;
}
@@ -300,7 +299,7 @@
break;
}
[_currentSavePanel setAllowedFileTypes:[NSArray arrayWithObject:requiredFileType]];
[_currentSavePanel setAllowedFileTypes:@[requiredFileType]];
[[NSUserDefaults standardUserDefaults] setObject:requiredFileType forKey:@"SBSaveFormat"];
}
@@ -414,7 +413,7 @@
#pragma mark table datasource
- (NSInteger)numberOfRowsInTableView:(NSTableView *)t
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView
{
return self.mp4.tracks.count;
}
@@ -477,6 +476,11 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
}
- (void)tableViewSelectionDidChange:(NSNotification *)aNotification
{
[self reloadPropertyView];
}
- (void)reloadPropertyView
{
if ([propertyView view] != nil) {
// remove the current view
@@ -532,7 +536,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
return NO;
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:rowIndexes];
[pboard declareTypes:[NSArray arrayWithObject:SublerTableViewDataType] owner:self];
[pboard declareTypes:@[SublerTableViewDataType] owner:self];
[pboard setData:data forType:SublerTableViewDataType];
return YES;
}
@@ -595,7 +599,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
[importWindow autorelease], importWindow = nil;
[fileTracksTable reloadData];
[self tableViewSelectionDidChange:nil];
[self reloadPropertyView];
}
- (IBAction)sendToQueue:(id)sender
@@ -706,7 +710,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
[self.mp4 organizeAlternateGroups];
[fileTracksTable reloadData];
[self tableViewSelectionDidChange:nil];
[self reloadPropertyView];
[self updateChangeCount:NSChangeDone];
}
@@ -717,7 +721,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
[self.mp4 addTrack:[MP42ChapterTrack chapterTrackFromFile:fileURL]];
[fileTracksTable reloadData];
[self tableViewSelectionDidChange:nil];
[self reloadPropertyView];
[self updateChangeCount:NSChangeDone];
}
@@ -725,7 +729,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
{
NSError *error;
if ([chapters updateFromCSVFile:URL error:&error]) {
[self tableViewSelectionDidChange:nil];
[self reloadPropertyView];
[self updateChangeCount:NSChangeDone];
}
else {
@@ -762,7 +766,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
}];
}
- (void)showImportSheet:(NSArray *)fileURLs
- (void)showImportSheet:(NSArray<NSURL *> *)fileURLs
{
NSError *error = nil;
@@ -770,7 +774,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
if (importWindow) {
if ([importWindow onlyContainsSubtitleTracks]) { //execute always. Maybe we should do this only for subtitle
[importWindow addTracks:nil];
[importWindow addTracks:self];
[self didEndSheet:nil returnCode:NSOKButton contextInfo:nil];
} else { // show the dialog
[NSApp beginSheet:[importWindow window] modalForWindow:documentWindow
@@ -781,15 +785,18 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
}
}
- (void)importDoneWithTracks:(NSArray *)tracksToBeImported andMetadata:(MP42Metadata *)metadata
- (void)importDoneWithTracks:(NSArray<MP42Track *> *)tracksToBeImported andMetadata:(MP42Metadata *)metadata
{
if (tracksToBeImported) {
for (id track in tracksToBeImported)
for (MP42Track *track in tracksToBeImported) {
[self.mp4 addTrack:track];
}
[self updateChangeCount:NSChangeDone];
if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"SBOrganizeAlternateGroups"] boolValue])
if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"SBOrganizeAlternateGroups"] boolValue]) {
[self.mp4 organizeAlternateGroups];
}
}
if (metadata) {
@@ -813,7 +820,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
}
}
[self tableViewSelectionDidChange:nil];
[self reloadPropertyView];
[self updateChangeCount:NSChangeDone];
}
@@ -823,7 +830,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
panel.allowsMultipleSelection = NO;
panel.canChooseFiles = YES;
panel.canChooseDirectories = NO;
[panel setAllowedFileTypes:[NSArray arrayWithObjects:@"mp4", @"m4v", @"m4a", @"xml", @"nfo", nil]];
panel.allowedFileTypes = @[@"mp4", @"m4v", @"m4a", @"xml", @"nfo"];
[panel beginSheetModalForWindow:documentWindow completionHandler:^(NSInteger result) {
if (result == NSFileHandlingPanelOKButton) {
@@ -839,12 +846,12 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
NSString *filename = [[[[self fileURL] path] stringByDeletingPathExtension] lastPathComponent];
if (row != -1 && [[self.mp4 trackAtIndex:row] isKindOfClass:[MP42SubtitleTrack class]]) {
[panel setAllowedFileTypes:[NSArray arrayWithObject: @"srt"]];
panel.allowedFileTypes = @[@"srt"];
filename = [filename stringByAppendingFormat:@".%@", [[self.mp4 trackAtIndex:row] language]];
}
else if (row != -1 ) {
filename = [filename stringByAppendingString:@" - Chapters"];
[panel setAllowedFileTypes:[NSArray arrayWithObject: @"txt"]];
panel.allowedFileTypes = @[@"txt"];
}
[panel setCanSelectHiddenExtension: YES];
@@ -894,7 +901,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
duration:self.mp4.duration];
[fileTracksTable reloadData];
[self tableViewSelectionDidChange:nil];
[self reloadPropertyView];
[self updateChangeCount:NSChangeDone];
}
@@ -902,7 +909,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
{
[self.mp4 organizeAlternateGroups];
[fileTracksTable reloadData];
[self tableViewSelectionDidChange:nil];
[self reloadPropertyView];
[self updateChangeCount:NSChangeDone];
}
@@ -924,23 +931,25 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
NSPasteboard *pboard = [sender draggingPasteboard];
if ( [[pboard types] containsObject:NSURLPboardType] ) {
NSArray *items = [pboard readObjectsForClasses:
[NSArray arrayWithObject: [NSURL class]] options: nil];
NSMutableArray *supItems = [[[NSMutableArray alloc] init] autorelease];
NSArray *items = [pboard readObjectsForClasses:@[[NSURL class]] options:nil];
NSMutableArray<NSURL *> *supItems = [[[NSMutableArray alloc] init] autorelease];
for (NSURL *file in items) {
if ([[file pathExtension] caseInsensitiveCompare: @"txt"] == NSOrderedSame)
if ([[file pathExtension] caseInsensitiveCompare: @"txt"] == NSOrderedSame) {
[self addChapterTrack:file];
}
else if ([[file pathExtension] caseInsensitiveCompare: @"xml"] == NSOrderedSame ||
[[file pathExtension] caseInsensitiveCompare: @"nfo"] == NSOrderedSame)
[[file pathExtension] caseInsensitiveCompare: @"nfo"] == NSOrderedSame) {
[self addMetadata:file];
}
else if (isFileFormatSupported([file pathExtension])) {
[supItems addObject:file];
}
}
if ([supItems count])
if (supItems.count) {
[self showImportSheet:supItems];
}
return YES;
}
+4
View File
@@ -8,6 +8,8 @@
#import <Cocoa/Cocoa.h>
NS_ASSUME_NONNULL_BEGIN
@class MP42Metadata;
@protocol SBFileImportDelegate
@@ -40,3 +42,5 @@
- (IBAction)uncheckSelected:(id)sender;
@end
NS_ASSUME_NONNULL_END
+2 -1
View File
@@ -358,8 +358,9 @@
- (IBAction)addTracks:(id)sender
{
if (!_actionArray) // if add tracks is called directly, need to prepare actions
if (!_actionArray) { // if add tracks is called directly, need to prepare actions
[self _prepareActionArray];
}
NSMutableArray *tracks = [[NSMutableArray alloc] init];
NSInteger i = 0;
+5 -1
View File
@@ -8,6 +8,8 @@
#import <Cocoa/Cocoa.h>
NS_ASSUME_NONNULL_BEGIN
@class SBQueueItem;
@protocol SBItemViewDelegate <NSObject>
@@ -28,8 +30,10 @@
}
@property (nonatomic, readonly) SBQueueItem *item;
@property (nonatomic, assign, readwrite) id delegate;
@property (nonatomic, assign, readwrite) id<SBItemViewDelegate> delegate;
- (instancetype)initWithItem:(SBQueueItem *)item;
@end
NS_ASSUME_NONNULL_END
+4
View File
@@ -8,6 +8,8 @@
#import <Cocoa/Cocoa.h>
NS_ASSUME_NONNULL_BEGIN
@class SBTableView;
@class SBArtworkSelector;
@@ -66,3 +68,5 @@
+ (void) deleteCachedMetadata;
@end
NS_ASSUME_NONNULL_END
+4
View File
@@ -8,6 +8,8 @@
#import <Cocoa/Cocoa.h>
NS_ASSUME_NONNULL_BEGIN
@interface SBOptionsViewController : NSViewController {
@private
IBOutlet NSPopUpButton *_destButton;
@@ -26,3 +28,5 @@
- (instancetype)initWithOptions:(NSMutableDictionary *)options;
@end
NS_ASSUME_NONNULL_END
+2 -1
View File
@@ -37,8 +37,9 @@
@"SBAudioMixdown": @"1",
@"SBAudioBitrate": @"96",
@"SBAudioConvertAC3": @"YES",
@"SBAudioDtsPassthrough": @"NO",
@"SBAudioKeepAC3": @"YES",
@"SBAudioConvertDts": @"YES",
@"SBAudioKeepDTS": @"NO",
@"SBSubtitleConvertBitmap": @"YES",
@"SBRatingsCountry": @"All countries",
@"SBSaveFormat": @"m4v",
+6 -2
View File
@@ -8,13 +8,15 @@
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class MP42Metadata;
extern NSString *SBPresetManagerUpdatedNotification;
@interface SBPresetManager : NSObject {
@private
NSMutableArray *_presets;
NSMutableArray<MP42Metadata *> *_presets;
}
+ (SBPresetManager *)sharedManager;
@@ -25,6 +27,8 @@ extern NSString *SBPresetManagerUpdatedNotification;
- (MP42Metadata *)setWithName:(NSString *)name;
- (BOOL)removePresetAtIndex:(NSUInteger)index;
@property(readonly) NSArray *presets;
@property(readonly) NSArray<MP42Metadata *> *presets;
@end
NS_ASSUME_NONNULL_END
+18 -13
View File
@@ -22,6 +22,8 @@ NSString *SBPresetManagerUpdatedNotification = @"SBPresetManagerUpdatedNotificat
@implementation SBPresetManager
@synthesize presets = _presets;
+ (SBPresetManager *)sharedManager
{
static dispatch_once_t pred;
@@ -31,8 +33,9 @@ NSString *SBPresetManagerUpdatedNotification = @"SBPresetManagerUpdatedNotificat
return sharedPresetManager;
}
- (id)init {
if ((self = [super init])) {
- (instancetype)init {
self = [super init];
if (self) {
_presets = [[NSMutableArray alloc] init];
[self loadPresets];
@@ -48,7 +51,7 @@ NSString *SBPresetManagerUpdatedNotification = @"SBPresetManagerUpdatedNotificat
- (void)newSetFromExistingMetadata:(MP42Metadata *)set
{
id newSet = [set copy];
MP42Metadata *newSet = [set copy];
[_presets addObject:newSet];
[newSet release];
@@ -71,8 +74,9 @@ NSString *SBPresetManagerUpdatedNotification = @"SBPresetManagerUpdatedNotificat
NSString *appSupportPath = [self appSupportPath];
MP42Metadata *newPreset;
if (!appSupportPath)
if (!appSupportPath) {
return NO;
}
NSDirectoryEnumerator *dirEnum = [fileManager enumeratorAtPath:appSupportPath];
while ((file = [dirEnum nextObject])) {
@@ -89,10 +93,12 @@ NSString *SBPresetManagerUpdatedNotification = @"SBPresetManagerUpdatedNotificat
}
}
if (![_presets count])
if (!_presets.count) {
return NO;
else
}
else {
return YES;
}
}
- (BOOL)savePresets
@@ -101,12 +107,13 @@ NSString *SBPresetManagerUpdatedNotification = @"SBPresetManagerUpdatedNotificat
NSString *appSupportPath = [self appSupportPath];
BOOL noErr = YES;
if (!appSupportPath)
if (!appSupportPath) {
return NO;
}
if (![fileManager fileExistsAtPath:appSupportPath])
if (![fileManager fileExistsAtPath:appSupportPath]) {
[fileManager createDirectoryAtPath:appSupportPath withIntermediateDirectories:noErr attributes:nil error:NULL];
}
for (MP42Metadata *object in _presets) {
if ([object isEdited]) {
@@ -137,14 +144,14 @@ NSString *SBPresetManagerUpdatedNotification = @"SBPresetManagerUpdatedNotificat
return [self removePresetWithName:name];
}
- (BOOL)removePresetWithName:(NSString *)name
{
BOOL err = NO;
NSString *appSupportPath = [self appSupportPath];
if (!appSupportPath)
if (!appSupportPath) {
return NO;
}
NSFileManager *fileManager = [NSFileManager defaultManager];
err = [fileManager removeItemAtPath:[NSString stringWithFormat:@"%@/%@.sbpreset", appSupportPath, name]
@@ -153,6 +160,4 @@ NSString *SBPresetManagerUpdatedNotification = @"SBPresetManagerUpdatedNotificat
return err;
}
@synthesize presets = _presets;
@end
+6 -1
View File
@@ -11,6 +11,8 @@
#import "SBQueueItem.h"
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, SBQueueStatus) {
SBQueueStatusUnknown = 0,
SBQueueStatusWorking,
@@ -57,7 +59,7 @@ extern NSString *SBQueueCancelledNotification;
- (SBQueueItem *)itemAtIndex:(NSUInteger)index;
- (NSUInteger)indexOfItem:(SBQueueItem *)item;
- (NSIndexSet *)indexesOfItemsWithStatus:(SBQueueItemStatus)status;
- (NSArray *)itemsAtIndexes:(NSIndexSet *)indexes;
- (NSArray<SBQueueItem *> *)itemsAtIndexes:(NSIndexSet *)indexes;
- (void)insertItem:(SBQueueItem *)anItem atIndex:(NSUInteger)index;
@@ -69,3 +71,6 @@ extern NSString *SBQueueCancelledNotification;
- (BOOL)saveQueueToDisk;
@end
NS_ASSUME_NONNULL_END
+4
View File
@@ -11,6 +11,8 @@
@class SBQueueItem;
@class MP42Metadata;
NS_ASSUME_NONNULL_BEGIN
/**
* SBQueue actions protocol, actions can be run by
* the queue's items.
@@ -57,3 +59,5 @@
*/
@interface SBQueueOrganizeGroupsAction : NSObject <SBQueueActionProtocol>
@end
NS_ASSUME_NONNULL_END
+4 -1
View File
@@ -7,9 +7,10 @@
//
#import <Cocoa/Cocoa.h>
#import "SBQueue.h"
NS_ASSUME_NONNULL_BEGIN
@class SBQueueItem;
@class SBOptionsViewController;
@class SBQueuePreferences;
@@ -51,3 +52,5 @@
- (BOOL)saveQueueToDisk;
@end
NS_ASSUME_NONNULL_END
+31 -18
View File
@@ -22,7 +22,7 @@ static void *SBQueueContex = &SBQueueContex;
#define SublerBatchTableViewDataType @"SublerBatchTableViewDataType"
@interface SBQueueController () <NSPopoverDelegate, NSWindowDelegate, NSTableViewDelegate, NSTableViewDataSource, SBTableViewDelegate>
@interface SBQueueController () <NSPopoverDelegate, NSWindowDelegate, NSTableViewDelegate, NSTableViewDataSource, SBTableViewDelegate, SBItemViewDelegate>
@property (nonatomic, readonly) SBQueue *queue;
@property (nonatomic, retain) NSPopover *popover;
@@ -64,7 +64,7 @@ static void *SBQueueContex = &SBQueueContex;
return sharedManager;
}
- (id)init {
- (instancetype)init {
if (self = [super initWithWindowNibName:@"Queue"]) {
[SBQueuePreferences registerUserDefaults];
_prefs = [[SBQueuePreferences alloc] init];
@@ -185,14 +185,14 @@ static void *SBQueueContex = &SBQueueContex;
#pragma mark - Queue methods
/*
/**
* The queue status
*/
- (SBQueueStatus)status {
return self.queue.status;
}
/*
/**
* Saves the queue and the user defaults.
*/
- (BOOL)saveQueueToDisk {
@@ -200,7 +200,7 @@ static void *SBQueueContex = &SBQueueContex;
return [self.queue saveQueueToDisk];
}
/*
/**
* Opens a SBQueueItem in a new document window
* and removes it from the queue.
*/
@@ -209,21 +209,34 @@ static void *SBQueueContex = &SBQueueContex;
[self updateUI];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
if (!item.mp4File)
[item prepare:NULL];
__block NSError *error;
BOOL result = NO;
if (!item.mp4File) {
result = [item prepare:&error];
if (result == NO) {
NSLog(@"%@", error);
}
}
MP42File *mp4 = item.mp4File;
dispatch_sync(dispatch_get_main_queue(), ^{
SBDocument *doc = [[SBDocument alloc] initWithMP4:mp4 error:NULL];
[[NSDocumentController sharedDocumentController] addDocument:doc];
[doc makeWindowControllers];
[doc showWindows];
[doc release];
SBDocument *doc = [[SBDocument alloc] initWithMP4:mp4 error:&error];
[self.itemPopover close];
if (doc) {
[[NSDocumentController sharedDocumentController] addDocument:doc];
[doc makeWindowControllers];
[doc showWindows];
[doc release];
[self removeItems:[NSArray arrayWithObject:item]];
[self updateUI];
[self.itemPopover close];
[self removeItems:[NSArray arrayWithObject:item]];
[self updateUI];
} else {
NSLog(@"%@", error);
}
});
});
}
@@ -345,7 +358,7 @@ static void *SBQueueContex = &SBQueueContex;
#pragma mark - NSPopover delegate
/*
/**
* Creates a popover with the queue options.
*/
- (void)createOptionsPopover {
@@ -378,7 +391,7 @@ static void *SBQueueContex = &SBQueueContex;
return _detachedWindow;
}
/*
/**
* Creates a popover with a SBQueueItem
*/
- (void)createItemPopover:(SBQueueItem *)item {
@@ -440,7 +453,7 @@ static void *SBQueueContex = &SBQueueContex;
#pragma mark - UI methods
/*
/**
* Updates the count on the app dock icon.
*/
- (void)updateDockTile {
+7 -3
View File
@@ -11,6 +11,8 @@
@class MP42File;
NS_ASSUME_NONNULL_BEGIN
typedef enum SBQueueItemStatus : NSInteger {
SBQueueItemStatusUnknown = 0,
SBQueueItemStatusReady,
@@ -38,9 +40,9 @@ typedef enum SBQueueItemStatus : NSInteger {
}
@property (nonatomic, readwrite) SBQueueItemStatus status;
@property (nonatomic, readonly) NSString *localizedWorkingDescription;
@property (nonatomic, readonly, nullable) NSString *localizedWorkingDescription;
@property (nonatomic, readonly) MP42File *mp4File;
@property (nonatomic, readonly, nullable) MP42File *mp4File;
@property (nonatomic, readonly) NSURL *URL;
@property (nonatomic, copy) NSURL *destURL;
@@ -48,7 +50,7 @@ typedef enum SBQueueItemStatus : NSInteger {
@property (nonatomic, readonly) NSArray *actions;
@property (nonatomic, readonly) NSDictionary *attributes;
@property (nonatomic, assign) id delegate;
@property (nonatomic, assign, nullable) id delegate;
+ (instancetype)itemWithURL:(NSURL *)URL;
@@ -63,3 +65,5 @@ typedef enum SBQueueItemStatus : NSInteger {
- (void)cancel;
@end
NS_ASSUME_NONNULL_END
+11 -10
View File
@@ -205,9 +205,10 @@
}
}
// DTS -> always convert.
// DTS -> convert only if specified in the prefs.
if ([track.format isEqualToString:MP42AudioFormatDTS]) {
if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"SBAudioDtsPassthrough"] boolValue]) {
if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"SBAudioConvertDts"] boolValue]) {
if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"SBAudioKeepDts"] boolValue]) {
MP42AudioTrack *copy = [track copy];
copy.needConversion = YES;
copy.mixdownType = SBDolbyPlIIMixdown;
@@ -215,20 +216,19 @@
[self.mp4File addTrack:copy];
[copy release];
}
else {
track.needConversion = YES;
}
else {
track.needConversion = YES;
}
}
}
// VobSub -> only if specified in the prefs.
if (([track.format isEqualToString:MP42SubtitleFormatVobSub] && [[[NSUserDefaults standardUserDefaults] valueForKey:@"SBSubtitleConvertBitmap"] boolValue]))
track.needConversion = YES;
// If an audio track needs to be converted, apply the mixdown from the preferences.
if ([track isMemberOfClass:[MP42AudioTrack class]] && track.needConversion)
{
if ([track isMemberOfClass:[MP42AudioTrack class]] && track.needConversion) {
NSInteger mixdown = [[[NSUserDefaults standardUserDefaults]
valueForKey:@"SBAudioMixdown"] integerValue];
MP42AudioTrack *audioTrack = (MP42AudioTrack *)track;
@@ -252,8 +252,9 @@
}
}
if (isTrackMuxable(track.format) || trackNeedConversion(track.format))
if (isTrackMuxable(track.format) || trackNeedConversion(track.format)) {
[self.mp4File addTrack:track];
}
}
[fileImporter release];
}
+4
View File
@@ -8,6 +8,8 @@
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
extern NSString * const SBQueueFileType;
extern NSString * const SBQueueOrganize;
extern NSString * const SBQueueMetadata;
@@ -36,3 +38,5 @@ extern NSString * const SBQueueDestination;
- (void)saveUserDefaults;
@end
NS_ASSUME_NONNULL_END
+92 -45
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7706" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8173.3" systemVersion="15A243d" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7706"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8173.3"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="SBPrefsController">
@@ -25,6 +25,7 @@
<view key="contentView" id="2">
<rect key="frame" x="0.0" y="0.0" width="400" height="130"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
</view>
</window>
<userDefaultsController id="3">
@@ -44,6 +45,7 @@
<textField verticalHuggingPriority="750" id="77">
<rect key="frame" x="40" y="205" width="117" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Check for update:" id="89">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -53,6 +55,7 @@
<textField verticalHuggingPriority="750" id="78">
<rect key="frame" x="99" y="180" width="58" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Window:" id="88">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -62,6 +65,7 @@
<button id="79">
<rect key="frame" x="160" y="204" width="192" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<animations/>
<buttonCell key="cell" type="check" title="Automatically check daily" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="87">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -73,6 +77,7 @@
<button id="80">
<rect key="frame" x="160" y="179" width="192" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<animations/>
<buttonCell key="cell" type="check" title="Remember Size" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="86">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -88,6 +93,7 @@
<textField verticalHuggingPriority="750" id="81">
<rect key="frame" x="92" y="155" width="65" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Chapters:" id="85">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -97,6 +103,7 @@
<textField verticalHuggingPriority="750" id="206">
<rect key="frame" x="47" y="115" width="110" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Show ratings for:" id="207">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -106,6 +113,7 @@
<textField verticalHuggingPriority="750" id="139">
<rect key="frame" x="92" y="54" width="65" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Privacy:" id="140">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -115,6 +123,7 @@
<button id="82">
<rect key="frame" x="160" y="154" width="192" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<animations/>
<buttonCell key="cell" type="check" title="Create Preview Images" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="84">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -130,6 +139,7 @@
<button verticalHuggingPriority="750" id="133">
<rect key="frame" x="156" y="44" width="192" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<buttonCell key="cell" type="push" title="Clear recent searches" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="134">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@@ -141,6 +151,7 @@
<button verticalHuggingPriority="750" id="136">
<rect key="frame" x="156" y="13" width="192" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<buttonCell key="cell" type="push" title="Delete cached metadata" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="137">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@@ -152,6 +163,7 @@
<popUpButton verticalHuggingPriority="750" id="236">
<rect key="frame" x="160" y="109" width="185" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="239" id="237">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
@@ -172,6 +184,7 @@
<textField verticalHuggingPriority="750" id="249">
<rect key="frame" x="161" y="96" width="167" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="USA ratings are always shown." id="250">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -179,46 +192,26 @@
</textFieldCell>
</textField>
</subviews>
<animations/>
</customView>
<customView id="94" userLabel="Advanced View">
<rect key="frame" x="0.0" y="6" width="400" height="207"/>
<rect key="frame" x="0.0" y="0.0" width="400" height="242"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<textField verticalHuggingPriority="750" id="101">
<rect key="frame" x="111" y="138" width="58" height="17"/>
<rect key="frame" x="18" y="173" width="151" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Convert:" id="102">
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Convert:" id="102">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button id="99">
<rect key="frame" x="172" y="117" width="143" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="check" title="AC-3 audio to AAC" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="104">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="3" name="value" keyPath="values.SBAudioConvertAC3" id="112"/>
</connections>
</button>
<button id="edJ-A5-eyf">
<rect key="frame" x="190" y="97" width="91" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="check" title="Keep AC-3" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="Zgy-z5-6UG">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="3" name="enabled" keyPath="values.SBAudioConvertAC3" id="st6-D0-eUe"/>
<binding destination="3" name="value" keyPath="values.SBAudioKeepAC3" id="W2T-se-Fud"/>
</connections>
</button>
<button id="hjZ-wQ-Sbb">
<rect key="frame" x="172" y="137" width="124" height="18"/>
<rect key="frame" x="172" y="172" width="124" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<animations/>
<buttonCell key="cell" type="check" title="VobSub to Tx3g" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="wgy-N5-9cB">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -228,17 +221,19 @@
</connections>
</button>
<textField verticalHuggingPriority="750" id="hgg-QV-i0I">
<rect key="frame" x="53" y="172" width="115" height="17"/>
<rect key="frame" x="18" y="207" width="150" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Alternate Groups:" id="agM-jg-8mH">
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Alternate Groups:" id="agM-jg-8mH">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button id="3fA-qQ-VvX">
<rect key="frame" x="172" y="171" width="169" height="18"/>
<rect key="frame" x="172" y="206" width="169" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<animations/>
<buttonCell key="cell" type="check" title="Keep groups organized" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="Yld-Or-7Hu">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -248,37 +243,41 @@
</connections>
</button>
<button id="olE-Dy-uJm">
<rect key="frame" x="172" y="77" width="143" height="18"/>
<rect key="frame" x="172" y="152" width="143" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="check" title="DTS Passthrough" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="ZcC-1D-D4s">
<animations/>
<buttonCell key="cell" type="check" title="DTS audio to AAC" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="ZcC-1D-D4s">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="3" name="value" keyPath="values.SBAudioDtsPassthrough" id="0kP-jm-57D"/>
<binding destination="3" name="value" keyPath="values.SBAudioConvertDts" id="zGa-cq-MgW"/>
</connections>
</button>
<textField verticalHuggingPriority="750" id="113">
<rect key="frame" x="53" y="53" width="125" height="17"/>
<rect key="frame" x="18" y="53" width="151" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Downmix audio to:" id="114">
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Downmix audio to:" id="114">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="189">
<rect key="frame" x="42" y="24" width="136" height="17"/>
<rect key="frame" x="18" y="22" width="151" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Bitrate (per channel):" id="190">
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Bitrate (per channel):" id="190">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="201">
<rect key="frame" x="246" y="24" width="35" height="17"/>
<rect key="frame" x="237" y="24" width="42" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="kbps" id="202">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -286,8 +285,9 @@
</textFieldCell>
</textField>
<popUpButton verticalHuggingPriority="750" id="115">
<rect key="frame" x="181" y="47" width="178" height="26"/>
<rect key="frame" x="173" y="48" width="178" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<popUpButtonCell key="cell" type="push" title="Dolby Pro Logic II" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="1" imageScaling="proportionallyDown" inset="2" selectedItem="121" id="116">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
@@ -306,8 +306,9 @@
</connections>
</popUpButton>
<popUpButton verticalHuggingPriority="750" id="191">
<rect key="frame" x="181" y="17" width="63" height="26"/>
<rect key="frame" x="172" y="17" width="63" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<popUpButtonCell key="cell" type="push" title="80" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="80" imageScaling="proportionallyDown" inset="2" selectedItem="195" id="192">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
@@ -327,8 +328,47 @@
<binding destination="123" name="selectedTag" keyPath="values.SBAudioBitrate" id="205"/>
</connections>
</popUpButton>
<button id="99">
<rect key="frame" x="172" y="112" width="143" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<animations/>
<buttonCell key="cell" type="check" title="AC-3 audio to AAC" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="104">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="3" name="value" keyPath="values.SBAudioConvertAC3" id="112"/>
</connections>
</button>
<button id="edJ-A5-eyf">
<rect key="frame" x="190" y="92" width="99" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<animations/>
<buttonCell key="cell" type="check" title="Keep AC-3" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="Zgy-z5-6UG">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="3" name="enabled" keyPath="values.SBAudioConvertAC3" id="st6-D0-eUe"/>
<binding destination="3" name="value" keyPath="values.SBAudioKeepAC3" id="W2T-se-Fud"/>
</connections>
</button>
<button id="3Jb-tI-sSK">
<rect key="frame" x="190" y="132" width="99" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<animations/>
<buttonCell key="cell" type="check" title="Keep DTS" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="LFa-OQ-j5q">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="3" name="enabled" keyPath="values.SBAudioConvertDts" id="SkM-S0-Vns"/>
<binding destination="3" name="value" keyPath="values.SBAudioKeepDTS" id="Wlo-3r-j2i"/>
</connections>
</button>
</subviews>
<point key="canvasLocation" x="340" y="609.5"/>
<animations/>
<point key="canvasLocation" x="262" y="808"/>
</customView>
<userDefaultsController representsSharedInstance="YES" id="123"/>
<customView id="142" userLabel="Sets View">
@@ -345,6 +385,7 @@
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" id="166" customClass="SBTableView">
<rect key="frame" x="0.0" y="0.0" width="354" height="19"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="_sourceListBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
@@ -385,20 +426,25 @@
</connections>
</tableView>
</subviews>
<animations/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="165">
<animations/>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="165">
<rect key="frame" x="1" y="181" width="354" height="15"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
</scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="164">
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="164">
<rect key="frame" x="224" y="17" width="15" height="102"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
</scroller>
</scrollView>
<button verticalHuggingPriority="750" id="184">
<rect key="frame" x="20" y="19" width="25" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<buttonCell key="cell" type="smallSquare" bezelStyle="smallSquare" image="NSRemoveTemplate" imagePosition="overlaps" alignment="center" enabled="NO" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="185">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@@ -408,6 +454,7 @@
</connections>
</button>
</subviews>
<animations/>
</customView>
<menu id="pzR-CP-Gdo">
<items>
+52 -43
View File
@@ -145,7 +145,7 @@
<key>CFBundleIconFile</key>
<string>Subler.icns</string>
<key>CFBundleIdentifier</key>
<string>org.galad.${PRODUCT_NAME:identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@@ -160,6 +160,57 @@
<string>0.32</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.video</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>mzstatic.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
<key>subler.org</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
<key>themoviedb.org</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
<key>thetvdb.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
<key>tmdb.org</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2009-2014, Damiano Galassi</string>
<key>NSMainNibFile</key>
@@ -193,47 +244,5 @@
</dict>
</dict>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>mzstatic.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
<key>tmdb.org</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
<key>thetvdb.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
<key>themoviedb.org</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>
</dict>
</plist>
+1 -1
View File
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>DG.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
+1 -2
View File
@@ -28,9 +28,8 @@
}
- (void)testExample {
SBQueueSetAction *action = [[SBQueueSetAction alloc] init];
// This is an example of a functional test case.
XCTAssert(action, @"Pass");
//XCTAssert(action, @"Pass");
}
- (void)testPerformanceExample {
+9 -3
View File
@@ -16,7 +16,7 @@
A917286119FD288B00348DF8 /* SBLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = A917286019FD288B00348DF8 /* SBLogger.m */; };
A91F622D0FB0A56F00B96B33 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A91F622C0FB0A56F00B96B33 /* libicucore.dylib */; };
A925AA8518378D8A00BE84D4 /* MP42Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A925AA8218378D7900BE84D4 /* MP42Foundation.framework */; };
A925AA8818378DD000BE84D4 /* MP42Foundation.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = A925AA8218378D7900BE84D4 /* MP42Foundation.framework */; };
A925AA8818378DD000BE84D4 /* MP42Foundation.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = A925AA8218378D7900BE84D4 /* MP42Foundation.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
A95B8DA91B09F37800F2F152 /* Subler_Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = A95B8DA81B09F37800F2F152 /* Subler_Tests.m */; };
A95C881D0F827BFB00F51A22 /* ToolbarRemoveTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A95C881C0F827BFB00F51A22 /* ToolbarRemoveTemplate.png */; };
A960E96317D4B00900FC6ED9 /* SBImageBrowserView.m in Sources */ = {isa = PBXBuildFile; fileRef = A960E96217D4B00900FC6ED9 /* SBImageBrowserView.m */; };
@@ -30,7 +30,7 @@
A975644F132A325C0051ED08 /* info-pressed.pdf in Resources */ = {isa = PBXBuildFile; fileRef = A975644C132A325C0051ED08 /* info-pressed.pdf */; };
A982D0C0140AB66400B92357 /* SBQueueItem.m in Sources */ = {isa = PBXBuildFile; fileRef = A982D0BF140AB66400B92357 /* SBQueueItem.m */; };
A984DB4B0F52D644001A20B2 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A984DB4A0F52D644001A20B2 /* Sparkle.framework */; };
A984DB530F52D679001A20B2 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = A984DB4A0F52D644001A20B2 /* Sparkle.framework */; };
A984DB530F52D679001A20B2 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = A984DB4A0F52D644001A20B2 /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
A984DB740F52DD4B001A20B2 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = A984DB730F52DD4B001A20B2 /* dsa_pub.pem */; };
A98739FE13FBB09B00B795A7 /* ToolbarActionTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A98739FD13FBB09B00B795A7 /* ToolbarActionTemplate.png */; };
A99BF39619F90F6300BDBE50 /* playBackTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = A99BF39519F90F6300BDBE50 /* playBackTemplate.pdf */; };
@@ -637,7 +637,7 @@
2A37F4A9FDCFA73011CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0630;
LastUpgradeCheck = 0700;
TargetAttributes = {
A95B8DA31B09F37700F2F152 = {
CreatedOnToolsVersion = 6.3.1;
@@ -999,6 +999,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = "DG.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Subler.app/Contents/MacOS/Subler";
};
@@ -1032,6 +1033,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = "DG.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Subler.app/Contents/MacOS/Subler";
};
@@ -1058,6 +1060,8 @@
LD_RUNPATH_SEARCH_PATHS = "";
LIBRARY_SEARCH_PATHS = "$(inherited)";
MACOSX_DEPLOYMENT_TARGET = 10.7;
OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.galad.${PRODUCT_NAME:identifier}";
PRODUCT_NAME = Subler;
SDKROOT = macosx;
};
@@ -1083,6 +1087,8 @@
LD_RUNPATH_SEARCH_PATHS = "";
LIBRARY_SEARCH_PATHS = "$(inherited)";
MACOSX_DEPLOYMENT_TARGET = 10.7;
OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.galad.${PRODUCT_NAME:identifier}";
PRODUCT_NAME = Subler;
SDKROOT = macosx;
};