commit fcc318e844f84d2bbd76854a6502ec1e40aa93f2 Author: Damiano Galassi Date: Mon Nov 18 13:28:07 2013 +0100 Initial import diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..d5ad011 Binary files /dev/null and b/.DS_Store differ diff --git a/Classes/.DS_Store b/Classes/.DS_Store new file mode 100644 index 0000000..9a42227 Binary files /dev/null and b/Classes/.DS_Store differ diff --git a/Classes/MetadataImporters/MetadataImporter.h b/Classes/MetadataImporters/MetadataImporter.h new file mode 100755 index 0000000..e08d817 --- /dev/null +++ b/Classes/MetadataImporters/MetadataImporter.h @@ -0,0 +1,48 @@ +// +// MetadataImporter.h +// Subler +// +// Created by Douglas Stebila on 2013-05-30. +// +// + +#import + +@class SBMetadataSearchController; +@class MP42Metadata; + +@interface MetadataImporter : NSObject { + SBMetadataSearchController *mCallback; + BOOL isCancelled; +} + +#pragma mark Helper routines ++ (NSDictionary *) parseFilename: (NSString *) filename; ++ (NSString *) urlEncoded:(NSString *)s; ++ (NSData *) downloadDataOrGetFromCache:(NSURL *)url; + +#pragma mark Static methods ++ (NSArray *) languagesForProvider:(NSString *)aProvider; ++ (instancetype) importerForProvider:(NSString *)aProviderName; ++ (instancetype) defaultMovieProvider; ++ (instancetype) defaultTVProvider; ++ (NSString *) defaultMovieLanguage; ++ (NSString *) defaultTVLanguage; + +#pragma mark Asynchronous searching +- (void) searchTVSeries:(NSString *)aSeries language:(NSString *)aLanguage callback:(SBMetadataSearchController *)aCallback; +- (void) searchTVSeries:(NSString *)aSeries language:(NSString *)aLanguage seasonNum:(NSString *)aSeasonNum episodeNum:(NSString *)aEpisodeNum callback:(SBMetadataSearchController *)aCallback; +- (void) loadTVMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage callback:(SBMetadataSearchController *)aCallback; +- (void) searchMovie:(NSString *)aMovieTitle language:(NSString *)aLanguage callback:(SBMetadataSearchController *)aCallback; +- (void) loadMovieMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage callback:(SBMetadataSearchController *)aCallback; +- (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; + +@end diff --git a/Classes/MetadataImporters/MetadataImporter.m b/Classes/MetadataImporters/MetadataImporter.m new file mode 100755 index 0000000..fbd570d --- /dev/null +++ b/Classes/MetadataImporters/MetadataImporter.m @@ -0,0 +1,312 @@ +// +// MetadataImporter.m +// Subler +// +// Created by Douglas Stebila on 2013-05-30. +// +// + +#import +#import +#import + +#import "MetadataImporter.h" + +#import "SBMetadataSearchController.h" + +#import + +#import "iTunesStore.h" +#import "TheMovieDB3.h" +#import "TheTVDB.h" + + +@implementation MetadataImporter + +#pragma mark Helper routines + ++ (NSDictionary *) parseFilename: (NSString *) filename +{ + NSMutableDictionary *results = nil; + + if (!filename || ![filename length]) { + return results; + } + + NSString *regexString = @"^\\[(.+)\\](?:(?:\\s|_)+)?([^()]+)(?:(?:\\s|_)+)(?:(?:-\\s|-_|Ep)+)([0-9][0-9]?)"; + NSDictionary *resultDictionary = [filename dictionaryByMatchingRegex:regexString + withKeysAndCaptures:@"fanSubGroup", 1, @"seriesName", 2, @"episodeNumber", 3, nil]; + + if (resultDictionary != nil && [resultDictionary count]) { + results = [[NSMutableDictionary alloc] initWithCapacity:2]; + NSString *seriesName = [[resultDictionary valueForKey:@"seriesName"] stringByReplacingOccurrencesOfString:@"_" withString:@" "]; + NSInteger episodeNumber = [[resultDictionary valueForKey:@"episodeNumber"] integerValue]; + [results setValue:@"tv" forKey:@"type"]; + [results setValue:seriesName forKey:@"seriesName"]; + [results setValue:@"1" forKey:@"seasonNum"]; + [results setValue:[NSString stringWithFormat:@"%ld", (long) episodeNumber] forKey:@"episodeNum"]; + + return [results autorelease]; + } + + NSTask *task = [[NSTask alloc] init]; + [task setLaunchPath:@"/usr/bin/perl"]; + + NSMutableArray *args = [[NSMutableArray alloc] initWithCapacity:3]; + NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"ParseFilename" ofType:@""]; + [args addObject:[NSString stringWithFormat:@"-I%@/lib", path]]; + [args addObject:[NSString stringWithFormat:@"%@/ParseFilename.pl", path]]; + [args addObject:filename]; + [task setArguments:args]; + + NSPipe *stdOut = [[NSPipe alloc] init]; + NSFileHandle *stdOutWrite = [stdOut fileHandleForWriting]; + [task setStandardOutput:stdOutWrite]; + + [task launch]; + [task waitUntilExit]; + [stdOutWrite closeFile]; + + NSData *outputData = [[stdOut fileHandleForReading] readDataToEndOfFile]; + NSString *outputString = [[NSString alloc] initWithData:outputData encoding:NSUTF8StringEncoding]; + NSArray *lines = [outputString componentsSeparatedByString:@"\n"]; + + if ([lines count]) { + if ([(NSString *) [lines objectAtIndex:0] isEqualToString:@"tv"]) { + if ([lines count] >= 4) { + results = [[NSMutableDictionary alloc] initWithCapacity:4]; + [results setValue:@"tv" forKey:@"type"]; + NSString *newSeriesName=[[lines objectAtIndex:1] + stringByReplacingOccurrencesOfString:@"." + withString:@" "]; + [results setValue:newSeriesName forKey:@"seriesName"]; + [results setValue:[lines objectAtIndex:2] forKey:@"seasonNum"]; + [results setValue:[lines objectAtIndex:3] forKey:@"episodeNum"]; + } + } else if ([(NSString *) [lines objectAtIndex:0] isEqualToString:@"movie"]) { + if ([lines count] >= 2) { + results = [[NSMutableDictionary alloc] initWithCapacity:4]; + [results setValue:@"movie" forKey:@"type"]; + NSString *newTitle=[[lines objectAtIndex:1] + stringByReplacingOccurrencesOfString:@"." + withString:@" "]; + newTitle = [newTitle stringByReplacingOccurrencesOfString:@"(" withString:@" "]; + newTitle = [newTitle stringByReplacingOccurrencesOfString:@")" withString:@" "]; + newTitle = [newTitle stringByReplacingOccurrencesOfString:@"[" withString:@" "]; + newTitle = [newTitle stringByReplacingOccurrencesOfString:@"]" withString:@" "]; + newTitle = [newTitle stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + [results setValue:newTitle forKey:@"title"]; + } + } + } + + [outputString release]; + [stdOut release]; + [args release]; + [task release]; + + return [results autorelease]; +} + ++ (NSString *) urlEncoded:(NSString *)s { + CFStringRef urlString = CFURLCreateStringByAddingPercentEscapes( + NULL, + (CFStringRef) s, + NULL, + (CFStringRef) @"!*'\"();:@&=+$,/?%#[]% ", + kCFStringEncodingUTF8); + return [(NSString *)urlString autorelease]; +} + ++ (NSString *) md5String:(NSString *) s { + const char *cStr = [s UTF8String]; + unsigned char result[CC_MD5_DIGEST_LENGTH]; + CC_MD5(cStr, strlen(cStr), result); + NSMutableString *r = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2]; + for(int i = 0; i < CC_MD5_DIGEST_LENGTH; ++i) { + [r appendFormat:@"%02x", result[i]]; + } + return [NSString stringWithString:r]; +} + ++ (NSData *)downloadDataOrGetFromCache:(NSURL *)url { + NSString *path = nil; + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); + if ([paths count]) { + NSString *bundleName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"]; + path = [[paths objectAtIndex:0] stringByAppendingPathComponent:bundleName]; + } + NSString *filename = [path stringByAppendingPathComponent:[MetadataImporter md5String:[url absoluteString]]]; + NSString *extension = [[url path] pathExtension]; + filename = [filename stringByAppendingPathExtension:extension]; + if ([[NSFileManager defaultManager] fileExistsAtPath:filename]) { + NSDictionary* attrs = [[NSFileManager defaultManager] attributesOfItemAtPath:filename error:nil]; + if (attrs) { + NSDate *date = [attrs fileCreationDate]; + NSTimeInterval oldness = [date timeIntervalSinceNow]; + // if less than 2 hours old + if (([[[[url absoluteString] pathExtension] lowercaseString] isEqualToString:@"jpg"]) || (oldness > -60 * 60 * 2)) { + return [NSData dataWithContentsOfFile:filename]; + } + } + } + NSError *outError = nil; + NSData *r = [NSData dataWithContentsOfURL:url options:NSDataReadingUncached error:&outError]; + + if (!outError && r) + [r writeToFile:filename atomically:NO]; + + return r; +} + +#pragma mark Static methods + ++ (NSArray *) languagesForProvider:(NSString *)aProvider { + MetadataImporter *m = [MetadataImporter importerForProvider:aProvider]; + NSArray *a = [m languages]; + return a; +} + ++ (instancetype) importerForProvider:(NSString *)aProvider { + if ([aProvider isEqualToString:@"iTunes Store"]) { + return [[[iTunesStore alloc] init] autorelease]; + } else if ([aProvider isEqualToString:@"TheMovieDB"]) { + return [[[TheMovieDB3 alloc] init] autorelease]; + } else if ([aProvider isEqualToString:@"TheTVDB"]) { + return [[[TheTVDB alloc] init] autorelease]; + } + return nil; +} + ++ (instancetype) defaultMovieProvider { + return [MetadataImporter importerForProvider:[[NSUserDefaults standardUserDefaults] valueForKey:@"SBMetadataPreference|Movie"]]; +} + ++ (instancetype) defaultTVProvider { + return [MetadataImporter importerForProvider:[[NSUserDefaults standardUserDefaults] valueForKey:@"SBMetadataPreference|TV"]]; +} + ++ (NSString *) defaultMovieLanguage { + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + return [defaults valueForKey:[NSString stringWithFormat:@"SBMetadataPreference|Movie|%@|Language", [defaults valueForKey:@"SBMetadataPreference|Movie"]]]; +} + ++ (NSString *) defaultTVLanguage { + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + return [defaults valueForKey:[NSString stringWithFormat:@"SBMetadataPreference|TV|%@|Language", [defaults valueForKey:@"SBMetadataPreference|TV"]]]; +} + +#pragma mark Asynchronous searching + +- (void) searchTVSeries:(NSString *)aSeries language:(NSString *)aLanguage callback:(SBMetadataSearchController *)aCallback { + mCallback = aCallback; + dispatch_async(dispatch_get_global_queue(0, 0), ^{ + @autoreleasepool { + NSArray *results = [self searchTVSeries:aSeries language:aLanguage]; + if (!isCancelled) { + [mCallback performSelectorOnMainThread:@selector(searchTVSeriesNameDone:) withObject:results waitUntilDone:YES]; + } + } + }); +} + +- (void) searchTVSeries:(NSString *)aSeries language:(NSString *)aLanguage seasonNum:(NSString *)aSeasonNum episodeNum:(NSString *)aEpisodeNum callback:(SBMetadataSearchController *)aCallback { + mCallback = aCallback; + dispatch_async(dispatch_get_global_queue(0, 0), ^{ + @autoreleasepool { + NSArray *results = [self searchTVSeries:aSeries language:aLanguage seasonNum:aSeasonNum episodeNum:aEpisodeNum]; + if (!isCancelled) { + [mCallback performSelectorOnMainThread:@selector(searchForResultsDone:) withObject:results waitUntilDone:YES]; + } + } + }); +} + +- (void) loadTVMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage callback:(SBMetadataSearchController *)aCallback { + mCallback = aCallback; + dispatch_async(dispatch_get_global_queue(0, 0), ^{ + @autoreleasepool { + [self loadTVMetadata:aMetadata language:aLanguage]; + if (!isCancelled) { + [mCallback performSelectorOnMainThread:@selector(loadAdditionalMetadataDone:) withObject:aMetadata waitUntilDone:YES]; + } + } + }); +} + +- (void) searchMovie:(NSString *)aMovieTitle language:(NSString *)aLanguage callback:(SBMetadataSearchController *)aCallback { + mCallback = aCallback; + dispatch_async(dispatch_get_global_queue(0, 0), ^{ + @autoreleasepool { + NSArray *results = [self searchMovie:aMovieTitle language:aLanguage]; + if (!isCancelled) + [mCallback performSelectorOnMainThread:@selector(searchForResultsDone:) withObject:results waitUntilDone:YES]; + } + }); +} + +- (void) loadMovieMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage callback:(SBMetadataSearchController *)aCallback { + mCallback = aCallback; + dispatch_async(dispatch_get_global_queue(0, 0), ^{ + @autoreleasepool { + [self loadMovieMetadata:aMetadata language:aLanguage]; + if (!isCancelled) { + [mCallback performSelectorOnMainThread:@selector(loadAdditionalMetadataDone:) withObject:aMetadata waitUntilDone:YES]; + } + } + }); +} + +- (void)cancel { + @synchronized(self) { + isCancelled = YES; + } +} + +#pragma mark Methods to be overridden + +- (NSArray *) languages { + @throw [NSException exceptionWithName:NSInternalInconsistencyException + reason:[NSString stringWithFormat:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)] + userInfo:nil]; +} + +- (NSArray *) searchTVSeries:(NSString *)aSeriesName language:(NSString *)aLanguage { + TheTVDB *searcher = [[TheTVDB alloc] init]; + NSArray *a = [searcher searchTVSeries:aSeriesName language:[[NSUserDefaults standardUserDefaults] valueForKey:@"SBMetadataPreference|TV|TheTVDB|Language"]]; + [searcher release]; + return a; +} + +- (NSArray *) searchTVSeries:(NSString *)aSeriesName language:(NSString *)aLanguage seasonNum:(NSString *)aSeasonNum episodeNum:(NSString *)aEpisodeNum { + @throw [NSException exceptionWithName:NSInternalInconsistencyException + reason:[NSString stringWithFormat:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)] + userInfo:nil]; +} + +- (MP42Metadata*) loadTVMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage { + @throw [NSException exceptionWithName:NSInternalInconsistencyException + reason:[NSString stringWithFormat:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)] + userInfo:nil]; +} + +- (NSArray *) searchMovie:(NSString *)aMovieTitle language:(NSString *)aLanguage { + @throw [NSException exceptionWithName:NSInternalInconsistencyException + reason:[NSString stringWithFormat:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)] + userInfo:nil]; +} + +- (MP42Metadata*) loadMovieMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage { + @throw [NSException exceptionWithName:NSInternalInconsistencyException + reason:[NSString stringWithFormat:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)] + userInfo:nil]; +} + +#pragma mark Finishing up + +- (void) dealloc { + mCallback = nil; + [super dealloc]; +} + +@end diff --git a/Classes/MetadataImporters/TheMovieDB3.h b/Classes/MetadataImporters/TheMovieDB3.h new file mode 100755 index 0000000..06e5db5 --- /dev/null +++ b/Classes/MetadataImporters/TheMovieDB3.h @@ -0,0 +1,15 @@ +// +// TheMovieDB3.h +// Subler +// +// Created by Douglas Stebila on 2013/05/30. +// Copyright 2013 Douglas Stebila. All rights reserved. +// + +#import + +#import "MetadataImporter.h" + +@interface TheMovieDB3 : MetadataImporter + +@end diff --git a/Classes/MetadataImporters/TheMovieDB3.m b/Classes/MetadataImporters/TheMovieDB3.m new file mode 100755 index 0000000..cea301a --- /dev/null +++ b/Classes/MetadataImporters/TheMovieDB3.m @@ -0,0 +1,193 @@ +// +// TheMovieDB3.m +// Subler +// +// Created by Douglas Stebila on 2013-05-30. +// +// + +#import +#import +#import +#import + +#import "SBMetadataSearchController.h" + +#import "TheMovieDB3.h" +#import "iTunesStore.h" + +#define API_KEY @"b0073bafb08b4f68df101eb2325f27dc" + +@implementation TheMovieDB3 + +- (NSArray *) languages { + return [[MP42Languages defaultManager] languages]; +} + +- (NSArray *) searchMovie:(NSString *)aMovieTitle language:(NSString *)aLanguage { + NSString *lang = [MP42Languages iso6391CodeFor:aLanguage]; + NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://api.themoviedb.org/3/search/movie?api_key=%@&query=%@&language=%@", API_KEY, [MetadataImporter urlEncoded:aMovieTitle], lang]]; + NSData *jsonData = [MetadataImporter downloadDataOrGetFromCache:url]; + if (jsonData) { + JSONDecoder *jsonDecoder = [JSONDecoder decoder]; + NSDictionary *d = [jsonDecoder objectWithData:jsonData]; + return [TheMovieDB3 metadataForResults:d]; + } + return nil; +} + +- (MP42Metadata *) artworksForResult:(NSDictionary *)r metadata:(MP42Metadata *)aMetadata { + // artwork + NSMutableArray *artworkThumbURLs = [[NSMutableArray alloc] initWithCapacity:2]; + NSMutableArray *artworkFullsizeURLs = [[NSMutableArray alloc] initWithCapacity:1]; + NSMutableArray *artworkProviderNames = [[NSMutableArray alloc] initWithCapacity:1]; + + // add iTunes artwork + MP42Metadata *iTunesMetadata = [iTunesStore quickiTunesSearchMovie:[[aMetadata tagsDict] valueForKey:@"Name"]]; + if (iTunesMetadata && [iTunesMetadata artworkThumbURLs] && [iTunesMetadata artworkFullsizeURLs] && ([[iTunesMetadata artworkThumbURLs] count] == [[iTunesMetadata artworkFullsizeURLs] count])) { + [artworkThumbURLs addObjectsFromArray:[iTunesMetadata artworkThumbURLs]]; + [artworkFullsizeURLs addObjectsFromArray:[iTunesMetadata artworkFullsizeURLs]]; + [artworkProviderNames addObjectsFromArray:[iTunesMetadata artworkProviderNames]]; + } + + // load image variables from configuration + NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://api.themoviedb.org/3/configuration?api_key=%@", API_KEY]]; + NSData *jsonData = [MetadataImporter downloadDataOrGetFromCache:url]; + NSArray *posters = [r valueForKeyPath:@"images.posters"]; + + if (jsonData && posters && [posters isKindOfClass:[NSArray class]]) { + JSONDecoder *jsonDecoder = [JSONDecoder decoder]; + NSDictionary *config = [jsonDecoder objectWithData:jsonData]; + + if ([config valueForKey:@"images"]) { + NSString *imageBaseUrl = [[config valueForKey:@"images"] valueForKey:@"secure_base_url"]; + NSString *posterThumbnailSize = [[[config valueForKey:@"images"] valueForKey:@"poster_sizes"] objectAtIndex:0]; + NSString *backdropThumbnailSize = [[[config valueForKey:@"images"] valueForKey:@"backdrop_sizes"] objectAtIndex:0]; + + for (NSDictionary *poster in posters) { + if ([poster valueForKey:@"file_path"] && ([poster valueForKey:@"file_path"] != [NSNull null])) { + [artworkThumbURLs addObject:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@%@", imageBaseUrl, posterThumbnailSize, [poster valueForKey:@"file_path"]]]]; + [artworkFullsizeURLs addObject:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@%@", imageBaseUrl, @"original", [poster valueForKey:@"file_path"]]]]; + [artworkProviderNames addObject:@"TheMovieDB|poster"]; + } + } + if (![posters count] && [r valueForKey:@"poster_path"] && ([r valueForKey:@"poster_path"] != [NSNull null])) { + [artworkThumbURLs addObject:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@%@", imageBaseUrl, posterThumbnailSize, [r valueForKey:@"poster_path"]]]]; + [artworkFullsizeURLs addObject:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@%@", imageBaseUrl, @"original", [r valueForKey:@"poster_path"]]]]; + [artworkProviderNames addObject:@"TheMovieDB|poster"]; + } + + if ([r valueForKey:@"backdrop_path"] && ([r valueForKey:@"backdrop_path"] != [NSNull null])) { + [artworkThumbURLs addObject:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@%@", imageBaseUrl, backdropThumbnailSize, [r valueForKey:@"backdrop_path"]]]]; + [artworkFullsizeURLs addObject:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@%@", imageBaseUrl, @"original", [r valueForKey:@"backdrop_path"]]]]; + [artworkProviderNames addObject:@"TheMovieDB|backdrop"]; + } + } + + } + + [aMetadata setArtworkThumbURLs:artworkThumbURLs]; + [aMetadata setArtworkFullsizeURLs:artworkFullsizeURLs]; + [aMetadata setArtworkProviderNames:artworkProviderNames]; + [artworkThumbURLs release]; + [artworkFullsizeURLs release]; + [artworkProviderNames release]; + + return aMetadata; +} + +- (MP42Metadata *) loadMovieMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage { + NSString *lang = [MP42Languages iso6391CodeFor:aLanguage]; + NSNumber *theMovieDBID = [[aMetadata tagsDict] valueForKey:@"TheMovieDB ID"]; + NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://api.themoviedb.org/3/movie/%@?api_key=%@&language=%@&append_to_response=casts,releases,images", theMovieDBID, API_KEY, lang]]; + NSData *jsonData = [MetadataImporter downloadDataOrGetFromCache:url]; + if (jsonData) { + JSONDecoder *jsonDecoder = [JSONDecoder decoder]; + NSDictionary *d = [jsonDecoder objectWithData:jsonData]; + MP42Metadata *r = [TheMovieDB3 metadataForResult:d language:lang]; + if (r) { + [aMetadata mergeMetadata:r]; + } + aMetadata = [self artworksForResult:d metadata:aMetadata]; + } + + return aMetadata; +} + +#pragma mark Parse results + ++ (NSString *) commaJoinedSubentriesOf:(NSArray *)aArray forKey:(NSString *)aKey { + if (!aArray || ([aArray count] == 0)) { + return nil; + } + NSMutableArray *r = [NSMutableArray arrayWithCapacity:[aArray count]]; + for (NSDictionary *d in aArray) { + if ([d valueForKey:aKey]) { + [r addObject:[d valueForKey:aKey]]; + } + } + return [r componentsJoinedByString:@", "]; +} + ++ (NSString *) commaJoinedSubentriesOf:(NSArray *)aArray forKey:(NSString *)aKey withKey:(NSString *)aWithKey equalTo:(NSString *)aEqualTo { + if (!aArray || ([aArray count] == 0)) { + return nil; + } + NSMutableArray *r = [NSMutableArray array]; + for (NSDictionary *d in aArray) { + if ([d valueForKey:aKey]) { + if ([d valueForKey:aWithKey] && [[d valueForKey:aWithKey] isEqualToString:aEqualTo]) { + [r addObject:[d valueForKey:aKey]]; + } + } + } + return [r componentsJoinedByString:@", "]; +} + ++ (MP42Metadata *) metadataForResult:(NSDictionary *)r language:(NSString *)aLanguage { + MP42Metadata *metadata = [[MP42Metadata alloc] init]; + metadata.mediaKind = 9; // movie + [metadata setTag:[r valueForKey:@"id"] forKey:@"TheMovieDB ID"]; + [metadata setTag:[r valueForKey:@"title"] forKey:@"Name"]; + [metadata setTag:[r valueForKey:@"release_date"] forKey:@"Release Date"]; + [metadata setTag:[TheMovieDB3 commaJoinedSubentriesOf:[r valueForKey:@"genres"] forKey:@"name"] forKey:@"Genre"]; + [metadata setTag:[r valueForKey:@"overview"] forKey:@"Description"]; + [metadata setTag:[r valueForKey:@"overview"] forKey:@"Long Description"]; + [metadata setTag:[TheMovieDB3 commaJoinedSubentriesOf:[r valueForKey:@"production_companies"] forKey:@"name"] forKey:@"Studio"]; + NSDictionary *casts = [r valueForKey:@"casts"]; + [metadata setTag:[TheMovieDB3 commaJoinedSubentriesOf:[casts valueForKey:@"cast"] forKey:@"name"] forKey:@"Cast"]; + [metadata setTag:[TheMovieDB3 commaJoinedSubentriesOf:[casts valueForKey:@"crew"] forKey:@"name" withKey:@"job" equalTo:@"Director"] forKey:@"Director"]; + [metadata setTag:[TheMovieDB3 commaJoinedSubentriesOf:[casts valueForKey:@"crew"] forKey:@"name" withKey:@"job" equalTo:@"Director"] forKey:@"Artist"]; + [metadata setTag:[TheMovieDB3 commaJoinedSubentriesOf:[casts valueForKey:@"crew"] forKey:@"name" withKey:@"job" equalTo:@"Producer"] forKey:@"Producers"]; + [metadata setTag:[TheMovieDB3 commaJoinedSubentriesOf:[casts valueForKey:@"crew"] forKey:@"name" withKey:@"job" equalTo:@"Executive Producer"] forKey:@"Executive Producer"]; + [metadata setTag:[TheMovieDB3 commaJoinedSubentriesOf:[casts valueForKey:@"crew"] forKey:@"name" withKey:@"department" equalTo:@"Writing"] forKey:@"Screenwriters"]; + [metadata setTag:[TheMovieDB3 commaJoinedSubentriesOf:[casts valueForKey:@"crew"] forKey:@"name" withKey:@"job" equalTo:@"Original Music Composer"] forKey:@"Composer"]; + + if (aLanguage) { + NSArray *countries = [[r valueForKey:@"releases"] valueForKey:@"countries"]; + + for (NSDictionary *d in countries) { + if ([[d valueForKey:@"iso_3166_1"] isEqualToString:@"US"]) { + [metadata setTag:[NSNumber numberWithUnsignedInteger: + [[MP42Ratings defaultManager] ratingIndexForiTunesCountry:@"USA" media:@"movie" ratingString:[d valueForKey:@"certification"]]] forKey:@"Rating"] ; + + } + } + } + + return [metadata autorelease]; +} + ++ (NSArray *) metadataForResults:(NSDictionary *)dict { + NSArray *resultsArray = [dict valueForKey:@"results"]; + NSMutableArray *returnArray = [[NSMutableArray alloc] initWithCapacity:[resultsArray count]]; + for (NSDictionary *r in resultsArray) { + if ([r isKindOfClass:[NSDictionary class]]) { + MP42Metadata *metadata = [TheMovieDB3 metadataForResult:r language:nil]; + [returnArray addObject:metadata]; + } + } + return [returnArray autorelease]; +} + +@end diff --git a/Classes/MetadataImporters/TheTVDB.h b/Classes/MetadataImporters/TheTVDB.h new file mode 100755 index 0000000..fa235f7 --- /dev/null +++ b/Classes/MetadataImporters/TheTVDB.h @@ -0,0 +1,13 @@ +// +// TheTVDB.h +// Subler +// +// Created by Douglas Stebila on 2013-06-06. +// +// + +#import "MetadataImporter.h" + +@interface TheTVDB : MetadataImporter + +@end diff --git a/Classes/MetadataImporters/TheTVDB.m b/Classes/MetadataImporters/TheTVDB.m new file mode 100755 index 0000000..33522b5 --- /dev/null +++ b/Classes/MetadataImporters/TheTVDB.m @@ -0,0 +1,225 @@ +// +// TheTVDB.m +// Subler +// +// Created by Douglas Stebila on 2013-06-06. +// +// + +#import +#import +#import + +#import "TheTVDB.h" + +#import "iTunesStore.h" +#import "XMLReader.h" + +#define API_KEY @"3498815BE9484A62" + +@implementation TheTVDB + +- (NSArray *) languages { + return [[MP42Languages defaultManager] languages]; +} + +- (NSArray *) searchTVSeries:(NSString *)aSeriesName language:(NSString *)aLanguage { + NSURL *url; + // search for series + url = [NSURL URLWithString:[NSString stringWithFormat:@"http://thetvdb.com/api/GetSeries.php?seriesname=%@", [MetadataImporter urlEncoded:aSeriesName]]]; + NSData *seriesXML = [MetadataImporter downloadDataOrGetFromCache:url]; + NSDictionary *series = [XMLReader dictionaryForXMLData:seriesXML error:NULL]; + if (!series) return nil; + NSArray *seriesArray = [series retrieveArrayForPath:@"Data.Series"]; + NSMutableArray *results = [[NSMutableArray alloc] initWithCapacity:[seriesArray count]]; + for (NSDictionary *s in seriesArray) { + [results addObject:[s retrieveForPath:@"SeriesName.text"]]; + } + return [results autorelease]; +} + +- (NSArray *) searchTVSeries:(NSString *)aSeriesName language:(NSString *)aLanguage seasonNum:(NSString *)aSeasonNum episodeNum:(NSString *)aEpisodeNum { + NSString *lang = [MP42Languages iso6391CodeFor:aLanguage]; + if (!lang) lang = @"en"; + NSURL *url; + + // search for series + url = [NSURL URLWithString:[NSString stringWithFormat:@"http://thetvdb.com/api/GetSeries.php?seriesname=%@", [MetadataImporter urlEncoded:aSeriesName]]]; + NSData *seriesXML = [MetadataImporter downloadDataOrGetFromCache:url]; + NSDictionary *series = [XMLReader dictionaryForXMLData:seriesXML error:NULL]; + + if (!series) return nil; + + NSArray *seriesObject = [series retrieveForPath:@"Data.Series"]; + NSMutableArray *seriesIDs = [[NSMutableArray alloc] init];; + if ([seriesObject isKindOfClass:[NSArray class]]) { + for (NSDictionary *s in seriesObject) + if ([aSeriesName isEqualToString:[s retrieveForPath:@"SeriesName.text"]]) + [seriesIDs addObject:[s retrieveForPath:@"seriesid.text"]]; + + if (![seriesIDs count]) + [seriesIDs addObject:[series retrieveForPath:@"Data.Series.0.seriesid.text"]]; + } + else { + NSString *seriesID = [series retrieveForPath:@"Data.Series.seriesid.text"]; + if (seriesID) + [seriesIDs addObject:seriesID]; + } + NSMutableArray *results = [[NSMutableArray alloc] init]; + + if ([seriesIDs count]) { + for (NSString *seriesID in seriesIDs) { + if (!seriesID || [seriesID isEqualToString:@""]) + continue; + + url = [NSURL URLWithString:[NSString stringWithFormat:@"http://thetvdb.com/api/%@/series/%@/all/%@.xml", API_KEY, seriesID, lang]]; + NSData *episodesXML = [MetadataImporter downloadDataOrGetFromCache:url]; + NSDictionary *episodes = [XMLReader dictionaryForXMLData:episodesXML error:NULL]; + + if (!episodes) + continue; + + NSArray *episodesArray = [episodes retrieveArrayForPath:@"Data.Episode"]; + NSDictionary *thisSeries = [episodes retrieveForPath:@"Data.Series"]; + + for (NSDictionary *episode in episodesArray) { + if (aSeasonNum && ![aSeasonNum isEqualToString:@""]) { + if ([[episode retrieveForPath:@"SeasonNumber.text"] isEqualToString:aSeasonNum]) { + if (aEpisodeNum && ![aEpisodeNum isEqualToString:@""]) { + if ([[episode retrieveForPath:@"EpisodeNumber.text"] isEqualToString:aEpisodeNum]) { + [results addObject:[TheTVDB metadataForEpisode:episode series:thisSeries]]; + } + } else { + [results addObject:[TheTVDB metadataForEpisode:episode series:thisSeries]]; + } + } + } else { + [results addObject:[TheTVDB metadataForEpisode:episode series:thisSeries]]; + } + } + } + } + + [seriesIDs release]; + + return [results autorelease]; +} + +- (MP42Metadata*) loadTVMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage { + // add iTunes artwork + MP42Metadata *iTunesMetadata = [iTunesStore quickiTunesSearchTV:[[aMetadata tagsDict] valueForKey:@"TV Show"] episodeTitle:[[aMetadata tagsDict] valueForKey:@"Name"]]; + NSMutableArray * newArtworkThumbURLs = [[[NSMutableArray alloc] init] autorelease]; + NSMutableArray * newArtworkFullsizeURLs = [[[NSMutableArray alloc] init] autorelease]; + NSMutableArray * newArtworkProviderNames = [[[NSMutableArray alloc] init] autorelease]; + if (iTunesMetadata && [iTunesMetadata artworkThumbURLs] && [iTunesMetadata artworkFullsizeURLs] && ([[iTunesMetadata artworkThumbURLs] count] == [[iTunesMetadata artworkFullsizeURLs] count])) { + [newArtworkThumbURLs addObjectsFromArray:[iTunesMetadata artworkThumbURLs]]; + [newArtworkFullsizeURLs addObjectsFromArray:[iTunesMetadata artworkFullsizeURLs]]; + [newArtworkProviderNames addObjectsFromArray:[iTunesMetadata artworkProviderNames]]; + } + [newArtworkThumbURLs addObjectsFromArray:[aMetadata artworkThumbURLs]]; + [newArtworkFullsizeURLs addObjectsFromArray:[aMetadata artworkFullsizeURLs]]; + [newArtworkProviderNames addObjectsFromArray:[aMetadata artworkProviderNames]]; + + NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://thetvdb.com/api/%@/series/%@/banners.xml", API_KEY, [[aMetadata tagsDict] valueForKey:@"TheTVDB Series ID"]]]; + NSData *bannersXML = [MetadataImporter downloadDataOrGetFromCache:url]; + NSDictionary *banners = [XMLReader dictionaryForXMLData:bannersXML error:NULL]; + if (!banners) return nil; + NSArray *bannersArray = [banners retrieveArrayForPath:@"Banners.Banner"]; + NSURL *u; + for (NSDictionary *banner in bannersArray) { + if ([[banner retrieveForPath:@"BannerType.text"] isEqualToString:@"season"] && [[banner retrieveForPath:@"BannerType2.text"] isEqualToString:@"season"] && [[banner retrieveForPath:@"Season.text"] isEqualToString:[[aMetadata tagsDict] valueForKey:@"TV Season"]]) { + u = [NSURL URLWithString:[NSString stringWithFormat:@"http://thetvdb.com/banners/%@", [banner retrieveForPath:@"BannerPath.text"]]]; + [newArtworkThumbURLs addObject:u]; + [newArtworkFullsizeURLs addObject:u]; + [newArtworkProviderNames addObject:[NSString stringWithFormat:@"TheTVDB|season %@", [[aMetadata tagsDict] valueForKey:@"TV Season"]]]; + } + } + for (NSDictionary *banner in bannersArray) { + if ([[banner retrieveForPath:@"BannerType.text"] isEqualToString:@"poster"]) { + u = [NSURL URLWithString:[NSString stringWithFormat:@"http://thetvdb.com/banners/%@", [banner retrieveForPath:@"BannerPath.text"]]]; + [newArtworkThumbURLs addObject:u]; + [newArtworkFullsizeURLs addObject:u]; + [newArtworkProviderNames addObject:@"TheTVDB|poster"]; + } + } + [aMetadata setArtworkThumbURLs:newArtworkThumbURLs]; + [aMetadata setArtworkFullsizeURLs:newArtworkFullsizeURLs]; + [aMetadata setArtworkProviderNames:newArtworkProviderNames]; + return aMetadata; +} + ++ (NSString *) cleanPeopleList:(NSString *)s { + NSArray *a = [[[s stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] + stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"|"]] + componentsSeparatedByString:@"|"]; + return [a componentsJoinedByString:@", "]; +} + ++ (MP42Metadata *) metadataForEpisode:(NSDictionary *)aEpisode series:(NSDictionary *)aSeries { + MP42Metadata *metadata = [[MP42Metadata alloc] init]; + metadata.mediaKind = 10; // TV show + [metadata setTag:[aSeries retrieveForPath:@"id.text"] forKey:@"TheTVDB Series ID"]; + [metadata setTag:[aSeries retrieveForPath:@"SeriesName.text"] forKey:@"TV Show"]; + [metadata setTag:[aSeries retrieveForPath:@"Overview.text"] forKey:@"Series Description"]; + [metadata setTag:[TheTVDB cleanPeopleList:[aSeries retrieveForPath:@"Genre.text"]] forKey:@"Genre"]; + + [metadata setTag:[NSNumber numberWithUnsignedInteger: + [[MP42Ratings defaultManager] ratingIndexForiTunesCountry:@"USA" media:@"TV" ratingString:[aSeries retrieveForPath:@"ContentRating.text"]]] forKey:@"Rating"]; + + [metadata setTag:[aSeries retrieveForPath:@"Network.text"] forKey:@"TV Network"]; + [metadata setTag:[aEpisode retrieveForPath:@"SeasonNumber.text"] forKey:@"TV Season"]; + [metadata setTag:[aEpisode retrieveForPath:@"EpisodeNumber.text"] forKey:@"TV Episode #"]; + + NSString *episodeID = [NSString stringWithFormat:@"%ld%02ld", (long)[[aEpisode retrieveForPath:@"SeasonNumber.text"] integerValue], + (long)[[aEpisode retrieveForPath:@"EpisodeNumber.text"] integerValue]]; + [metadata setTag:episodeID forKey:@"TV Episode ID"]; + + [metadata setTag:[aEpisode retrieveForPath:@"SeasonNumber.text"] forKey:@"TV Season"]; + [metadata setTag:[aEpisode retrieveForPath:@"EpisodeName.text"] forKey:@"Name"]; + [metadata setTag:[aEpisode retrieveForPath:@"FirstAired.text"] forKey:@"Release Date"]; + [metadata setTag:[aEpisode retrieveForPath:@"Overview.text"] forKey:@"Description"]; + [metadata setTag:[aEpisode retrieveForPath:@"Overview.text"] forKey:@"Long Description"]; + [metadata setTag:[aEpisode retrieveForPath:@"EpisodeNumber.text"] forKey:@"Track #"]; + [metadata setTag:[TheTVDB cleanPeopleList:[aEpisode retrieveForPath:@"Director.text"]] forKey:@"Director"]; + + [metadata setTag:[NSString stringWithFormat:@"%@, Season %@", [aSeries retrieveForPath:@"SeriesName.text"], [aEpisode retrieveForPath:@"SeasonNumber.text"]] forKey:@"Album"]; + [metadata setTag:[aSeries retrieveForPath:@"SeriesName.text"] forKey:@"Artist"]; + + [metadata setTag:[TheTVDB cleanPeopleList:[aEpisode retrieveForPath:@"Writer.text"]] forKey:@"Screenwriters"]; + // cast + NSString *actors = [TheTVDB cleanPeopleList:[aSeries retrieveForPath:@"Actors.text"]]; + NSString *gueststars = [TheTVDB cleanPeopleList:[aEpisode retrieveForPath:@"GuestStars.text"]]; + if ([actors length]) { + if ([gueststars length]) { + [metadata setTag:[NSString stringWithFormat:@"%@, %@", actors, gueststars] forKey:@"Cast"]; + } else { + [metadata setTag:actors forKey:@"Cast"]; + } + } else { + if ([gueststars length]) { + [metadata setTag:gueststars forKey:@"Cast"]; + } + } + // artwork + NSMutableArray *artworkThumbURLs = [[NSMutableArray alloc] initWithCapacity:10]; + NSMutableArray *artworkFullsizeURLs = [[NSMutableArray alloc] initWithCapacity:10]; + NSMutableArray *artworkProviderNames = [[NSMutableArray alloc] initWithCapacity:10]; + NSURL *u; + if ([aEpisode retrieveForPath:@"filename.text"]) { + u = [NSURL URLWithString:[NSString stringWithFormat:@"http://thetvdb.com/banners/%@", [aEpisode retrieveForPath:@"filename.text"]]]; + [artworkThumbURLs addObject:u]; + [artworkFullsizeURLs addObject:u]; + [artworkProviderNames addObject:@"TheTVDB|episode"]; + } + [metadata setArtworkThumbURLs: artworkThumbURLs]; + [metadata setArtworkFullsizeURLs: artworkFullsizeURLs]; + [metadata setArtworkProviderNames:artworkProviderNames]; + [artworkThumbURLs release]; + [artworkFullsizeURLs release]; + [artworkProviderNames release]; + // TheTVDB does not provide the following fields normally associated with TV shows in MP42Metadata: + // "Copyright", "Comments", "Producers", "Artist" + return [metadata autorelease]; +} + +@end diff --git a/Classes/MetadataImporters/iTunesStore.h b/Classes/MetadataImporters/iTunesStore.h new file mode 100755 index 0000000..71e0289 --- /dev/null +++ b/Classes/MetadataImporters/iTunesStore.h @@ -0,0 +1,26 @@ +// +// iTunesStore.h +// Subler +// +// Created by Douglas Stebila on 2011/01/28. +// Copyright 2011 Douglas Stebila. All rights reserved. +// + +#import + +#import "MetadataImporter.h" + +@interface iTunesStore : MetadataImporter + +#pragma mark iTunes stores ++ (NSDictionary *) getStoreFor:(NSString *)aLanguageString; + +#pragma mark Quick iTunes search for metadata ++ (MP42Metadata *) quickiTunesSearchTV:(NSString *)aSeriesName episodeTitle:(NSString *)aEpisodeTitle; ++ (MP42Metadata *) quickiTunesSearchMovie:(NSString *)aMovieName; + +#pragma mark Parse results ++ (NSArray *) readPeople:(NSString *)aPeople fromXML:(NSXMLDocument *)aXml; ++ (NSArray *) metadataForResults:(NSDictionary *)dict store:(NSDictionary *)store; + +@end diff --git a/Classes/MetadataImporters/iTunesStore.m b/Classes/MetadataImporters/iTunesStore.m new file mode 100755 index 0000000..87b081b --- /dev/null +++ b/Classes/MetadataImporters/iTunesStore.m @@ -0,0 +1,384 @@ +// +// iTunesStore.m +// Subler +// +// Created by Douglas Stebila on 2011/01/28. +// Copyright 2011 Douglas Stebila. All rights reserved. +// + +#import +#import +#import + +#import "iTunesStore.h" +#import "SBMetadataSearchController.h" + +@implementation iTunesStore + +#pragma mark iTunes stores + +- (NSArray *) languages { + NSString* iTunesStoresJSON = [[NSBundle mainBundle] pathForResource:@"iTunesStores" ofType:@"json"]; + JSONDecoder *jsonDecoder = [JSONDecoder decoder]; + NSArray *iTunesStores = [jsonDecoder objectWithData:[NSData dataWithContentsOfFile:iTunesStoresJSON]]; + NSMutableArray *results = [[NSMutableArray alloc] initWithCapacity:[iTunesStores count]]; + for (NSDictionary *store in iTunesStores) { + [results addObject:[NSString stringWithFormat:@"%@ (%@)", [store valueForKey:@"country"], [store valueForKey:@"language"]]]; + } + return [results autorelease]; +} + ++ (NSDictionary *) getStoreFor:(NSString *)aLanguageString { + NSString* iTunesStoresJSON = [[NSBundle mainBundle] pathForResource:@"iTunesStores" ofType:@"json"]; + JSONDecoder *jsonDecoder = [JSONDecoder decoder]; + NSArray *iTunesStores = [jsonDecoder objectWithData:[NSData dataWithContentsOfFile:iTunesStoresJSON]]; + for (NSDictionary *store in iTunesStores) { + if (aLanguageString && [aLanguageString isEqualToString:[NSString stringWithFormat:@"%@ (%@)", [store valueForKey:@"country"], [store valueForKey:@"language"]]]) { + return store; + } + } + return nil; +} + +#pragma mark Search for TV episode metadata + +NSInteger sortMP42Metadata(id ep1, id ep2, void *context) +{ + int v1 = [[[((MP42Metadata *) ep1) tagsDict] valueForKey:@"TV Episode #"] intValue]; + int v2 = [[[((MP42Metadata *) ep2) tagsDict] valueForKey:@"TV Episode #"] intValue]; + + int s1 = [[[((MP42Metadata *) ep1) tagsDict] valueForKey:@"TV Season"] intValue]; + int s2 = [[[((MP42Metadata *) ep2) tagsDict] valueForKey:@"TV Season"] intValue]; + + if (s1 == s2) { + if (v1 < v2) + return NSOrderedAscending; + else if (v1 > v2) + return NSOrderedDescending; + } + + if (s1 < s2) + return NSOrderedAscending; + else if (s1 > s2) + return NSOrderedDescending; + else + return NSOrderedSame; +} + +- (NSArray *)filterResult:(NSArray *)results tvSeries:(NSString *)aSeriesName seasonNum:(NSString *)aSeasonNum episodeNum:(NSString *)aEpisodeNum { + NSMutableArray *r = [[NSMutableArray alloc] init]; + for (MP42Metadata *m in results) { + if (!aSeriesName || [[[m tagsDict] valueForKey:@"TV Show"] isEqualToString:aSeriesName]) { + // Episode Number and Season Number + if ((aEpisodeNum && [aEpisodeNum length]) && (aSeasonNum && [aSeasonNum length])) { + if ([[[[m tagsDict] valueForKey:@"TV Episode #"] stringValue] isEqualToString:aEpisodeNum] && + [[[m tagsDict] valueForKey:@"TV Season"] integerValue] == [aSeasonNum integerValue]) { + [r addObject:m]; + } + + } + // Episode Number only + else if ((aEpisodeNum && [aEpisodeNum length]) && !(aSeasonNum && [aSeasonNum length])) { + if ([[[[m tagsDict] valueForKey:@"TV Episode #"] stringValue] isEqualToString:aEpisodeNum]) { + [r addObject:m]; + } + + } + // Season Number only + else if (!(aEpisodeNum && [aEpisodeNum length]) && (aSeasonNum && [aSeasonNum length])) { + if ([[[m tagsDict] valueForKey:@"TV Season"] integerValue] == [aSeasonNum integerValue]) { + [r addObject:m]; + } + } + else if (!(aEpisodeNum && [aEpisodeNum length]) && !(aSeasonNum && [aSeasonNum length])) { + [r addObject:m]; + } + } + } + return [r autorelease]; +} + +- (NSArray *) searchTVSeries:(NSString *)aSeriesName language:(NSString *)aLanguage seasonNum:(NSString *)aSeasonNum episodeNum:(NSString *)aEpisodeNum +{ + NSString *country = @"US"; + NSString *language = @"EN"; + NSString *season = @"season"; + NSDictionary *store = [iTunesStore getStoreFor:aLanguage]; + if (store) { + country = [store valueForKey:@"country2"]; + language = [store valueForKey:@"language2"]; + if ([store valueForKey:@"season"] && ![[store valueForKey:@"season"] isEqualToString:@""]) { + season = [[store valueForKey:@"season"] lowercaseString]; + } + } + + NSURL *url; + if (aSeasonNum && [aSeasonNum length]) { + url = [NSURL URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/search?country=%@&lang=%@&term=%@&attribute=tvSeasonTerm&entity=tvEpisode&limit=200", country, [language lowercaseString], [MetadataImporter urlEncoded:[NSString stringWithFormat:@"%@ %@ %@", aSeriesName, season, aSeasonNum]]]]; + } else { + url = [NSURL URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/search?country=%@&lang=%@&term=%@&attribute=showTerm&entity=tvEpisode&limit=200", country, [language lowercaseString], [MetadataImporter urlEncoded:aSeriesName]]]; + } + NSData *jsonData = [MetadataImporter downloadDataOrGetFromCache:url]; + if (jsonData) { + JSONDecoder *jsonDecoder = [JSONDecoder decoder]; + NSDictionary *d = [jsonDecoder objectWithData:jsonData]; + if ([d isKindOfClass:[NSDictionary class]]) { + NSArray *results = [iTunesStore metadataForResults:d store:store]; + if (([results count] == 0) && ![aLanguage isEqualToString:@"USA (English)"]) { + return [self searchTVSeries:aSeriesName language:@"USA (English)" seasonNum:aSeasonNum episodeNum:aEpisodeNum]; + } + if (([results count] == 0) && aSeasonNum) { + return [self searchTVSeries:aSeriesName language:@"USA (English)" seasonNum:nil episodeNum:aEpisodeNum]; + } + + // Filter results + NSArray *r = [self filterResult:results tvSeries:aSeriesName seasonNum:aSeasonNum episodeNum:aEpisodeNum]; + + // If we don't have any result for the exact series name, relax the filter + if (![r count]) { + r = [self filterResult:results tvSeries:nil seasonNum:aSeasonNum episodeNum:aEpisodeNum]; + } + + NSArray *resultsSorted = [r sortedArrayUsingFunction:sortMP42Metadata context:NULL]; + return resultsSorted; + } + } + return nil; +} + +#pragma mark Quick iTunes search for metadata + ++ (MP42Metadata *) quickiTunesSearchTV:(NSString *)aSeriesName episodeTitle:(NSString *)aEpisodeTitle { + NSDictionary *store = [iTunesStore getStoreFor:[[NSUserDefaults standardUserDefaults] valueForKey:@"SBMetadataPreference|TV|iTunes Store|Language"]]; + if (!store) { + return nil; + } + NSString *country = [store valueForKey:@"country2"]; + NSString *language = [store valueForKey:@"language2"]; + NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/search?country=%@&lang=%@&term=%@&entity=tvEpisode", country, [language lowercaseString], [MetadataImporter urlEncoded:[NSString stringWithFormat:@"%@ %@", aSeriesName, aEpisodeTitle]]]]; + NSData *jsonData = [MetadataImporter downloadDataOrGetFromCache:url]; + if (jsonData) { + JSONDecoder *jsonDecoder = [JSONDecoder decoder]; + NSDictionary *d = [jsonDecoder objectWithData:jsonData]; + if ([d isKindOfClass:[NSDictionary class]]) { + NSArray *results = [iTunesStore metadataForResults:d store:store]; + if ([results count] > 0) { + return [results objectAtIndex:0]; + } + } + } + return nil; +} + ++ (MP42Metadata *) quickiTunesSearchMovie:(NSString *)aMovieName { + NSDictionary *store = [iTunesStore getStoreFor:[[NSUserDefaults standardUserDefaults] valueForKey:@"SBMetadataPreference|Movie|iTunes Store|Language"]]; + if (!store) { + return nil; + } + NSString *country = [store valueForKey:@"country2"]; + NSString *language = [store valueForKey:@"language2"]; + NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/search?country=%@&lang=%@&term=%@&entity=movie", country, language, [MetadataImporter urlEncoded:aMovieName]]]; + NSData *jsonData = [MetadataImporter downloadDataOrGetFromCache:url]; + if (jsonData) { + JSONDecoder *jsonDecoder = [JSONDecoder decoder]; + NSDictionary *d = [jsonDecoder objectWithData:jsonData]; + if ([d isKindOfClass:[NSDictionary class]]) { + NSArray *results = [iTunesStore metadataForResults:d store:store]; + if ([results count] > 0) { + return [results objectAtIndex:0]; + } + } + } + return nil; +} + +#pragma mark Search for movie metadata + +- (NSArray *) searchMovie:(NSString *)aMovieTitle language:(NSString *)aLanguage +{ + NSString *country = @"US"; + NSString *language = @"EN"; + NSDictionary *store = [iTunesStore getStoreFor:aLanguage]; + if (store) { + country = [store valueForKey:@"country2"]; + language = [store valueForKey:@"language2"]; + } + + NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/search?country=%@&lang=%@&term=%@&entity=movie&limit=150", country, language, [MetadataImporter urlEncoded:aMovieTitle]]]; + NSData *jsonData = [MetadataImporter downloadDataOrGetFromCache:url]; + if (jsonData) { + JSONDecoder *jsonDecoder = [JSONDecoder decoder]; + NSDictionary *d = [jsonDecoder objectWithData:jsonData]; + if ([d isKindOfClass:[NSDictionary class]]) { + return [iTunesStore metadataForResults:d store:store]; + } + } + return nil; +} + +#pragma mark Load additional metadata + +- (MP42Metadata *) loadTVMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage { + NSDictionary *store = [iTunesStore getStoreFor:[[NSUserDefaults standardUserDefaults] valueForKey:@"SBMetadataPreference|TV|iTunes Store|Language"]]; + if (!store) { + return nil; + } + NSString *country = [store valueForKey:@"country2"]; + NSString *language = [store valueForKey:@"language2"]; + NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/lookup?country=%@&lang=%@&id=%@", country, [language lowercaseString], [[aMetadata tagsDict] valueForKey:@"playlistID"]]]; + NSData *jsonData = [MetadataImporter downloadDataOrGetFromCache:url]; + if (jsonData) { + JSONDecoder *jsonDecoder = [JSONDecoder decoder]; + NSDictionary *d = [jsonDecoder objectWithData:jsonData]; + if ([d isKindOfClass:[NSDictionary class]]) { + NSArray *resultsArray = [d valueForKey:@"results"]; + if ([resultsArray count] > 0) { + NSDictionary *r = [resultsArray objectAtIndex:0]; + [aMetadata setTag:[r valueForKey:@"longDescription"] forKey:@"Series Description"]; + } + } + } + return aMetadata; +} + +- (MP42Metadata *) loadMovieMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage { + NSData *xmlData = [MetadataImporter downloadDataOrGetFromCache:[NSURL URLWithString:[[aMetadata tagsDict] valueForKey:@"iTunes URL"]]]; + if (xmlData) { + NSXMLDocument *xml = [[NSXMLDocument alloc] initWithData:xmlData options:NSXMLDocumentTidyHTML error:NULL]; + NSArray *p = [iTunesStore readPeople:@"Actor" fromXML:xml]; + if (p && [p count]) [aMetadata setTag:[p componentsJoinedByString:@", "] forKey:@"Cast"]; + p = [iTunesStore readPeople:@"Director" fromXML:xml]; + if (p && [p count]) [aMetadata setTag:[p componentsJoinedByString:@", "] forKey:@"Director"]; + if (p && [p count]) [aMetadata setTag:[p componentsJoinedByString:@", "] forKey:@"Artist"]; + p = [iTunesStore readPeople:@"Producer" fromXML:xml]; + if (p && [p count]) [aMetadata setTag:[p componentsJoinedByString:@", "] forKey:@"Producers"]; + p = [iTunesStore readPeople:@"Screenwriter" fromXML:xml]; + if (p && [p count]) [aMetadata setTag:[p componentsJoinedByString:@", "] forKey:@"Screenwriters"]; + NSArray *nodes = [xml nodesForXPath:[NSString stringWithFormat:@"//li[@class='copyright']"] error:NULL]; + for (NSXMLNode *n in nodes) { + NSString *copyright = [n stringValue]; + copyright = [copyright stringByReplacingOccurrencesOfString:@". All Rights Reserved." withString:@""]; + copyright = [copyright stringByReplacingOccurrencesOfString:@". All rights reserved." withString:@""]; + copyright = [copyright stringByReplacingOccurrencesOfString:@". All Rights Reserved" withString:@""]; + copyright = [copyright stringByReplacingOccurrencesOfString:@". All rights reserved" withString:@""]; + copyright = [copyright stringByReplacingOccurrencesOfString:@" by " withString:@" "]; + [aMetadata setTag:copyright forKey:@"Copyright"]; + } + [xml release]; + } + + return aMetadata; +} + +#pragma mark Parse results + +/* Scrape people from iTunes Store website HTML */ ++ (NSArray *) readPeople:(NSString *)aPeople fromXML:(NSXMLDocument *)aXml { + if (aXml) { + NSArray *nodes = [aXml nodesForXPath:[NSString stringWithFormat:@"//div[starts-with(@metrics-loc,'Titledbox_%@')]", aPeople] error:NULL]; + for (NSXMLNode *n in nodes) { + NSXMLDocument *subXML = [[NSXMLDocument alloc] initWithXMLString:[n XMLString] options:0 error:NULL]; + if (subXML) { + NSArray *subNodes = [subXML nodesForXPath:@"//a" error:NULL]; + NSMutableArray *r = [[NSMutableArray alloc] initWithCapacity:[subNodes count]]; + for (NSXMLNode *sub in subNodes) { + [r addObject:[sub stringValue]]; + } + [subXML release]; + return [r autorelease]; + } + } + } + return nil; +} + ++ (NSArray *) metadataForResults:(NSDictionary *)dict store:(NSDictionary *)store { + NSMutableArray *returnArray = [[NSMutableArray alloc] initWithCapacity:[[dict valueForKey:@"resultCount"] integerValue]]; + NSArray *resultsArray = [dict valueForKey:@"results"]; + for (int i = 0; i < [resultsArray count]; i++) { + NSDictionary *r = [resultsArray objectAtIndex:i]; + + // Skip if the result is not a track (for example an artist or a collection) + if (![[r valueForKey:@"wrapperType"] isEqualToString:@"track"]) + continue; + + MP42Metadata *metadata = [[MP42Metadata alloc] init]; + if ([[r valueForKey:@"kind"] isEqualToString:@"feature-movie"]) { + metadata.mediaKind = 9; // movie + [metadata setTag:[r valueForKey:@"trackName"] forKey:@"Name"]; + [metadata setTag:[r valueForKey:@"artistName"] forKey:@"Director"]; + [metadata setTag:[r valueForKey:@"artistName"] forKey:@"Artist"]; + } else if ([[r valueForKey:@"kind"] isEqualToString:@"tv-episode"]) { + metadata.mediaKind = 10; // TV show + [metadata setTag:[r valueForKey:@"artistName"] forKey:@"TV Show"]; + [metadata setTag:[r valueForKey:@"artistName"] forKey:@"Artist"]; + NSString *s = [r valueForKey:@"collectionName"]; + NSString *season = nil; + if (![[store valueForKey:@"season"] isEqualToString:@""]) { + NSArray *sa = [[s lowercaseString] componentsSeparatedByString:[NSString stringWithFormat:@", %@ ", [store valueForKey:@"season"]]]; + if ([sa count] > 1) { + season = [sa objectAtIndex:1]; + } else { + season = @"1"; + } + } + if (season) { + [metadata setTag:season forKey:@"TV Season"]; + NSString *episodeID = [NSString stringWithFormat:@"%ld%02ld", (long)[season integerValue], + (long)[[r valueForKey:@"trackNumber"] integerValue]]; + [metadata setTag:episodeID forKey:@"TV Episode ID"]; + [metadata setTag:[NSString stringWithFormat:@"%@, Season %@", [r valueForKey:@"artistName"], season] forKey:@"Album"]; + } + [metadata setTag:[r valueForKey:@"trackNumber"] forKey:@"TV Episode #"]; + [metadata setTag:[r valueForKey:@"trackName"] forKey:@"Name"]; + [metadata setTag:[NSString stringWithFormat:@"%@/%@", [r valueForKey:@"trackNumber"], [r valueForKey:@"trackCount"]] forKey:@"Track #"]; + [metadata setTag:[r valueForKey:@"artistId"] forKey:@"artistID"]; + [metadata setTag:[r valueForKey:@"collectionId"] forKey:@"playlistID"]; + } + // metadata common to both TV episodes and movies + [metadata setTag:[(NSString *) [r valueForKey:@"releaseDate"] substringToIndex:10] forKey:@"Release Date"]; + if ([r valueForKey:@"shortDescription"]) + [metadata setTag:[r valueForKey:@"shortDescription"] forKey:@"Description"]; + else + [metadata setTag:[r valueForKey:@"longDescription"] forKey:@"Description"]; + [metadata setTag:[r valueForKey:@"longDescription"] forKey:@"Long Description"]; + [metadata setTag:[r valueForKey:@"primaryGenreName"] forKey:@"Genre"]; + [metadata setTag:[NSNumber numberWithUnsignedInteger:[[MP42Ratings defaultManager] ratingIndexForiTunesCountry:[store valueForKey:@"country"] media:(metadata.mediaKind == 9 ? @"movie" : @"TV") ratingString:[r valueForKey:@"contentAdvisoryRating"]]] forKey:@"Rating"]; + [metadata setTag:[r valueForKey:@"trackViewUrl"] forKey:@"iTunes URL"]; + if ([store valueForKey:@"storeCode"]) { + [metadata setTag:[[store valueForKey:@"storeCode"] stringValue] forKey:@"iTunes Country"]; + } + NSString *trackExplicitness = [r valueForKey:@"trackExplicitness"]; + [metadata setTag:[r valueForKey:@"trackId"] forKey:@"contentID"]; + if ([trackExplicitness isEqualToString:@"explicit"]) { + [metadata setContentRating:4]; + } else if ([trackExplicitness isEqualToString:@"cleaned"]) { + [metadata setContentRating:2]; + } + // artwork + NSString *artworkString = [r valueForKey:@"artworkUrl100"]; + if (artworkString) { + NSMutableArray *artworkThumbURLs = [[NSMutableArray alloc] initWithCapacity:1]; + [artworkThumbURLs addObject:[NSURL URLWithString:artworkString]]; + [metadata setArtworkThumbURLs: artworkThumbURLs]; + [artworkThumbURLs release]; + artworkString = [artworkString stringByReplacingOccurrencesOfString:@"100x100-75." withString:@""]; + NSMutableArray *artworkFullsizeURLs = [[NSMutableArray alloc] initWithCapacity:1]; + [artworkFullsizeURLs addObject:[NSURL URLWithString:artworkString]]; + [metadata setArtworkFullsizeURLs: artworkFullsizeURLs]; + [artworkFullsizeURLs release]; + NSMutableArray *artworkProviderNames = [[NSMutableArray alloc] initWithCapacity:1]; + [artworkProviderNames addObject:@"iTunes"]; + [metadata setArtworkProviderNames:artworkProviderNames]; + [artworkProviderNames release]; + } + + // add to array + [returnArray addObject:metadata]; + [metadata release]; + + } + return [returnArray autorelease]; +} + +@end \ No newline at end of file diff --git a/Classes/PropertyView/English.lproj/ChapterView.xib b/Classes/PropertyView/English.lproj/ChapterView.xib new file mode 100755 index 0000000..1d9b64a --- /dev/null +++ b/Classes/PropertyView/English.lproj/ChapterView.xib @@ -0,0 +1,912 @@ + + + + 1060 + 13A603 + 4511 + 1265 + 695.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 4511 + + + NSButton + NSButtonCell + NSCustomObject + NSCustomView + NSScrollView + NSScroller + NSTabView + NSTabViewItem + NSTableColumn + NSTableHeaderView + NSTableView + NSTextFieldCell + NSView + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + SBChapterViewController + + + FirstResponder + + + NSApplication + + + + 268 + + + + 274 + {{-11, -12}, {502, 279}} + + + + + + 1 + + + 274 + + + + 274 + + + + 2322 + + + + 256 + {446, 181} + + + + YES + NO + YES + + + 256 + {446, 17} + + + + + + + + -2147483392 + {{-22, 0}, {12, 17}} + + + + time + 96 + 40 + 1000 + + 75497536 + 2048 + Time + + .LucidaGrandeUI + 11 + 3100 + + + 3 + MC4zMzMzMzI5OQA + + + 6 + System + headerTextColor + + 3 + MAA + + + + + 337641536 + 133120 + Text Cell + + + + 6 + System + controlBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + + + ti_ER + ar_LY + kok_IN + mk_MK + eo + fr_CH + sw + so_ET + gv + ar_BH + hy_AM_REVISED + it_IT + bg_BG + ro + es_HN + en_BE + is + kw_GB + kl + ga_IE + nl_NL + uk + fr_CA + sk_SK + es_AR + en_MT + fr_BE + ca + cs_CZ + fr_FR + en_ZA + sl + fa + so + pt + et_EE + eu_ES + fi + de_CH + or + gu_IN + mt_MT + nb + ms + es_CR + as_IN + ar_SA + am + pl + hu + lv + ar_DZ + ur + pt_PT + eu + so_DJ + de + en_IN + hr_HR + ar_AE + gu + lt + te_IN + ar_KW + sr_Latn + de_AT + en_US + es_PR + pl_PL + uz_Cyrl_UZ + ar_EG + it_CH + nl + haw_US + is_IS + en_IE + kl_GL + ps + zh_Hans_CN + ar + ru_UA + th_TH + fr_LU + uz_Latn_UZ + az + bn_IN + es_MX + kk_KZ + en_US_POSIX + el_GR + he + es_UY + nn_NO + sr + sk + ur_PK + es_PA + sv_FI + zh + es_DO + en_CA + en_BW + de_DE + haw + pa_IN + sq + kw + ga + ml + mt + af_ZA + az_Latn + ko_KR + fa_AF + ps_AF + be_BY + bn + it + sr_Latn_CS + zh_Hans + as + ms_MY + be + sl_SI + fa_IR + es_EC + kok + es_PY + ta_IN + am_ET + es_CO + uz_Latn + el + zh_Hant_MO + kk + kn + zh_Hant + en + es_PE + pt_BR + ar_LB + en_NZ + es_ES + en_HK + es_BO + hu_HU + sr_Cyrl + nb_NO + sv + vi + ti_ET + bg + om + de_LU + en_SG + id_ID + ur_IN + uz + da + ru_RU + es_US + es_VE + ko + ja + af + ar_YE + lt_LT + om_KE + zh_Hans_SG + es_NI + he_IL + en_PK + en_PH + az_Cyrl_AZ + en_AU + az_Cyrl + ta + ar_MA + sw_KE + tr_TR + zh_Hant_HK + en_ZW + de_BE + mk + pa + da_DK + es_GT + es + ar_IQ + az_Latn_AZ + so_SO + lv_LV + mr + te + sq_AL + ml_IN + uk_UA + hi_IN + ca_ES + ar_TN + id + om_ET + cs + fo_FO + hy_AM + en_GB + sr_Cyrl_CS + gl_ES + sw_TZ + ro_RO + cy + fr + ms_BN + so_KE + tr + gl + cy_GB + ar_OM + fo + es_CL + sv_SE + ar_JO + uz_Cyrl + zh_Hant_TW + et + hi + fi_FI + nn + th + ar_SY + ja_JP + gv_GB + hy + en_VI + kn_IN + ti + ar_QA + es_SV + hr + ru + ar_SD + mr_IN + vi_VN + nl_BE + or_IN + + + 3 + YES + YES + + + + title + 344 + 40 + 2000 + + 75497536 + 2048 + Title + + + + + + 337641536 + 133120 + Text Cell + + + + + + 3 + YES + YES + + + + 3 + 2 + + 3 + MQA + + + 6 + System + gridColor + + 3 + MC41AA + + + 14 + -155189248 + + + 1 + 4 + 15 + 0 + YES + 0 + 1 + + + {{1, 17}, {446, 181}} + + + + + + 4 + + + + -2147483392 + {{412, 17}, {11, 176}} + + + + NO + 256 + + _doScroller: + 37 + 0.19473679999999999 + + + + -2147483392 + {{1, 193}, {411, 11}} + + + + NO + 257 + + _doScroller: + 0.99763599999999997 + + + + 2338 + + + + {{1, 0}, {446, 17}} + + + + + + 4 + + + {{17, 36}, {448, 199}} + + + + 133682 + + + + + QSAAAEEgAABBgAAAQYAAAA + 0.25 + 4 + 1 + + + + 292 + {{40, 7}, {24, 22}} + + + + YES + + 603979776 + 134217728 + + + .LucidaGrandeUI + 13 + 1044 + + + -2030288896 + 162 + + NSImage + NSRemoveTemplate + + + + 200 + 25 + + NO + + + + 292 + {{17, 7}, {24, 22}} + + + + YES + + 67108864 + 134217728 + + + + -2030288896 + 162 + + NSImage + NSAddTemplate + + + + 200 + 25 + + NO + + + {{10, 25}, {482, 241}} + + + + + Chapters + + 6 + System + controlColor + + + + + + + + 134217728 + YES + YES + + + + + + {480, 272} + + + + NSView + + + + NO + + + + view + + + + 2 + + + + removeChapter + + + + 47 + + + + removeChapter: + + + + 48 + + + + addChapter: + + + + 50 + + + + chapterTableView + + + + 49 + + + + delegate + + + + 29 + + + + dataSource + + + + 28 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + + + + 10 + + + + + + + + 11 + + + + + + + + 12 + + + + + + + + + + 19 + + + + + + + + + + + 20 + + + + + 21 + + + + + 23 + + + + + 31 + + + + + + + + 32 + + + + + 42 + + + + + + + + 43 + + + + + 22 + + + + + + + + + 24 + + + + + + + + 25 + + + + + + + + 26 + + + + + 27 + + + + + + + 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 + + + + + + + + + + SBChapterViewController + NSViewController + + id + id + + + + addChapter: + id + + + removeChapter: + id + + + + SBTableView + NSButton + + + + chapterTableView + SBTableView + + + removeChapter + NSButton + + + + IBProjectSource + ./Classes/SBChapterViewController.h + + + + SBTableView + NSTableView + + IBProjectSource + ./Classes/SBTableView.h + + + + + 0 + IBCocoaFramework + YES + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + {8, 8} + {8, 8} + + + diff --git a/Classes/PropertyView/English.lproj/EmptyView.xib b/Classes/PropertyView/English.lproj/EmptyView.xib new file mode 100755 index 0000000..fdd471b --- /dev/null +++ b/Classes/PropertyView/English.lproj/EmptyView.xib @@ -0,0 +1,256 @@ + + + + 1060 + 13A603 + 4511 + 1265 + 695.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 4511 + + + NSCustomObject + NSCustomView + NSTabView + NSTabViewItem + NSTextField + NSTextFieldCell + NSView + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + SBEmptyViewController + + + FirstResponder + + + NSApplication + + + + 268 + + + + 274 + {{-11, -12}, {502, 279}} + + + + + + 1 + + + 274 + + + + 301 + {{176, 112}, {129, 17}} + + + + YES + + 68157504 + 272630784 + Nothing to see here + + .LucidaGrandeUI + 13 + 1044 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + NO + 1 + + + {{10, 25}, {482, 241}} + + + + + Empty + + + + + + + .LucidaGrandeUI + 11 + 3100 + + 134217728 + YES + YES + + + + + + {480, 272} + + + + NSView + + + + NO + + + + view + + + + 4 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + + + + 5 + + + + + + + + 6 + + + + + + + + 9 + + + + + + + + 2 + + + + + + + + 3 + + + + + + + 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 + + + + + + + + + + SBEmptyViewController + NSViewController + + IBProjectSource + ./Classes/SBEmptyViewController.h + + + + + 0 + IBCocoaFramework + YES + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + diff --git a/Classes/PropertyView/English.lproj/MovieView.xib b/Classes/PropertyView/English.lproj/MovieView.xib new file mode 100755 index 0000000..a1d8c35 --- /dev/null +++ b/Classes/PropertyView/English.lproj/MovieView.xib @@ -0,0 +1,3021 @@ + + + + 1060 + 13A603 + 4511 + 1265 + 695.00 + + 4511 + 3336 + + + IKImageBrowserView + NSBox + NSButton + NSButtonCell + NSCustomObject + NSCustomView + NSMenu + NSMenuItem + NSPopUpButton + NSPopUpButtonCell + NSScrollView + NSScroller + NSSlider + NSSliderCell + NSTabView + NSTabViewItem + NSTableColumn + NSTableHeaderView + NSTableView + NSTextField + NSTextFieldCell + NSView + NSWindowTemplate + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.imagekit.ibplugin + + + PluginDependencyRecalculationVersion + + + + + SBMovieViewController + + + FirstResponder + + + NSApplication + + + + 1804 + + + + 1810 + + {{-11, -12}, {502, 279}} + + + + + + 1 + + + 1810 + + + + 1810 + + + + 3858 + + + + 1792 + + {446, 181} + + + + YES + NO + YES + + + 1792 + + {446, 17} + + + + + + + + 256 + {15, 20} + + + + name + 107 + 40 + 1000 + + 75497536 + 2048 + Annotation + + .LucidaGrandeUI + 11 + 3100 + + + 3 + MC4zMzMzMzI5OQA + + + 6 + System + headerTextColor + + 3 + MAA + + + + + 337641537 + 133120 + Text Cell + + + + 6 + System + controlBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + + + ti_ER + ar_LY + kok_IN + mk_MK + eo + fr_CH + sw + so_ET + gv + ar_BH + hy_AM_REVISED + it_IT + bg_BG + ro + es_HN + en_BE + is + kw_GB + kl + ga_IE + nl_NL + uk + fr_CA + sk_SK + es_AR + en_MT + fr_BE + ca + cs_CZ + fr_FR + en_ZA + sl + fa + so + pt + et_EE + eu_ES + fi + de_CH + or + gu_IN + mt_MT + nb + ms + es_CR + as_IN + ar_SA + am + pl + hu + lv + ar_DZ + ur + pt_PT + eu + so_DJ + de + en_IN + hr_HR + ar_AE + gu + lt + te_IN + ar_KW + sr_Latn + de_AT + en_US + es_PR + pl_PL + uz_Cyrl_UZ + ar_EG + it_CH + nl + haw_US + is_IS + en_IE + kl_GL + ps + zh_Hans_CN + ar + ru_UA + th_TH + fr_LU + uz_Latn_UZ + az + bn_IN + es_MX + kk_KZ + en_US_POSIX + el_GR + he + es_UY + nn_NO + sr + sk + ur_PK + es_PA + sv_FI + zh + es_DO + en_CA + en_BW + de_DE + haw + pa_IN + sq + kw + ga + ml + mt + af_ZA + az_Latn + ko_KR + fa_AF + ps_AF + be_BY + bn + it + sr_Latn_CS + zh_Hans + as + ms_MY + be + sl_SI + fa_IR + es_EC + kok + es_PY + ta_IN + am_ET + es_CO + uz_Latn + el + zh_Hant_MO + kk + kn + zh_Hant + en + es_PE + pt_BR + ar_LB + en_NZ + es_ES + en_HK + es_BO + hu_HU + sr_Cyrl + nb_NO + sv + vi + ti_ET + bg + om + de_LU + en_SG + id_ID + ur_IN + uz + da + ru_RU + es_US + es_VE + ko + ja + af + ar_YE + lt_LT + om_KE + zh_Hans_SG + es_NI + he_IL + en_PK + en_PH + az_Cyrl_AZ + en_AU + az_Cyrl + ta + ar_MA + sw_KE + tr_TR + zh_Hant_HK + en_ZW + de_BE + mk + pa + da_DK + es_GT + es + ar_IQ + az_Latn_AZ + so_SO + lv_LV + mr + te + sq_AL + ml_IN + uk_UA + hi_IN + ca_ES + ar_TN + id + om_ET + cs + fo_FO + hy_AM + en_GB + sr_Cyrl_CS + gl_ES + sw_TZ + ro_RO + cy + fr + ms_BN + so_KE + tr + gl + cy_GB + ar_OM + fo + es_CL + sv_SE + ar_JO + uz_Cyrl + zh_Hant_TW + et + hi + fi_FI + nn + th + ar_SY + ja_JP + gv_GB + hy + en_VI + kn_IN + ti + ar_QA + es_SV + hr + ru + ar_SD + mr_IN + vi_VN + nl_BE + or_IN + + + 3 + YES + + + + value + 333 + 40 + 2000 + + 75497536 + 2048 + Value + + + 3 + MC4zMzMzMzI5OQA + + + + + 337641473 + 131072 + Text Cell + + + + + + 3 + YES + YES + + + + 3 + 2 + + 3 + MQA + + + 6 + System + gridColor + + 3 + MC41AA + + + 14 + 2126512128 + + + 1 + 4 + -1 + 0 + YES + 0 + 1 + + + {{1, 17}, {446, 181}} + + + + + + 4 + + + + 3874 + + + + {{1, 0}, {446, 17}} + + + + + + 4 + + + + -2147481856 + + {{1, 184}, {446, 14}} + + + + NO + 257 + + _doScroller: + + + + -2147481856 + + {{412, 17}, {11, 152}} + + + + NO + 256 + + _doScroller: + 1 + + + + {{17, 36}, {448, 199}} + + + + 133682 + + + + + QSAAAEEgAABBgAAAQYAAAA + 0.25 + 4 + 1 + + + + 1828 + + {{17, 7}, {28, 22}} + + + + YES + + 71303232 + 134350848 + + + -2038284288 + 34 + + LucidaGrande + 11 + 16 + + + + 400 + 75 + + + YES + + + 2147483647 + + NSImage + NSAddTemplate + + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + + YES + + OtherViews + + + + + YES + 1 + YES + YES + 2 + + NO + + + + 1828 + + {{44, 7}, {24, 22}} + + + + {250, 750} + YES + + 603979776 + 134217728 + + + .LucidaGrandeUI + 13 + 1044 + + + -2033434624 + 162 + + NSImage + NSRemoveTemplate + + + + 400 + 75 + + NO + + + + 1828 + + {{76, 7}, {33, 22}} + + + + YES + + 71303232 + 134350848 + + + -2038284288 + 162 + + + + 400 + 75 + + + YES + + + 2147483647 + + NSImage + NSSmartBadgeTemplate + + + + _popUpItemAction: + + + YES + + OtherViews + + + + + YES + 1 + YES + YES + 2 + + NO + + + + {{10, 25}, {482, 241}} + + + + + Metadata + + 6 + System + controlColor + + + + + + Item 1 + + + 1810 + + + + 10002 + + + + 3858 + + + + 1554 + + + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + Apple URL pasteboard type + NSFilenamesPboardType + NSTypedFilenamesPboardType:'.SGI' + NSTypedFilenamesPboardType:'8BPS' + NSTypedFilenamesPboardType:'BMP ' + NSTypedFilenamesPboardType:'BMPf' + NSTypedFilenamesPboardType:'EPSF' + NSTypedFilenamesPboardType:'GIFf' + NSTypedFilenamesPboardType:'JPEG' + NSTypedFilenamesPboardType:'PDF ' + NSTypedFilenamesPboardType:'PICT' + NSTypedFilenamesPboardType:'PNGf' + NSTypedFilenamesPboardType:'PNTG' + NSTypedFilenamesPboardType:'TIFF' + NSTypedFilenamesPboardType:'TPIC' + NSTypedFilenamesPboardType:'icns' + NSTypedFilenamesPboardType:'jp2 ' + NSTypedFilenamesPboardType:'qtif' + NSTypedFilenamesPboardType:3FR + NSTypedFilenamesPboardType:3fr + NSTypedFilenamesPboardType:ARW + NSTypedFilenamesPboardType:BMP + NSTypedFilenamesPboardType:CR2 + NSTypedFilenamesPboardType:CRW + NSTypedFilenamesPboardType:CUR + NSTypedFilenamesPboardType:DCR + NSTypedFilenamesPboardType:DNG + NSTypedFilenamesPboardType:EFX + NSTypedFilenamesPboardType:EPI + NSTypedFilenamesPboardType:EPS + NSTypedFilenamesPboardType:EPSF + NSTypedFilenamesPboardType:EPSI + NSTypedFilenamesPboardType:ERF + NSTypedFilenamesPboardType:EXR + NSTypedFilenamesPboardType:FAX + NSTypedFilenamesPboardType:FFF + NSTypedFilenamesPboardType:FPIX + NSTypedFilenamesPboardType:FPX + NSTypedFilenamesPboardType:G3 + NSTypedFilenamesPboardType:GIF + NSTypedFilenamesPboardType:HDR + NSTypedFilenamesPboardType:ICNS + NSTypedFilenamesPboardType:ICO + NSTypedFilenamesPboardType:JFAX + NSTypedFilenamesPboardType:JFIF + NSTypedFilenamesPboardType:JFX + NSTypedFilenamesPboardType:JP2 + NSTypedFilenamesPboardType:JPE + NSTypedFilenamesPboardType:JPEG + NSTypedFilenamesPboardType:JPF + NSTypedFilenamesPboardType:JPG + NSTypedFilenamesPboardType:JPS + NSTypedFilenamesPboardType:MAC + NSTypedFilenamesPboardType:MOS + NSTypedFilenamesPboardType:MPO + NSTypedFilenamesPboardType:MRW + NSTypedFilenamesPboardType:NEF + NSTypedFilenamesPboardType:NRW + NSTypedFilenamesPboardType:ORF + NSTypedFilenamesPboardType:PCT + NSTypedFilenamesPboardType:PDF + NSTypedFilenamesPboardType:PEF + NSTypedFilenamesPboardType:PIC + NSTypedFilenamesPboardType:PICT + NSTypedFilenamesPboardType:PNG + NSTypedFilenamesPboardType:PNT + NSTypedFilenamesPboardType:PNTG + NSTypedFilenamesPboardType:PS + NSTypedFilenamesPboardType:PSD + NSTypedFilenamesPboardType:QTI + NSTypedFilenamesPboardType:QTIF + NSTypedFilenamesPboardType:RAF + NSTypedFilenamesPboardType:RAW + NSTypedFilenamesPboardType:RGB + NSTypedFilenamesPboardType:RW2 + NSTypedFilenamesPboardType:RWL + NSTypedFilenamesPboardType:SGI + NSTypedFilenamesPboardType:SR2 + NSTypedFilenamesPboardType:SRF + NSTypedFilenamesPboardType:SRW + NSTypedFilenamesPboardType:TARGA + NSTypedFilenamesPboardType:TGA + NSTypedFilenamesPboardType:TIF + NSTypedFilenamesPboardType:TIFF + NSTypedFilenamesPboardType:XBM + NSTypedFilenamesPboardType:arw + NSTypedFilenamesPboardType:bmp + NSTypedFilenamesPboardType:cr2 + NSTypedFilenamesPboardType:crw + NSTypedFilenamesPboardType:cur + NSTypedFilenamesPboardType:dcr + NSTypedFilenamesPboardType:dng + NSTypedFilenamesPboardType:efx + NSTypedFilenamesPboardType:epi + NSTypedFilenamesPboardType:eps + NSTypedFilenamesPboardType:epsf + NSTypedFilenamesPboardType:epsi + NSTypedFilenamesPboardType:erf + NSTypedFilenamesPboardType:exr + NSTypedFilenamesPboardType:fax + NSTypedFilenamesPboardType:fff + NSTypedFilenamesPboardType:fpix + NSTypedFilenamesPboardType:fpx + NSTypedFilenamesPboardType:g3 + NSTypedFilenamesPboardType:gif + NSTypedFilenamesPboardType:hdr + NSTypedFilenamesPboardType:icns + NSTypedFilenamesPboardType:ico + NSTypedFilenamesPboardType:jfax + NSTypedFilenamesPboardType:jfif + NSTypedFilenamesPboardType:jfx + NSTypedFilenamesPboardType:jp2 + NSTypedFilenamesPboardType:jpe + NSTypedFilenamesPboardType:jpeg + NSTypedFilenamesPboardType:jpf + NSTypedFilenamesPboardType:jpg + NSTypedFilenamesPboardType:jps + NSTypedFilenamesPboardType:mac + NSTypedFilenamesPboardType:mos + NSTypedFilenamesPboardType:mpo + NSTypedFilenamesPboardType:mrw + NSTypedFilenamesPboardType:nef + NSTypedFilenamesPboardType:nrw + NSTypedFilenamesPboardType:orf + NSTypedFilenamesPboardType:pct + NSTypedFilenamesPboardType:pdf + NSTypedFilenamesPboardType:pef + NSTypedFilenamesPboardType:pic + NSTypedFilenamesPboardType:pict + NSTypedFilenamesPboardType:png + NSTypedFilenamesPboardType:pnt + NSTypedFilenamesPboardType:pntg + NSTypedFilenamesPboardType:ps + NSTypedFilenamesPboardType:psd + NSTypedFilenamesPboardType:qti + NSTypedFilenamesPboardType:qtif + NSTypedFilenamesPboardType:raf + NSTypedFilenamesPboardType:raw + NSTypedFilenamesPboardType:rgb + NSTypedFilenamesPboardType:rw2 + NSTypedFilenamesPboardType:rwl + NSTypedFilenamesPboardType:sgi + NSTypedFilenamesPboardType:sr2 + NSTypedFilenamesPboardType:srf + NSTypedFilenamesPboardType:srw + NSTypedFilenamesPboardType:targa + NSTypedFilenamesPboardType:tga + NSTypedFilenamesPboardType:tif + NSTypedFilenamesPboardType:tiff + NSTypedFilenamesPboardType:xbm + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + {446, 197} + + + YES + NO + NO + NO + NO + YES + YES + YES + YES + YES + 177 + 177 + + + + + {{1, 1}, {446, 197}} + + + + + 6 + + + + -2147481856 + + {{-100, -100}, {438, 15}} + + + NO + 1 + + _doScroller: + + + + -2147481856 + + {{424, 1}, {15, 250}} + + + NO + + _doScroller: + 1 + + + + {{17, 36}, {448, 199}} + + + 133650 + + + + QSAAAEEgAABDPKqrQygAAA + 0.25 + 4 + 1 + + + + 1828 + + {{17, 7}, {24, 22}} + + + {250, 750} + YES + + 67108864 + 134217728 + + + + -2033434624 + 162 + + + + 400 + 75 + + NO + + + + 1828 + + {{40, 7}, {24, 22}} + + + {250, 750} + YES + + 603979776 + 134217728 + + + + -2033434624 + 162 + + + + 400 + 75 + + NO + + + + 1825 + + {{350, 11}, {115, 15}} + + YES + + -2147221248 + 131072 + + 2 + 0.0 + 1 + 0.0 + 0 + 1 + NO + NO + + NO + + + + {{10, 25}, {482, 241}} + + + Artwork + + + + + Item 2 + + + 1792 + + + + 1581 + + + + 1810 + + + + 1837 + + {{122, 53}, {71, 18}} + + YES + + 67108864 + 131072 + Gapless + + + 1211912448 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 400 + 75 + + NO + + + + 1837 + + {{122, 33}, {71, 18}} + + YES + + 67108864 + 131072 + Podcast + + + 1211912448 + 2 + + + + + 400 + 75 + + NO + + + + 1837 + + {{122, 139}, {143, 22}} + + YES + + -2076180416 + 133120 + + + 1 + 109199360 + 129 + + + + 400 + 75 + + + Normal (Music) + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + 1 + + + YES + + OtherViews + + + + Home Video + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + + Audio Book + + 1048576 + 2147483647 + + + _popUpItemAction: + 2 + + + + + Music Video + + 2147483647 + + + _popUpItemAction: + 6 + + + + + Movie + + 2147483647 + + + _popUpItemAction: + 9 + + + + + TV Show + + 2147483647 + + + _popUpItemAction: + 10 + + + + + Booklet + + 2147483647 + + + _popUpItemAction: + 11 + + + + + Ringtone + + 1048576 + 2147483647 + + + _popUpItemAction: + 14 + + + + + Podcast + + 1048576 + 2147483647 + + + _popUpItemAction: + 21 + + + + + iTunes U + + 1048576 + 2147483647 + + + _popUpItemAction: + 23 + + + + + 1 + 1 + YES + YES + 2 + + NO + + + + 1837 + + {{52, 143}, {67, 14}} + + YES + + 68157504 + 272761856 + Media Kind: + + + + + + NO + 1 + + + + 1837 + + {{122, 112}, {143, 22}} + + YES + + -2076180416 + 133120 + + + 109199360 + 129 + + + + 400 + 75 + + + None + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + OtherViews + + + + + Clean + + 1048576 + 2147483647 + + + _popUpItemAction: + 2 + + + + + Explicit + + 1048576 + 2147483647 + + + _popUpItemAction: + 4 + + + + + 1 + YES + YES + 2 + + NO + + + + 1837 + + {{32, 117}, {88, 14}} + + YES + + 68157504 + 272761856 + Content Rating: + + + + + + NO + 1 + + + + 1837 + + {{121, 85}, {143, 22}} + + YES + + -2076180416 + 133120 + + + 109199360 + 129 + + + + 400 + 75 + + + No + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + OtherViews + + + + + 720p + + 1048576 + 2147483647 + + + _popUpItemAction: + 1 + + + + + 1080p + + 1048576 + 2147483647 + + + _popUpItemAction: + 2 + + + + + 1 + YES + YES + 2 + + NO + + + + 1837 + + {{95, 90}, {24, 14}} + + YES + + 68157504 + 272761856 + HD: + + + + + + NO + 1 + + + + 1837 + + {{70, 55}, {50, 14}} + + YES + + 68157504 + 272761856 + Options: + + + + + + NO + 1 + + + + {291, 198} + + + + + {{95, 33}, {291, 198}} + + {0, 0} + + 67108864 + 134217728 + Box + + + 6 + System + textBackgroundColor + + + + 3 + MCAwLjgAA + + + + 0 + 0 + 0 + NO + + + + {{10, 25}, {482, 241}} + + Other Settings + + + + + + + 134217728 + YES + YES + + + + + + + {480, 272} + + + + NSView + + + 7 + 2 + {{196, 400}, {346, 127}} + 611844096 + Window + NSWindow + + + + + 1792 + + + + 1804 + + {{17, 90}, {87, 17}} + + YES + + 68157504 + 272630784 + Preset Name: + + + + + + NO + 1 + + + + 1804 + + {{20, 60}, {306, 22}} + + YES + + -1804599231 + 272630784 + + + + YES + + + 6 + System + textColor + + + + NO + 1 + + + + 1825 + + {{236, 12}, {96, 32}} + + {250, 750} + YES + + 67108864 + 134217728 + Save + + + -2038284288 + 129 + + LucidaGrande + 13 + 16 + + + DQ + 400 + 75 + + NO + + + + 1825 + + {{140, 12}, {96, 32}} + + {250, 750} + YES + + 67108864 + 134217728 + Cancel + + + -2038284288 + 129 + + + Gw + 400 + 75 + + NO + + + + {346, 127} + + {{0, 0}, {2560, 1418}} + {10000000000000, 10000000000000} + YES + + + + NO + + + + addArtwork + + + + 229 + + + + contentRating + + + + 89 + + + + gapless + + + + 91 + + + + hdVideo + + + + 208 + + + + mediaKind + + + + 88 + + + + podcast + + + + 197 + + + + presetName + + + + 193 + + + + removeArtwork + + + + 230 + + + + removeTag + + + + 56 + + + + saveWindow + + + + 188 + + + + setList + + + + 187 + + + + tagList + + + + 36 + + + + view + + + + 2 + + + + addTag: + + + + 37 + + + + removeTag: + + + + 55 + + + + selectArtwork: + + + + 232 + + + + removeArtwork: + + + + 231 + + + + zoomSliderDidChange: + + + + 237 + + + + changeGapless: + + + + 111 + + + + changePodcast: + + + + 198 + + + + changeMediaKind: + + + + 109 + + + + changecContentRating: + + + + 113 + + + + changehdVideo: + + + + 209 + + + + saveSet: + + + + 189 + + + + closeSaveSheet: + + + + 190 + + + + tagsTableView + + + + 39 + + + + imageBrowser + + + + 218 + + + + dataSource + + + + 28 + + + + delegate + + + + 29 + + + + _delegate + + + + 221 + + + + _dragDestinationDelegate + + + + 233 + + + + dragDestinationDelegate + + + + 234 + + + + delegate + + + + 220 + + + + _dataSource + + + + 222 + + + + dataSource + + + + 219 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + + + + 10 + + + + + + + + + + 11 + + + + + + + + 12 + + + + + + + + + + + 19 + + + + + + + + + + + 21 + + + + + 20 + + + + + 23 + + + + + 30 + + + + + + + + 31 + + + + + + + + 32 + + + + + + + + 33 + + + + + 53 + + + + + + + + 54 + + + + + 179 + + + + + + + + 180 + + + + + + + + 181 + + + + + + + + 184 + + + + + 15 + + + + + + + + 16 + + + + + + + + + + + 214 + + + + + + + + + + 216 + + + + + 215 + + + + + 223 + + + + + + + + 224 + + + + + 226 + + + + + + + + 227 + + + + + 235 + + + + + + + + 236 + + + + + 40 + + + + + + + + 41 + + + + + + + + 87 + + + + + + + + + + + + + + + + 57 + + + + + + + + 58 + + + + + 194 + + + + + + + + 195 + + + + + 59 + + + + + + + + 60 + + + + + + + + 61 + + + + + + + + + + + + + + + + + 63 + + + + + 212 + + + + + 64 + + + + + 67 + + + + + 68 + + + + + 69 + + + + + 71 + + + + + 62 + + + + + 210 + + + + + 211 + + + + + 72 + + + + + + + + 73 + + + + + 74 + + + + + + + + 77 + + + + + + + + 78 + + + + + + + + + + 86 + + + + + 85 + + + + + 84 + + + + + 75 + + + + + + + + 76 + + + + + 199 + + + + + + + + 202 + + + + + + + + 203 + + + + + + + + + + 206 + + + + + 205 + + + + + 204 + + + + + 200 + + + + + + + + 201 + + + + + 139 + + + + + + + + 140 + + + + + 167 + + + + + + Preset Save + + + 168 + + + + + + + + + + + 173 + + + + + + + + 174 + + + + + 171 + + + + + + + + 176 + + + + + 170 + + + + + + + + 177 + + + + + 169 + + + + + + + + 178 + + + + + 22 + + + + + + + + + 25 + + + + + + + + 24 + + + + + + + + 27 + + + + + 26 + + + + + 217 + + + + + + + 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 + + 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 + + + SBImageBrowserView + com.apple.imagekit.ibplugin + + + 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 + + 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 + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + + + + + + IKImageBrowserView + + id + id + id + + + + _dataSource + id + + + _delegate + id + + + _dragDestinationDelegate + id + + + + IBProjectSource + ./Classes/IKImageBrowserView.h + + + + SBImageBrowserView + IKImageBrowserView + + paste: + id + + + paste: + + paste: + id + + + + IBProjectSource + ./Classes/SBImageBrowserView.h + + + + SBMovieViewController + NSViewController + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addMetadataSet: + id + + + addTag: + id + + + changeGapless: + id + + + changeMediaKind: + id + + + changePodcast: + id + + + changecContentRating: + id + + + changehdVideo: + id + + + closeSaveSheet: + id + + + doubleClickAction: + id + + + removeArtwork: + id + + + removeTag: + id + + + saveSet: + id + + + selectArtwork: + id + + + showSaveSet: + id + + + zoomSliderDidChange: + id + + + + NSButton + NSPopUpButton + NSButton + NSPopUpButton + SBImageBrowserView + NSPopUpButton + NSButton + NSTextField + NSButton + NSButton + NSWindow + NSPopUpButton + NSPopUpButton + SBTableView + + + + addArtwork + NSButton + + + contentRating + NSPopUpButton + + + gapless + NSButton + + + hdVideo + NSPopUpButton + + + imageBrowser + SBImageBrowserView + + + mediaKind + NSPopUpButton + + + podcast + NSButton + + + presetName + NSTextField + + + removeArtwork + NSButton + + + removeTag + NSButton + + + saveWindow + NSWindow + + + setList + NSPopUpButton + + + tagList + NSPopUpButton + + + tagsTableView + SBTableView + + + + IBProjectSource + ./Classes/SBMovieViewController.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 + + {8, 8} + {11, 11} + {10, 3} + {8, 8} + {14, 14} + {15, 15} + + + diff --git a/Classes/PropertyView/English.lproj/SoundView.xib b/Classes/PropertyView/English.lproj/SoundView.xib new file mode 100755 index 0000000..a99988a --- /dev/null +++ b/Classes/PropertyView/English.lproj/SoundView.xib @@ -0,0 +1,1047 @@ + + + + 1060 + 13A603 + 4511 + 1265 + 695.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 4511 + + + NSBox + NSCustomObject + NSCustomView + NSMenu + NSMenuItem + NSPopUpButton + NSPopUpButtonCell + NSSlider + NSSliderCell + NSTabView + NSTabViewItem + NSTextField + NSTextFieldCell + NSView + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + SBSoundViewController + + + FirstResponder + + + NSApplication + + + + 268 + + + + 274 + {{-11, -12}, {502, 279}} + + + + + + 1 + + + 274 + + + + 45 + + + + 274 + + + + 268 + {{58, 153}, {48, 14}} + + + + YES + + 68157504 + 272761856 + Volume: + + .LucidaGrandeUI + 11 + 3100 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + NO + 1 + + + + 268 + {{111, 146}, {210, 17}} + + + + YES + + -2080374784 + 131072 + + + + 200 + 0.0 + 100 + 0.0 + 1 + 0 + NO + NO + + NO + + + + 268 + {{13, 103}, {93, 14}} + + + + YES + + 68157504 + 272761856 + Alternate Group: + + + + + + NO + 1 + + + + 268 + {{55, 78}, {51, 14}} + + + + YES + + 68157504 + 272761856 + Fallback: + + + + + + NO + 1 + + + + 268 + {{108, 98}, {87, 22}} + + + + YES + + -2076180416 + 133120 + + + 109199360 + 129 + + + 400 + 75 + + + None + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + + YES + + OtherViews + + + + + 1 + + 1048576 + 2147483647 + + + _popUpItemAction: + 1 + + + + + 2 + + 1048576 + 2147483647 + + + _popUpItemAction: + 2 + + + + + 3 + + 1048576 + 2147483647 + + + _popUpItemAction: + 3 + + + + + 4 + + 1048576 + 2147483647 + + + _popUpItemAction: + 4 + + + + + 5 + + 1048576 + 2147483647 + + + _popUpItemAction: + 5 + + + + + 6 + + 1048576 + 2147483647 + + + _popUpItemAction: + 6 + + + + + 1 + YES + YES + 2 + + NO + + + + 268 + {{108, 73}, {216, 22}} + + + + YES + + -2076180416 + 133120 + + + 109199360 + 129 + + + 400 + 75 + + + None + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + OtherViews + + + + + 1 + YES + YES + 2 + + NO + + + + 268 + {{52, 54}, {54, 14}} + + + + YES + + 68157504 + 272761856 + Subtitles: + + + + + + NO + 1 + + + + 268 + {{108, 49}, {216, 22}} + + + + YES + + -2076180416 + 133120 + + + 109199360 + 129 + + + 400 + 75 + + + None + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + OtherViews + + + + + 1 + YES + YES + 2 + + NO + + + + 268 + {{292, 134}, {32, 11}} + + + + YES + + 68157504 + 272892928 + +6 db + + .LucidaGrandeUI + 9 + 3614 + + + + + + NO + 1 + + + + 268 + {{197, 134}, {34, 11}} + + + + YES + + 68157504 + 272892928 + + 0 db + + + + + + NO + 1 + + + + 268 + {{108, 134}, {32, 11}} + + + + YES + + 68157504 + 272892928 + -∞ db + + + + + + NO + 1 + + + {372, 193} + + + + + + {{55, 23}, {372, 193}} + + + + {0, 0} + + 67108864 + 0 + Box + + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 3 + MCAwLjgwMDAwMDAxAA + + + + 0 + 0 + 0 + NO + + + {{10, 25}, {482, 241}} + + + + + Sound Settings + + + + + + + 134217728 + YES + YES + + + + + + {480, 272} + + + + NSView + + + + NO + + + + view + + + + 4 + + + + alternateGroup + + + + 113 + + + + setAltenateGroup: + + + + 115 + + + + volume + + + + 124 + + + + setTrackVolume: + + + + 125 + + + + fallback + + + + 139 + + + + follows + + + + 148 + + + + setFallbackTrack: + + + + 150 + + + + setFollowsTrack: + + + + 151 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + + + + 5 + + + + + + + + 6 + + + + + + + + 9 + + + + + + + + 36 + + + + + + + + + + + + + + + + + + 10 + + + + + + + + 11 + + + + + 98 + + + + + + + + 99 + + + + + 102 + + + + + + + + 103 + + + + + + + + 104 + + + + + + + + 105 + + + + + + + + + + + + + + 106 + + + + + 107 + + + + + 108 + + + + + 109 + + + + + 110 + + + + + 111 + + + + + 112 + + + + + 114 + + + + + 116 + + + + + + + + 117 + + + + + 118 + + + + + + + + 119 + + + + + 120 + + + + + + + + 121 + + + + + 126 + + + + + + + + 127 + + + + + 128 + + + + + + + + 129 + + + + + + + + 130 + + + + + + + + 135 + + + + + 141 + + + + + + + + 142 + + + + + + + + 143 + + + + + + + + 144 + + + + + + + + 145 + + + + + 146 + + + + + + + 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 + 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 + + + + + + + + + + SBSoundViewController + NSViewController + + id + id + id + id + + + + setAltenateGroup: + id + + + setFallbackTrack: + id + + + setFollowsTrack: + id + + + setTrackVolume: + id + + + + NSPopUpButton + NSPopUpButton + NSPopUpButton + NSSlider + + + + alternateGroup + NSPopUpButton + + + fallback + NSPopUpButton + + + follows + NSPopUpButton + + + volume + NSSlider + + + + IBProjectSource + ./Classes/SBSoundViewController.h + + + + + 0 + IBCocoaFramework + YES + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + {11, 11} + {10, 3} + + + diff --git a/Classes/PropertyView/English.lproj/VideoView.xib b/Classes/PropertyView/English.lproj/VideoView.xib new file mode 100755 index 0000000..62f330b --- /dev/null +++ b/Classes/PropertyView/English.lproj/VideoView.xib @@ -0,0 +1,2384 @@ + + + + 1060 + 13A603 + 4511 + 1265 + 695.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 4511 + + + NSBox + NSButton + NSButtonCell + NSCustomObject + NSCustomView + NSMenu + NSMenuItem + NSNumberFormatter + NSPopUpButton + NSPopUpButtonCell + NSTabView + NSTabViewItem + NSTextField + NSTextFieldCell + NSView + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + SBVideoViewController + + + FirstResponder + + + NSApplication + + + + 268 + + + + 274 + {{-11, -10}, {502, 302}} + + + + + + 1 + + + 274 + + + + 45 + + + + 274 + + + + 268 + {{89, 232}, {72, 14}} + + + + YES + + 68157504 + 272761856 + Normal Size: + + .LucidaGrandeUI + 11 + 3100 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + NO + 1 + + + + 268 + {{221, 232}, {13, 14}} + + + + YES + + 68157504 + 272761856 + x + + + + + + NO + 1 + + + + 268 + {{221, 202}, {13, 14}} + + + + YES + + 68157504 + 272761856 + x + + + + + + NO + 1 + + + + 268 + {{94, 202}, {67, 14}} + + + + YES + + 68157504 + 272761856 + Scaled Size: + + + + + + NO + 1 + + + + 268 + {{166, 178}, {137, 18}} + + + + YES + + -2080374784 + 131072 + Preserve Aspect Ratio + + + 1211912448 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + NO + + + + 268 + {{166, 227}, {50, 19}} + + + + YES + + -2077228991 + 138544128 + + + + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + NO + 1 + + + + 268 + {{166, 200}, {50, 19}} + + + + YES + + -1804599231 + -2008939520 + + + + + + + + + + + # + # + + + + + + NaN + + + + 0 + 0 + YES + NO + 1 + AAAAAAAAAAAAAAAAAAAAAA + + + + 3 + YES + YES + YES + + . + , + NO + NO + NO + + + YES + + + + NO + 1 + + + + 268 + {{239, 227}, {50, 19}} + + + + YES + + -2077228991 + 138544128 + + + + + + + NO + 1 + + + + 268 + {{239, 200}, {50, 19}} + + + + YES + + -1804599231 + -2008939520 + + + + + + + + + # + # + + + + + + NaN + + + + + + 3 + YES + YES + YES + + . + , + NO + NO + NO + + + YES + + + + NO + 1 + + + + 268 + {{221, 119}, {13, 14}} + + + + YES + + 68157504 + 272761856 + x + + + + + + NO + 1 + + + + 268 + {{121, 119}, {40, 14}} + + + + YES + + 68157504 + 272761856 + Offset: + + + + + + NO + 1 + + + + 268 + {{68, 93}, {93, 14}} + + + + YES + + 68157504 + 272761856 + Alternate Group: + + + + + + NO + 1 + + + + 268 + {{166, 117}, {50, 19}} + + + + YES + + -1804599231 + -2008939520 + + + + + + + + + # + # + + + + + + NaN + + + + + + 3 + YES + YES + YES + + . + , + NO + NO + NO + + + YES + + + + NO + 1 + + + + 268 + {{239, 117}, {50, 19}} + + + + YES + + -1804599231 + -2008939520 + + + + + + + + + # + # + + + + + + NaN + + + + + + 3 + YES + YES + YES + + . + , + NO + NO + NO + + + YES + + + + NO + 1 + + + + 268 + {{294, 232}, {36, 14}} + + + + YES + + 68157504 + 272761856 + pixels + + + + + + NO + 1 + + + + 268 + {{294, 202}, {36, 14}} + + + + YES + + 68157504 + 272761856 + pixels + + + + + + NO + 1 + + + + 268 + {{294, 119}, {36, 14}} + + + + YES + + 68157504 + 272761856 + pixels + + + + + + NO + 1 + + + + 268 + {{163, 88}, {70, 22}} + + + + YES + + -2076180416 + 133120 + + + 109199360 + 129 + + + 400 + 75 + + + None + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + + YES + + OtherViews + + + + + 1 + + 1048576 + 2147483647 + + + _popUpItemAction: + 1 + + + + + 2 + + 1048576 + 2147483647 + + + _popUpItemAction: + 2 + + + + + 3 + + 1048576 + 2147483647 + + + _popUpItemAction: + 3 + + + + + 4 + + 1048576 + 2147483647 + + + _popUpItemAction: + 4 + + + + + 5 + + 1048576 + 2147483647 + + + _popUpItemAction: + 5 + + + + + 6 + + 1048576 + 2147483647 + + + _popUpItemAction: + 6 + + + + + 1 + YES + YES + 2 + + NO + + + + 268 + {{17, 68}, {144, 14}} + + + + YES + + 68157504 + 71435264 + H.264 Video Profile/Level: + + + + + + NO + 1 + + + + -2147483380 + {{117, 68}, {44, 14}} + + + + YES + + 68157504 + 71435264 + Forced: + + + + + + NO + 1 + + + + 268 + {{221, 155}, {13, 14}} + + + + YES + + 68157504 + 272761856 + x + + + + + + NO + 1 + + + + 268 + {{86, 155}, {75, 14}} + + + + YES + + 68157504 + 272761856 + Aspect Ratio: + + + + + + NO + 1 + + + + 268 + {{166, 153}, {50, 19}} + + + + YES + + -1804599231 + -2008939520 + + + + + + + + + # + # + + + + + + NaN + + + + + + 3 + YES + YES + YES + + . + , + NO + NO + NO + + + YES + + + + NO + 1 + + + + 268 + {{239, 153}, {50, 19}} + + + + YES + + -1804599231 + 138544128 + + + + + + + + # + # + + + + + + NaN + + + + + + 3 + YES + YES + YES + + . + , + NO + NO + NO + + + YES + + + + NO + 1 + + + + 268 + {{163, 15}, {275, 44}} + + + + YES + + 67108864 + 272760832 + You should only change the video profile if you want to load the file onto one of the devices listed and have been unable to do so. However, if the video file uses advanced features of the codec, then the file may still be unplayable on the device. + + .LucidaGrandeUI + 9 + 3614 + + + + + + NO + 1 + + + + 268 + {{163, 63}, {275, 22}} + + + + YES + + -2076180416 + 133120 + + + 109199360 + 129 + + + 400 + 75 + + + Current profile: unknown + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + 1 + + + YES + + OtherViews + + + + + YES + YES + + + 2147483647 + + + _popUpItemAction: + + + + + Baseline @ 2.1 (iPod classic, iPod nano) + + 1048576 + 2147483647 + + + _popUpItemAction: + 6621 + + + + + Main @ 3.1 (iPhone, iPod touch, iPad, tv) + + 1048576 + 2147483647 + + + _popUpItemAction: + 7731 + + + + + High @ 3.1 + + 2147483647 + + + _popUpItemAction: + 10031 + + + + + High @ 4.1 + + 2147483647 + + + _popUpItemAction: + 10041 + + + + + .LucidaGrandeUI + 13 + 1044 + + + 1 + YES + YES + 2 + + NO + + + + 268 + {{163, 63}, {196, 22}} + + + + _NS:9 + YES + + -1539309504 + 133120 + + _NS:9 + + 109199360 + 129 + + + 400 + 75 + + + No + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + OtherViews + + + + + Some Samples Are Forced + + 1048576 + 2147483647 + + + _popUpItemAction: + 1 + + + + + All Samples Are Forced + + 1048576 + 2147483647 + + + _popUpItemAction: + 2 + + + + + + 1 + YES + YES + 2 + + NO + + + + -2147483380 + {{87, 44}, {74, 14}} + + + + YES + + 68157504 + 272761856 + Forced track: + + + + + + NO + 1 + + + + -2147483380 + {{163, 39}, {196, 22}} + + + + YES + + -2076180416 + 133120 + + + 109199360 + 129 + + + 400 + 75 + + + None + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + OtherViews + + + + + 1 + YES + YES + 2 + + NO + + + {454, 260} + + + + + + {{14, 4}, {454, 260}} + + + + {0, 0} + + 67108864 + 0 + Box + + + + 3 + MCAwLjgwMDAwMDAxAA + + + + 0 + 0 + 0 + NO + + + {{10, 25}, {482, 264}} + + + + + Visual Settings + + + + + + + 134217728 + YES + YES + + + + + + {484, 297} + + + + NSView + + + + NO + + + + trackWidth + + + + 80 + + + + trackHeight + + + + 81 + + + + offsetX + + + + 82 + + + + offsetY + + + + 83 + + + + sampleWidth + + + + 84 + + + + sampleHeight + + + + 85 + + + + setSize: + + + + 91 + + + + setSize: + + + + 92 + + + + setSize: + + + + 93 + + + + setSize: + + + + 94 + + + + alternateGroup + + + + 120 + + + + setAltenateGroup: + + + + 122 + + + + hSpacing + + + + 135 + + + + vSpacing + + + + 136 + + + + setPixelAspect: + + + + 137 + + + + setPixelAspect: + + + + 138 + + + + preserveAspectRatio + + + + 139 + + + + profileLevelUnchanged + + + + 174 + + + + view + + + + 179 + + + + videoProfile + + + + 182 + + + + setProfileLevel: + + + + 184 + + + + forcedSubs + + + + 198 + + + + setForcedSubtitles: + + + + 199 + + + + videoProfileLabel + + + + 200 + + + + forcedSubsLabel + + + + 201 + + + + videoProfileDescription + + + + 202 + + + + forcedLabel + + + + 212 + + + + forced + + + + 214 + + + + setForcedTrack: + + + + 215 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + + + + 5 + + + + + + + + 6 + + + + + + + + 9 + + + + + + + + 36 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 + + + + + + + + 11 + + + + + 16 + + + + + + + + 17 + + + + + 18 + + + + + + + + 19 + + + + + 12 + + + + + + + + 13 + + + + + 14 + + + + + + + + 15 + + + + + 20 + + + + + + + + 21 + + + + + 26 + + + + + + + + 27 + + + + + + + + 22 + + + + + + + + 23 + + + + + 24 + + + + + + + + 25 + + + + + + + + 28 + + + + + + + + 35 + + + + + 29 + + + + + + + + 34 + + + + + 30 + + + + + + + + 33 + + + + + + + + 31 + + + + + + + + 32 + + + + + + + + 76 + + + + + + + + 77 + + + + + 72 + + + + + + + + 73 + + + + + 74 + + + + + + + + 75 + + + + + 90 + + + + + 95 + + + + + 96 + + + + + 97 + + + + + 98 + + + + + + + + 99 + + + + + 110 + + + + + + + + 111 + + + + + + + + 112 + + + + + + + + + + + + + + 113 + + + + + 114 + + + + + 115 + + + + + 116 + + + + + 117 + + + + + 118 + + + + + 119 + + + + + 123 + + + + + + + + 124 + + + + + + + + 125 + + + + + + + + 126 + + + + + + + + 129 + + + + + + + + 130 + + + + + 131 + + + + + + + + 132 + + + + + 133 + + + + + 134 + + + + + 140 + + + + + + + + 151 + + + + + 162 + + + + + + + + 163 + + + + + 166 + + + + + + + + 167 + + + + + + + + 168 + + + + + + + + + + + + + 169 + + + + + 170 + + + + + 171 + + + + + 175 + + + + + 176 + + + + + 185 + + + + + 186 + + + + + + + + 187 + + + + + 188 + + + + + + + + 189 + + + + + + + + 190 + + + + + + + + + + 191 + + + + + 192 + + + + + 193 + + + + + 203 + + + + + + + + 204 + + + + + + + + 205 + + + + + + + + 206 + + + + + + + + 207 + + + + + 208 + + + + + + + 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 + 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 + 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 + 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 + + + + + + + + + + SBVideoViewController + NSViewController + + id + id + id + id + id + id + + + + setAltenateGroup: + id + + + setForcedSubtitles: + id + + + setForcedTrack: + id + + + setPixelAspect: + id + + + setProfileLevel: + id + + + setSize: + id + + + + NSPopUpButton + NSPopUpButton + NSTextField + NSPopUpButton + NSTextField + NSTextField + NSTextField + NSTextField + NSButton + NSMenuItem + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + NSPopUpButton + NSTextField + NSTextField + + + + alternateGroup + NSPopUpButton + + + forced + NSPopUpButton + + + forcedLabel + NSTextField + + + forcedSubs + NSPopUpButton + + + forcedSubsLabel + NSTextField + + + hSpacing + NSTextField + + + offsetX + NSTextField + + + offsetY + NSTextField + + + preserveAspectRatio + NSButton + + + profileLevelUnchanged + NSMenuItem + + + sampleHeight + NSTextField + + + sampleWidth + NSTextField + + + trackHeight + NSTextField + + + trackWidth + NSTextField + + + vSpacing + NSTextField + + + videoProfile + NSPopUpButton + + + videoProfileDescription + NSTextField + + + videoProfileLabel + NSTextField + + + + IBProjectSource + ./Classes/SBVideoViewController.h + + + + + 0 + IBCocoaFramework + YES + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + {11, 11} + {10, 3} + {15, 15} + + + diff --git a/Classes/PropertyView/SBChapterViewController.h b/Classes/PropertyView/SBChapterViewController.h new file mode 100755 index 0000000..ac1298b --- /dev/null +++ b/Classes/PropertyView/SBChapterViewController.h @@ -0,0 +1,28 @@ +// +// ChapterViewController.h +// Subler +// +// Created by Damiano Galassi on 06/02/09. +// Copyright 2009 Damiano Galassi. All rights reserved. +// + +#import +#import +#import + +@class SBTableView; + +@interface SBChapterViewController : NSViewController { + MP42ChapterTrack *track; + + NSDictionary *detailBoldAttr; + + IBOutlet SBTableView *chapterTableView; + IBOutlet NSButton *removeChapter; +} + +- (void) setTrack:(MP42ChapterTrack *)track; +- (IBAction) addChapter: (id) sender; +- (IBAction) removeChapter: (id) sender; + +@end diff --git a/Classes/PropertyView/SBChapterViewController.m b/Classes/PropertyView/SBChapterViewController.m new file mode 100755 index 0000000..e9cb164 --- /dev/null +++ b/Classes/PropertyView/SBChapterViewController.m @@ -0,0 +1,112 @@ +// +// ChapterViewController.m +// Subler +// +// Created by Damiano Galassi on 06/02/09. +// Copyright 2009 Damiano Galassi. All rights reserved. +// + +#import "SBChapterViewController.h" + +#import + +@implementation SBChapterViewController + +- (void)awakeFromNib +{ + NSMutableParagraphStyle * ps = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease]; + [ps setHeadIndent: -10.0]; + [ps setAlignment:NSRightTextAlignment]; + + detailBoldAttr = [[NSDictionary dictionaryWithObjectsAndKeys: + [NSFont boldSystemFontOfSize:11.0], NSFontAttributeName, + ps, NSParagraphStyleAttributeName, + [NSColor grayColor], NSForegroundColorAttributeName, + nil] retain]; +} + +- (void)setTrack:(MP42ChapterTrack *)chapterTrack +{ + track = chapterTrack; +} + +- (NSAttributedString *)boldString:(NSString *)string +{ + return [[[NSAttributedString alloc] initWithString:string attributes:detailBoldAttr] autorelease]; +} + +- (NSInteger)numberOfRowsInTableView:(NSTableView *)t +{ + return [track chapterCount]; +} + +- (id) tableView:(NSTableView *)tableView + objectValueForTableColumn:(NSTableColumn *)tableColumn + row:(NSInteger)rowIndex +{ + MP42TextSample * chapter = [track chapterAtIndex:rowIndex]; + if ([tableColumn.identifier isEqualToString:@"time"]) + return [self boldString:SMPTEStringFromTime(chapter.timestamp, 1000)]; + + if ([tableColumn.identifier isEqualToString:@"title"]) + return chapter.title; + + return nil; +} + +- (void)tableView:(NSTableView *)tableView + setObjectValue:(id)anObject + forTableColumn:(NSTableColumn *)tableColumn + row:(NSInteger)rowIndex +{ + MP42TextSample * chapter = [track chapterAtIndex:rowIndex]; + + if ([tableColumn.identifier isEqualToString:@"title"]) { + if (![chapter.title isEqualToString:anObject]) { + [track setTitle:anObject forChapter:chapter]; + + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + } + } + else if ([tableColumn.identifier isEqualToString:@"time"]) { + MP42Duration timestamp = TimeFromSMPTEString(anObject, 1000); + if (!(chapter.timestamp == timestamp)) { + [track setTimestamp:timestamp forChapter:chapter]; + + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + } + } +} + +- (void)tableViewSelectionDidChange:(NSNotification *)aNotification +{ + if ([chapterTableView selectedRow] != -1) + [removeChapter setEnabled:YES]; + else + [removeChapter setEnabled:NO]; +} + +- (IBAction)removeChapter:(id)sender { + NSUInteger current_index = [chapterTableView selectedRow]; + if (current_index < [track chapterCount]) { + [track removeChapterAtIndex:current_index]; + + [chapterTableView reloadData]; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + } +} + +- (IBAction)addChapter:(id)sender { + [track addChapter:@"Chapter" duration:0]; + + [chapterTableView reloadData]; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; +} + +- (void)dealloc +{ + [detailBoldAttr release]; + [super dealloc]; +} + +@end diff --git a/Classes/PropertyView/SBEmptyViewController.h b/Classes/PropertyView/SBEmptyViewController.h new file mode 100755 index 0000000..b15c999 --- /dev/null +++ b/Classes/PropertyView/SBEmptyViewController.h @@ -0,0 +1,15 @@ +// +// PropertyViewController.h +// Subler +// +// Created by Damiano Galassi on 06/02/09. +// Copyright 2009 Damiano Galassi. All rights reserved. +// + +#import + + +@interface SBEmptyViewController : NSViewController { +} + +@end diff --git a/Classes/PropertyView/SBEmptyViewController.m b/Classes/PropertyView/SBEmptyViewController.m new file mode 100755 index 0000000..8212a1f --- /dev/null +++ b/Classes/PropertyView/SBEmptyViewController.m @@ -0,0 +1,15 @@ +// +// PropertyViewController.m +// Subler +// +// Created by Damiano Galassi on 06/02/09. +// Copyright 2009 Damiano Galassi. All rights reserved. +// + +#import "SBEmptyViewController.h" + + +@implementation SBEmptyViewController + + +@end diff --git a/Classes/PropertyView/SBMovieViewController.h b/Classes/PropertyView/SBMovieViewController.h new file mode 100755 index 0000000..7b0167e --- /dev/null +++ b/Classes/PropertyView/SBMovieViewController.h @@ -0,0 +1,77 @@ +// +// MovieViewController.h +// Subler +// +// Created by Damiano Galassi on 06/02/09. +// Copyright 2009 Damiano Galassi. All rights reserved. +// + +#import +#import + +@class MP42File; +@class MP42Metadata; +@class SBTableView; +@class SBImageBrowserView; + +@interface SBMovieViewController : NSViewController { + MP42Metadata *metadata; + + IBOutlet NSPopUpButton *tagList; + IBOutlet NSPopUpButton *setList; + + IBOutlet SBTableView *tagsTableView; + + IBOutlet NSPopUpButton *mediaKind; + IBOutlet NSPopUpButton *contentRating; + IBOutlet NSPopUpButton *hdVideo; + IBOutlet NSButton *gapless; + IBOutlet NSButton *podcast; + + IBOutlet NSButton *removeTag; + + IBOutlet NSWindow *saveWindow; + IBOutlet NSTextField *presetName; + + NSPopUpButtonCell *ratingCell; + NSComboBoxCell *genreCell; + + NSDictionary *tags; + NSArray *tagsArray; + NSArray *tagsMenu; + NSDictionary *detailBoldAttr; + + NSMutableDictionary *dct; + NSTableColumn *tabCol; + CGFloat width; + + IBOutlet SBImageBrowserView *imageBrowser; + + IBOutlet NSButton *addArtwork; + IBOutlet NSButton *removeArtwork; +} + +- (void) setFile: (MP42File *)file; +- (void) setMetadata: (MP42Metadata *)data; + +- (IBAction) addTag: (id) sender; +- (IBAction) removeTag: (id) sender; + +- (IBAction) addMetadataSet: (id)sender; + +- (IBAction) showSaveSet: (id)sender; +- (IBAction) closeSaveSheet: (id) sender; +- (IBAction) saveSet: (id)sender; + +- (IBAction) changeMediaKind: (id) sender; +- (IBAction) changecContentRating: (id) sender; +- (IBAction) changeGapless: (id) sender; +- (IBAction) changePodcast: (id) sender; +- (IBAction) changehdVideo: (id) sender; + +- (IBAction) zoomSliderDidChange:(id)sender; + +- (IBAction) selectArtwork: (id) sender; +- (IBAction) removeArtwork: (id) sender; + +@end \ No newline at end of file diff --git a/Classes/PropertyView/SBMovieViewController.m b/Classes/PropertyView/SBMovieViewController.m new file mode 100755 index 0000000..f8f9669 --- /dev/null +++ b/Classes/PropertyView/SBMovieViewController.m @@ -0,0 +1,823 @@ +// +// MovieViewController.m +// Subler +// +// Created by Damiano Galassi on 06/02/09. +// Copyright 2009 Damiano Galassi. All rights reserved. +// + +NSString *MetadataPBoardType = @"MetadataPBoardType"; + +#import "SBMovieViewController.h" +#import "SBTableView.h" +#import "SBPresetManager.h" +#import "SBTableView.h" +#import "SBImageBrowserView.h" + +#import +#import +#import + +@interface SBMovieViewController () +- (void) updateSetsMenu: (id)sender; + +@end + +@implementation SBMovieViewController + +- (void)awakeFromNib +{ + [self updateSetsMenu:self]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(updateSetsMenu:) + name:@"SBPresetManagerUpdatedNotification" object:nil]; + + tagsMenu = [[metadata writableMetadata] retain]; + for (id tag in tagsMenu) + [tagList addItemWithTitle:tag]; + + ratingCell = [[NSPopUpButtonCell alloc] init]; + [ratingCell setAutoenablesItems:NO]; + [ratingCell setFont:[NSFont systemFontOfSize:11]]; + [ratingCell setControlSize:NSSmallControlSize]; + [ratingCell setBordered:NO]; + NSArray *ratings = [[MP42Ratings defaultManager] ratings]; + for (NSString *rating in ratings) { + [[ratingCell menu] addItem:[[[NSMenuItem alloc] initWithTitle:rating action:NULL keyEquivalent:@""] autorelease]]; + } + + genreCell = [[NSComboBoxCell alloc] init]; + [genreCell setCompletes:YES]; + [genreCell setFont:[NSFont systemFontOfSize:11]]; + [genreCell setDrawsBackground:NO]; + [genreCell setBezeled:NO]; + [genreCell setButtonBordered:NO]; + [genreCell setControlSize:NSSmallControlSize]; + [genreCell setIntercellSpacing:NSMakeSize(1.0, 1.0)]; + [genreCell setEditable:YES]; + [genreCell addItemsWithObjectValues:[metadata availableGenres]]; + + NSMutableParagraphStyle * ps = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease]; + [ps setHeadIndent: -10.0]; + [ps setAlignment:NSRightTextAlignment]; + + detailBoldAttr = [[NSDictionary dictionaryWithObjectsAndKeys: + [NSFont boldSystemFontOfSize:11.0], NSFontAttributeName, + ps, NSParagraphStyleAttributeName, + [NSColor grayColor], NSForegroundColorAttributeName, + nil] retain]; + + [mediaKind selectItemWithTag:metadata.mediaKind]; + [contentRating selectItemWithTag:metadata.contentRating]; + [hdVideo selectItemWithTag:metadata.hdVideo]; + [gapless setState:metadata.gapless]; + [podcast setState:metadata.podcast]; + + tabCol = [[[tagsTableView tableColumns] objectAtIndex:1] retain]; + width = [tabCol width]; + + [self updateTagsArray]; + + [tagsTableView setDoubleAction:@selector(doubleClickAction:)]; + [tagsTableView setTarget:self]; + [tagsTableView set_pasteboardTypes:[NSArray arrayWithObject:MetadataPBoardType]]; + + dct = [[NSMutableDictionary alloc] init]; + + [imageBrowser set_pasteboardTypes:[NSArray arrayWithObjects: NSPasteboardTypeTIFF, NSPasteboardTypePNG, nil]]; + [imageBrowser setZoomValue:1.0]; + [imageBrowser reloadData]; +} + +- (void) setFile: (MP42File *)file +{ + metadata = file.metadata; + tags = metadata.tagsDict; +} + +- (void) setMetadata: (MP42Metadata *)data +{ + metadata = data; + tags = data.tagsDict; +} + +- (void) updateTagsArray +{ + [tagsArray autorelease]; + NSArray *context = [metadata availableMetadata]; + tagsArray = [[tags allKeys] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) { + NSInteger right = [context indexOfObject:obj2]; + NSInteger left = [context indexOfObject:obj1]; + + if (right < left) + return NSOrderedDescending; + else + return NSOrderedAscending; + }]; + [tagsArray retain]; +} + +- (void) add:(NSDictionary *) data +{ + NSArray *metadataKeys = [data allKeys]; + + for (NSString *key in metadataKeys) { + [metadata setTag:[data valueForKey:key] forKey:key]; + } + NSUndoManager *undo = [[self view] undoManager]; + [[undo prepareWithInvocationTarget:self] remove:data]; + + if (![undo isUndoing]) { + [undo setActionName:@"Insert"]; + } + + [self updateTagsArray]; + [tagsTableView reloadData]; +} + +- (void) remove:(NSDictionary *) data +{ + NSArray *metadataKeys = [data allKeys]; + + for (NSString *key in metadataKeys) { + [metadata removeTagForKey:key]; + } + NSUndoManager *undo = [[self view] undoManager]; + [[undo prepareWithInvocationTarget:self] add:data]; + + if (![undo isUndoing]) { + [undo setActionName:@"Delete"]; + } + + [self updateTagsArray]; + [tagsTableView reloadData]; +} + +- (IBAction) addTag: (id) sender +{ + NSString *tagName = [[sender selectedItem] title]; + + if (![metadata.tagsDict valueForKey:tagName]) + [self add:[NSDictionary dictionaryWithObject:@"" forKey:tagName]]; +} + +- (IBAction) removeTag: (id) sender { + NSIndexSet *rowIndexes = [tagsTableView selectedRowIndexes]; + NSUInteger current_index = [rowIndexes lastIndex]; + NSMutableDictionary *tagDict = [[[NSMutableDictionary alloc] init] autorelease]; + + while (current_index != NSNotFound) { + if ([tagsTableView editedRow] == -1) { + NSString *tagName = [tagsArray objectAtIndex:current_index]; + [tagDict setObject:[metadata.tagsDict valueForKey:tagName] forKey:tagName]; + } + current_index = [rowIndexes indexLessThanIndex: current_index]; + } + [self remove:tagDict]; +} + +- (void) updateMetadata:(id)value forKey:(NSString *)key +{ + NSString *oldValue = [[[metadata tagsDict] valueForKey:key] retain]; + + if ([metadata setTag:value forKey:key]) { + + [tagsTableView noteHeightOfRowsWithIndexesChanged: + [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [tagsTableView numberOfRows])]]; + + NSUndoManager *undo = [[self view] undoManager]; + [[undo prepareWithInvocationTarget:self] updateMetadata:oldValue + forKey:key]; + if (![undo isUndoing]) { + [undo setActionName:@"Editing"]; + } + } + [oldValue release]; +} + +- (NSArray *) allSet +{ + return [metadata writableMetadata]; +} + +- (NSArray *) tvShowSet +{ + return [NSArray arrayWithObjects: @"Name", @"Artist", @"Album", @"Release Date", @"Track #", @"Disk #", @"TV Show", @"TV Episode #", @"TV Network", @"TV Episode ID", @"TV Season", @"Genre", @"Description", @"Long Description", nil]; +} + +- (NSArray *) movieSet +{ + return [NSArray arrayWithObjects: @"Name", @"Artist", @"Album", @"Genre", @"Release Date", @"Track #", @"Disk #", @"Cast", @"Director", @"Screenwriters", @"Genre", @"Description", @"Long Description", @"Rating", @"Copyright", nil]; +} + +- (IBAction) addMetadataSet: (id)sender +{ + NSArray *metadataKeys = nil; + if ([sender tag] == 0) + metadataKeys = [self allSet]; + else if ([sender tag] == 1) { + metadataKeys = [self movieSet]; + metadata.mediaKind = 9; + [mediaKind selectItemWithTag:metadata.mediaKind]; + } + else if ([sender tag] == 2) { + metadataKeys = [self tvShowSet]; + metadata.mediaKind = 10; + [mediaKind selectItemWithTag:metadata.mediaKind]; + } + + NSMutableDictionary *tagDict = [[[NSMutableDictionary alloc] init] autorelease]; + for (NSString *key in metadataKeys) { + if (![[metadata tagsDict] valueForKey:key]) + [tagDict setValue:@"" forKey:key]; + } + + [self add:tagDict]; +} + +- (void) applySet: (id)sender +{ + NSInteger tag = [sender tag]; + SBPresetManager *presetManager = [SBPresetManager sharedManager]; + + MP42Metadata *newTags = [[presetManager presets] objectAtIndex:tag]; + + NSArray *metadataKeys = [[newTags tagsDict] allKeys]; + + NSMutableDictionary *tagDict = [[[NSMutableDictionary alloc] init] autorelease]; + for (NSString *key in metadataKeys) { + [tagDict setValue:[[newTags tagsDict] valueForKey:key] forKey:key]; + } + + [metadata.artworks addObjectsFromArray:newTags.artworks]; + [metadata setIsArtworkEdited:YES]; + [imageBrowser reloadData]; + + metadata.mediaKind = newTags.mediaKind; + [mediaKind selectItemWithTag:metadata.mediaKind]; + + metadata.hdVideo = newTags.hdVideo; + [hdVideo selectItemWithTag:metadata.hdVideo]; + + metadata.gapless = newTags.gapless; + [gapless setState:metadata.gapless]; + + metadata.podcast = newTags.podcast; + [podcast setState:metadata.podcast]; + + metadata.contentRating = newTags.contentRating; + [contentRating selectItemWithTag:metadata.contentRating]; + + [self add:tagDict]; +} + +- (void) updateSetsMenu: (id)sender +{ + SBPresetManager *presetManager = [SBPresetManager sharedManager]; + NSMenu * setListMenu = [setList menu]; + + while ([setListMenu numberOfItems] > 1) + [setListMenu removeItemAtIndex: 1]; + + NSMenuItem *newItem = [[[NSMenuItem alloc] initWithTitle:@"Save Set" action:@selector(showSaveSet:) keyEquivalent:@""] autorelease]; + [newItem setTarget:self]; + [setListMenu addItem:newItem]; + + [setListMenu addItem:[NSMenuItem separatorItem]]; + + newItem = [[[NSMenuItem alloc] initWithTitle:@"All" action:@selector(addMetadataSet:) keyEquivalent:@""] autorelease]; + [newItem setTarget:self]; + [newItem setTag: 0]; + [setListMenu addItem:newItem]; + + newItem = [[[NSMenuItem alloc] initWithTitle:@"Movie" action:@selector(addMetadataSet:) keyEquivalent:@""] autorelease]; + [newItem setTarget:self]; + [newItem setTag: 1]; + [setListMenu addItem:newItem]; + + newItem = [[[NSMenuItem alloc] initWithTitle:@"TV Show" action:@selector(addMetadataSet:) keyEquivalent:@""] autorelease]; + [newItem setTarget:self]; + [newItem setTag: 2]; + [setListMenu addItem:newItem]; + + if ([[presetManager presets] count]) + [setListMenu addItem:[NSMenuItem separatorItem]]; + + NSUInteger i = 0; + + for (MP42Metadata *set in [presetManager presets]) { + newItem = [[NSMenuItem alloc] initWithTitle:[set presetName] action:@selector(applySet:) keyEquivalent:@""]; + if (i < 9) + [newItem setKeyEquivalent:[NSString stringWithFormat:@"%lu", (unsigned long)i+1]]; + + [newItem setTarget:self]; + [newItem setTag:i++]; + + [setListMenu addItem:newItem]; + [newItem release]; + } +} + +- (IBAction) showSaveSet: (id)sender +{ + [NSApp beginSheet:saveWindow modalForWindow:[[self view]window] + modalDelegate:nil didEndSelector:NULL contextInfo:nil]; +} + +- (IBAction) saveSet: (id) sender +{ + SBPresetManager *presetManager = [SBPresetManager sharedManager]; + + [metadata setPresetName:[presetName stringValue]]; + [presetManager newSetFromExistingMetadata: metadata]; + + [NSApp endSheet: saveWindow]; + [saveWindow orderOut:self]; +} + +- (IBAction) closeSaveSheet: (id) sender +{ + [NSApp endSheet: saveWindow]; + [saveWindow orderOut:self]; +} + +/* NSTableView additions for copy & paste and more */ + +- (IBAction)doubleClickAction:(id)sender +{ + // make sure they clicked a real cell and not a header or empty row + if ([sender clickedRow] != -1 && [sender clickedColumn] == 1) { + // edit the cell + [sender editColumn:[sender clickedColumn] + row:[sender clickedRow] + withEvent:nil + select:YES]; + } +} + +- (void)_deleteSelectionFromTableView:(NSTableView *)tableView; +{ + [self removeTag:tableView]; +} + +- (void)_copySelectionFromTableView:(NSTableView *)tableView; +{ + NSPasteboard *pb = [NSPasteboard generalPasteboard]; + NSIndexSet *rowIndexes = [tableView selectedRowIndexes]; + NSUInteger current_index = [rowIndexes lastIndex]; + NSMutableDictionary *data = [[NSMutableDictionary alloc] init]; + NSString *string = @""; + + while (current_index != NSNotFound) { + NSString *tagName = [tagsArray objectAtIndex:current_index]; + NSString *tagValue = [tags objectForKey:tagName]; + string = [string stringByAppendingFormat:@"%@: %@\n",tagName, tagValue]; + [data setValue:tagValue forKey:tagName]; + + current_index = [rowIndexes indexLessThanIndex: current_index]; + } + + NSArray *types = [NSArray arrayWithObjects: + MetadataPBoardType, NSStringPboardType, nil]; + [pb declareTypes:types owner:nil]; + [pb setString:string forType: NSStringPboardType]; + [pb setData:[NSArchiver archivedDataWithRootObject:data] forType:MetadataPBoardType]; + [data release]; +} + +- (void)_cutSelectionFromTableView:(NSTableView *)tableView; +{ + [self _copySelectionFromTableView:tableView]; + [self removeTag:tableView]; +} + +- (void)_pasteToTableView:(NSTableView *)tableView +{ + NSPasteboard *pb = [NSPasteboard generalPasteboard]; + NSData *archivedData = [pb dataForType:MetadataPBoardType]; + NSMutableDictionary *data = [NSUnarchiver unarchiveObjectWithData:archivedData]; + + [self add:data]; +} + +- (void)_pasteToImageBrowserView:(IKImageBrowserView *)ImageBrowserView +{ + NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; + + NSArray *classes = [NSArray arrayWithObjects:[NSURL class], [NSImage class], nil]; + NSDictionary *options = [NSDictionary dictionaryWithObject:[NSImage imageTypes] + forKey:NSPasteboardURLReadingContentsConformToTypesKey]; + NSArray *copiedItems = [pasteboard readObjectsForClasses:classes options:options]; + + if (copiedItems != nil) { + for (id item in copiedItems) + [self addArtwork:item]; + + metadata.isArtworkEdited = YES; + metadata.isEdited = YES; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + [imageBrowser reloadData]; + } +} + +- (NSAttributedString *) boldString: (NSString *) string +{ + return [[[NSAttributedString alloc] initWithString:string attributes:detailBoldAttr] autorelease]; +} + +/* TableView delegate methods */ + +- (NSInteger) numberOfRowsInTableView: (NSTableView *) t +{ + return [[metadata tagsDict] count]; +} + +- (NSCell *)tableView:(NSTableView *)tableView dataCellForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row +{ + NSCell *cell = nil; + NSString *tagName = nil; + if (tableColumn != nil) + tagName= [tagsArray objectAtIndex:row]; + + if ([tableColumn.identifier isEqualToString:@"name"]) { + cell = [tableColumn dataCell]; + } + else if ([tableColumn.identifier isEqualToString:@"value"]) { + if ([tagName isEqualToString:@"Rating"]) { + cell = ratingCell; + } + else if ([tagName isEqualToString:@"Genre"]) { + cell = genreCell; + } + else + cell = [tableColumn dataCell]; + } + else + cell = nil; + + return cell; +} + +- (id) tableView:(NSTableView *)tableView +objectValueForTableColumn:(NSTableColumn *)tableColumn + row:(NSInteger)rowIndex +{ + if ([tableColumn.identifier isEqualToString:@"name"]) + return [self boldString:[tagsArray objectAtIndex:rowIndex]]; + + if ([tableColumn.identifier isEqualToString:@"value"]) + return [tags objectForKey:[tagsArray objectAtIndex:rowIndex]]; + + return nil; +} + +- (void) tableView: (NSTableView *) tableView + setObjectValue: (id) anObject + forTableColumn: (NSTableColumn *) tableColumn + row: (NSInteger) rowIndex +{ + NSString *tagName = [tagsArray objectAtIndex:rowIndex]; + [dct removeAllObjects]; + + if ([tableColumn.identifier isEqualToString:@"value"]) { + [self updateMetadata:anObject forKey:tagName]; + } +} + +- (CGFloat) tableView: (NSTableView *) tableView + heightOfRow: (NSInteger) rowIndex +{ + NSString *key = [tagsArray objectAtIndex:rowIndex]; + CGFloat height; + + if (!(height = [[dct objectForKey:key] floatValue])) { + //calculate new row height + NSRect r = NSMakeRect(0,0,width,1000.0); + NSTextFieldCell *cell = [tabCol dataCellForRow:rowIndex]; + [cell setObjectValue:[tags objectForKey:[tagsArray objectAtIndex:rowIndex]]]; + height = [cell cellSizeForBounds:r].height; // Slow, but we cache it. + [dct setObject:@(height) forKey:key]; + } + + if (height < 14.0) + return 14.0; + else + return height; +} + +- (NSString *) tableView: (NSTableView *) aTableView + toolTipForCell: (NSCell *) aCell + rect: (NSRectPointer) rect + tableColumn: (NSTableColumn *) aTableColumn + row: (NSInteger) row + mouseLocation: (NSPoint) mouseLocation +{ + return nil; +} + +- (void)tableViewColumnDidResize: (NSNotification* )notification +{ + [dct removeAllObjects]; + width = [tabCol width]; + [tagsTableView noteHeightOfRowsWithIndexesChanged: + [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [tagsTableView numberOfRows])]]; +} + +- (void)tableViewSelectionDidChange:(NSNotification *)aNotification +{ + if ([tagsTableView selectedRow] != -1) + [removeTag setEnabled:YES]; + else + [removeTag setEnabled:NO]; +} + +- (IBAction) changeMediaKind: (id) sender +{ + uint8_t tagName = [[sender selectedItem] tag]; + + if (metadata.mediaKind != tagName) { + metadata.mediaKind = tagName; + metadata.isEdited = YES; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + } +} + +- (IBAction) changecContentRating: (id) sender +{ + uint8_t tagName = [[sender selectedItem] tag]; + + if (metadata.contentRating != tagName) { + metadata.contentRating = tagName; + metadata.isEdited = YES; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + } +} + +- (IBAction) changeGapless: (id) sender +{ + uint8_t newValue; + if (sender == gapless) + newValue = [gapless state]; + else { + newValue = ![gapless state]; + [gapless setState:newValue]; + } + + if (metadata.gapless != newValue) { + metadata.gapless = newValue; + metadata.isEdited = YES; + } + + NSUndoManager *undo = [[self view] undoManager]; + [[undo prepareWithInvocationTarget:self] changeGapless: self]; + + if (![undo isUndoing]) { + [undo setActionName:@"Check Gapless"]; + } +} + +- (IBAction) changePodcast: (id) sender +{ + uint8_t newValue; + if (sender == podcast) + newValue = [podcast state]; + else { + newValue = ![podcast state]; + [podcast setState:newValue]; + } + + if (metadata.podcast != newValue) { + metadata.podcast = newValue; + metadata.isEdited = YES; + } + + NSUndoManager *undo = [[self view] undoManager]; + [[undo prepareWithInvocationTarget:self] changePodcast: self]; + + if (![undo isUndoing]) { + [undo setActionName:@"Check Podast"]; + } +} + +- (IBAction) changehdVideo: (id) sender +{ + uint8_t tagName = [[sender selectedItem] tag]; + + if (metadata.hdVideo != tagName) { + metadata.hdVideo = tagName; + metadata.isEdited = YES; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + } +} + +#pragma mark - +#pragma mark IKImageBrowserDataSource + +- (NSUInteger)numberOfItemsInImageBrowser:(IKImageBrowserView *) aBrowser +{ + return [metadata.artworks count]; +} + +- (id)imageBrowser:(IKImageBrowserView *) aBrowser itemAtIndex:(NSUInteger)index +{ + return [metadata.artworks objectAtIndex:index]; +} + +- (BOOL)imageBrowser:(IKImageBrowserView *) aBrowser moveItemsAtIndexes: (NSIndexSet *)indexes toIndex:(NSUInteger)destinationIndex +{ + destinationIndex -= [indexes countOfIndexesInRange:NSMakeRange(0, destinationIndex)];; + + NSArray *objects = [metadata.artworks objectsAtIndexes:indexes]; + [metadata.artworks removeObjectsAtIndexes:indexes]; + + for (id object in [objects reverseObjectEnumerator]) + [metadata.artworks insertObject:object atIndex:destinationIndex]; + + metadata.isEdited = YES; + metadata.isArtworkEdited = YES; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + + return YES; +} + +- (NSUInteger)imageBrowser:(IKImageBrowserView *) aBrowser writeItemsAtIndexes:(NSIndexSet *) itemIndexes toPasteboard:(NSPasteboard *)pasteboard +{ + NSInteger index; + [pasteboard declareTypes:[NSArray arrayWithObject:NSTIFFPboardType] owner:nil]; + + for (index = [itemIndexes lastIndex]; index != NSNotFound; index = [itemIndexes indexLessThanIndex:index]) { + NSArray *representations = [[[metadata.artworks objectAtIndex:index] image] representations]; + NSData *bitmapData = [NSBitmapImageRep representationOfImageRepsInArray:representations + usingType:NSTIFFFileType properties:nil]; + + [pasteboard setData:bitmapData forType:NSTIFFPboardType]; + } + + return [itemIndexes count]; +} + +- (void)imageBrowser:(IKImageBrowserView *) aBrowser removeItemsAtIndexes:(NSIndexSet *) indexes +{ + [metadata.artworks removeObjectsAtIndexes:indexes]; + + metadata.isEdited = YES; + metadata.isArtworkEdited = YES; + + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; +} + +#pragma mark - +#pragma mark IKImageBrowserDelegate + +- (void)imageBrowser:(IKImageBrowserView *) aBrowser cellWasDoubleClickedAtIndex:(NSUInteger) index +{ +} + +- (void)imageBrowserSelectionDidChange:(IKImageBrowserView *) aBrowser +{ + NSIndexSet *rowIndexes = [aBrowser selectionIndexes]; + + if ([rowIndexes count]) + [removeArtwork setEnabled:YES]; + else + [removeArtwork setEnabled:NO]; +} + +- (IBAction) zoomSliderDidChange:(id)sender { + [imageBrowser setZoomValue:[sender floatValue]]; + [imageBrowser setNeedsDisplay:YES]; +} + +- (IBAction) removeArtwork:(id) sender { + NSIndexSet *rowIndexes = [imageBrowser selectionIndexes]; + + metadata.isEdited = YES; + metadata.isArtworkEdited = YES; + + [metadata.artworks removeObjectsAtIndexes: rowIndexes]; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + + [imageBrowser reloadData]; +} + +- (BOOL)addArtwork:(id)item +{ + NSString *type; + NSError *error; + + if ([item isKindOfClass:[NSURL class]]) { + if ([item getResourceValue:&type forKey:NSURLTypeIdentifierKey error:&error]) { + if (UTTypeConformsTo((CFStringRef)type, (CFStringRef)@"public.jpeg")) { + MP42Image *artwork = [[MP42Image alloc] initWithData:[NSData dataWithContentsOfURL:item] type:MP42_ART_JPEG]; + [metadata.artworks addObject:artwork]; + [artwork release]; + } + else { + NSImage * artworkImage = [[NSImage alloc] initWithContentsOfURL:item]; + MP42Image *artwork = [[MP42Image alloc] initWithImage:artworkImage]; + [metadata.artworks addObject:artwork]; + + [artwork release]; + [artworkImage release]; + } + return YES; + } + } + else if ([item isKindOfClass:[NSImage class]]) { + MP42Image *artwork = [[MP42Image alloc] initWithImage:item]; + [metadata.artworks addObject:artwork]; + [artwork release]; + return YES; + } + else if ([item isKindOfClass:[MP42Image class]]) { + [metadata.artworks addObject:item]; + } + + return NO; +} + +- (IBAction)selectArtwork:(id)sender +{ + NSOpenPanel *panel = [NSOpenPanel openPanel]; + panel.allowsMultipleSelection = YES; + panel.canChooseFiles = YES; + panel.canChooseDirectories = NO; + [panel setAllowedFileTypes:[NSArray arrayWithObject:@"public.image"]]; + + [panel beginSheetModalForWindow: [[self view] window] completionHandler:^(NSInteger result) { + if (result == NSFileHandlingPanelOKButton) { + + for (NSURL *url in [panel URLs]) + [self addArtwork:url]; + + metadata.isArtworkEdited = YES; + metadata.isEdited = YES; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + [imageBrowser reloadData]; + } + }]; +} + +- (NSDragOperation)draggingEntered:(id < NSDraggingInfo >)sender +{ + return NSDragOperationGeneric; +} + +- (NSDragOperation)draggingUpdated:(id < NSDraggingInfo >)sender +{ + return NSDragOperationGeneric; +} + +- (BOOL)performDragOperation:(id)sender +{ + BOOL edited = NO; + NSPasteboard *pasteboard = [sender draggingPasteboard]; + + NSArray *classes = [NSArray arrayWithObjects:[NSURL class], [NSImage class], nil]; + NSDictionary *options = [NSDictionary dictionaryWithObject:[NSImage imageTypes] + forKey:NSPasteboardURLReadingContentsConformToTypesKey]; + NSArray *draggedItems = [pasteboard readObjectsForClasses:classes options:options]; + + if (draggedItems) { + for (id dragItem in draggedItems) + edited = [self addArtwork:dragItem]; + + if (edited) { + metadata.isArtworkEdited = YES; + metadata.isEdited = YES; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + [imageBrowser reloadData]; + + return YES; + } + } + + return NO; +} + +- (void)concludeDragOperation:(id < NSDraggingInfo >)sender +{ + [imageBrowser reloadData]; +} + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver: self]; + + [imageBrowser setDataSource:nil]; + [imageBrowser setDelegate:nil]; + [tagsTableView setDataSource:nil]; + [tagsTableView setDelegate:nil]; + + [tagsArray release]; + [tagsMenu release]; + [tabCol release]; + [detailBoldAttr release]; + [ratingCell release]; + [genreCell release]; + [dct release]; + [super dealloc]; +} + +@end diff --git a/Classes/PropertyView/SBSoundViewController.h b/Classes/PropertyView/SBSoundViewController.h new file mode 100755 index 0000000..43afafe --- /dev/null +++ b/Classes/PropertyView/SBSoundViewController.h @@ -0,0 +1,35 @@ +// +// PropertyViewController.h +// Subler +// +// Created by Damiano Galassi on 06/02/09. +// Copyright 2009 Damiano Galassi. All rights reserved. +// + +#import + +@class MP42AudioTrack; +@class MP42File; + +@interface SBSoundViewController : NSViewController { + MP42AudioTrack *track; + MP42File *mp4file; + + NSMutableArray *_fallbacks; + NSMutableArray *_follows; + + IBOutlet NSSlider *volume; + IBOutlet NSPopUpButton *alternateGroup; + IBOutlet NSPopUpButton *fallback; + IBOutlet NSPopUpButton *follows; +} + +- (void)setTrack:(MP42AudioTrack *)soundTrack; +- (void)setFile:(MP42File *)mp4; + +- (IBAction)setTrackVolume:(id)sender; +- (IBAction)setAltenateGroup:(id)sender; +- (IBAction)setFallbackTrack:(id)sender; +- (IBAction)setFollowsTrack:(id)sender; + +@end diff --git a/Classes/PropertyView/SBSoundViewController.m b/Classes/PropertyView/SBSoundViewController.m new file mode 100755 index 0000000..7b646a4 --- /dev/null +++ b/Classes/PropertyView/SBSoundViewController.m @@ -0,0 +1,149 @@ +// +// PropertyViewController.m +// Subler +// +// Created by Damiano Galassi on 06/02/09. +// Copyright 2009 Damiano Galassi. All rights reserved. +// + +#import "SBSoundViewController.h" +#import + +@implementation SBSoundViewController + +- (void)awakeFromNib +{ + [alternateGroup selectItemAtIndex:track.alternate_group]; + + _fallbacks = [[NSMutableArray alloc] init]; + + if ([[track format] isEqualToString:MP42AudioFormatAC3]) { + NSInteger i = 1; + NSInteger selectedItem = 0; + + for (MP42AudioTrack *fileTrack in [mp4file tracksWithMediaType:MP42MediaTypeAudio]) { + if ([[fileTrack format] isEqualToString:MP42AudioFormatAAC]) { + NSMenuItem *newItem = [[[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"%@ - %@ - %@", + fileTrack.Id ? [NSString stringWithFormat:@"%d", fileTrack.Id] : @"na", + fileTrack.name, + fileTrack.language] + action:@selector(setFallbackTrack:) + keyEquivalent:@""] autorelease]; + [newItem setTarget:self]; + [newItem setTag:i]; + [[fallback menu] addItem:newItem]; + [_fallbacks addObject:fileTrack]; + + if (track.fallbackTrack == fileTrack) + selectedItem = i; + + i++; + } + } + [fallback selectItemWithTag:selectedItem]; + } + else { + [fallback setEnabled:NO]; + } + + _follows = [[NSMutableArray alloc] init]; + + NSInteger i = 1; + NSInteger selectedItem = 0; + + for (MP42SubtitleTrack *fileTrack in [mp4file tracksWithMediaType:MP42MediaTypeSubtitle]) { + NSMenuItem *newItem = [[[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"%@ - %@ - %@", + fileTrack.Id ? [NSString stringWithFormat:@"%d", fileTrack.Id] : @"na", + fileTrack.name, + fileTrack.language] + action:@selector(setFollowsTrack:) + keyEquivalent:@""] autorelease]; + [newItem setTarget:self]; + [newItem setTag:i]; + [[follows menu] addItem:newItem]; + [_follows addObject:fileTrack]; + + if (track.followsTrack == fileTrack) + selectedItem = i; + + i++; + } + + [follows selectItemWithTag:selectedItem]; + + [volume setFloatValue:track.volume * 100]; +} + +- (void)setFile:(MP42File *)mp4 +{ + mp4file = mp4; +} + +- (void)setTrack:(MP42AudioTrack *)soundTrack +{ + track = soundTrack; +} + +- (IBAction)setTrackVolume:(id)sender +{ + float value = [sender doubleValue] / 100; + if (track.volume != value) { + track.volume = value; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + } +} + +- (IBAction)setFallbackTrack:(id)sender +{ + NSInteger index = [sender tag]; + + if (index) { + MP42AudioTrack *audioTrack = [_fallbacks objectAtIndex:index-1]; + + if (audioTrack != track.fallbackTrack) { + track.fallbackTrack = audioTrack; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + } + } + else { + track.fallbackTrack = nil; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + } +} + +- (IBAction)setFollowsTrack:(id)sender +{ + NSInteger index = [sender tag]; + + if (index) { + MP42SubtitleTrack *subTrack = [_follows objectAtIndex:index-1]; + + if (subTrack != track.followsTrack) { + track.followsTrack = subTrack; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + } } + else { + track.followsTrack = nil; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + } +} + +- (IBAction)setAltenateGroup:(id)sender +{ + uint8_t tagName = [[sender selectedItem] tag]; + + if (track.alternate_group != tagName) { + track.alternate_group = tagName; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + } +} + +- (void)dealloc +{ + [_fallbacks release]; + [_follows release]; + + [super dealloc]; +} + +@end diff --git a/Classes/PropertyView/SBVideoViewController.h b/Classes/PropertyView/SBVideoViewController.h new file mode 100755 index 0000000..745b032 --- /dev/null +++ b/Classes/PropertyView/SBVideoViewController.h @@ -0,0 +1,62 @@ +// +// PropertyViewController.h +// Subler +// +// Created by Damiano Galassi on 06/02/09. +// Copyright 2009 Damiano Galassi. All rights reserved. +// + +#import + +@class MP42File; +@class MP42VideoTrack; +@class MP42SubtitleTrack; + +@interface SBVideoViewController : NSViewController { + MP42VideoTrack *track; + MP42File *mp4file; + + IBOutlet NSTextField *sampleWidth; + IBOutlet NSTextField *sampleHeight; + + IBOutlet NSTextField *trackWidth; + IBOutlet NSTextField *trackHeight; + + IBOutlet NSTextField *hSpacing; + IBOutlet NSTextField *vSpacing; + + IBOutlet NSTextField *offsetX; + IBOutlet NSTextField *offsetY; + + IBOutlet NSPopUpButton *alternateGroup; + + IBOutlet NSPopUpButton *videoProfile; + IBOutlet NSTextField *videoProfileLabel; + IBOutlet NSTextField *videoProfileDescription; + + IBOutlet NSPopUpButton *forcedSubs; + IBOutlet NSTextField *forcedSubsLabel; + + IBOutlet NSPopUpButton *forced; + IBOutlet NSTextField *forcedLabel; + + IBOutlet NSButton *preserveAspectRatio; + + IBOutlet NSMenuItem *profileLevelUnchanged; + + NSMutableArray *_forced; +} + +- (void)setTrack:(MP42VideoTrack *)videoTrack; +- (void)setFile:(MP42File *)mp4; + +- (IBAction)setSize:(id)sender; +- (IBAction)setPixelAspect:(id)sender; +- (IBAction)setAltenateGroup:(id)sender; + +- (IBAction)setProfileLevel:(id)sender; + +- (IBAction)setForcedSubtitles:(id)sender; +- (IBAction)setForcedTrack:(id)sender; + +@end diff --git a/Classes/PropertyView/SBVideoViewController.m b/Classes/PropertyView/SBVideoViewController.m new file mode 100755 index 0000000..0617290 --- /dev/null +++ b/Classes/PropertyView/SBVideoViewController.m @@ -0,0 +1,320 @@ +// +// PropertyViewController.m +// Subler +// +// Created by Damiano Galassi on 06/02/09. +// Copyright 2009 Damiano Galassi. All rights reserved. +// + +#import "SBVideoViewController.h" +#import + +@implementation SBVideoViewController + +static NSString *getProfileName(uint8_t profile) { + switch (profile) { + case 66: + return @"Baseline"; + case 77: + return @"Main"; + case 88: + return @"Extended"; + case 100: + return @"High"; + case 110: + return @"High 10"; + case 122: + return @"High 4:2:2"; + case 144: + return @"High 4:4:4"; + default: + return @"Unknown profile"; + } +} + +static NSString *getLevelName(uint8_t level) { + switch (level) { + case 10: + case 20: + case 30: + case 40: + case 50: + return [NSString stringWithFormat:@"%u", level/10]; + case 11: + case 12: + case 13: + case 21: + case 22: + case 31: + case 32: + case 41: + case 42: + case 51: + return [NSString stringWithFormat:@"%u.%u", level/10, level % 10]; + default: + return [NSString stringWithFormat:@"unknown level %x", level]; + } +} + +- (void)awakeFromNib +{ + [sampleWidth setStringValue: [NSString stringWithFormat:@"%lld", track.width]]; + [sampleHeight setStringValue: [NSString stringWithFormat:@"%lld", track.height]]; + + [trackWidth setStringValue: [NSString stringWithFormat:@"%d", (uint16_t)track.trackWidth]]; + [trackHeight setStringValue: [NSString stringWithFormat:@"%d", (uint16_t)track.trackHeight]]; + + [hSpacing setStringValue: [NSString stringWithFormat:@"%lld", track.hSpacing]]; + [vSpacing setStringValue: [NSString stringWithFormat:@"%lld", track.vSpacing]]; + + [offsetX setStringValue: [NSString stringWithFormat:@"%d", track.offsetX]]; + [offsetY setStringValue: [NSString stringWithFormat:@"%d", track.offsetY]]; + + [alternateGroup selectItemAtIndex:track.alternate_group]; + + if ([track.format isEqualToString:MP42VideoFormatH264] && track.origProfile && track.origLevel) { + [profileLevelUnchanged setTitle:[NSString stringWithFormat:@"Current profile: %@ @ %@", + getProfileName(track.origProfile), getLevelName(track.origLevel)]]; + if ((track.origProfile == track.newProfile) && (track.origLevel == track.newLevel)) { + [videoProfile selectItemWithTag:1]; + } else { + if ((track.newProfile == 66) && (track.newLevel == 21)) { + [videoProfile selectItemWithTag:6621]; + } else if ((track.newProfile == 77) && (track.newLevel == 31)) { + [videoProfile selectItemWithTag:7731]; + } else if ((track.newProfile == 100) && (track.newLevel == 31)) { + [videoProfile selectItemWithTag:10031]; + } else if ((track.newProfile == 100) && (track.newLevel == 41)) { + [videoProfile selectItemWithTag:10041]; + } + } + } else { + [videoProfile setEnabled:NO]; + [videoProfile setHidden:YES]; + [videoProfileLabel setHidden:YES]; + [videoProfileDescription setHidden:YES]; + } + + if ([track isKindOfClass:[MP42SubtitleTrack class]]) { + [forcedSubs setEnabled:YES]; + [forcedSubs setHidden:NO]; + [forcedSubsLabel setHidden:NO]; + + [forced setHidden:NO]; + [forcedLabel setHidden:NO]; + + MP42SubtitleTrack * subTrack = (MP42SubtitleTrack*)track; + + if (!subTrack.someSamplesAreForced && !subTrack.allSamplesAreForced) { + [forcedSubs selectItemWithTag:0]; + } else if (subTrack.someSamplesAreForced && !subTrack.allSamplesAreForced) { + [forcedSubs selectItemWithTag:1]; + } else if (subTrack.allSamplesAreForced) { + [forcedSubs selectItemWithTag:2]; + } + + _forced = [[NSMutableArray alloc] init]; + + NSInteger i = 1; + NSInteger selectedItem = 0; + for (MP42SubtitleTrack *fileTrack in [mp4file tracksWithMediaType:MP42MediaTypeSubtitle]) { + NSMenuItem *newItem = [[[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"%@ - %@ - %@", + fileTrack.Id ? [NSString stringWithFormat:@"%d", fileTrack.Id] : @"NA", + fileTrack.name, + fileTrack.language] + action:@selector(setForcedTrack:) + keyEquivalent:@""] autorelease]; + [newItem setTarget:self]; + [newItem setTag:i]; + [[forced menu] addItem:newItem]; + [_forced addObject:fileTrack]; + + if (((MP42SubtitleTrack *)track).forcedTrack == fileTrack) + selectedItem = i; + + i++; + } + + [forced selectItemWithTag:selectedItem]; + } + else { + [forcedSubs setEnabled:NO]; + [forcedSubs setHidden:YES]; + [forcedSubsLabel setHidden:YES]; + } +} + +- (void)setTrack:(MP42VideoTrack *)videoTrack +{ + track = videoTrack; +} + +- (void)setFile:(MP42File *)mp4 +{ + mp4file = mp4; +} + +- (IBAction)setSize:(id)sender +{ + NSInteger i; + + if (sender == trackWidth) { + i = [trackWidth integerValue]; + if (track.trackWidth != i) { + if ([preserveAspectRatio state] == NSOnState) { + track.trackHeight = (track.trackHeight / track.trackWidth) * i; + [trackHeight setIntegerValue:track.trackHeight]; + } + track.trackWidth = i; + + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + track.isEdited = YES; + } + } + else if (sender == trackHeight) { + i = [trackHeight integerValue]; + if (track.trackHeight != i) { + track.trackHeight = i; + + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + track.isEdited = YES; + } + } + else if (sender == offsetX) { + i = [offsetX integerValue]; + if (track.offsetX != i) { + track.offsetX = i; + + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + track.isEdited = YES; + } + } + else if (sender == offsetY) { + i = [offsetY integerValue]; + if (track.offsetY != i) { + track.offsetY = i; + + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + track.isEdited = YES; + } + } +} + +- (IBAction)setPixelAspect:(id)sender +{ + NSInteger i; + + if (sender == hSpacing) { + i = [hSpacing integerValue]; + if (track.hSpacing != i) { + track.hSpacing = i; + + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + track.isEdited = YES; + } + } + else if (sender == vSpacing) { + i = [vSpacing integerValue]; + if (track.vSpacing != i) { + track.vSpacing = i; + + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + track.isEdited = YES; + } + } +} + + +- (IBAction)setAltenateGroup:(id)sender +{ + uint8_t tagName = [[sender selectedItem] tag]; + + if (track.alternate_group != tagName) { + track.alternate_group = tagName; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + } +} + +- (IBAction)setProfileLevel:(id)sender +{ + NSInteger tagName = [[sender selectedItem] tag]; + switch (tagName) { + case 1: + track.newProfile = track.origProfile; + track.newLevel = track.origLevel; + return; + case 6621: + track.newProfile = 66; + track.newLevel = 21; + break; + case 7731: + track.newProfile = 77; + track.newLevel = 31; + break; + case 10031: + track.newProfile = 100; + track.newLevel = 31; + break; + case 10041: + track.newProfile = 100; + track.newLevel = 41; + break; + default: + return; + } + + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; +} + +- (IBAction)setForcedSubtitles:(id)sender +{ + if ([track isKindOfClass:[MP42SubtitleTrack class]]) { + MP42SubtitleTrack *subTrack = (MP42SubtitleTrack *)track; + NSInteger tagName = [[sender selectedItem] tag]; + + switch (tagName) { + case 0: + subTrack.someSamplesAreForced = NO; + subTrack.allSamplesAreForced = NO; + break; + case 1: + subTrack.someSamplesAreForced = YES; + subTrack.allSamplesAreForced = NO; + break; + case 2: + subTrack.someSamplesAreForced = YES; + subTrack.allSamplesAreForced = YES; + break; + default: + return; + } + + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + } +} + +- (IBAction)setForcedTrack:(id)sender +{ + NSInteger index = [sender tag]; + + if (index) { + MP42SubtitleTrack *subTrack = [_forced objectAtIndex:index-1]; + + if (subTrack != ((MP42SubtitleTrack *)track).forcedTrack) { + ((MP42SubtitleTrack *)track).forcedTrack = subTrack; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + } + } + else { + ((MP42SubtitleTrack *)track).forcedTrack = nil; + [[[[[self view]window] windowController] document] updateChangeCount:NSChangeDone]; + } +} + +- (void)dealloc +{ + [_forced release]; + [super dealloc]; +} + +@end diff --git a/Classes/SBAppDelegate.h b/Classes/SBAppDelegate.h new file mode 100755 index 0000000..58cb97a --- /dev/null +++ b/Classes/SBAppDelegate.h @@ -0,0 +1,31 @@ +// +// SBAppDelegate.h +// Subler +// +// Created by Damiano Galassi on 29/01/09. +// Copyright 2009 Damiano Galassi. All rights reserved. +// + +#import + +@class SBPrefsController; +@class MP42File; + +@interface SBDocumentController : NSDocumentController + +@end + +@interface SBAppDelegate : NSObject { + SBPrefsController *prefController; + SBDocumentController *documentController; +} + +- (IBAction) showBatchWindow: (id) sender; +- (IBAction) showPrefsWindow: (id) sender; +- (IBAction) donate:(id)sender; +- (IBAction) help:(id)sender; + +- (IBAction) linkDonate: (id) sender; + +@end + diff --git a/Classes/SBAppDelegate.m b/Classes/SBAppDelegate.m new file mode 100755 index 0000000..534b739 --- /dev/null +++ b/Classes/SBAppDelegate.m @@ -0,0 +1,172 @@ +// +// SBAppDelegate.m +// Subler +// +// Created by Damiano Galassi on 29/01/09. +// Copyright 2009 Damiano Galassi. All rights reserved. +// + +#import "SBAppDelegate.h" +#import "SBDocument.h" +#import "SBPresetManager.h" +#import "SBQueueController.h" +#import "SBPrefsController.h" + +#define DONATE_NAG_TIME (60 * 60 * 24 * 7) + +@implementation SBAppDelegate + +- (void)applicationWillFinishLaunching:(NSNotification *)aNotification +{ + documentController = [[SBDocumentController alloc] init]; + + [SBPrefsController registerUserDefaults]; + + if ([[NSUserDefaults standardUserDefaults] valueForKey:@"SBShowQueueWindow"]) + [[SBQueueController sharedManager] showWindow:self]; +} + +- (void)applicationWillTerminate:(NSNotification *)notification { + SBPresetManager *presetManager = [SBPresetManager sharedManager]; + [presetManager savePresets]; + + if ([[[SBQueueController sharedManager] window] isVisible]) + [[NSUserDefaults standardUserDefaults] setValue:@"YES" forKey:@"SBShowQueueWindow"]; + else + [[NSUserDefaults standardUserDefaults] setValue:nil forKey:@"SBShowQueueWindow"]; + + if (![[SBQueueController sharedManager] saveQueueToDisk]) + if ([[NSUserDefaults standardUserDefaults] valueForKey:@"Debug"]) + NSLog(@"Failed to save queue to disk!"); +} + +- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)app +{ + SBQueueStatus status= [[SBQueueController sharedManager] status]; + NSInteger result; + if (status == SBQueueStatusWorking) { + result = NSRunCriticalAlertPanel( + NSLocalizedString(@"Are you sure you want to quit Subler?", nil), + NSLocalizedString(@"Your current queue will be lost. Do you want to quit anyway?", nil), + NSLocalizedString(@"Quit", nil), NSLocalizedString(@"Don't Quit", nil), nil); + + if (result == NSAlertDefaultReturn) + return NSTerminateNow; + else + return NSTerminateCancel; + } + + return NSTerminateNow; +} + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification +{ + BOOL firstLaunch = YES; + + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"FirstLaunch"]) + firstLaunch = NO; + + if (![[NSUserDefaults standardUserDefaults] valueForKey:@"WarningDonate"]) { + NSDate * lastDonateDate = [[NSUserDefaults standardUserDefaults] valueForKey:@"DonateAskDate"]; + const BOOL timePassed = !lastDonateDate || (-1 * [lastDonateDate timeIntervalSinceNow]) >= DONATE_NAG_TIME; + + if (!firstLaunch && timePassed) { + [[NSUserDefaults standardUserDefaults] setValue:[NSDate date] forKey:@"DonateAskDate"]; + + NSAlert * alert = [[NSAlert alloc] init]; + [alert setMessageText: NSLocalizedString(@"Support Subler", "Donation -> title")]; + + NSString * donateMessage = [NSString stringWithFormat: @"%@", + NSLocalizedString(@" A lot of time and effort have gone into development, coding, and refinement." + " If you enjoy using it, please consider showing your appreciation with a donation.", "Donation -> message")]; + + [alert setInformativeText:donateMessage]; + [alert setAlertStyle: NSInformationalAlertStyle]; + + [alert addButtonWithTitle: NSLocalizedString(@"Donate", "Donation -> button")]; + NSButton * noDonateButton = [alert addButtonWithTitle: NSLocalizedString(@"Nope", "Donation -> button")]; + [noDonateButton setKeyEquivalent:@"\e"]; //escape key + + const BOOL allowNeverAgain = lastDonateDate != nil; //hide the "don't show again" check the first time - give them time to try the app + [alert setShowsSuppressionButton:allowNeverAgain]; + if (allowNeverAgain) + [[alert suppressionButton] setTitle:NSLocalizedString(@"Don't ask me about this ever again.", "Donation -> button")]; + + const NSInteger donateResult = [alert runModal]; + if (donateResult == NSAlertFirstButtonReturn) + [self linkDonate:self]; + + if (allowNeverAgain) + [[NSUserDefaults standardUserDefaults] setBool:([[alert suppressionButton] state] != NSOnState) forKey:@"WarningDonate"]; + + [alert release]; + } + } + + if (firstLaunch) + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"FirstLaunch"]; + + [SBQueueController sharedManager]; +} + +- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender +{ + return NO; +} + +- (IBAction) showBatchWindow: (id) sender +{ + [[SBQueueController sharedManager] showWindow:self]; +} + +- (IBAction) showPrefsWindow: (id) sender +{ + if (!prefController) { + prefController = [[SBPrefsController alloc] init]; + } + [prefController showWindow:self]; +} + +- (IBAction) donate:(id)sender +{ + [self linkDonate:sender]; +} + +- (IBAction) help:(id)sender +{ + [[NSWorkspace sharedWorkspace] openURL: [NSURL + URLWithString:@"http://code.google.com/p/subler/wiki/Documentation"]]; +} + +- (IBAction) linkDonate:(id)sender +{ + [[NSWorkspace sharedWorkspace] openURL: [NSURL + URLWithString:@"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=YKZHVC6HG6AFQ&lc=GB&item_name=Subler¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted"]]; +} + +@end + +@implementation SBDocumentController + +- (id) init +{ + return [super init]; +} + +- (id)openDocumentWithContentsOfURL:(NSURL *)absoluteURL display:(BOOL)displayDocument error:(NSError **)outError { + SBDocument *doc = nil; + + if ([[[absoluteURL path] pathExtension] caseInsensitiveCompare: @"mkv"] == NSOrderedSame || + [[[absoluteURL path] pathExtension] caseInsensitiveCompare: @"mka"] == NSOrderedSame || + [[[absoluteURL path] pathExtension] caseInsensitiveCompare: @"mks"] == NSOrderedSame || + [[[absoluteURL path] pathExtension] caseInsensitiveCompare: @"mov"] == NSOrderedSame) { + doc = [self openUntitledDocumentAndDisplay:displayDocument error:outError]; + [doc performSelectorOnMainThread:@selector(showImportSheet:) withObject:[NSArray arrayWithObject:absoluteURL] waitUntilDone:NO]; + return doc; + } + else { + return [super openDocumentWithContentsOfURL:absoluteURL display:displayDocument error:outError]; + } +} + +@end diff --git a/Classes/SBArtworkSelector.h b/Classes/SBArtworkSelector.h new file mode 100755 index 0000000..ba9d1fa --- /dev/null +++ b/Classes/SBArtworkSelector.h @@ -0,0 +1,40 @@ +// +// ArtworkSelector.h +// Subler +// +// Created by Douglas Stebila on 2011/02/03. +// Copyright 2011 Douglas Stebila. All rights reserved. +// + +#import +#import + +@protocol SBArtworkSelectorDelegate +- (void)selectArtworkDone:(NSURL *)url; +@end + +@interface SBArtworkSelector : NSWindowController { + id delegate; + IBOutlet IKImageBrowserView *imageBrowser; + IBOutlet NSSlider *slider; + IBOutlet NSButton *addArtworkButton; + IBOutlet NSButton *loadMoreArtworkButton; + NSMutableArray *imageURLsUnloaded; + NSMutableArray *images; + NSArray *artworkProviderNames; +} + +#pragma mark Initialization +- (instancetype)initWithDelegate:(id )del imageURLs:(NSArray *)imageURLs artworkProviderNames:(NSArray *)artworkProviderNames; + +#pragma mark Load images +- (IBAction) loadMoreArtwork:(id)sender; + +#pragma mark User interface +- (IBAction) zoomSliderDidChange:(id)sender; + +#pragma mark Finishing up +- (IBAction) addArtwork:(id)sender; +- (IBAction) addNoArtwork:(id)sender; + +@end diff --git a/Classes/SBArtworkSelector.m b/Classes/SBArtworkSelector.m new file mode 100755 index 0000000..8cf745a --- /dev/null +++ b/Classes/SBArtworkSelector.m @@ -0,0 +1,175 @@ +// +// ArtworkSelector.m +// Subler +// +// Created by Douglas Stebila on 2011/02/03. +// Copyright 2011 Douglas Stebila. All rights reserved. +// + +#import "SBArtworkSelector.h" +#import "MetadataImporter.h" +#import + +#pragma mark IKImageBrowserItem data source objects + +@interface myImageObject : NSObject{ + NSURL *_url; + NSString *_urlString; + NSString *_artworkProviderName; +} +@end + +@implementation myImageObject + +- (void) dealloc { + [_url release]; + [_urlString release]; + [_artworkProviderName release]; + [super dealloc]; +} + +- (void) setURL:(NSURL *)url { + if(_url != url){ + [_url release]; + [_urlString release]; + _url = [url retain]; + _urlString = [[url absoluteString] retain]; + } +} + +- (NSURL *) url { + return _url; +} + +- (void) setArtworkProviderName:(NSString *)artworkProviderName { + _artworkProviderName = [artworkProviderName retain]; +} + +- (NSString *) imageRepresentationType { + return IKImageBrowserNSDataRepresentationType; +} + +- (id) imageRepresentation { + return [MetadataImporter downloadDataOrGetFromCache:_url]; +} + +- (NSString *) imageUID { + return _urlString; +} + +- (NSString *) imageTitle { + NSArray *a = [_artworkProviderName componentsSeparatedByString:@"|"]; + if ([a count] > 0) { + return [a objectAtIndex:0]; + } + return nil; +} + +- (NSString *) imageSubtitle { + NSArray *a = [_artworkProviderName componentsSeparatedByString:@"|"]; + if ([a count] > 1) { + return [a objectAtIndex:1]; + } + return nil; +} + +@end + +#pragma mark - + +@implementation SBArtworkSelector + +#pragma mark Initialization + +- (instancetype)initWithDelegate:(id )del imageURLs:(NSArray *)imageURLs artworkProviderNames:(NSArray *)aArtworkProviderNames { + if ((self = [super initWithWindowNibName:@"ArtworkSelector"])) { + delegate = del; + imageURLsUnloaded = [[NSMutableArray alloc] initWithArray:imageURLs]; + artworkProviderNames = [aArtworkProviderNames retain]; + } + return self; +} + +#pragma mark Load images + +- (void)awakeFromNib { + images = [[NSMutableArray alloc] initWithCapacity:[imageURLsUnloaded count]]; + myImageObject *m; + for (int i = 0; (i < 10) && ([imageURLsUnloaded count] > 0); i++) { + m = [[myImageObject alloc] init]; + [m setURL:[imageURLsUnloaded objectAtIndex:0]]; + [m setArtworkProviderName:[artworkProviderNames objectAtIndex:[images count]]]; + [imageURLsUnloaded removeObjectAtIndex:0]; + [images addObject:m]; + [m release]; + } + [loadMoreArtworkButton setEnabled:([imageURLsUnloaded count] > 0)]; + [imageBrowser reloadData]; + [imageBrowser setSelectionIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO]; +} + +- (IBAction) loadMoreArtwork:(id)sender { + myImageObject *m; + for (int i = 0; (i < 10) && ([imageURLsUnloaded count] > 0); i++) { + m = [[myImageObject alloc] init]; + [m setURL:[imageURLsUnloaded objectAtIndex:0]]; + [m setArtworkProviderName:[artworkProviderNames objectAtIndex:[images count]]]; + [imageURLsUnloaded removeObjectAtIndex:0]; + [images addObject:m]; + [m release]; + } + [loadMoreArtworkButton setEnabled:([imageURLsUnloaded count] > 0)]; + [imageBrowser reloadData]; +} + +#pragma mark User interface + +- (IBAction) zoomSliderDidChange:(id)sender { + [imageBrowser setZoomValue:[slider floatValue]]; + [imageBrowser setNeedsDisplay:YES]; +} + +#pragma mark Finishing up + +- (IBAction) addArtwork:(id)sender { + [delegate performSelector:@selector(selectArtworkDone:) withObject:[[[imageBrowser selectionIndexes] retain] autorelease]]; +} + +- (IBAction) addNoArtwork:(id)sender { + [delegate performSelector:@selector(selectArtworkDone:) withObject:nil]; +} + +- (void) dealloc { + [images release]; + [imageURLsUnloaded release]; + [artworkProviderNames release]; + [super dealloc]; +} + +#pragma mark - +#pragma mark IKImageBrowserDataSource + +- (NSUInteger) numberOfItemsInImageBrowser:(IKImageBrowserView *) aBrowser { + return [images count]; +} + +- (id) imageBrowser:(IKImageBrowserView *) aBrowser itemAtIndex:(NSUInteger)index { + return [images objectAtIndex:index]; +} + +#pragma mark - +#pragma mark IKImageBrowserDelegate + +- (void) imageBrowser:(IKImageBrowserView *) aBrowser cellWasDoubleClickedAtIndex:(NSUInteger) index { + [self addArtwork:nil]; +} + +- (void) imageBrowserSelectionDidChange:(IKImageBrowserView *) aBrowser { + if ([[aBrowser selectionIndexes] count]) { + [addArtworkButton setEnabled:YES]; + } else { + [addArtworkButton setEnabled:NO]; + } +} + +@end diff --git a/Classes/SBDocument.h b/Classes/SBDocument.h new file mode 100755 index 0000000..161507e --- /dev/null +++ b/Classes/SBDocument.h @@ -0,0 +1,74 @@ +// +// SBDocument.h +// Subler +// +// Created by Damiano Galassi on 29/01/09. +// Copyright Damiano Galassi 2009 . All rights reserved. +// + +#import + +@class MP42File; + +@interface SBDocument : NSDocument { + MP42File *mp4File; + IBOutlet NSWindow *documentWindow; + + IBOutlet NSTableView *fileTracksTable; + IBOutlet NSSplitView *splitView; + + IBOutlet NSWindow *savingWindow; + IBOutlet NSTextField *saveOperationName; + + NSSavePanel *_currentSavePanel; + IBOutlet NSView *saveView; + IBOutlet NSPopUpButton *fileFormat; + IBOutlet NSProgressIndicator *optBar; + + IBOutlet NSToolbarItem *addTracks; + IBOutlet NSToolbarItem *deleteTrack; + IBOutlet NSToolbarItem *searchMetadata; + IBOutlet NSToolbarItem *sendToQueue; + + NSMutableArray *languages; + + NSViewController *propertyView; + IBOutlet NSView *targetView; + id importWindow; + + IBOutlet NSWindow *offsetWindow; + IBOutlet NSTextField *offset; + + IBOutlet NSButton *cancelSave; + IBOutlet NSButton *_64bit_data; + IBOutlet NSButton *_64bit_time; + BOOL _optimize; +} + +- (IBAction)selectFile:(id)sender; +- (IBAction)deleteTrack:(id)sender; +- (IBAction)sendToQueue:(id)sender; +- (IBAction)searchMetadata:(id)sender; + +- (IBAction)showTrackOffsetSheet:(id)sender; +- (IBAction)setTrackOffset:(id)sender; +- (IBAction)closeOffsetSheet:(id)sender; + +- (IBAction)setSaveFormat:(id)sender; +- (IBAction)cancelSaveOperation:(id)sender; +- (IBAction)sendToExternalApp:(id)sender; + +- (IBAction)saveAndOptimize:(id)sender; + +- (IBAction)selectMetadataFile:(id)sender; +- (IBAction)addChaptersEvery:(id)sender; +- (IBAction)iTunesFriendlyTrackGroups:(id)sender; + +- (IBAction)export:(id)sender; + +- (void)showImportSheet:(NSArray *)fileURLs; + +- (MP42File *)mp4File; +- (void)setMp4File:(MP42File *)mp4; + +@end diff --git a/Classes/SBDocument.m b/Classes/SBDocument.m new file mode 100755 index 0000000..5a3aa05 --- /dev/null +++ b/Classes/SBDocument.m @@ -0,0 +1,946 @@ +// +// SBDocument.m +// Subler +// +// Created by Damiano Galassi on 29/01/09. +// Copyright Damiano Galassi 2009 . All rights reserved. +// + +#import "SBDocument.h" +#import "SBQueueController.h" +#import "SBQueueItem.h" +#import "SBFileImport.h" + +#import "SBEmptyViewController.h" +#import "SBMovieViewController.h" +#import "SBVideoViewController.h" +#import "SBSoundViewController.h" +#import "SBChapterViewController.h" + +#import "SBMetadataSearchController.h" +#import "SBArtworkSelector.h" + +#import +#import +#import + +#define SublerTableViewDataType @"SublerTableViewDataType" + +@interface SBDocument () + +@end + +@implementation SBDocument + +- (NSString *)windowNibName +{ + return @"SBDocument"; +} + +- (void)awakeFromNib +{ + if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"rememberWindowSize"] integerValue]) { + [documentWindow setFrameAutosaveName:@"documentSave"]; + [documentWindow setFrameUsingName:@"documentSave"]; + [splitView setAutosaveName:@"splitViewSave"]; + } + + [optBar setUsesThreadedAnimation:NO]; +} + +- (void)windowControllerDidLoadNib:(NSWindowController *)aController +{ + [super windowControllerDidLoadNib:aController]; + + languages = [[[MP42Languages defaultManager] languages] copy]; + + SBMovieViewController *controller = [[SBMovieViewController alloc] initWithNibName:@"MovieView" bundle:nil]; + [controller setFile:mp4File]; + if (controller !=nil){ + propertyView = controller; + [[propertyView view] setAutoresizingMask:( NSViewWidthSizable | NSViewHeightSizable )]; + [[propertyView view] setFrame:[targetView bounds]]; + [targetView addSubview: [propertyView view]]; + } + + [documentWindow recalculateKeyViewLoop]; + + [fileTracksTable registerForDraggedTypes:[NSArray arrayWithObjects:SublerTableViewDataType, nil]]; + [documentWindow registerForDraggedTypes:[NSArray arrayWithObjects: + NSColorPboardType, NSFilenamesPboardType, nil]]; + + _optimize = NO; + + [sendToQueue setImage:[NSImage imageNamed:NSImageNameShareTemplate]]; +} + +- (id)initWithType:(NSString *)typeName error:(NSError **)outError +{ + if (self = [super initWithType:typeName error:outError]) + mp4File = [[MP42File alloc] initWithDelegate:self]; + + return self; +} + ++ (BOOL)canConcurrentlyReadDocumentsOfType:(NSString *)type +{ + return NO; +} + +- (BOOL)isEntireFileLoaded +{ + return NO; +} + +#pragma mark Read methods + +- (void)reloadFile:(NSURL *)absoluteURL +{ + if (absoluteURL) { + MP42File *newFile = [[MP42File alloc] initWithExistingFile:absoluteURL andDelegate:self]; + if (newFile) { + [mp4File autorelease]; + mp4File = newFile; + [fileTracksTable reloadData]; + [self tableViewSelectionDidChange:nil]; + } + else + [self close]; + } +} + +- (BOOL)readFromURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError +{ + mp4File = [[MP42File alloc] initWithExistingFile:absoluteURL andDelegate:self]; + + if ( outError != NULL && !mp4File ) { + *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL]; + + return NO; + } + + return YES; +} + +- (BOOL)revertToContentsOfURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError +{ + [mp4File release]; + mp4File = [[MP42File alloc] initWithExistingFile:absoluteURL andDelegate:self]; + + [fileTracksTable reloadData]; + [self tableViewSelectionDidChange:nil]; + [self updateChangeCount:NSChangeCleared]; + + if ( outError != NULL && !mp4File ) { + *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL]; + + return NO; + } + return YES; +} + ++ (BOOL)autosavesInPlace +{ + return NO; +} + +#pragma mark Save methods + +- (BOOL)saveDidComplete:(NSError **)outError URL:(NSURL *)absoluteURL +{ + [NSApp endSheet: savingWindow]; + [savingWindow orderOut:self]; + [optBar stopAnimation:self]; + + if (*outError) { + [self presentError:*outError + modalForWindow:documentWindow + delegate:nil + didPresentSelector:NULL + contextInfo:NULL]; + + [*outError release]; + } + + [self reloadFile:absoluteURL]; + + return YES; +} + +- (void)endSave:(id)sender { + /* Post an event so our event loop wakes up */ + [NSApp postEvent:[NSEvent otherEventWithType:NSApplicationDefined location:NSZeroPoint modifierFlags:0 timestamp:0 windowNumber:0 context:NULL subtype:0 data1:0 data2:0] atStart:NO]; +} + +- (BOOL)writeSafelyToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName + forSaveOperation:(NSSaveOperationType)saveOperation error:(NSError **)outError; +{ + __block BOOL success = NO; + __block int32_t done = 0; + __block NSError *inError = NULL; + + NSMutableDictionary * attributes = [[NSMutableDictionary alloc] init]; + if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"chaptersPreviewTrack"] boolValue]) + [attributes setObject:@YES forKey:MP42GenerateChaptersPreviewTrack]; + if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"SBOrganizeAlternateGroups"] boolValue]) + [attributes setObject:@YES forKey:MP42OrganizeAlternateGroups]; + + + [optBar setIndeterminate:YES]; + [optBar startAnimation:self]; + [saveOperationName setStringValue:@"Saving…"]; + [NSApp beginSheet:savingWindow modalForWindow:documentWindow + modalDelegate:nil didEndSelector:NULL contextInfo:nil]; + + IOPMAssertionID assertionID; + // Enable sleep assertion + CFStringRef reasonForActivity= CFSTR("Subler Save Operation"); + IOReturn io_success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, + kIOPMAssertionLevelOn, reasonForActivity, &assertionID); + + dispatch_async(dispatch_get_global_queue(0, 0), ^{ + switch (saveOperation) { + case NSSaveOperation: + // movie file already exists, so we'll just update + // the movie resource + success = [mp4File updateMP4FileWithAttributes:attributes error:&inError]; + break; + case NSSaveAsOperation: + if ([_64bit_data state]) [attributes setObject:@YES forKey:MP4264BitData]; + if ([_64bit_time state]) [attributes setObject:@YES forKey:MP4264BitTime]; + success = [mp4File writeToUrl:absoluteURL withAttributes:attributes error:&inError]; + break; + case NSSaveToOperation: + // not implemented + break; + } + if (_optimize) { + [saveOperationName setStringValue:@"Optimizing…"]; + [mp4File optimize]; + _optimize = NO; + } + + done = 1; + [inError retain]; + }); + + while (!done) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + @try { + NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantFuture] inMode:NSDefaultRunLoopMode dequeue:YES]; + if (event) [NSApp sendEvent:event]; + } + @catch (NSException *localException) { + NSLog(@"Exception thrown during save: %@", localException); + } + @finally { + [pool drain]; + } + } + + if (io_success == kIOReturnSuccess) + IOPMAssertionRelease(assertionID); + + *outError = [inError autorelease]; + + [attributes release]; + [self saveDidComplete:outError URL:absoluteURL]; + return success; +} + +- (BOOL)prepareSavePanel:(NSSavePanel *)savePanel +{ + _currentSavePanel = savePanel; + [savePanel setExtensionHidden:NO]; + [savePanel setAccessoryView:saveView]; + + NSArray *formats = [self writableTypesForSaveOperation:NSSaveAsOperation]; + [fileFormat removeAllItems]; + for (id 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"]]]; + + NSString *filename = nil; + for (NSUInteger i = 0; i < [mp4File tracksCount]; i++) { + MP42Track *track = [mp4File trackAtIndex:i]; + if ([track sourceURL]) { + filename = [[[track sourceURL] lastPathComponent] stringByDeletingPathExtension]; + break; + } + } + + if (filename) + [savePanel performSelector:@selector(setNameFieldStringValue:) withObject:filename]; + + if (mp4File.dataSize > 4200000000) + [_64bit_data setState:NSOnState]; + + return YES; +} + +- (IBAction)setSaveFormat:(id)sender +{ + NSString *requiredFileType = nil; + NSInteger index = [sender indexOfSelectedItem]; + switch (index) { + case 0: + requiredFileType = MP42FileTypeM4V; + break; + case 1: + requiredFileType = MP42FileTypeMP4; + break; + case 2: + requiredFileType = MP42FileTypeM4A; + break; + default: + requiredFileType = MP42FileTypeM4V; + break; + } + + [_currentSavePanel setAllowedFileTypes:[NSArray arrayWithObject:requiredFileType]]; + [[NSUserDefaults standardUserDefaults] setObject:requiredFileType forKey:@"SBSaveFormat"]; +} + +- (IBAction)cancelSaveOperation:(id)sender +{ + [cancelSave setEnabled:NO]; + [mp4File cancel]; +} + +- (IBAction)saveAndOptimize:(id)sender +{ + _optimize = YES; + [self saveDocument:sender]; +} + +- (IBAction)sendToExternalApp:(id)sender +{ + /* send to itunes after save */ + NSAppleScript *myScript = [[NSAppleScript alloc] initWithSource: + [NSString stringWithFormat:@"%@%@%@", @"tell application \"iTunes\" to open (POSIX file \"", [[self fileURL] path], @"\")"]]; + + [myScript executeAndReturnError: nil]; + [myScript release]; +} + +#pragma mark Interface validation + +- (void)progressStatus:(CGFloat)progress +{ + dispatch_async(dispatch_get_main_queue(), ^{ + [optBar setIndeterminate:NO]; + [optBar setDoubleValue:progress]; + }); +} + +- (BOOL)validateUserInterfaceItem:(id < NSValidatedUserInterfaceItem >)anItem +{ + SEL action = [anItem action]; + + if (action == @selector(saveDocument:)) + if ([self isDocumentEdited]) + return YES; + + if (action == @selector(saveDocumentAs:)) + return YES; + + if (action == @selector(revertDocumentToSaved:)) + if ([self isDocumentEdited]) + return YES; + + if (action == @selector(saveAndOptimize:)) + if (![self isDocumentEdited] && [mp4File hasFileRepresentation]) + return YES; + + if (action == @selector(selectMetadataFile:)) + return YES; + + if (action == @selector(selectFile:)) + return YES; + + if (action == @selector(deleteTrack:)) + return YES; + + if (action == @selector(searchMetadata:)) + return YES; + + if (action == @selector(sendToQueue:)) + return YES; + + if (action == @selector(sendToExternalApp:)) + return YES; + + if (action == @selector(showTrackOffsetSheet:) && [fileTracksTable selectedRow] != -1) + return YES; + + if (action == @selector(addChaptersEvery:)) + return YES; + + if (action == @selector(iTunesFriendlyTrackGroups:)) + return YES; + + if (action == @selector(export:) && [fileTracksTable selectedRow] != -1) + if ([[mp4File trackAtIndex:[fileTracksTable selectedRow]] respondsToSelector:@selector(exportToURL:error:)] && + [[mp4File trackAtIndex:[fileTracksTable selectedRow]] muxed]) + return YES; + + return NO; +} + +- (BOOL)validateToolbarItem:(NSToolbarItem *)toolbarItem +{ + if (toolbarItem == addTracks) + return YES; + + else if (toolbarItem == deleteTrack) + if ([fileTracksTable selectedRow] != -1 && [NSApp isActive]) + return YES; + + if (toolbarItem == searchMetadata) + return YES; + + if (toolbarItem == sendToQueue) + return YES; + + return NO; +} + +#pragma mark table datasource + +- (NSInteger)numberOfRowsInTableView:(NSTableView *)t +{ + if (!mp4File) + return 0; + + return [mp4File tracksCount]; +} + +- (id)tableView:(NSTableView *)tableView +objectValueForTableColumn:(NSTableColumn *)tableColumn + row:(NSInteger)rowIndex +{ + MP42Track *track = [mp4File trackAtIndex:rowIndex]; + + if (!track) + return nil; + + if ([tableColumn.identifier isEqualToString:@"trackId"]) { + if ([track Id] == 0) + return @"na"; + else + return [NSString stringWithFormat:@"%d", [track Id]]; + } + + if ([tableColumn.identifier isEqualToString:@"trackName"]) + return track.name; + + if ([tableColumn.identifier isEqualToString:@"trackInfo"]) + return track.formatSummary; + + if ([tableColumn.identifier isEqualToString:@"trackEnabled"]) + return @(track.enabled); + + if ([tableColumn.identifier isEqualToString:@"trackDuration"]) + return track.timeString; + + if ([tableColumn.identifier isEqualToString:@"trackLanguage"]) + return track.language; + + return nil; +} + +- (void)tableView:(NSTableView *)tableView + setObjectValue:(id)anObject + forTableColumn:(NSTableColumn *)tableColumn + row:(NSInteger)rowIndex +{ + MP42Track *track = [mp4File trackAtIndex:rowIndex]; + + if ([tableColumn.identifier isEqualToString:@"trackLanguage"]) { + if (![track.language isEqualToString:anObject]) { + track.language = anObject; + [self updateChangeCount:NSChangeDone]; + } + } + else if ([tableColumn.identifier isEqualToString:@"trackName"]) { + if (![track.name isEqualToString:anObject]) { + track.name = anObject; + [self updateChangeCount:NSChangeDone]; + } + } + else if ([tableColumn.identifier isEqualToString:@"trackEnabled"]) { + if (!(track.enabled == [anObject integerValue])) { + track.enabled = [anObject integerValue]; + [self updateChangeCount:NSChangeDone]; + } + } +} + +- (void)tableViewSelectionDidChange:(NSNotification *)aNotification +{ + if ([propertyView view] != nil) + [[propertyView view] removeFromSuperview]; // remove the current view + + [[self undoManager] removeAllActionsWithTarget:propertyView]; // remove the undo items from the dealloced view + + if (propertyView != nil) + [propertyView release]; // remove the current view controller + + NSInteger row = [fileTracksTable selectedRow]; + if (row == -1) + { + SBMovieViewController *controller = [[SBMovieViewController alloc] initWithNibName:@"MovieView" bundle:nil]; + [controller setFile:mp4File]; + if (controller !=nil) + propertyView = controller; + } + else if (row != -1 && [[mp4File trackAtIndex:row] isMemberOfClass:[MP42ChapterTrack class]]) + { + SBChapterViewController *controller = [[SBChapterViewController alloc] initWithNibName:@"ChapterView" bundle:nil]; + [controller setTrack:(MP42ChapterTrack *)[mp4File trackAtIndex:row]]; + if (controller !=nil) + propertyView = controller; + } + else if (row != -1 && [[mp4File trackAtIndex:row] isKindOfClass:[MP42VideoTrack class]]) + { + SBVideoViewController *controller = [[SBVideoViewController alloc] initWithNibName:@"VideoView" bundle:nil]; + [controller setTrack:(MP42VideoTrack *)[mp4File trackAtIndex:row]]; + [controller setFile:mp4File]; + if (controller !=nil) + propertyView = controller; + } + else if (row != -1 && [[mp4File trackAtIndex:row] isKindOfClass:[MP42AudioTrack class]]) + { + SBSoundViewController *controller = [[SBSoundViewController alloc] initWithNibName:@"SoundView" bundle:nil]; + [controller setTrack:(MP42AudioTrack *)[mp4File trackAtIndex:row]]; + [controller setFile:mp4File]; + if (controller !=nil) + propertyView = controller; + } + else + { + SBEmptyViewController *controller = [[SBEmptyViewController alloc] initWithNibName:@"EmptyView" bundle:nil]; + if (controller !=nil) + propertyView = controller; + } + + // embed the current view to our host view + [targetView addSubview: [propertyView view]]; + [documentWindow recalculateKeyViewLoop]; + + // make sure we automatically resize the controller's view to the current window size + [[propertyView view] setFrame: [targetView bounds]]; + [[propertyView view] setAutoresizingMask:( NSViewWidthSizable | NSViewHeightSizable )]; +} + +- (BOOL)tableView:(NSTableView *)tv writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard +{ + // Copy the row numbers to the pasteboard. + if ([[mp4File trackAtIndex:[rowIndexes firstIndex]] muxed]) + return NO; + + NSData *data = [NSKeyedArchiver archivedDataWithRootObject:rowIndexes]; + [pboard declareTypes:[NSArray arrayWithObject:SublerTableViewDataType] owner:self]; + [pboard setData:data forType:SublerTableViewDataType]; + return YES; +} + +- (NSDragOperation)tableView:(NSTableView*)tv + validateDrop:(id )info + proposedRow:(NSInteger)row + proposedDropOperation:(NSTableViewDropOperation)op +{ + if (op == NSTableViewDropAbove && row < [mp4File tracksCount]) { + if(![[mp4File trackAtIndex:row] muxed]) + return NSDragOperationEvery; + } + else if (op == NSTableViewDropAbove && row == [mp4File tracksCount]) + return NSDragOperationEvery; + + return NSDragOperationNone; +} + +- (BOOL)tableView:(NSTableView *)aTableView acceptDrop:(id )info + row:(NSInteger)row dropOperation:(NSTableViewDropOperation)operation +{ + NSPasteboard* pboard = [info draggingPasteboard]; + NSData* rowData = [pboard dataForType:SublerTableViewDataType]; + NSIndexSet* rowIndexes = [NSKeyedUnarchiver unarchiveObjectWithData:rowData]; + NSInteger dragRow = [rowIndexes firstIndex]; + + [mp4File moveTrackAtIndex:dragRow toIndex:row]; + [fileTracksTable reloadData]; + return YES; +} + +- (BOOL)canDragRowsWithIndexes:(NSIndexSet *)rowIndexes atPoint:(NSPoint)mouseDownPoint +{ + return YES; +} + +/* NSComboBoxCell dataSource */ + +- (NSInteger)numberOfItemsInComboBoxCell:(NSComboBoxCell *)comboBoxCell +{ + return [languages count]; +} + +- (id)comboBoxCell:(NSComboBoxCell *)comboBoxCell objectValueForItemAtIndex:(NSInteger)index { + return [languages objectAtIndex:index]; +} + +- (NSUInteger)comboBoxCell:(NSComboBoxCell *)comboBoxCell indexOfItemWithStringValue:(NSString *)string { + return [languages indexOfObject: string]; +} + +#pragma mark Various things + +- (IBAction)sendToQueue:(id)sender +{ + SBQueueController *queue = [SBQueueController sharedManager]; + if ([mp4File hasFileRepresentation]) { + SBQueueItem *item = [SBQueueItem itemWithMP4:mp4File]; + [queue addItem:item]; + [self close]; + } + else { + NSSavePanel * panel = [NSSavePanel savePanel]; + [self prepareSavePanel:panel]; + + [panel setPrompt:@"Send To Queue"]; + + [panel beginSheetModalForWindow:documentWindow completionHandler:^(NSInteger result) { + if (result == NSFileHandlingPanelOKButton) { + NSMutableDictionary *attributes = [[NSMutableDictionary alloc] init]; + if ([_64bit_data state]) [attributes setObject:@YES forKey:MP4264BitData]; + if ([_64bit_time state]) [attributes setObject:@YES forKey:MP4264BitTime]; + + SBQueueItem *item = [SBQueueItem itemWithMP4:mp4File url:[panel URL] attributes:attributes]; + [queue addItem:item]; + + [attributes release]; + [self close]; + } + }]; + } +} + +- (IBAction)searchMetadata:(id)sender +{ + importWindow = [[SBMetadataSearchController alloc] initWithDelegate:self]; + + [NSApp beginSheet:[importWindow window] modalForWindow:documentWindow + modalDelegate:nil didEndSelector:NULL contextInfo:nil]; +} + +- (IBAction)showTrackOffsetSheet:(id)sender +{ + [offset setStringValue:[NSString stringWithFormat:@"%lld", + [[[mp4File tracks] objectAtIndex:[fileTracksTable selectedRow]] startOffset]]]; + + [NSApp beginSheet:offsetWindow modalForWindow:documentWindow + modalDelegate:nil didEndSelector:NULL contextInfo:nil]; +} + +- (IBAction)setTrackOffset:(id)sender +{ + MP42Track *selectedTrack = [[mp4File tracks] objectAtIndex:[fileTracksTable selectedRow]]; + [selectedTrack setStartOffset:[offset integerValue]]; + + [self updateChangeCount:NSChangeDone]; + + [NSApp endSheet: offsetWindow]; + [offsetWindow orderOut:self]; +} + +- (IBAction)closeOffsetSheet:(id)sender +{ + [NSApp endSheet: offsetWindow]; + [offsetWindow orderOut:self]; +} + +- (IBAction)deleteTrack:(id)sender +{ + if ([fileTracksTable selectedRow] == -1 || [fileTracksTable editedRow] != -1) + return; + + [mp4File removeTrackAtIndex:[fileTracksTable selectedRow]]; + + [mp4File organizeAlternateGroups]; + + [fileTracksTable reloadData]; + [self tableViewSelectionDidChange:nil]; + [self updateChangeCount:NSChangeDone]; +} + +// Import tracks from file + +- (void)addChapterTrack:(NSURL *)fileURL +{ + [mp4File addTrack:[MP42ChapterTrack chapterTrackFromFile:fileURL]]; + + [fileTracksTable reloadData]; + [self tableViewSelectionDidChange:nil]; + [self updateChangeCount:NSChangeDone]; +} + +- (IBAction)selectFile:(id)sender +{ + NSOpenPanel *panel = [NSOpenPanel openPanel]; + panel.allowsMultipleSelection = NO; + panel.canChooseFiles = YES; + panel.canChooseDirectories = NO; + [panel setAllowedFileTypes:supportedFileFormat()]; + + [panel beginSheetModalForWindow:documentWindow completionHandler:^(NSInteger result) { + if (result == NSFileHandlingPanelOKButton) { + NSString *fileExtension = [[panel.URLs objectAtIndex: 0] pathExtension]; + + if ([fileExtension caseInsensitiveCompare: @"txt"] == NSOrderedSame) + [self addChapterTrack:[panel.URLs objectAtIndex: 0]]; + else + [self performSelectorOnMainThread:@selector(showImportSheet:) + withObject:panel.URLs waitUntilDone: NO]; + } + }]; +} + +- (void)showImportSheet:(NSArray *)fileURLs +{ + NSError *error = nil; + + importWindow = [[SBFileImport alloc] initWithDelegate:self andFiles:fileURLs error:&error]; + + if (importWindow) + [NSApp beginSheet:[importWindow window] modalForWindow:documentWindow + modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:importWindow]; + else if (error) + [self presentError:error modalForWindow:documentWindow delegate:nil didPresentSelector:NULL contextInfo:nil]; +} + +- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;{ + [importWindow autorelease], importWindow = nil; + + // IKImageBrowserView is a bit problematic, do the refresh at the end of the run loop + dispatch_async(dispatch_get_main_queue(), ^{ + [fileTracksTable reloadData]; + [self tableViewSelectionDidChange:nil]; + }); +} + +- (void)importDoneWithTracks:(NSArray *)tracksToBeImported andMetadata:(MP42Metadata *)metadata +{ + if (tracksToBeImported) { + for (id track in tracksToBeImported) + [mp4File addTrack:track]; + + [self updateChangeCount:NSChangeDone]; + if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"SBOrganizeAlternateGroups"] boolValue]) + [mp4File organizeAlternateGroups]; + } + + if (metadata) { + [mp4File.metadata mergeMetadata:metadata]; + [self updateChangeCount:NSChangeDone]; + } +} + +- (void)metadataImportDone:(MP42Metadata *)metadataToBeImported +{ + if (metadataToBeImported) { + [mp4File.metadata mergeMetadata:metadataToBeImported]; + + 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"]; + + [self updateChangeCount:NSChangeDone]; + } + } + + [NSApp endSheet:[importWindow window]]; + [[importWindow window] orderOut:self]; + [importWindow autorelease], importWindow = nil; + + if (metadataToBeImported) { + [self tableViewSelectionDidChange:nil]; + [self updateChangeCount:NSChangeDone]; + } +} + +- (void)addMetadata:(NSURL *)URL +{ + if ([[URL pathExtension] isEqualToString:@"xml"] || [[URL pathExtension] isEqualToString:@"nfo"]) { + MP42Metadata *xmlMetadata = [[MP42Metadata alloc] initWithFileURL:URL]; + [mp4File.metadata mergeMetadata:xmlMetadata]; + [xmlMetadata release]; + } + else { + MP42File *file = nil; + if ((file = [[MP42File alloc] initWithExistingFile:URL andDelegate:self])) { + [mp4File.metadata mergeMetadata:file.metadata]; + [file release]; + } + } + + [self tableViewSelectionDidChange:nil]; + [self updateChangeCount:NSChangeDone]; +} + +- (IBAction)selectMetadataFile:(id)sender +{ + NSOpenPanel *panel = [NSOpenPanel openPanel]; + panel.allowsMultipleSelection = NO; + panel.canChooseFiles = YES; + panel.canChooseDirectories = NO; + [panel setAllowedFileTypes:[NSArray arrayWithObjects:@"mp4", @"m4v", @"m4a", @"xml", @"nfo", nil]]; + + [panel beginSheetModalForWindow:documentWindow completionHandler:^(NSInteger result) { + if (result == NSFileHandlingPanelOKButton) { + [self addMetadata:[panel URL]]; + } + }]; +} + +- (IBAction)export:(id)sender +{ + NSInteger row = [fileTracksTable selectedRow]; + NSSavePanel * panel = [NSSavePanel savePanel]; + NSString *filename = [[[[self fileURL] path] stringByDeletingPathExtension] lastPathComponent]; + + if (row != -1 && [[mp4File trackAtIndex:row] isKindOfClass:[MP42SubtitleTrack class]]) { + [panel setAllowedFileTypes:[NSArray arrayWithObject: @"srt"]]; + filename = [filename stringByAppendingFormat:@".%@", [[mp4File trackAtIndex:row] language]]; + } + else if (row != -1 ) { + filename = [filename stringByAppendingString:@" - Chapters"]; + [panel setAllowedFileTypes:[NSArray arrayWithObject: @"txt"]]; + } + + [panel setCanSelectHiddenExtension: YES]; + [panel setNameFieldStringValue:filename]; + + [panel beginSheetModalForWindow:documentWindow completionHandler:^(NSInteger result) { + if (result == NSFileHandlingPanelOKButton) { + id track = [mp4File trackAtIndex:[fileTracksTable selectedRow]]; + + if (![track exportToURL: [panel URL] error: nil]) { + NSAlert * alert = [[NSAlert alloc] init]; + [alert addButtonWithTitle: NSLocalizedString(@"OK", "Export alert panel -> button")]; + [alert setMessageText: NSLocalizedString(@"File Could Not Be Saved", "Export alert panel -> title")]; + [alert setInformativeText: [NSString stringWithFormat: + NSLocalizedString(@"There was a problem creating the file \"%@\".", + "Export alert panel -> message"), [[[panel URL] path] lastPathComponent]]]; + [alert setAlertStyle: NSWarningAlertStyle]; + + [alert runModal]; + [alert release]; + } + + } + }]; +} + +- (IBAction)addChaptersEvery:(id)sender +{ + MP42ChapterTrack *chapterTrack = [mp4File chapters]; + NSInteger minutes = [sender tag] * 60 * 1000; + NSInteger i, y = 1; + + if (!chapterTrack) { + chapterTrack = [[MP42ChapterTrack alloc] init]; + [chapterTrack setDuration:mp4File.duration]; + [mp4File addTrack:chapterTrack]; + [chapterTrack release]; + } + + if (minutes) + for (i = 0, y = 1; i < mp4File.duration; i += minutes, y++) { + [chapterTrack addChapter:[NSString stringWithFormat:@"Chapter %ld", (long)y] + duration:i]; + } + else + [chapterTrack addChapter:@"Chapter 1" + duration:mp4File.duration]; + + [fileTracksTable reloadData]; + [self tableViewSelectionDidChange:nil]; + [self updateChangeCount:NSChangeDone]; +} + +- (IBAction)iTunesFriendlyTrackGroups:(id)sender +{ + [mp4File organizeAlternateGroups]; + [fileTracksTable reloadData]; + [self tableViewSelectionDidChange:nil]; + [self updateChangeCount:NSChangeDone]; +} + +// Drag & Drop + +- (NSDragOperation)draggingEntered:(id )sender { + NSPasteboard *pboard = [sender draggingPasteboard]; + NSDragOperation sourceDragMask = [sender draggingSourceOperationMask]; + + if ( [[pboard types] containsObject:NSFilenamesPboardType] ) { + if (sourceDragMask & NSDragOperationCopy) { + return NSDragOperationCopy; + } + } + return NSDragOperationNone; +} + +- (BOOL)performDragOperation:(id )sender { + 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]; + + for (NSURL *file in items) { + if ([[file pathExtension] caseInsensitiveCompare: @"txt"] == NSOrderedSame) + [self addChapterTrack:file]; + else if ([[file pathExtension] caseInsensitiveCompare: @"xml"] == NSOrderedSame || + [[file pathExtension] caseInsensitiveCompare: @"nfo"] == NSOrderedSame) + [self addMetadata:file]; + else if (isFileFormatSupported([file pathExtension])) { + [supItems addObject:file]; + } + } + + if ([supItems count]) + [self showImportSheet:supItems]; + + return YES; + } + return NO; +} + +- (MP42File *)mp4File { + return mp4File; +} + +- (void)setMp4File:(MP42File *)mp4 { + [mp4File autorelease]; + mp4File = [mp4 retain]; + [fileTracksTable reloadData]; + [self tableViewSelectionDidChange:nil]; +} + +- (void)dealloc +{ + [propertyView release]; + [languages release]; + + [mp4File release]; + [super dealloc]; +} + +@end diff --git a/Classes/SBFileImport.h b/Classes/SBFileImport.h new file mode 100755 index 0000000..d721d89 --- /dev/null +++ b/Classes/SBFileImport.h @@ -0,0 +1,38 @@ +// +// FileImport.h +// Subler +// +// Created by Damiano Galassi on 31/01/10. +// Copyright 2010. All rights reserved. +// + +#import + +@class MP42FileImporter; +@class MP42Metadata; + +@protocol SBFileImportDelegate +- (void)importDoneWithTracks:(NSArray *)tracksToBeImported andMetadata:(MP42Metadata *)metadata; +@end + +@interface SBFileImport : NSWindowController { + NSArray *_fileURLs; + NSMutableArray *_fileImporters; + NSMutableArray *_tracks; + + NSMutableArray *_importCheckArray; + NSMutableArray *_actionArray; + + id delegate; + IBOutlet NSTableView *tableView; + IBOutlet NSButton *addTracksButton; + IBOutlet NSButton *importMetadata; + IBOutlet NSProgressIndicator *loadProgressBar; +} + +- (instancetype)initWithDelegate:(id )del andFiles:(NSArray *)files error:(NSError **)outError; + +- (IBAction)closeWindow:(id)sender; +- (IBAction)addTracks:(id)sender; + +@end diff --git a/Classes/SBFileImport.m b/Classes/SBFileImport.m new file mode 100755 index 0000000..8e25a85 --- /dev/null +++ b/Classes/SBFileImport.m @@ -0,0 +1,377 @@ +// +// FileImport.m +// Subler +// +// Created by Damiano Galassi on 31/01/10. +// Copyright 2010. All rights reserved. +// + +#import "SBFileImport.h" +#import +#import +#import + +@implementation SBFileImport + +- (instancetype)initWithDelegate:(id )del andFiles:(NSArray *)files error:(NSError **)outError +{ + if ((self = [super initWithWindowNibName:@"FileImport"])) { + delegate = del; + _fileURLs = [files retain]; + _fileImporters = [[NSMutableArray alloc] initWithCapacity:[files count]]; + _tracks = [[NSMutableArray alloc] init]; + + for (NSURL *file in files) { + MP42FileImporter *importer = [[MP42FileImporter alloc] initWithURL:file error:outError]; + if (importer) { + [_tracks addObject:[file lastPathComponent]]; + [_fileImporters addObject:importer]; + [importer release]; + [_tracks addObjectsFromArray:importer.tracks]; + } + } + } + + return self; +} + +- (void)awakeFromNib +{ + _importCheckArray = [[NSMutableArray alloc] initWithCapacity:[_tracks count]]; + _actionArray = [[NSMutableArray alloc] initWithCapacity:[_tracks count]]; + + for (id object in _tracks) { + if ([object isKindOfClass:[MP42Track class]]) { + if (isTrackMuxable([object format]) || trackNeedConversion([object format])) + [_importCheckArray addObject:@YES]; + else + [_importCheckArray addObject:@NO]; + + if ([[object format] isEqualToString:MP42AudioFormatAC3] && + [[[NSUserDefaults standardUserDefaults] valueForKey:@"SBAudioConvertAC3"] boolValue]) { + if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"SBAudioKeepAC3"] boolValue] && + [object fallbackTrack] == nil) + [_actionArray addObject:@6]; + else if ([object fallbackTrack]) + [_actionArray addObject:@0]; + else + [_actionArray addObject:@([[[NSUserDefaults standardUserDefaults] + valueForKey:@"SBAudioMixdown"] integerValue])]; + } + else if ([[object format] isEqualToString:MP42AudioFormatDTS]) + [_actionArray addObject:@1]; + else if ([[object format] isEqualToString:MP42SubtitleFormatVobSub] && + [[[NSUserDefaults standardUserDefaults] valueForKey:@"SBSubtitleConvertBitmap"] boolValue]) + [_actionArray addObject:@1]; + else if (!trackNeedConversion([object format])) + [_actionArray addObject:@0]; + else if ([object isMemberOfClass:[MP42AudioTrack class]]) + [_actionArray addObject:@([[[NSUserDefaults standardUserDefaults] + valueForKey:@"SBAudioMixdown"] integerValue])]; + else if ([object isMemberOfClass:[MP42ChapterTrack class]]) + [_actionArray addObject:@0]; + else + [_actionArray addObject:@1]; + + } + else { + [_importCheckArray addObject:@YES]; + [_actionArray addObject:@0]; + } + } + + if ([[_fileImporters objectAtIndex:0] metadata]) + [importMetadata setEnabled:YES]; + else + [importMetadata setEnabled:NO]; + + [addTracksButton setEnabled:YES]; +} + +- (NSInteger)numberOfRowsInTableView:(NSTableView *)t +{ + return [_tracks count]; +} + +- (BOOL)tableView:(NSTableView *)tableView isGroupRow:(NSInteger)row +{ + id object = [_tracks objectAtIndex:row]; + if ([object isKindOfClass:[MP42Track class]]) + return NO; + + return YES; +} + +- (NSCell *)tableView:(NSTableView *)tableView dataCellForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex +{ + NSCell *cell = nil; + MP42Track *track = [_tracks objectAtIndex:rowIndex]; + + if ([track isKindOfClass:[MP42Track class]]) { + if ([tableColumn.identifier isEqualToString:@"check"]) { + NSButtonCell *buttonCell = [[NSButtonCell alloc] init]; + [buttonCell setButtonType:NSSwitchButton]; + [buttonCell setControlSize:NSSmallControlSize]; + [buttonCell setTitle:@""]; + + return [buttonCell autorelease]; + } + + if ([tableColumn.identifier isEqualToString:@"trackAction"]) { + NSPopUpButtonCell *actionCell = [[NSPopUpButtonCell alloc] init]; + [actionCell setAutoenablesItems:NO]; + [actionCell setFont:[NSFont systemFontOfSize:11]]; + [actionCell setControlSize:NSSmallControlSize]; + [actionCell setBordered:NO]; + + if ([track isMemberOfClass:[MP42VideoTrack class]]) { + if ([[track.sourceURL pathExtension] caseInsensitiveCompare: @"264"] == NSOrderedSame || + [[track.sourceURL pathExtension] caseInsensitiveCompare: @"h264"] == NSOrderedSame) { + NSInteger i = 0; + NSArray *formatArray = [NSArray arrayWithObjects:@"23.976", @"24", @"25", @"29.97", @"30", @"50", @"59.96", @"60", nil]; + NSInteger tags[8] = {2398, 24, 25, 2997, 30, 50, 5994, 60}; + + for (NSString* format in formatArray) { + NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:format action:NULL keyEquivalent:@""] autorelease]; + [item setTag:tags[i++]]; + [item setEnabled:YES]; + [[actionCell menu] addItem:item]; + } + } + else { + NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:@"Passthru" action:NULL keyEquivalent:@""] autorelease]; + [item setTag:0]; + [item setEnabled:YES]; + [[actionCell menu] addItem:item]; + + if (isTrackMuxable(track.format)) + [item setEnabled:YES]; + else + [item setEnabled:NO]; + } + } + else if ([track isMemberOfClass:[MP42SubtitleTrack class]]) { + NSInteger tag = 0; + NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:@"Passthru" action:NULL keyEquivalent:@""] autorelease]; + [item setTag:tag++]; + if (!trackNeedConversion(track.format)) + [item setEnabled:YES]; + else + [item setEnabled:NO]; + [[actionCell menu] addItem:item]; + + NSArray *formatArray = [NSArray arrayWithObjects:MP42SubtitleFormatTx3g, nil]; + for (NSString* format in formatArray) { + item = [[[NSMenuItem alloc] initWithTitle:format action:NULL keyEquivalent:@""] autorelease]; + [item setTag:tag++]; + [item setEnabled:YES]; + [[actionCell menu] addItem:item]; + } + } + else if ([track isMemberOfClass:[MP42AudioTrack class]]) { + NSInteger tag = 0; + NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:@"Passthru" action:NULL keyEquivalent:@""] autorelease]; + [item setTag:tag++]; + if (!trackNeedConversion(track.format)) + [item setEnabled:YES]; + else + [item setEnabled:NO]; + [[actionCell menu] addItem:item]; + + NSArray *formatArray = [NSArray arrayWithObjects:@"AAC - Dolby Pro Logic II", @"AAC - Dolby Pro Logic", @"AAC - Stereo", @"AAC - Mono", @"AAC - Multi-channel", @"AAC + AC-3", nil]; + for (NSString* format in formatArray) { + item = [[[NSMenuItem alloc] initWithTitle:format action:NULL keyEquivalent:@""] autorelease]; + [item setTag:tag++]; + [item setEnabled:YES]; + [[actionCell menu] addItem:item]; + } + } + else if ([track isMemberOfClass:[MP42ChapterTrack class]]) { + NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:@"Passthru" action:NULL keyEquivalent:@""] autorelease]; + [item setTag:0]; + [item setEnabled:YES]; + [[actionCell menu] addItem:item]; + } + cell = actionCell; + + return [cell autorelease]; + } + } + + return [tableColumn dataCell]; +} + +- (id)tableView:(NSTableView *)tableView + objectValueForTableColumn:(NSTableColumn *)tableColumn + row:(NSInteger)rowIndex +{ + id object = [_tracks objectAtIndex:rowIndex]; + + if (!object) + return nil; + + if ([object isKindOfClass:[MP42Track class]]) { + if( [tableColumn.identifier isEqualToString: @"check"] ) + return [_importCheckArray objectAtIndex:rowIndex]; + + if ([tableColumn.identifier isEqualToString:@"trackId"]) + return [NSString stringWithFormat:@"%d", [object Id]]; + + if ([tableColumn.identifier isEqualToString:@"trackName"]) + return [object name]; + + if ([tableColumn.identifier isEqualToString:@"trackInfo"]) + return [object format]; + + if ([tableColumn.identifier isEqualToString:@"trackDuration"]) + return [object timeString]; + + if ([tableColumn.identifier isEqualToString:@"trackLanguage"]) + return [object language]; + + if ([tableColumn.identifier isEqualToString:@"trackAction"]) + return [_actionArray objectAtIndex:rowIndex]; + } + else if ([tableColumn.identifier isEqualToString:@"trackName"]) + return object; + + return nil; +} + +- (void)tableView:(NSTableView *)tableView + setObjectValue:(id)anObject + forTableColumn:(NSTableColumn *)tableColumn + row:(NSInteger)rowIndex +{ + if ([tableColumn.identifier isEqualToString: @"check"]) + [_importCheckArray replaceObjectAtIndex:rowIndex withObject:anObject]; + if ([tableColumn.identifier isEqualToString:@"trackAction"]) + [_actionArray replaceObjectAtIndex:rowIndex withObject:anObject]; +} + +- (IBAction)closeWindow:(id)sender +{ + [tableView setDelegate:nil]; + [tableView setDataSource:nil]; + [NSApp endSheet:[self window] returnCode:NSOKButton]; + [[self window] orderOut:self]; +} + +- (IBAction)addTracks:(id)sender +{ + NSMutableArray *tracks = [[NSMutableArray alloc] init]; + NSInteger i = 0; + + for (MP42Track *track in _tracks) { + if ([track isKindOfClass:[MP42Track class]]) { + if ([[_importCheckArray objectAtIndex: i] boolValue]) { + NSUInteger conversion = [[_actionArray objectAtIndex:i] integerValue]; + + if ([track isMemberOfClass:[MP42AudioTrack class]]) { + if (conversion == 6) { + MP42AudioTrack *copy = [track copy]; + [copy setNeedConversion:YES]; + [copy setMixdownType:SBDolbyPlIIMixdown]; + + [(MP42AudioTrack *)track setFallbackTrack:copy]; + + [tracks addObject:copy]; + [copy release]; + } + else if (conversion) + [track setNeedConversion:YES]; + + switch (conversion) { + case 6: + [track setEnabled:NO]; + break; + case 5: + [(MP42AudioTrack *)track setMixdownType:nil]; + break; + case 4: + [(MP42AudioTrack *)track setMixdownType:SBMonoMixdown]; + break; + case 3: + [(MP42AudioTrack *)track setMixdownType:SBStereoMixdown]; + break; + case 2: + [(MP42AudioTrack *)track setMixdownType:SBDolbyMixdown]; + break; + case 1: + default: + [(MP42AudioTrack *)track setMixdownType:SBDolbyPlIIMixdown]; + break; + } + } + else if ([track isMemberOfClass:[MP42SubtitleTrack class]]) { + if (conversion) + [track setNeedConversion:YES]; + } + else if ([track isMemberOfClass:[MP42VideoTrack class]]) { + if ([[track.sourceURL pathExtension] caseInsensitiveCompare:@"264"] == NSOrderedSame || + [[track.sourceURL pathExtension] caseInsensitiveCompare:@"h264"] == NSOrderedSame) { + switch(conversion) { + case 0: + [track setId:2398]; + break; + case 1: + [track setId:24]; + break; + case 2: + [track setId:25]; + break; + case 3: + [track setId:2997]; + break; + case 4: + [track setId:30]; + break; + case 5: + [track setId:50]; + break; + case 6: + [track setId:5994]; + break; + case 7: + [track setId:60]; + break; + default: + [track setId:2398]; + break; + } + } + } + + [tracks addObject:track]; + } + } + i++; + } + + MP42Metadata *metadata = nil; + if ([importMetadata state]) + metadata = [[[(MP42FileImporter *)[_fileImporters objectAtIndex:0] metadata] retain] autorelease]; + + [delegate importDoneWithTracks:tracks andMetadata: metadata]; + + [tracks release]; + + [tableView setDelegate:nil]; + [tableView setDataSource:nil]; + [NSApp endSheet:[self window] returnCode:NSOKButton]; + [[self window] orderOut:self]; +} + +- (void)dealloc +{ + [_fileURLs release]; + [_fileImporters release]; + [_tracks release]; + + [_importCheckArray release]; + [_actionArray release]; + + [super dealloc]; +} + +@end diff --git a/Classes/SBImageBrowserView.h b/Classes/SBImageBrowserView.h new file mode 100755 index 0000000..c8ab96e --- /dev/null +++ b/Classes/SBImageBrowserView.h @@ -0,0 +1,22 @@ +// +// SBImageBrowserView.h +// Subler +// +// Created by Damiano Galassi on 02/09/13. +// +// + +#import + +@protocol SBImageBrowserViewDelegate +@optional +- (void)_pasteToImageBrowserView:(IKImageBrowserView *)ImageBrowserView; +@end + +@interface SBImageBrowserView : IKImageBrowserView { + NSArray *_pasteboardTypes; +} + +@property(readwrite, retain) NSArray* _pasteboardTypes; + +@end diff --git a/Classes/SBImageBrowserView.m b/Classes/SBImageBrowserView.m new file mode 100755 index 0000000..026569f --- /dev/null +++ b/Classes/SBImageBrowserView.m @@ -0,0 +1,51 @@ +// +// SBImageBrowserView.m +// Subler +// +// Created by Damiano Galassi on 02/09/13. +// +// + +#import "SBImageBrowserView.h" + +@implementation SBImageBrowserView + +@synthesize _pasteboardTypes; + +- (BOOL)validateMenuItem:(NSMenuItem *)item +{ + id delegate = [self delegate]; + SEL action = [item action]; + + if (action == @selector(paste:)) { + if (![self pasteboardHasSupportedType] || ![delegate respondsToSelector:@selector(_pasteToImageBrowserView:)]) + return NO; + else + return YES; + } + else + return [super validateMenuItem:item]; +} + +- (IBAction)paste:(id)sender +{ + if ([[self delegate] respondsToSelector:@selector(_pasteToImageBrowserView:)]) + [(SBImageBrowserView *)[self delegate] _pasteToImageBrowserView:self]; +} + +- (BOOL)pasteboardHasSupportedType { + // has the pasteboard got a type we support? + NSPasteboard *pb = [NSPasteboard generalPasteboard]; + NSString *bestType = [pb availableTypeFromArray:_pasteboardTypes]; + return (bestType != nil); + + return YES; +} + +- (void)dealloc +{ + [_pasteboardTypes release]; + [super dealloc]; +} + +@end diff --git a/Classes/SBMetadataSearchController.h b/Classes/SBMetadataSearchController.h new file mode 100755 index 0000000..e6dc060 --- /dev/null +++ b/Classes/SBMetadataSearchController.h @@ -0,0 +1,94 @@ +// +// MetadataImportController.h +// Subler +// +// Created by Douglas Stebila on 2011/01/27. +// Copyright 2011 Douglas Stebila. All rights reserved. +// + +#import + +@class SBTableView; +@class SBArtworkSelector; +@class MP42Metadata; + +@protocol SBMetadataSearchControllerDelegate +- (void)metadataImportDone:(MP42Metadata *)metadataToBeImported; +@end + +@interface SBMetadataSearchController : NSWindowController { + id delegate; + NSDictionary *detailBoldAttr; + + IBOutlet NSTabView *searchMode; + + IBOutlet NSTextField *movieName; + IBOutlet NSPopUpButton *movieLanguage; + IBOutlet NSPopUpButton *movieMetadataProvider; + + IBOutlet NSComboBox *tvSeriesName; + NSMutableArray *tvSeriesNameSearchArray; + IBOutlet NSTextField *tvSeasonNum; + IBOutlet NSTextField *tvEpisodeNum; + IBOutlet NSPopUpButton *tvLanguage; + IBOutlet NSPopUpButton *tvMetadataProvider; + + IBOutlet NSButton *searchButton; + id currentSearcher; + + NSArray *resultsArray; + IBOutlet NSTableView *resultsTable; + MP42Metadata *selectedResult; + NSDictionary *selectedResultTags; + NSArray *selectedResultTagsArray; + IBOutlet SBTableView *metadataTable; + + IBOutlet NSButton *addButton; + + id artworkSelectorWindow; + + IBOutlet NSProgressIndicator *progress; + IBOutlet NSTextField *progressText; + +} + +#pragma mark Initialization +- (instancetype)initWithDelegate:(id)del; + +#pragma mark Metadata provider +- (void) createLanguageMenus; +- (void) metadataProvidersSelectDefaultLanguage; +- (IBAction) metadataProviderLanguageSelected:(id)sender; +- (IBAction) metadataProviderSelected:(id)sender; + +#pragma mark Search input fields +- (void) updateSearchButtonVisibility; +- (void) searchTVSeriesNameDone:(NSMutableArray *)seriesArray; + +#pragma mark Search for metadata +- (IBAction) searchForResults:(id)sender; +- (void) searchForResultsDone:(NSArray *)metadataArray; + +#pragma mark Load additional metadata +- (IBAction) loadAdditionalMetadata:(id)sender; +- (void) loadAdditionalMetadataDone:(MP42Metadata *)metadata; + +#pragma mark Select artwork +- (void) selectArtwork; +- (void) selectArtworkDone:(NSIndexSet *)indexes; + +#pragma mark Load artwork +- (void) loadArtworks:(NSIndexSet *)indexes; + +#pragma mark Finishing up +- (void) addMetadata; +- (IBAction) closeWindow: (id) sender; + +#pragma mark Miscellaneous +- (NSAttributedString *) boldString: (NSString *) string; + +#pragma mark Static methods ++ (void) clearRecentSearches; ++ (void) deleteCachedMetadata; + +@end diff --git a/Classes/SBMetadataSearchController.m b/Classes/SBMetadataSearchController.m new file mode 100755 index 0000000..d430984 --- /dev/null +++ b/Classes/SBMetadataSearchController.m @@ -0,0 +1,579 @@ +// +// MetadataImportController.m +// Subler +// +// Created by Douglas Stebila on 2011/01/27. +// Copyright 2011 Douglas Stebila. All rights reserved. +// +#import +#import +#import + +#import + +#import "SBMetadataSearchController.h" +#import "SBArtworkSelector.h" +#import "SBDocument.h" +#import "MetadataImporter.h" + +@interface SBMetadataSearchController () + +@end + +@implementation SBMetadataSearchController + +#pragma mark Initialization + +- (instancetype)initWithDelegate:(id)del +{ + if ((self = [super initWithWindowNibName:@"MetadataSearch"])) { + delegate = del; + + NSMutableParagraphStyle * ps = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease]; + [ps setHeadIndent: -10.0]; + [ps setAlignment:NSRightTextAlignment]; + detailBoldAttr = [[NSDictionary dictionaryWithObjectsAndKeys: + [NSFont boldSystemFontOfSize:[NSFont smallSystemFontSize]], NSFontAttributeName, + ps, NSParagraphStyleAttributeName, + [NSColor grayColor], NSForegroundColorAttributeName, + nil] retain]; + } + + return self; +} + +- (void)windowDidLoad { + + [super windowDidLoad]; + + [[self window] makeFirstResponder:movieName]; + + // metadata provider preferences + [movieMetadataProvider selectItemWithTitle:[[NSUserDefaults standardUserDefaults] valueForKey:@"SBMetadataPreference|Movie"]]; + [tvMetadataProvider selectItemWithTitle:[[NSUserDefaults standardUserDefaults] valueForKey:@"SBMetadataPreference|TV"]]; + [self metadataProviderSelected:movieMetadataProvider]; + [self metadataProviderSelected:tvMetadataProvider]; + + MP42File *mp4File = [((SBDocument *) delegate) mp4File]; + + NSString *filename = nil; + for (NSUInteger i = 0; i < [mp4File tracksCount]; i++) { + MP42Track *track = [mp4File trackAtIndex:i]; + if ([track sourceURL]) { + filename = [[track sourceURL] lastPathComponent]; + break; + } + } + if (!filename) return; + + NSDictionary *parsed = [MetadataImporter parseFilename:filename]; + if (!parsed) return; + + if ([@"movie" isEqualToString:(NSString *) [parsed valueForKey:@"type"]]) { + [searchMode selectTabViewItemAtIndex:0]; + if ([parsed valueForKey:@"title"]) [movieName setStringValue:[parsed valueForKey:@"title"]]; + } else if ([@"tv" isEqualToString:(NSString *) [parsed valueForKey:@"type"]]) { + [searchMode selectTabViewItemAtIndex:1]; + [[self window] makeFirstResponder:tvSeriesName]; + if ([parsed valueForKey:@"seriesName"]) [((NSTextField *) tvSeriesName) setStringValue:[parsed valueForKey:@"seriesName"]]; + if ([parsed valueForKey:@"seasonNum"]) [tvSeasonNum setStringValue:[parsed valueForKey:@"seasonNum"]]; + if ([parsed valueForKey:@"episodeNum"]) [tvEpisodeNum setStringValue:[parsed valueForKey:@"episodeNum"]]; + // just in case this is actually a movie, set the text in the movie field for the user's convenience + [movieName setStringValue:[filename stringByDeletingPathExtension]]; + } + [self updateSearchButtonVisibility]; + if ([searchButton isEnabled]) { + [self searchForResults:nil]; + } + + return; +} + +#pragma mark Metadata provider + +- (void) createLanguageMenus { + [movieLanguage removeAllItems]; + NSArray *langs = [MetadataImporter languagesForProvider:[[movieMetadataProvider selectedItem] title]]; + for (NSString *lang in langs) { + [movieLanguage addItemWithTitle:lang]; + } + [tvLanguage removeAllItems]; + langs = [MetadataImporter languagesForProvider:[[tvMetadataProvider selectedItem] title]]; + for (NSString *lang in langs) { + [tvLanguage addItemWithTitle:lang]; + } +} + +- (void) metadataProvidersSelectDefaultLanguage { + [movieLanguage selectItemWithTitle:[[NSUserDefaults standardUserDefaults] valueForKey:[NSString stringWithFormat:@"SBMetadataPreference|Movie|%@|Language", [[movieMetadataProvider selectedItem] title]]]]; + [tvLanguage selectItemWithTitle:[[NSUserDefaults standardUserDefaults] valueForKey:[NSString stringWithFormat:@"SBMetadataPreference|TV|%@|Language", [[tvMetadataProvider selectedItem] title]]]]; +} + +- (IBAction) metadataProviderLanguageSelected:(id)sender { + if (sender == movieLanguage) { + [[NSUserDefaults standardUserDefaults] setValue:[[movieLanguage selectedItem] title] forKey:[NSString stringWithFormat:@"SBMetadataPreference|Movie|%@|Language", [[movieMetadataProvider selectedItem] title]]]; + } else if (sender == tvLanguage) { + [[NSUserDefaults standardUserDefaults] setValue:[[tvLanguage selectedItem] title] forKey:[NSString stringWithFormat:@"SBMetadataPreference|TV|%@|Language", [[tvMetadataProvider selectedItem] title]]]; + } +} + +- (IBAction) metadataProviderSelected:(id)sender { + if (sender == movieMetadataProvider) { + [[NSUserDefaults standardUserDefaults] setValue:[[movieMetadataProvider selectedItem] title] forKey:@"SBMetadataPreference|Movie"]; + } else if (sender == tvMetadataProvider) { + [[NSUserDefaults standardUserDefaults] setValue:[[tvMetadataProvider selectedItem] title] forKey:@"SBMetadataPreference|TV"]; + } + + [self createLanguageMenus]; + [self metadataProvidersSelectDefaultLanguage]; + [self searchForResults:nil]; +} + +#pragma mark Search input fields + +- (void)updateSearchButtonVisibility { + if ([[[searchMode selectedTabViewItem] label] isEqualToString:@"Movie"]) { + if ([[movieName stringValue] length] > 0) { + [searchButton setEnabled:YES]; + return; + } + } else if ([[[searchMode selectedTabViewItem] label] isEqualToString:@"TV Episode"]) { + if ([[tvSeriesName stringValue] length] > 0) { + if (([[tvSeasonNum stringValue] length] == 0) && ([[tvEpisodeNum stringValue] length] > 0)) { + [searchButton setEnabled:NO]; + return; + } else { + [searchButton setEnabled:YES]; + return; + } + } + } + [searchButton setEnabled:NO]; +} + +- (void)controlTextDidChange:(NSNotification *)aNotification { + [self updateSearchButtonVisibility]; + [addButton setKeyEquivalent:@""]; + [searchButton setKeyEquivalent:@"\r"]; +} + +- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem { + [self updateSearchButtonVisibility]; +} + +- (void) searchTVSeriesNameDone:(NSMutableArray *)seriesArray { + if (tvSeriesNameSearchArray) + [tvSeriesNameSearchArray release]; + + tvSeriesNameSearchArray = [seriesArray retain]; + [tvSeriesNameSearchArray sortUsingSelector:@selector(compare:)]; + [tvSeriesName noteNumberOfItemsChanged]; + [tvSeriesName reloadData]; + + currentSearcher = nil; +} + +#pragma mark Search for results + +- (IBAction) searchForResults: (id) sender { + if (currentSearcher) { + [currentSearcher cancel]; + currentSearcher = nil; + } + + if ([[[searchMode selectedTabViewItem] label] isEqualToString:@"Movie"] && [[movieName stringValue] length]) { + [progress startAnimation:self]; + [progress setHidden:NO]; + [progressText setStringValue:[NSString stringWithFormat:@"Searching %@ for movie information…", + [[movieMetadataProvider selectedItem] title]]]; + [progressText setHidden:NO]; + currentSearcher = [MetadataImporter importerForProvider:[[movieMetadataProvider selectedItem] title]]; + [currentSearcher searchMovie:[movieName stringValue] language:[movieLanguage titleOfSelectedItem] callback:self]; + } else if ([[[searchMode selectedTabViewItem] label] isEqualToString:@"TV Episode"] && [[tvSeriesName stringValue] length]) { + [progress startAnimation:self]; + [progress setHidden:NO]; + [progressText setStringValue:[NSString stringWithFormat:@"Searching %@ for episode information…", + [[tvMetadataProvider selectedItem] title]]]; + [progressText setHidden:NO]; + currentSearcher = [MetadataImporter importerForProvider:[[tvMetadataProvider selectedItem] title]]; + [currentSearcher searchTVSeries:[tvSeriesName stringValue] language:[tvLanguage titleOfSelectedItem] seasonNum:[tvSeasonNum stringValue] episodeNum:[tvEpisodeNum stringValue] callback:self]; + } + else { + // Nothing to search, reset the table view + [resultsArray release]; + resultsArray = nil; + selectedResult = nil; + [resultsTable reloadData]; + [metadataTable reloadData]; + } +} + +- (void) searchForResultsDone:(NSArray *)_resultsArray { + if (resultsArray) + [resultsArray release]; + + [progressText setHidden:YES]; + [progress setHidden:YES]; + [progress stopAnimation:self]; + resultsArray = [_resultsArray retain]; + selectedResult = nil; + [resultsTable reloadData]; + [metadataTable reloadData]; + [self tableViewSelectionDidChange:[NSNotification notificationWithName:@"tableViewSelectionDidChange" object:resultsTable]]; + [[self window] makeFirstResponder:resultsTable]; + currentSearcher = nil; +} + +#pragma mark Load additional metadata + +- (IBAction) loadAdditionalMetadata:(id) sender { + if (currentSearcher) { + [currentSearcher cancel]; + currentSearcher = nil; + } + + [addButton setEnabled:NO]; + if ([[[searchMode selectedTabViewItem] label] isEqualToString:@"Movie"]) { + [progress startAnimation:self]; + [progress setHidden:NO]; + [progressText setStringValue:@"Downloading additional movie metadata…"]; + [progressText setHidden:NO]; + currentSearcher = [MetadataImporter importerForProvider:[[movieMetadataProvider selectedItem] title]]; + [currentSearcher loadMovieMetadata:selectedResult language:[[movieLanguage selectedItem] title] callback:self]; + } else if ([[[searchMode selectedTabViewItem] label] isEqualToString:@"TV Episode"]) { + [progress startAnimation:self]; + [progress setHidden:NO]; + [progressText setStringValue:@"Downloading additional TV metadata…"]; + [progressText setHidden:NO]; + currentSearcher = [MetadataImporter importerForProvider:[[tvMetadataProvider selectedItem] title]]; + [currentSearcher loadTVMetadata:selectedResult language:[[tvLanguage selectedItem] title] callback:self]; + } +} + +- (void) loadAdditionalMetadataDone:(MP42Metadata *)metadata { + [progress setHidden:YES]; + [progressText setHidden:YES]; + [progress stopAnimation:self]; + selectedResult = metadata; + [self selectArtwork]; + currentSearcher = nil; +} + +#pragma mark Select artwork + +- (void) selectArtwork { + if (selectedResult.artworkThumbURLs && [selectedResult.artworkThumbURLs count]) { + if ([selectedResult.artworkThumbURLs count] == 1) { + [self loadArtworks:[NSIndexSet indexSetWithIndex:0]]; + } else { + artworkSelectorWindow = [[SBArtworkSelector alloc] initWithDelegate:self imageURLs:selectedResult.artworkThumbURLs artworkProviderNames:selectedResult.artworkProviderNames]; + [NSApp beginSheet:[artworkSelectorWindow window] modalForWindow:[self window] modalDelegate:nil didEndSelector:NULL contextInfo:nil]; + } + } else { + [self addMetadata]; + } +} + +- (void) selectArtworkDone:(NSIndexSet *)indexes { + [NSApp endSheet:[artworkSelectorWindow window]]; + [[artworkSelectorWindow window] orderOut:self]; + [artworkSelectorWindow autorelease]; artworkSelectorWindow = nil; + + [self loadArtworks:indexes]; +} + +#pragma mark Load artwork + +- (void) loadArtworks:(NSIndexSet *)indexes { + if (indexes) { + [progress startAnimation:self]; + [progress setHidden:NO]; + [progressText setStringValue:@"Downloading artwork…"]; + [progressText setHidden:NO]; + [tvSeriesName setEnabled:NO]; + [tvSeasonNum setEnabled:NO]; + [tvEpisodeNum setEnabled:NO]; + [movieName setEnabled:NO]; + [searchButton setEnabled:NO]; + [resultsTable setEnabled:NO]; + [metadataTable setEnabled:NO]; + + dispatch_async(dispatch_get_global_queue(0, 0), ^{ + dispatch_group_t group = dispatch_group_create(); + + [indexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) { + dispatch_group_async(group, dispatch_get_global_queue(0, 0), ^{ + NSData *artworkData = [MetadataImporter downloadDataOrGetFromCache:[selectedResult.artworkFullsizeURLs objectAtIndex:idx]]; + + // Hack, download smaller iTunes version if big iTunes version is not available + if (!artworkData) { + NSString *provider = [selectedResult.artworkProviderNames objectAtIndex:idx]; + if ([provider isEqualToString:@"iTunes"]) { + NSURL *url = [selectedResult.artworkFullsizeURLs objectAtIndex:idx]; + url = [[url URLByDeletingPathExtension] URLByAppendingPathExtension:@"600x600-75.jpg"]; + artworkData = [MetadataImporter downloadDataOrGetFromCache:url]; + } + } + + // Add artwork to metadata object + if (artworkData && [artworkData length]) { + MP42Image *artwork = [[MP42Image alloc] initWithData:artworkData type:MP42_ART_JPEG]; + dispatch_sync(dispatch_get_main_queue(), ^{ + [selectedResult.artworks addObject:artwork]; + }); + [artwork release]; + } + }); + }]; + + dispatch_group_wait(group, DISPATCH_TIME_FOREVER); + dispatch_release(group); + dispatch_sync(dispatch_get_main_queue(), ^{ + [self addMetadata]; + }); + }); + } + else { + [self addMetadata]; + } +} + +#pragma mark Finishing up + +- (void) addMetadata { + // save TV series name in user preferences + if ([[[searchMode selectedTabViewItem] label] isEqualToString:@"TV Episode"]) { + NSArray *previousTVseries = [[NSUserDefaults standardUserDefaults] arrayForKey:@"Previously used TV series"]; + NSMutableArray *newTVseries; + NSString *formattedTVshowName = [selectedResultTags objectForKey:@"TV Show"]; + if (previousTVseries == nil) { + newTVseries = [NSMutableArray arrayWithCapacity:1]; + [newTVseries addObject:formattedTVshowName]; + [[NSUserDefaults standardUserDefaults] setObject:newTVseries forKey:@"Previously used TV series"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + } else { + if ([previousTVseries indexOfObject:formattedTVshowName] == NSNotFound) { + newTVseries = [NSMutableArray arrayWithArray:previousTVseries]; + [newTVseries addObject:formattedTVshowName]; + [[NSUserDefaults standardUserDefaults] setObject:newTVseries forKey:@"Previously used TV series"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + } + } + } + if ([delegate respondsToSelector:@selector(metadataImportDone:)]) { + [delegate performSelector:@selector(metadataImportDone:) withObject:selectedResult]; + } +} + +- (IBAction) closeWindow: (id) sender +{ + if (currentSearcher) + [currentSearcher cancel]; + + if ([delegate respondsToSelector:@selector(metadataImportDone:)]) { + [delegate performSelector:@selector(metadataImportDone:) withObject:nil]; + } +} + +- (void) dealloc +{ + [detailBoldAttr release]; + + [selectedResultTagsArray release]; + [tvSeriesNameSearchArray release]; + [resultsArray release]; + + if (currentSearcher) { + [currentSearcher cancel]; + } + + [super dealloc]; +} + +#pragma mark - + +#pragma mark Privacy + ++ (void) clearRecentSearches { + [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"Previously used TV series"]; +} + ++ (void) deleteCachedMetadata { + NSString *path = nil; + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); + if ([paths count]) { + NSString *bundleName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"]; + path = [[paths objectAtIndex:0] stringByAppendingPathComponent:bundleName]; + } + NSArray *contents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:nil]; + for (NSString *filename in contents) { + [[NSFileManager defaultManager] removeItemAtPath:[path stringByAppendingPathComponent:filename] error:nil]; + } +} + +#pragma mark Miscellaneous + +- (NSAttributedString *) boldString: (NSString *) string { + return [[[NSAttributedString alloc] initWithString:string attributes:detailBoldAttr] autorelease]; +} + +#pragma mark - + +#pragma mark NSComboBox delegates and protocols + +- (NSString *)comboBox:(NSComboBox *)comboBox completedString:(NSString *)uncompletedString { + if (!uncompletedString || ([uncompletedString length] < 1)) return nil; + if (comboBox == tvSeriesName) { + NSArray *previousTVseries = [[NSUserDefaults standardUserDefaults] arrayForKey:@"Previously used TV series"]; + if (previousTVseries == nil) return nil; + NSEnumerator *previousTVseriesEnum = [previousTVseries objectEnumerator]; + NSString *s; + while ((s = (NSString *) [previousTVseriesEnum nextObject])) { + if ([[s lowercaseString] hasPrefix:[uncompletedString lowercaseString]]) { + return s; + } + } + return nil; + } + return nil; +} + +- (void)comboBoxWillPopUp:(NSNotification *)notification { + if ([notification object] == tvSeriesName) { + if ([[tvSeriesName stringValue] length] == 0) { + [tvSeriesNameSearchArray release]; + tvSeriesNameSearchArray = [[NSMutableArray alloc] initWithArray:[[NSUserDefaults standardUserDefaults] arrayForKey:@"Previously used TV series"]]; + [tvSeriesNameSearchArray sortUsingSelector:@selector(compare:)]; + [tvSeriesName reloadData]; + } else if ([[tvSeriesName stringValue] length] > 3) { + [tvSeriesNameSearchArray release]; + tvSeriesNameSearchArray = [[NSMutableArray alloc] initWithCapacity:1]; + [tvSeriesNameSearchArray addObject:@"searching…"]; + [tvSeriesName reloadData]; + [currentSearcher cancel]; + currentSearcher = [MetadataImporter defaultTVProvider]; + [currentSearcher searchTVSeries:[tvSeriesName stringValue] language:[[tvLanguage selectedItem] title] callback:self]; + } else { + tvSeriesNameSearchArray = nil; + [tvSeriesName reloadData]; + } + } +} + +- (NSInteger)numberOfItemsInComboBox:(NSComboBox *)comboBox { + // for some unknown reason, the number of items displayed won't be correct unless these member variables get accessed + // bug to fix! + //NSLog(@"in numberOfItemsInComboBox; box numberOfVisibleItems = %d, cell numberOfVisibleItems = %d", (int) [comboBox numberOfVisibleItems], (int) [[comboBox cell] numberOfVisibleItems]); + if (comboBox == tvSeriesName) { + if (tvSeriesNameSearchArray != nil) { + return [tvSeriesNameSearchArray count]; + } + } + return 0; +} + +- (id)comboBox:(NSComboBox *)comboBox objectValueForItemAtIndex:(NSInteger)index { + if (comboBox == tvSeriesName) { + if (tvSeriesNameSearchArray != nil) { + return [tvSeriesNameSearchArray objectAtIndex:index]; + } + } + return nil; +} + +#pragma mark - + +#pragma mark NSTableView delegates and protocols + +- (NSInteger) numberOfRowsInTableView:(NSTableView *)tableView { + if (tableView == resultsTable) { + if (resultsArray != nil) { + return [resultsArray count]; + } + } else if (tableView == (NSTableView *) metadataTable) { + if (selectedResult != nil) { + return [selectedResultTagsArray count]; + } + } + return 0; +} + +- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex { + if (tableView == resultsTable) { + if (resultsArray != nil) { + MP42Metadata *result = [resultsArray objectAtIndex:rowIndex]; + if ((result.mediaKind == 10) && ([resultsArray count] > 1)) { // TV show + return [NSString stringWithFormat:@"%@x%@ - %@", [result.tagsDict valueForKey:@"TV Season"], [result.tagsDict valueForKey:@"TV Episode #"], [result.tagsDict valueForKey:@"Name"]]; + } else { + return [result.tagsDict valueForKey:@"Name"]; + } + } + } else if (tableView == (NSTableView *) metadataTable) { + if (selectedResult != nil) { + if ([tableColumn.identifier isEqualToString:@"name"]) { + return [self boldString:[selectedResultTagsArray objectAtIndex:rowIndex]]; + } + if ([tableColumn.identifier isEqualToString:@"value"]) { + return [selectedResultTags objectForKey:[selectedResultTagsArray objectAtIndex:rowIndex]]; + } + } + } + return nil; +} + +static NSInteger sortFunction (id ldict, id rdict, void *context) { + NSComparisonResult rc; + + NSInteger right = [(NSArray*) context indexOfObject:rdict]; + NSInteger left = [(NSArray*) context indexOfObject:ldict]; + + if (right < left) + rc = NSOrderedDescending; + else + rc = NSOrderedAscending; + + return rc; +} + +- (void)tableViewSelectionDidChange:(NSNotification *)aNotification { + if ([aNotification object] == resultsTable || [aNotification object] == metadataTable) { + if (/*resultsArray && */[resultsArray count] > 0) { + selectedResult = [resultsArray objectAtIndex:[resultsTable selectedRow]]; + selectedResultTags = selectedResult.tagsDict; + if (selectedResultTagsArray) [selectedResultTagsArray release]; + selectedResultTagsArray = [[[selectedResultTags allKeys] sortedArrayUsingFunction:sortFunction context:[selectedResult availableMetadata]] retain]; + [metadataTable reloadData]; + [addButton setEnabled:YES]; + [addButton setKeyEquivalent:@"\r"]; + [searchButton setKeyEquivalent:@""]; + } + } else { + [addButton setEnabled:NO]; + [addButton setKeyEquivalent:@""]; + [searchButton setKeyEquivalent:@"\r"]; + } +} + +- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row { + if (tableView != (NSTableView *) metadataTable) return [tableView rowHeight]; + + // It is important to use a constant value when calculating the height. Querying the tableColumn width will not work, since it dynamically changes as the user resizes -- however, we don't get a notification that the user "did resize" it until after the mouse is let go. We use the latter as a hook for telling the table that the heights changed. We must return the same height from this method every time, until we tell the table the heights have changed. Not doing so will quicly cause drawing problems. + NSTableColumn *tableColumnToWrap = (NSTableColumn *) [[tableView tableColumns] objectAtIndex:1]; + NSInteger columnToWrap = [tableView.tableColumns indexOfObject:tableColumnToWrap]; + + // Grab the fully prepared cell with our content filled in. Note that in IB the cell's Layout is set to Wraps. + NSCell *cell = [tableView preparedCellAtColumn:columnToWrap row:row]; + + // See how tall it naturally would want to be if given a restricted with, but unbound height + NSRect constrainedBounds = NSMakeRect(0, 0, [tableColumnToWrap width], CGFLOAT_MAX); + NSSize naturalSize = [cell cellSizeForBounds:constrainedBounds]; + + // Make sure we have a minimum height -- use the table's set height as the minimum. + if (naturalSize.height > [tableView rowHeight]) { + return naturalSize.height; + } else { + return [tableView rowHeight]; + } +} + +@end diff --git a/Classes/SBPrefsController.h b/Classes/SBPrefsController.h new file mode 100755 index 0000000..c3c8186 --- /dev/null +++ b/Classes/SBPrefsController.h @@ -0,0 +1,35 @@ +// +// SBPrefsController.h +// +// Created by Damiano Galassi on 13/05/08. +// Copyright 2008 Damiano Galassi. All rights reserved. +// + +#import + +@class SBMovieViewController; +@class SBTableView; + +@interface SBPrefsController : NSWindowController { + IBOutlet NSView *generalView, *advancedView, *setsView; + + id _popover; + SBMovieViewController *_controller; + NSInteger _currentRow; + + IBOutlet SBTableView *tableView; + IBOutlet NSButton *removeSet; +} + ++ (void)registerUserDefaults; + +- (instancetype)init; +- (IBAction)clearRecentSearches:(id) sender; +- (IBAction)deleteCachedMetadata:(id) sender; +- (IBAction)toggleInfoWindow:(id) sender; + +- (IBAction)deletePreset:(id) sender; + +- (IBAction)updateRatingsCountry:(id)sender; + +@end diff --git a/Classes/SBPrefsController.m b/Classes/SBPrefsController.m new file mode 100755 index 0000000..f22fbc4 --- /dev/null +++ b/Classes/SBPrefsController.m @@ -0,0 +1,293 @@ +// +// SBPrefsController.m +// +// Created by Damiano Galassi on 13/05/08. +// Copyright 2008 Damiano Galassi. All rights reserved. +// + +#import +#import + +#import "SBPrefsController.h" +#import "SBMetadataSearchController.h" +#import "SBPresetManager.h" +#import "SBTableView.h" +#import "SBMovieViewController.h" + +#import "MAAttachedWindow.h" + +#define TOOLBAR_GENERAL @"TOOLBAR_GENERAL" +#define TOOLBAR_ADVANCED @"TOOLBAR_ADVANCED" +#define TOOLBAR_SETS @"TOOLBAR_SETS" + +@interface SBPrefsController () +- (NSArray *)ratingsCountries; + +- (void)setPrefView:(id)sender; +- (NSToolbarItem *)toolbarItemWithIdentifier:(NSString *)identifier + label:(NSString *)label + image:(NSImage *)image; +@end + +@implementation SBPrefsController + ++ (void)registerUserDefaults +{ + [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys: + @"m4v", @"SBSaveFormat", + @"0", @"defaultSaveFormat", + @"YES", @"SBQueueOptimize", + @"YES", @"SBOrganizeAlternateGroups", + @"1", @"SBAudioMixdown", + @"96", @"SBAudioBitrate", + @"YES", @"SBAudioConvertAC3", + @"YES", @"SBAudioKeepAC3", + @"YES", @"SBSubtitleConvertBitmap", + @"All countries", @"SBRatingsCountry", + @"m4v", @"SBSaveFormat", + @"NO", @"mp464bitOffset", + @"YES", @"chaptersPreviewTrack", + @"TheMovieDB", @"SBMetadataPreference|Movie", + @"USA (English)", @"SBMetadataPreference|Movie|iTunes Store|Language", + @"English", @"SBMetadataPreference|Movie|TheMovieDB|Language", + @"TheTVDB", @"SBMetadataPreference|TV", + @"USA (English)", @"SBMetadataPreference|TV|iTunes Store|Language", + @"English", @"SBMetadataPreference|TV|TheTVDB|Language", + nil]]; +} + +- (instancetype)init +{ + if ((self = [super initWithWindowNibName:@"Prefs"])) { + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(updateTableView:) + name:@"SBPresetManagerUpdatedNotification" object:nil]; + } + + return self; +} + +- (void)awakeFromNib +{ + NSToolbar *toolbar = [[[NSToolbar alloc] initWithIdentifier: @"Preferences Toolbar"] autorelease]; + [toolbar setDelegate:self]; + [toolbar setAllowsUserCustomization:NO]; + [toolbar setDisplayMode:NSToolbarDisplayModeIconAndLabel]; + [toolbar setSizeMode:NSToolbarSizeModeRegular]; + [[self window] setToolbar:toolbar]; + + [toolbar setSelectedItemIdentifier:TOOLBAR_GENERAL]; + [self setPrefView:nil]; +} + +- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar + itemForItemIdentifier:(NSString *)ident + willBeInsertedIntoToolbar:(BOOL)flag +{ + if ([ident isEqualToString:TOOLBAR_GENERAL]) { + return [self toolbarItemWithIdentifier:ident + label:NSLocalizedString(@"General", @"Preferences General Toolbar Item") + image:[NSImage imageNamed:NSImageNamePreferencesGeneral]]; + } + else if ([ident isEqualToString:TOOLBAR_ADVANCED]) { + return [self toolbarItemWithIdentifier:ident + label:NSLocalizedString(@"Advanced", @"Preferences Audio Toolbar Item") + image:[NSImage imageNamed:NSImageNameAdvanced]]; + } + else if ([ident isEqualToString:TOOLBAR_SETS]) { + return [self toolbarItemWithIdentifier:ident + label:NSLocalizedString(@"Sets", @"Preferences Sets Toolbar Item") + image:[NSImage imageNamed:NSImageNameFolderSmart]]; + } + + return nil; +} + +- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar +{ + return [self toolbarDefaultItemIdentifiers: toolbar]; +} + +- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar +{ + return [self toolbarAllowedItemIdentifiers: toolbar]; +} + +- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar +{ + return [NSArray arrayWithObjects: TOOLBAR_GENERAL, TOOLBAR_SETS, TOOLBAR_ADVANCED, nil]; +} + +- (IBAction)clearRecentSearches:(id)sender { + [SBMetadataSearchController clearRecentSearches]; +} + +- (IBAction)deleteCachedMetadata:(id)sender { + [SBMetadataSearchController deleteCachedMetadata]; +} + +- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView { + SBPresetManager *presetManager = [SBPresetManager sharedManager]; + return [[presetManager presets] count]; +} + +- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn + row:(NSInteger)rowIndex { + if ([aTableColumn.identifier isEqualToString:@"name"]) { + SBPresetManager *presetManager = [SBPresetManager sharedManager]; + return [[[presetManager presets] objectAtIndex:rowIndex] presetName]; + } + return nil; +} + +- (IBAction)deletePreset:(id)sender +{ + [self closePopOver:self]; + + NSInteger rowIndex = [tableView selectedRow]; + SBPresetManager *presetManager = [SBPresetManager sharedManager]; + [presetManager removePresetAtIndex:rowIndex]; + [tableView reloadData]; +} + +- (IBAction)closePopOver:(id)sender +{ + if(_popover) { + if (!NSClassFromString(@"NSPopover")) { + [[self window] removeChildWindow:_popover]; + [_popover orderOut:self]; + } + else + [_popover close]; + + [_popover release]; + _popover = nil; + [_controller release]; + _controller = nil; + } +} + +- (IBAction)toggleInfoWindow:(id)sender +{ + if (_currentRow == [tableView clickedRow] && _popover) + [self closePopOver:sender]; + else { + _currentRow = [tableView clickedRow]; + [self closePopOver:sender]; + + SBPresetManager *presetManager = [SBPresetManager sharedManager]; + _controller = [[SBMovieViewController alloc] initWithNibName:@"MovieView" bundle:nil]; + [_controller setMetadata:[[presetManager presets] objectAtIndex:_currentRow]]; + + if (NSClassFromString(@"NSPopover")) { + _popover = [[NSPopover alloc] init]; + ((NSPopover *)_popover).contentViewController = _controller; + ((NSPopover *)_popover).contentSize = NSMakeSize(480.0f, 500.0f); + + [_popover showRelativeToRect:[tableView frameOfCellAtColumn:1 row:_currentRow] ofView:tableView preferredEdge:NSMaxYEdge]; + } + else { + NSInteger row = [tableView selectedRow]; + + NSRect cellFrame = [tableView frameOfCellAtColumn:1 row:row]; + NSRect tableFrame = [[[tableView superview] superview]frame]; + + NSPoint windowPoint = NSMakePoint(NSMidX(cellFrame) + 20, + NSHeight(tableFrame) + tableFrame.origin.y - cellFrame.origin.y - (cellFrame.size.height / 2) - 8); + + _popover = [[MAAttachedWindow alloc] initWithView:[_controller view] + attachedToPoint:windowPoint + inWindow:[self window] + onSide:MAPositionBottom + atDistance:0]; + + [_popover setBackgroundColor:[NSColor colorWithCalibratedRed:0.98 green:0.98 blue:1 alpha:0.9]]; + [_popover setDelegate:self]; + [(MAAttachedWindow *)_popover setCornerRadius:6]; + + [[self window] addChildWindow:_popover ordered:NSWindowAbove]; + + [_popover setAlphaValue:0.0]; + + [NSAnimationContext beginGrouping]; + [[NSAnimationContext currentContext] setDuration:0.2]; + [_popover makeKeyAndOrderFront:self]; + [[_popover animator] setAlphaValue:1.0]; + [NSAnimationContext endGrouping]; + } + } +} + +- (void)updateTableView:(id)sender +{ + [tableView reloadData]; +} + +- (void)tableViewSelectionDidChange:(NSNotification *)aNotification +{ + if ([tableView selectedRow] != -1) + [removeSet setEnabled:YES]; + else + [removeSet setEnabled:NO]; +} + +- (NSArray *)ratingsCountries { + return [[MP42Ratings defaultManager] ratingsCountries]; +} + +- (IBAction) updateRatingsCountry:(id)sender { + [[MP42Ratings defaultManager] updateRatingsCountry]; +} + +- (void)setPrefView:(id)sender +{ + NSView *view = generalView; + if (sender) { + NSString *identifier = [sender itemIdentifier]; + if ([identifier isEqualToString: TOOLBAR_ADVANCED]) + view = advancedView; + else if ([identifier isEqualToString: TOOLBAR_SETS]) + view = setsView; + } + + NSWindow *window = [self window]; + if ([window contentView] == view) + return; + + NSRect windowRect = [window frame]; + CGFloat difference = ([view frame].size.height - [[window contentView] frame].size.height); + windowRect.origin.y -= difference; + windowRect.size.height += difference; + + [view setHidden:YES]; + [window setContentView:view]; + [window setFrame:windowRect display:YES animate:YES]; + [view setHidden:NO]; + + //set title label + if (sender) + [window setTitle:[sender label]]; + else { + NSToolbar *toolbar = [window toolbar]; + NSString *itemIdentifier = [toolbar selectedItemIdentifier]; + for (NSToolbarItem *item in [toolbar items]) + if ([[item itemIdentifier] isEqualToString:itemIdentifier]) { + [window setTitle: [item label]]; + break; + } + } +} + +- (NSToolbarItem *)toolbarItemWithIdentifier:(NSString *)identifier + label:(NSString *)label + image:(NSImage *)image +{ + NSToolbarItem *item = [[NSToolbarItem alloc] initWithItemIdentifier:identifier]; + [item setLabel:label]; + [item setImage:image]; + [item setAction:@selector(setPrefView:)]; + [item setAutovalidates:NO]; + return [item autorelease]; +} + +@end diff --git a/Classes/SBPresetManager.h b/Classes/SBPresetManager.h new file mode 100755 index 0000000..48aa2e6 --- /dev/null +++ b/Classes/SBPresetManager.h @@ -0,0 +1,28 @@ +// +// SBPresetManager.h +// Subler +// +// Created by Damiano Galassi on 02/01/11. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@class MP42Metadata; + +extern NSString *SBPresetManagerUpdatedNotification; + +@interface SBPresetManager : NSObject { + NSMutableArray *_presets; +} + ++ (SBPresetManager *)sharedManager; + +- (void)newSetFromExistingMetadata:(MP42Metadata *)set; +- (BOOL)savePresets; + +- (BOOL)removePresetAtIndex:(NSUInteger)index; + +@property(readonly) NSArray *presets; + +@end diff --git a/Classes/SBPresetManager.m b/Classes/SBPresetManager.m new file mode 100755 index 0000000..5fef353 --- /dev/null +++ b/Classes/SBPresetManager.m @@ -0,0 +1,154 @@ +// +// SBPresetManager.m +// Subler +// +// Created by Damiano Galassi on 02/01/11. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import "SBPresetManager.h" +#import + +/// Notification sent to update presets lists. +NSString *SBPresetManagerUpdatedNotification = @"SBPresetManagerUpdatedNotification"; + +@interface SBPresetManager () +- (BOOL)loadPresets; +- (BOOL)savePresets; +- (NSString *)appSupportPath; +- (BOOL)removePresetWithName:(NSString*)name; + +@end + +@implementation SBPresetManager + ++ (SBPresetManager *)sharedManager +{ + static dispatch_once_t pred; + static SBPresetManager *sharedPresetManager = nil; + + dispatch_once(&pred, ^{ sharedPresetManager = [[self alloc] init]; }); + return sharedPresetManager; +} + +- (id)init { + if ((self = [super init])) { + _presets = [[NSMutableArray alloc] init]; + + [self loadPresets]; + } + + return self; +} + +- (void)updateNotification +{ + [[NSNotificationCenter defaultCenter] postNotificationName:SBPresetManagerUpdatedNotification object:self]; +} + +- (void)newSetFromExistingMetadata:(MP42Metadata *)set +{ + id newSet = [set copy]; + [_presets addObject:newSet]; + [newSet release]; + + [self savePresets]; + [self updateNotification]; +} + +- (NSString *)appSupportPath +{ + NSString *appSupportPath = nil; + + NSArray *allPaths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, + NSUserDomainMask, + YES); + if ([allPaths count]) + appSupportPath = [[allPaths objectAtIndex:0] stringByAppendingPathComponent:@"Subler"]; + + return appSupportPath; +} + +- (BOOL)loadPresets +{ + NSString *file; + NSFileManager *fileManager = [NSFileManager defaultManager]; + NSString *appSupportPath = [self appSupportPath]; + MP42Metadata *newPreset; + + if (!appSupportPath) + return NO; + + NSDirectoryEnumerator *dirEnum = [fileManager enumeratorAtPath:appSupportPath]; + while ((file = [dirEnum nextObject])) { + if ([[file pathExtension] isEqualToString:@"sbpreset"]) { + @try { + newPreset = [NSKeyedUnarchiver unarchiveObjectWithFile:[appSupportPath stringByAppendingPathComponent:file]]; + } + @catch (NSException *exception) { + continue; + } + + newPreset.isEdited = NO; + [_presets addObject:newPreset]; + } + } + + if (![_presets count]) + return NO; + else + return YES; +} + +- (BOOL)savePresets +{ + NSFileManager *fileManager = [NSFileManager defaultManager]; + NSString *appSupportPath = [self appSupportPath]; + BOOL noErr = YES; + + + if (!appSupportPath) + return NO; + + if (![fileManager fileExistsAtPath:appSupportPath]) + [fileManager createDirectoryAtPath:appSupportPath withIntermediateDirectories:noErr attributes:nil error:NULL]; + + for (MP42Metadata *object in _presets) { + if ([object isEdited]) { + NSString *saveLocation = [NSString stringWithFormat:@"%@/%@.sbpreset", appSupportPath, [object presetName]]; + noErr = [NSKeyedArchiver archiveRootObject:object + toFile:saveLocation]; + } + } + return noErr; +} + +- (BOOL)removePresetAtIndex:(NSUInteger)index +{ + NSString *name = [[_presets objectAtIndex:index] presetName]; + [_presets removeObjectAtIndex:index]; + + [self updateNotification]; + + return [self removePresetWithName:name]; +} + + +- (BOOL)removePresetWithName:(NSString *)name +{ + BOOL err = NO; + NSString *appSupportPath = [self appSupportPath]; + + if (!appSupportPath) + return NO; + + NSFileManager *fileManager = [NSFileManager defaultManager]; + err = [fileManager removeItemAtPath:[NSString stringWithFormat:@"%@/%@.sbpreset", appSupportPath, name] + error:NULL]; + + return err; +} + +@synthesize presets = _presets; + +@end diff --git a/Classes/SBQueueController.h b/Classes/SBQueueController.h new file mode 100755 index 0000000..fb60d66 --- /dev/null +++ b/Classes/SBQueueController.h @@ -0,0 +1,81 @@ +// +// SBQueueController.h +// Subler +// +// Created by Damiano Galassi on 12/08/11. +// Copyright 2011 Damiano Galassi. All rights reserved. +// + +#import +#import + +@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 NSTextField *countLabel; + IBOutlet NSProgressIndicator *progressIndicator; + + IBOutlet NSButton *OptimizeOption; + IBOutlet NSButton *MetadataOption; + IBOutlet NSButton *ITunesGroupsOption; + 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; + + NSMutableArray *filesArray; + SBQueueStatus status; + + IOPMAssertionID _assertionID; + BOOL _cancelled; +} + +@property(readonly) SBQueueStatus status; + ++ (SBQueueController *)sharedManager; + +- (void)start:(id)sender; +- (void)stop:(id)sender; + +- (void)addItem:(SBQueueItem*)item; + +- (BOOL)saveQueueToDisk; + +- (IBAction)removeSelectedItems:(id)sender; +- (IBAction)removeCompletedItems:(id)sender; + +- (IBAction)edit:(id)sender; +- (IBAction)showInFinder:(id)sender; + +- (IBAction)toggleStartStop:(id)sender; +- (IBAction)toggleOptions:(id)sender; + +- (IBAction)open:(id)sender; +- (IBAction)chooseDestination:(id)sender; +- (IBAction)destination:(id)sender; + +@end diff --git a/Classes/SBQueueController.m b/Classes/SBQueueController.m new file mode 100755 index 0000000..a7de3b4 --- /dev/null +++ b/Classes/SBQueueController.m @@ -0,0 +1,1002 @@ +// +// SBQueueController.m +// Subler +// +// Created by Damiano Galassi on 12/08/11. +// Copyright 2011 Damiano Galassi. All rights reserved. +// + +#import "SBQueueController.h" +#import "SBQueueItem.h" +#import "SBDocument.h" +#import "SBTableView.h" +#import "MetadataImporter.h" + +#import +#import +#import +#import + + +#define SublerBatchTableViewDataType @"SublerBatchTableViewDataType" +#define kOptionsPanelHeight 88 + +static NSString *fileType = @"mp4"; + +@interface SBQueueController () +- (void)updateUI; +- (void)updateDockTile; +- (NSURL *)queueURL; +- (NSMenuItem *)prepareDestPopupItem:(NSURL *)dest; +- (void)prepareDestPopup; + +- (void)addItems:(NSArray *)items atIndexes:(NSIndexSet *)indexes; +- (void)removeItems:(NSArray *)items; +@end + + +@implementation SBQueueController + +@synthesize status; + + ++ (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]; + + [self updateDockTile]; + } + + return self; +} + +- (void)awakeFromNib +{ + [progressIndicator setHidden:YES]; + [countLabel setStringValue:@"Empty"]; + + NSRect frame = [[self window] frame]; + frame.size.height += kOptionsPanelHeight; + frame.origin.y -= kOptionsPanelHeight; + + [[self window] setFrame:frame display:NO animate:NO]; + + frame = [[self window] frame]; + frame.size.height -= kOptionsPanelHeight; + frame.origin.y += kOptionsPanelHeight; + + [tableScrollView setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin]; + [optionsBox setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin]; + + [[self window] setFrame:frame display:YES animate:NO]; + + [tableScrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; + [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]]; +} + +- (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 + return nil; +} + +- (BOOL)saveQueueToDisk +{ + return [NSKeyedArchiver archiveRootObject:filesArray toFile:[[self queueURL] path]]; +} + +- (NSMenuItem *)prepareDestPopupItem:(NSURL*) dest +{ + NSMenuItem *folderItem = [[NSMenuItem alloc] initWithTitle:[dest lastPathComponent] action:@selector(destination:) keyEquivalent:@""]; + [folderItem setTag:10]; + + NSImage* menuItemIcon = [[NSWorkspace sharedWorkspace] iconForFile:[dest path]]; + [menuItemIcon setSize:NSMakeSize(16, 16)]; + + [folderItem setImage:menuItemIcon]; + + return [folderItem autorelease]; +} + +- (void)prepareDestPopup +{ + NSMenuItem *folderItem = nil; + + if ([[NSUserDefaults standardUserDefaults] valueForKey:@"SBQueueDestination"]) { + destination = [[NSURL fileURLWithPath:[[NSUserDefaults standardUserDefaults] valueForKey:@"SBQueueDestination"]] retain]; + +#ifdef SB_SANDBOX + if ([[NSUserDefaults standardUserDefaults] valueForKey:@"SBQueueDestinationBookmark"]) { + BOOL bookmarkDataIsStale; + NSError *error; + NSData *bookmarkData = [[NSUserDefaults standardUserDefaults] valueForKey:@"SBQueueDestinationBookmark"]; + + [destination release]; + destination = [[NSURL + URLByResolvingBookmarkData:bookmarkData + options:NSURLBookmarkResolutionWithSecurityScope + relativeToURL:nil + bookmarkDataIsStale:&bookmarkDataIsStale + error:&error] retain]; + } +#endif + if (![[NSFileManager defaultManager] fileExistsAtPath:[destination path] isDirectory:nil]) + destination = nil; + } + + if (!destination) { + NSArray *allPaths = NSSearchPathForDirectoriesInDomains(NSMoviesDirectory, + NSUserDomainMask, + YES); + if ([allPaths count]) + destination = [[NSURL fileURLWithPath:[allPaths lastObject]] retain];; + } + + folderItem = [self prepareDestPopupItem:destination]; + + [[destButton menu] insertItem:[NSMenuItem separatorItem] atIndex:0]; + [[destButton menu] insertItem:folderItem atIndex:0]; + + if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"SBQueueDestinationSelected"] boolValue]) { + [destButton selectItem:folderItem]; + customDestination = YES; + } +} + +- (IBAction)destination:(id)sender +{ + if ([sender tag] == 10) { + customDestination = YES; + [[NSUserDefaults standardUserDefaults] setValue:@"YES" forKey:@"SBQueueDestinationSelected"]; + } + else { + customDestination = NO; + [[NSUserDefaults standardUserDefaults] setValue:nil forKey:@"SBQueueDestinationSelected"]; + } +} + +- (void)updateDockTile +{ + int count = 0; + for (SBQueueItem *item in filesArray) + if ([item status] != SBQueueItemStatusCompleted) + count++; + + if (count) + [[NSApp dockTile] setBadgeLabel:[NSString stringWithFormat:@"%d", count]]; + else + [[NSApp dockTile] setBadgeLabel:nil]; +} + +- (void)updateUI +{ + [tableView reloadData]; + if (status != SBQueueStatusWorking) { + [countLabel setStringValue:[NSString stringWithFormat:@"%lu files in queue.", (unsigned long)[filesArray 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 downloadDataOrGetFromCache:url]; + 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) + return; + + status = SBQueueStatusWorking; + + [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]; +} + +- (void)progressStatus: (CGFloat)progress { + dispatch_async(dispatch_get_main_queue(), ^{ + [progressIndicator setIndeterminate:NO]; + [progressIndicator setDoubleValue:progress]; + }); +} + +- (void)stop:(id)sender +{ + _cancelled = YES; + [_currentMP4 cancel]; +} + +- (IBAction)toggleStartStop:(id)sender +{ + if (status == SBQueueStatusWorking) { + [self stop:sender]; + } + else { + [self start:sender]; + } +} + +- (IBAction)toggleOptions:(id)sender +{ + NSInteger value = 0; + if (optionsStatus) { + value = -kOptionsPanelHeight; + optionsStatus = NO; + } + else { + value = kOptionsPanelHeight; + optionsStatus = YES; + } + + NSRect frame = [[self window] frame]; + frame.size.height += value; + frame.origin.y -= value; + + [tableScrollView setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin]; + [optionsBox setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin]; + + [[self window] setFrame:frame display:YES animate:YES]; + + [tableScrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; + [optionsBox setAutoresizingMask:NSViewWidthSizable | NSViewMaxYMargin]; +} + +#pragma mark Open methods + +- (IBAction)open:(id)sender +{ + NSOpenPanel *panel = [NSOpenPanel openPanel]; + panel.allowsMultipleSelection = YES; + panel.canChooseFiles = YES; + panel.canChooseDirectories = YES; + [panel setAllowedFileTypes:supportedFileFormat()]; + + [panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger result) { + if (result == NSFileHandlingPanelOKButton) { + NSMutableArray *items = [[NSMutableArray alloc] init]; + + for (NSURL *url in [panel URLs]) + [items addObject:[SBQueueItem itemWithURL:url]]; + + [self addItems:items atIndexes:nil]; + [items release]; + + [self updateUI]; + + if ([AutoStartOption state]) + [self start:self]; + } + }]; +} + +- (IBAction)chooseDestination:(id)sender +{ + NSOpenPanel *panel = [NSOpenPanel openPanel]; + panel.allowsMultipleSelection = NO; + panel.canChooseFiles = NO; + panel.canChooseDirectories = YES; + panel.canCreateDirectories = YES; + + [panel setPrompt:@"Select"]; + [panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger result) { + if (result == NSFileHandlingPanelOKButton) { + destination = [[panel URL] retain]; + + NSMenuItem *folderItem = [self prepareDestPopupItem:[panel URL]]; + + [[destButton menu] removeItemAtIndex:0]; + [[destButton menu] insertItem:folderItem atIndex:0]; + + [destButton selectItem:folderItem]; + customDestination = YES; + +#ifdef SB_SANDBOX + NSData *bookmark = nil; + NSError *error = nil; + bookmark = [[panel URL] bookmarkDataWithOptions:NSURLBookmarkCreationWithSecurityScope + includingResourceValuesForKeys:nil + relativeToURL:nil // Make it app-scoped + error:&error]; + if (error) { + NSLog(@"Error creating bookmark for URL (%@): %@", [panel URL], error); + [NSApp presentError:error]; + } + + [[NSUserDefaults standardUserDefaults] setValue:bookmark forKey:@"SBQueueDestinationBookmark"]; +#endif + [[NSUserDefaults standardUserDefaults] setValue:[[panel URL] path] forKey:@"SBQueueDestination"]; + [[NSUserDefaults standardUserDefaults] setValue:@"YES" forKey:@"SBQueueDestinationSelected"]; + } + else + [destButton selectItemAtIndex:2]; + }]; +} + +#pragma mark TableView + +- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView +{ + return [filesArray count]; +} + +- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex +{ + if ([aTableColumn.identifier isEqualToString:@"nameColumn"]) + return [[[filesArray objectAtIndex:rowIndex] URL] lastPathComponent]; + + if ([aTableColumn.identifier isEqualToString:@"statusColumn"]) { + SBQueueItemStatus batchStatus = [(SBQueueItem *)[filesArray objectAtIndex:rowIndex] status]; + if (batchStatus == SBQueueItemStatusCompleted) + return [NSImage imageNamed:@"EncodeComplete"]; + else if (batchStatus == SBQueueItemStatusWorking) + return [NSImage imageNamed:@"EncodeWorking"]; + else if (batchStatus == SBQueueItemStatusFailed) + return [NSImage imageNamed:@"EncodeCanceled"]; + else + return docImg; + } + + return nil; +} + +- (void)_deleteSelectionFromTableView:(NSTableView *)aTableView +{ + NSMutableIndexSet *rowIndexes = [[aTableView selectedRowIndexes] mutableCopy]; + 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]; + + // 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]]; + + if ([rowIndexes count]) { + if ([NSTableView instancesRespondToSelector:@selector(beginUpdates)]) { + #if __MAC_OS_X_VERSION_MAX_ALLOWED > 1060 + [aTableView beginUpdates]; + [aTableView removeRowsAtIndexes:rowIndexes withAnimation:NSTableViewAnimationEffectFade]; + [aTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:selectedIndex] byExtendingSelection:NO]; + [self removeItems:array]; + [aTableView endUpdates]; + #endif + } + else { + [self removeItems:array]; + [aTableView reloadData]; + [aTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:selectedIndex] byExtendingSelection:NO]; + } + + if (status != SBQueueStatusWorking) { + [countLabel setStringValue:[NSString stringWithFormat:@"%lu files in queue.", (unsigned long)[filesArray count]]]; + [self updateDockTile]; + } + } + [rowIndexes release]; +} + +- (IBAction)edit:(id)sender +{ + SBQueueItem *item = [[filesArray objectAtIndex:[tableView clickedRow]] retain]; + + [self removeItems:[NSArray arrayWithObject:item]]; + [self updateUI]; + + MP42File *mp4; + if (!item.mp4File) + mp4 = [self prepareQueueItem:item.URL error:NULL]; + else + mp4 = item.mp4File; + + SBDocument *doc = [[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:NULL]; + [doc setMp4File:mp4]; + [item release]; +} + +- (IBAction)showInFinder:(id)sender +{ + SBQueueItem *item = [filesArray objectAtIndex:[tableView clickedRow]]; + [[NSWorkspace sharedWorkspace] selectFile:[item.destURL path] inFileViewerRootedAtPath:nil]; +} + +- (IBAction)removeSelectedItems:(id)sender +{ + [self _deleteSelectionFromTableView:tableView]; +} + +- (IBAction)removeCompletedItems:(id)sender +{ + NSMutableIndexSet *indexes = [[NSMutableIndexSet alloc] init]; + + for (SBQueueItem *item in filesArray) + if ([item status] == SBQueueItemStatusCompleted) + [indexes addIndex:[filesArray indexOfObject:item]]; + + 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]; + [tableView reloadData]; + } + + if (status != SBQueueStatusWorking) { + [countLabel setStringValue:[NSString stringWithFormat:@"%lu files in queue.", (unsigned long)[filesArray count]]]; + [self updateDockTile]; + } + } + + [indexes release]; +} + +- (BOOL)validateUserInterfaceItem:(id < NSValidatedUserInterfaceItem >)anItem +{ + SEL action = [anItem action]; + + if (action == @selector(removeSelectedItems:)) + if ([tableView selectedRow] != -1 || [tableView clickedRow] != -1) + return YES; + + if (action == @selector(showInFinder:)) { + if ([tableView clickedRow] != -1) { + SBQueueItem *item = [filesArray objectAtIndex:[tableView clickedRow]]; + if ([item status] == SBQueueItemStatusCompleted) + return YES; + } + } + + if (action == @selector(edit:)) + return YES; + + if (action == @selector(removeCompletedItems:)) + return YES; + + if (action == @selector(chooseDestination:)) + return YES; + + if (action == @selector(destination:)) + return YES; + + return NO; +} + +#pragma mark Drag & Drop + +- (BOOL)tableView:(NSTableView *)tv writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard +{ + // Copy the row numbers to the pasteboard. + NSData *data = [NSKeyedArchiver archivedDataWithRootObject:rowIndexes]; + [pboard declareTypes:[NSArray arrayWithObject:SublerBatchTableViewDataType] owner:self]; + [pboard setData:data forType:SublerBatchTableViewDataType]; + return YES; +} + +- (NSDragOperation)tableView:(NSTableView *)view + validateDrop:(id )info + proposedRow:(NSInteger)row + proposedDropOperation:(NSTableViewDropOperation)operation +{ + if (nil == [info draggingSource]) { // From other application + [view setDropRow: row dropOperation: NSTableViewDropAbove]; + return NSDragOperationCopy; + } + else if (view == [info draggingSource] && operation == NSTableViewDropAbove) { // From self + return NSDragOperationEvery; + } + else + return NSDragOperationNone; +} + +- (BOOL)tableView:(NSTableView *)view + acceptDrop:(id )info + row:(NSInteger)row + dropOperation:(NSTableViewDropOperation)operation +{ + NSPasteboard *pboard = [info draggingPasteboard]; + + if (tableView == [info draggingSource]) { // From self + 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]; + + for (id object in [objects reverseObjectEnumerator]) + [filesArray insertObject:object atIndex:row]; + + NSIndexSet *selectionSet = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(row, [rowIndexes count])]; + + [view reloadData]; + [view selectRowIndexes:selectionSet byExtendingSelection:NO]; + + return YES; + } + 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) { + [queueItems addObject:[SBQueueItem itemWithURL:url]]; + [indexes addIndex:row]; + } + + [self addItems:queueItems atIndexes:indexes]; + + [queueItems release]; + [indexes release]; + [self updateUI]; + + if ([AutoStartOption state]) + [self start:self]; + + return YES; + } + } + + return NO; +} + +- (void)addItem:(SBQueueItem *)item +{ + [self addItems:[NSArray arrayWithObject:item] atIndexes:nil]; + + [self updateUI]; + + if ([AutoStartOption state]) + [self start:self]; +} + +- (void)addItems:(NSArray *)items atIndexes:(NSIndexSet *)indexes; +{ + NSMutableIndexSet *mutableIndexes = [indexes mutableCopy]; + if ([indexes count] == [items count]) + for (id item in [items reverseObjectEnumerator]) { + [filesArray insertObject:item atIndex:[mutableIndexes firstIndex]]; + [mutableIndexes removeIndexesInRange:NSMakeRange(0, 1)]; + } + else if ([indexes count] == 1) { + for (id item in [items reverseObjectEnumerator]) { + [filesArray insertObject:item atIndex:[mutableIndexes firstIndex]]; + } + } + else + for (id item in [items reverseObjectEnumerator]) { + [filesArray addObject:item]; + } + + NSUndoManager *undo = [[self window] undoManager]; + [[undo prepareWithInvocationTarget:self] removeItems:items]; + + if (![undo isUndoing]) { + [undo setActionName:@"Add Queue Item"]; + } + if ([undo isUndoing] || [undo isRedoing]) + [self updateUI]; + + if ([AutoStartOption state]) + [self start:self]; + + [mutableIndexes release]; +} + +- (void)removeItems:(NSArray *)items +{ + NSMutableIndexSet *indexes = [[NSMutableIndexSet alloc] init]; + + for (id item in items) { + [indexes addIndex:[filesArray indexOfObject:item]]; + [filesArray removeObject:item]; + } + + NSUndoManager *undo = [[self window] undoManager]; + [[undo prepareWithInvocationTarget:self] addItems:items atIndexes:indexes]; + + if (![undo isUndoing]) { + [undo setActionName:@"Delete Queue Item"]; + } + if ([undo isUndoing] || [undo isRedoing]) + [self updateUI]; + + [indexes release]; +} + +@end diff --git a/Classes/SBQueueItem.h b/Classes/SBQueueItem.h new file mode 100755 index 0000000..3af9cc1 --- /dev/null +++ b/Classes/SBQueueItem.h @@ -0,0 +1,48 @@ +// +// SBQueueItem.h +// Subler +// +// Created by Damiano Galassi on 16/08/11. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@class MP42File; + +typedef enum SBQueueItemStatus : NSInteger { + SBQueueItemtatusUnknown = 0, + SBQueueItemStatusReady, + SBQueueItemStatusWorking, + SBQueueItemStatusCompleted, + SBQueueItemStatusFailed, + SBQueueItemStatusCancelled, +} SBQueueItemStatus; + +@interface SBQueueItem : NSObject { + MP42File *mp4File; + NSURL *fileURL; + NSURL *destURL; + NSDictionary *attributes; + + SBQueueItemStatus status; + BOOL humanEdited; +} + +@property (atomic, readonly) MP42File *mp4File; +@property (atomic, readonly) NSDictionary *attributes; +@property (atomic, readonly) NSURL *URL; +@property (atomic, retain, readwrite) NSURL *destURL; + +@property (atomic, readwrite) SBQueueItemStatus status; + +- (instancetype)initWithURL:(NSURL *)URL; ++ (instancetype)itemWithURL:(NSURL *)URL; + +- (instancetype)initWithMP4:(MP42File *)MP4; +- (instancetype)initWithMP4:(MP42File *)MP4 url:(NSURL *)URL attributes:(NSDictionary *)dict; + ++ (instancetype)itemWithMP4:(MP42File *)MP4; ++ (instancetype)itemWithMP4:(MP42File *)MP4 url:(NSURL *)URL attributes:(NSDictionary *)dict; + +@end diff --git a/Classes/SBQueueItem.m b/Classes/SBQueueItem.m new file mode 100755 index 0000000..f1c9ab2 --- /dev/null +++ b/Classes/SBQueueItem.m @@ -0,0 +1,152 @@ +// +// SBQueueItem.m +// Subler +// +// Created by Damiano Galassi on 16/08/11. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import "SBQueueItem.h" +#import + +@implementation SBQueueItem + +@synthesize attributes; +@synthesize URL = fileURL; +@synthesize destURL; +@synthesize mp4File; + +- (instancetype)init +{ + self = [super init]; + if (self) { + + } + + return self; +} + +- (instancetype)initWithURL:(NSURL*)URL { + self = [super init]; + if (self) { + fileURL = [URL retain]; + + NSFileManager *fileManager = [NSFileManager defaultManager]; + unsigned long long originalFileSize = [[[fileManager attributesOfItemAtPath:[fileURL path] error:nil] valueForKey:NSFileSize] unsignedLongLongValue]; + if (originalFileSize > 4200000000) { + attributes = [[NSDictionary alloc] initWithObjectsAndKeys:@YES, MP4264BitData, nil]; + } + } + + return self; +} + ++ (instancetype)itemWithURL:(NSURL*)URL +{ + return [[[SBQueueItem alloc] initWithURL:URL] autorelease]; +} + +- (id)initWithMP4:(MP42File*)MP4 { + self = [super init]; + if (self) { + mp4File = [MP4 retain]; + + if ([MP4 URL]) + fileURL = [[MP4 URL] retain]; + else { + for (NSUInteger i = 0; i < [mp4File tracksCount]; i++) { + MP42Track *track = [mp4File trackAtIndex:i]; + if ([track sourceURL]) { + fileURL = [[track sourceURL] retain]; + break; + } + } + } + + status = SBQueueItemStatusReady; + } + + return self; +} + ++ (instancetype)itemWithMP4:(MP42File*)MP4 +{ + return [[[SBQueueItem alloc] initWithMP4:MP4] autorelease]; +} + +- (id)initWithMP4:(MP42File*)MP4 url:(NSURL*)URL attributes:(NSDictionary*)dict +{ + if (self = [super init]) + { + mp4File = [MP4 retain]; + fileURL = [URL retain]; + destURL = [URL retain]; + attributes = [dict retain]; + + status = SBQueueItemStatusReady; + } + + return self; +} + ++ (instancetype)itemWithMP4:(MP42File*)MP4 url:(NSURL*)URL attributes:(NSDictionary*)dict +{ + return [[[SBQueueItem alloc] initWithMP4:MP4 url:URL attributes:dict] autorelease]; +} + +- (SBQueueItemStatus)status +{ + return status; +} + +- (void) setStatus:(SBQueueItemStatus)itemStatus +{ + status = itemStatus; + if (status == SBQueueItemStatusCompleted) { + if (mp4File) { + [mp4File release]; + mp4File = nil; + } + } +} + +- (void)dealloc +{ + [attributes release]; + [fileURL release]; + [destURL release]; + [mp4File release]; + + [super dealloc]; +} + +- (void)encodeWithCoder:(NSCoder *)coder +{ + [coder encodeInt:1 forKey:@"SBQueueItemTagEncodeVersion"]; + + [coder encodeObject:mp4File forKey:@"SBQueueItemMp4File"]; + [coder encodeObject:fileURL forKey:@"SBQueueItemFileURL"]; + [coder encodeObject:destURL forKey:@"SBQueueItemDestURL"]; + [coder encodeObject:attributes forKey:@"SBQueueItemAttributes"]; + + [coder encodeInt:status forKey:@"SBQueueItemStatus"]; + [coder encodeInt:humanEdited forKey:@"SBQueueItemHumanEdited"]; +} + +- (id)initWithCoder:(NSCoder *)decoder +{ + self = [super init]; + + mp4File = [[decoder decodeObjectForKey:@"SBQueueItemMp4File"] retain]; + + fileURL = [[decoder decodeObjectForKey:@"SBQueueItemFileURL"] retain]; + destURL = [[decoder decodeObjectForKey:@"SBQueueItemDestURL"] retain]; + attributes = [[decoder decodeObjectForKey:@"SBQueueItemAttributes"] retain]; + + status = [decoder decodeIntForKey:@"SBQueueItemStatus"]; + humanEdited = [decoder decodeIntForKey:@"SBQueueItemHumanEdited"]; + + return self; +} + +@end diff --git a/Classes/SBTableView.h b/Classes/SBTableView.h new file mode 100755 index 0000000..81ab453 --- /dev/null +++ b/Classes/SBTableView.h @@ -0,0 +1,25 @@ +// +// SBTableView.h +// Subler +// +// Created by Damiano Galassi on 17/06/09. +// Copyright 2009 Damiano Galassi. All rights reserved. +// + +#import + +@protocol SBTableViewDelegate +@optional +- (void)_deleteSelectionFromTableView:(NSTableView *)tableView; +- (void)_copySelectionFromTableView:(NSTableView *)tableView; +- (void)_cutSelectionFromTableView:(NSTableView *)tableView; +- (void)_pasteToTableView:(NSTableView *)tableView; +@end + +@interface SBTableView : NSTableView { + NSArray *_pasteboardTypes; +} +- (void)keyDown:(NSEvent *)event; +@property(readwrite, retain) NSArray* _pasteboardTypes; +@end + diff --git a/Classes/SBTableView.m b/Classes/SBTableView.m new file mode 100755 index 0000000..a552981 --- /dev/null +++ b/Classes/SBTableView.m @@ -0,0 +1,102 @@ +// +// SBTableView.m +// Subler +// +// Created by Damiano Galassi on 17/06/09. +// Copyright 2009 Damiano Galassi. All rights reserved. +// + +#import "SBTableView.h" + + +@implementation SBTableView + +- (void)keyDown:(NSEvent *)event +{ + id delegate = [self delegate]; + + unichar key = [[event charactersIgnoringModifiers] characterAtIndex:0]; + if (key == NSEnterCharacter || key == NSCarriageReturnCharacter) + [self editColumn:1 row:[self selectedRow] withEvent:nil select:YES]; + else if ((key == NSDeleteCharacter || key == NSDeleteFunctionKey) && [delegate respondsToSelector:@selector(_deleteSelectionFromTableView:)]) { + if ([self selectedRow] == -1) + NSBeep(); + else + [delegate _deleteSelectionFromTableView:self]; + return; + } + else if (key == 27) { + [self deselectAll:self]; + return; + } + else + [super keyDown:event]; +} + +- (IBAction)delete:(id)sender +{ + if ([self selectedRow] == -1) + return; + else if ([[self delegate] respondsToSelector:@selector(_deleteSelectionFromTableView:)]) + [(SBTableView *)[self delegate] _deleteSelectionFromTableView:self]; +} + +- (IBAction)copy:(id)sender { + if ([self selectedRow] == -1) + return; + else if ([[self delegate] respondsToSelector:@selector(_copySelectionFromTableView:)]) + [(SBTableView *)[self delegate] _copySelectionFromTableView:self]; +} + +- (IBAction)cut:(id)sender { + if ([self selectedRow] == -1) + return; + else if ([[self delegate] respondsToSelector:@selector(_cutSelectionFromTableView:)]) + [(SBTableView *)[self delegate] _cutSelectionFromTableView:self]; +} + +- (IBAction)paste:(id)sender { + if ([[self delegate] respondsToSelector:@selector(_pasteToTableView:)]) + [(SBTableView *)[self delegate] _pasteToTableView:self]; +} + +- (BOOL)pasteboardHasSupportedType { + // has the pasteboard got a type we support? + NSPasteboard *pb = [NSPasteboard generalPasteboard]; + NSString *bestType = [pb availableTypeFromArray:_pasteboardTypes]; + return (bestType != nil); +} + +- (BOOL)validateMenuItem:(NSMenuItem *)item +{ + id delegate = [self delegate]; + SEL action = [item action]; + + if (action == @selector(delete:)) + if ([self selectedRow] == -1 || ![delegate respondsToSelector:@selector(_deleteSelectionFromTableView:)]) + return NO; + + if (action == @selector(copy:)) + if ([self selectedRow] == -1 || ![delegate respondsToSelector:@selector(_copySelectionFromTableView:)]) + return NO; + + if (action == @selector(cut:)) + if ([self selectedRow] == -1 || ![delegate respondsToSelector:@selector(_cutSelectionFromTableView:)]) + return NO; + + if (action == @selector(paste:)) + if (![self pasteboardHasSupportedType] || ![delegate respondsToSelector:@selector(_pasteToTableView:)]) + return NO; + + return YES; +} + +- (void) dealloc +{ + [_pasteboardTypes release]; + [super dealloc]; +} + +@synthesize _pasteboardTypes; + +@end diff --git a/Classes/SBView.h b/Classes/SBView.h new file mode 100755 index 0000000..4554cd0 --- /dev/null +++ b/Classes/SBView.h @@ -0,0 +1,17 @@ +// +// SBView.h +// Subler +// +// Created by Damiano Galassi on 17/06/09. +// Copyright 2009 Damiano Galassi. All rights reserved. +// + +#import + + +@interface SBView : NSView { + IBOutlet NSViewController *viewController; + +} + +@end diff --git a/Classes/SBView.m b/Classes/SBView.m new file mode 100755 index 0000000..fdc013e --- /dev/null +++ b/Classes/SBView.m @@ -0,0 +1,44 @@ +// +// SBView.m +// Subler +// +// Created by Damiano Galassi on 17/06/09. +// Copyright 2009 Damiano Galassi. All rights reserved. +// + +#import "SBView.h" + + +@implementation SBView + +- (void)setViewController:(NSViewController *)newController +{ + if (viewController) + { + NSResponder *controllerNextResponder = [viewController nextResponder]; + [super setNextResponder:controllerNextResponder]; + [viewController setNextResponder:nil]; + } + + viewController = newController; + + if (newController) + { + NSResponder *ownNextResponder = [self nextResponder]; + [super setNextResponder: viewController]; + [viewController setNextResponder:ownNextResponder]; + } +} + +- (void)setNextResponder:(NSResponder *)newNextResponder +{ + if (viewController) + { + [viewController setNextResponder:newNextResponder]; + return; + } + + [super setNextResponder:newNextResponder]; +} + +@end diff --git a/English.lproj/ArtworkSelector.xib b/English.lproj/ArtworkSelector.xib new file mode 100755 index 0000000..fb8aff8 --- /dev/null +++ b/English.lproj/ArtworkSelector.xib @@ -0,0 +1,780 @@ + + + + 1060 + 13A603 + 4511 + 1265 + 695.00 + + 4511 + 3336 + + + IKImageBrowserView + NSButton + NSButtonCell + NSCustomObject + NSScrollView + NSScroller + NSSlider + NSSliderCell + NSView + NSWindowTemplate + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.imagekit.ibplugin + + + PluginDependencyRecalculationVersion + + + + + SBArtworkSelector + + + FirstResponder + + + NSApplication + + + 11 + 2 + {{227, 346}, {480, 380}} + 813171712 + Window + NSWindow + + + {480, 380} + + + 256 + + + + 274 + + + + 2322 + + + + 18 + + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + Apple URL pasteboard type + NSFilenamesPboardType + NSTypedFilenamesPboardType:'.SGI' + NSTypedFilenamesPboardType:'8BPS' + NSTypedFilenamesPboardType:'BMP ' + NSTypedFilenamesPboardType:'BMPf' + NSTypedFilenamesPboardType:'EPSF' + NSTypedFilenamesPboardType:'FPix' + NSTypedFilenamesPboardType:'GIFf' + NSTypedFilenamesPboardType:'ICO ' + NSTypedFilenamesPboardType:'JPEG' + NSTypedFilenamesPboardType:'PDF ' + NSTypedFilenamesPboardType:'PICT' + NSTypedFilenamesPboardType:'PNGf' + NSTypedFilenamesPboardType:'PNTG' + NSTypedFilenamesPboardType:'TIFF' + NSTypedFilenamesPboardType:'TPIC' + NSTypedFilenamesPboardType:'icns' + NSTypedFilenamesPboardType:'jp2 ' + NSTypedFilenamesPboardType:'qtif' + NSTypedFilenamesPboardType:3FR + NSTypedFilenamesPboardType:3fr + NSTypedFilenamesPboardType:ARW + NSTypedFilenamesPboardType:BMP + NSTypedFilenamesPboardType:CR2 + NSTypedFilenamesPboardType:CRW + NSTypedFilenamesPboardType:CUR + NSTypedFilenamesPboardType:DCR + NSTypedFilenamesPboardType:DNG + NSTypedFilenamesPboardType:EFX + NSTypedFilenamesPboardType:EPI + NSTypedFilenamesPboardType:EPS + NSTypedFilenamesPboardType:EPSF + NSTypedFilenamesPboardType:EPSI + NSTypedFilenamesPboardType:ERF + NSTypedFilenamesPboardType:EXR + NSTypedFilenamesPboardType:FAX + NSTypedFilenamesPboardType:FFF + NSTypedFilenamesPboardType:FPIX + NSTypedFilenamesPboardType:FPX + NSTypedFilenamesPboardType:G3 + NSTypedFilenamesPboardType:GIF + NSTypedFilenamesPboardType:HDR + NSTypedFilenamesPboardType:ICNS + NSTypedFilenamesPboardType:ICO + NSTypedFilenamesPboardType:JFAX + NSTypedFilenamesPboardType:JFIF + NSTypedFilenamesPboardType:JFX + NSTypedFilenamesPboardType:JP2 + NSTypedFilenamesPboardType:JPE + NSTypedFilenamesPboardType:JPEG + NSTypedFilenamesPboardType:JPF + NSTypedFilenamesPboardType:JPG + NSTypedFilenamesPboardType:JPS + NSTypedFilenamesPboardType:MAC + NSTypedFilenamesPboardType:MOS + NSTypedFilenamesPboardType:MPO + NSTypedFilenamesPboardType:MRW + NSTypedFilenamesPboardType:NEF + NSTypedFilenamesPboardType:NRW + NSTypedFilenamesPboardType:ORF + NSTypedFilenamesPboardType:PCT + NSTypedFilenamesPboardType:PDF + NSTypedFilenamesPboardType:PEF + NSTypedFilenamesPboardType:PIC + NSTypedFilenamesPboardType:PICT + NSTypedFilenamesPboardType:PNG + NSTypedFilenamesPboardType:PNT + NSTypedFilenamesPboardType:PNTG + NSTypedFilenamesPboardType:PS + NSTypedFilenamesPboardType:PSD + NSTypedFilenamesPboardType:QTI + NSTypedFilenamesPboardType:QTIF + NSTypedFilenamesPboardType:RAF + NSTypedFilenamesPboardType:RAW + NSTypedFilenamesPboardType:RGB + NSTypedFilenamesPboardType:RW2 + NSTypedFilenamesPboardType:RWL + NSTypedFilenamesPboardType:SGI + NSTypedFilenamesPboardType:SR2 + NSTypedFilenamesPboardType:SRF + NSTypedFilenamesPboardType:SRW + NSTypedFilenamesPboardType:TARGA + NSTypedFilenamesPboardType:TGA + NSTypedFilenamesPboardType:TIF + NSTypedFilenamesPboardType:TIFF + NSTypedFilenamesPboardType:XBM + NSTypedFilenamesPboardType:arw + NSTypedFilenamesPboardType:bmp + NSTypedFilenamesPboardType:cr2 + NSTypedFilenamesPboardType:crw + NSTypedFilenamesPboardType:cur + NSTypedFilenamesPboardType:dcr + NSTypedFilenamesPboardType:dng + NSTypedFilenamesPboardType:efx + NSTypedFilenamesPboardType:epi + NSTypedFilenamesPboardType:eps + NSTypedFilenamesPboardType:epsf + NSTypedFilenamesPboardType:epsi + NSTypedFilenamesPboardType:erf + NSTypedFilenamesPboardType:exr + NSTypedFilenamesPboardType:fax + NSTypedFilenamesPboardType:fff + NSTypedFilenamesPboardType:fpix + NSTypedFilenamesPboardType:fpx + NSTypedFilenamesPboardType:g3 + NSTypedFilenamesPboardType:gif + NSTypedFilenamesPboardType:hdr + NSTypedFilenamesPboardType:icns + NSTypedFilenamesPboardType:ico + NSTypedFilenamesPboardType:jfax + NSTypedFilenamesPboardType:jfif + NSTypedFilenamesPboardType:jfx + NSTypedFilenamesPboardType:jp2 + NSTypedFilenamesPboardType:jpe + NSTypedFilenamesPboardType:jpeg + NSTypedFilenamesPboardType:jpf + NSTypedFilenamesPboardType:jpg + NSTypedFilenamesPboardType:jps + NSTypedFilenamesPboardType:mac + NSTypedFilenamesPboardType:mos + NSTypedFilenamesPboardType:mpo + NSTypedFilenamesPboardType:mrw + NSTypedFilenamesPboardType:nef + NSTypedFilenamesPboardType:nrw + NSTypedFilenamesPboardType:orf + NSTypedFilenamesPboardType:pct + NSTypedFilenamesPboardType:pdf + NSTypedFilenamesPboardType:pef + NSTypedFilenamesPboardType:pic + NSTypedFilenamesPboardType:pict + NSTypedFilenamesPboardType:png + NSTypedFilenamesPboardType:pnt + NSTypedFilenamesPboardType:pntg + NSTypedFilenamesPboardType:ps + NSTypedFilenamesPboardType:psd + NSTypedFilenamesPboardType:qti + NSTypedFilenamesPboardType:qtif + NSTypedFilenamesPboardType:raf + NSTypedFilenamesPboardType:raw + NSTypedFilenamesPboardType:rgb + NSTypedFilenamesPboardType:rw2 + NSTypedFilenamesPboardType:rwl + NSTypedFilenamesPboardType:sgi + NSTypedFilenamesPboardType:sr2 + NSTypedFilenamesPboardType:srf + NSTypedFilenamesPboardType:srw + NSTypedFilenamesPboardType:targa + NSTypedFilenamesPboardType:tga + NSTypedFilenamesPboardType:tif + NSTypedFilenamesPboardType:tiff + NSTypedFilenamesPboardType:xbm + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + {438, 274} + + + + YES + NO + YES + YES + NO + YES + NO + NO + YES + YES + 148 + 148 + + + + + {{1, 1}, {438, 274}} + + + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + 6 + + + + -2147483392 + {{424, 1}, {15, 250}} + + + + NO + + _doScroller: + 1 + 0.96363627910614014 + + + + -2147483392 + {{-100, -100}, {438, 15}} + + + + NO + 1 + + _doScroller: + 0.50602412223815918 + + + {{20, 84}, {440, 276}} + + + + 133650 + + + + QSAAAEEgAABDPKqrQygAAA + 0.25 + 4 + 1 + + + + 289 + {{336, 12}, {130, 32}} + + + + YES + + 603979776 + 134217728 + Set as artwork + + .LucidaGrandeUI + 13 + 1044 + + + -2038284288 + 129 + + DQ + 200 + 25 + + NO + + + + 289 + {{364, 49}, {96, 18}} + + + + YES + + -2080112384 + 131072 + + + 1 + 0.20000000000000001 + 0.60000000000000009 + 0.0 + 5 + 1 + NO + NO + + NO + + + + 292 + {{14, 12}, {172, 32}} + + + + YES + + 603979776 + 134217728 + Load more artwork... + + + -2038284288 + 268435585 + + l + 200 + 25 + + NO + + + + 289 + {{240, 12}, {96, 32}} + + + + YES + + 67108864 + 134217728 + None + + + -2038284288 + 129 + + Gw + 200 + 25 + + NO + + + {480, 380} + + + + + {{0, 0}, {2560, 1418}} + {480, 402} + {10000000000000, 10000000000000} + artworkWindow + YES + + + + NO + + + + window + + + + 37 + + + + addArtwork: + + + + 38 + + + + slider + + + + 43 + + + + zoomSliderDidChange: + + + + 44 + + + + addArtworkButton + + + + 46 + + + + loadMoreArtwork: + + + + 47 + + + + loadMoreArtworkButton + + + + 48 + + + + addNoArtwork: + + + + 51 + + + + imageBrowser + + + + 45 + + + + delegate + + + + 35 + + + + _delegate + + + + 40 + + + + dataSource + + + + 41 + + + + _dataSource + + + + 39 + + + + delegate + + + + 42 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 3 + + + + + + + + 4 + + + + + + + + + + + + 7 + + + + + + + + 8 + + + + + + + + 9 + + + + + + + + 10 + + + + + + + + + + 12 + + + + + 13 + + + + + 14 + + + + + 15 + + + + + 16 + + + + + 49 + + + + + + + + 50 + + + + + 11 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.imagekit.ibplugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{387, 471}, {480, 380}} + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + + + + IKImageBrowserView + + id + id + id + + + + _dataSource + id + + + _delegate + id + + + _dragDestinationDelegate + id + + + + IBProjectSource + ./Classes/IKImageBrowserView.h + + + + SBArtworkSelector + NSWindowController + + id + id + id + id + + + + addArtwork: + id + + + addNoArtwork: + id + + + loadMoreArtwork: + id + + + zoomSliderDidChange: + id + + + + NSButton + IKImageBrowserView + NSButton + NSSlider + + + + addArtworkButton + NSButton + + + imageBrowser + IKImageBrowserView + + + loadMoreArtworkButton + NSButton + + + slider + NSSlider + + + + IBProjectSource + ./Classes/SBArtworkSelector.h + + + + + 0 + IBCocoaFramework + YES + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + diff --git a/English.lproj/Credits.rtf b/English.lproj/Credits.rtf new file mode 100755 index 0000000..72cbd5a --- /dev/null +++ b/English.lproj/Credits.rtf @@ -0,0 +1,52 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf390 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fswiss\fcharset0 ArialMT;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww9000\viewh8400\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 + +\f0\b\fs24 \cf0 Engineering & Human Interface Design: +\b0 \ + Damiano Galassi\ +\ + +\b Project Contributors:\ + +\b0 +\f1\fs26 Douglas Stebila +\f0\b\fs24 \ + +\b0 Ryan Walklin\ + Bicus\ + Odibi\ + +\f1\fs26 maury.markowitz +\f0\fs24 \ +\ + +\b Metadata providers: +\b0 \ + TMDb (TheMovieDB). This product uses the TMDb API but is not endorsed or certified by TMDb.\ + {\field{\*\fldinst{HYPERLINK "http://themoviedb.org/"}}{\fldrslt http://themoviedb.org/}}\ + TheTVDB\ + {\field{\*\fldinst{HYPERLINK "http://thetvdb.com/"}}{\fldrslt http://thetvdb.com/}}\ +\ + +\b Third-Party Resources:\ + +\b0 Tesseract\ + {\field{\*\fldinst{HYPERLINK "http://tesseract-ocr.googlecode.com"}}{\fldrslt http://tesseract-ocr.googlecode.com}}\ + Perian Project\ + {\field{\*\fldinst{HYPERLINK "http://perian.org/"}}{\fldrslt http://perian.org/}}\ + HandBrake\ + {\field{\*\fldinst{HYPERLINK "http://handbrake.fr/"}}{\fldrslt http://handbrake.fr/}}\ + The Mozilla Foundation and Dag \'c5gren for the universal charset detector.\ + mp4v2\ + {\field{\*\fldinst{HYPERLINK "http://code.google.com/p/mp4v2"}}{\fldrslt http://code.google.com/p/mp4v2}}\ + Transmission\ + {\field{\*\fldinst{HYPERLINK "http://www.transmissionbt.com/"}}{\fldrslt http://www.transmissionbt.com/}}\ + FFmpeg\ + {\field{\*\fldinst{HYPERLINK "http://ffmpeg.org/"}}{\fldrslt http://ffmpeg.org/}} \ + Video::Filename Perl library (by Behan Webster)\ + {\field{\*\fldinst{HYPERLINK "http://search.cpan.org/~behanw/Video-Filename-0.35/"}}{\fldrslt http://search.cpan.org/~behanw/Video-Filename-0.35/}}\ +\ +The code is available under the GPL. The development site is located at {\field{\*\fldinst{HYPERLINK "http://code.google.com/p/subler/"}}{\fldrslt http://code.google.com/p/subler/}}} \ No newline at end of file diff --git a/English.lproj/FileImport.xib b/English.lproj/FileImport.xib new file mode 100755 index 0000000..1be07fd --- /dev/null +++ b/English.lproj/FileImport.xib @@ -0,0 +1,956 @@ + + + + 1060 + 13A603 + 4511 + 1265 + 695.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 4511 + + + IBCustomCell + NSButton + NSButtonCell + NSCustomObject + NSProgressIndicator + NSScrollView + NSScroller + NSTableColumn + NSTableHeaderView + NSTableView + NSTextField + NSTextFieldCell + NSView + NSWindowTemplate + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + SBFileImport + + + FirstResponder + + + NSApplication + + + 11 + 2 + {{83, 714}, {644, 283}} + 872416256 + Window + NSWindow + + + {550, 216} + + + 256 + + + + 274 + + + + 2322 + + + + 256 + {602, 171} + + + + YES + NO + YES + + + 256 + {602, 17} + + + + + + + + -2147483392 + {{588, 0}, {16, 17}} + + + + + check + 20 + 20 + 20 + + 75497536 + 2048 + + + .LucidaGrandeUI + 11 + 3100 + + + 3 + MC4zMzMzMzI5OQA + + + 6 + System + headerTextColor + + 3 + MAA + + + + + 67108864 + 0 + + .LucidaGrandeUI + 13 + 1044 + + + + 3 + YES + YES + + + + trackId + 26 + 25 + 30 + + 75497536 + 2048 + Id + + + + + + 337641536 + 2048 + Text Cell + + + + 6 + System + controlBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + + + 3 + YES + + + + trackName + 159 + 40 + 400 + + 75497536 + 2048 + Name + + + 6 + System + headerColor + + 3 + MQA + + + + + + 337641536 + 2048 + Text Cell + + + + + + 3 + YES + + + + trackDuration + 84 + 10 + 110 + + 75497536 + 67110912 + Duration + + + + + + 337641536 + 67110912 + Text Cell + + + + + + 3 + YES + + + + trackLanguage + 86 + 10 + 90 + + 75497536 + 67110912 + Language + + + + + + 337641536 + 67110912 + Text Cell + + + + + + 3 + YES + + + + trackInfo + 82 + 10 + 90 + + 75497536 + 67110912 + Info + + + + + + 337641536 + 67110912 + Text Cell + + + + + + 3 + YES + + + + trackAction + 124 + 10 + 3.4028234663852886e+38 + + 75497536 + 2048 + Action + + + + + + 67108864 + 0 + + + + 3 + YES + YES + + + + 3 + 2 + + + 6 + System + gridColor + + 3 + MC41AA + + + 17 + -692027392 + + + 1 + 15 + 0 + YES + 0 + 1 + + + {{1, 17}, {602, 171}} + + + + + + 4 + + + + -2147483392 + {{588, 17}, {15, 12}} + + + + NO + + _doScroller: + 0.99056603773584906 + + + + -2147483392 + {{1, 172}, {602, 16}} + + + + NO + 1 + + _doScroller: + 0.99834162520729686 + + + + 2338 + + + + {{1, 0}, {602, 17}} + + + + + + 4 + + + {{20, 49}, {604, 189}} + + + + 133682 + + + + + QSAAAEEgAABBmAAAQZgAAA + 0.25 + 4 + 1 + + + + 268 + {{17, 246}, {92, 17}} + + + + YES + + 68157504 + 272630784 + Select tracks: + + .LucidaGrandeUI-Bold + 13 + 2072 + + + + 6 + System + controlColor + + + + + NO + 1 + + + + 289 + {{534, 13}, {96, 32}} + + + + YES + + 603979776 + 134217728 + Add + + + -2038284288 + 129 + + DQ + 200 + 25 + + NO + + + + 289 + {{438, 13}, {96, 32}} + + + + YES + + 67108864 + 134217728 + Cancel + + + -2038284288 + 129 + + Gw + 200 + 25 + + NO + + + + -2147483382 + {{155, 20}, {189, 20}} + + + + 16394 + 100 + + + + 292 + {{18, 22}, {127, 18}} + + + + YES + + -1543503872 + 0 + Import Metadata + + + 1211912448 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + NO + + + {644, 283} + + + + + {{0, 0}, {2560, 1418}} + {550, 238} + {10000000000000, 10000000000000} + YES + + + + NO + + + + window + + + + 3 + + + + closeWindow: + + + + 29 + + + + addTracks: + + + + 30 + + + + addTracksButton + + + + 33 + + + + loadProgressBar + + + + 35 + + + + importMetadata + + + + 38 + + + + tableView + + + + 31 + + + + delegate + + + + 49 + + + + dataSource + + + + 24 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + + + + 2 + + + + + + + + + + + + + 4 + + + + + + + + + + + 5 + + + + + 6 + + + + + 8 + + + + + 13 + + + + + + + + 14 + + + + + 25 + + + + + + + + 26 + + + + + + + + 27 + + + + + 28 + + + + + 34 + + + + + 36 + + + + + + + + 37 + + + + + 7 + + + + + + + + + + + + + + 9 + + + + + + + + 10 + + + + + + + + 15 + + + + + + + + 17 + + + + + + + + 20 + + + + + + + + 22 + + + + + + + + 39 + + + + + + + + 52 + + + + + 23 + + + + + 21 + + + + + 18 + + + + + 16 + + + + + 11 + + + + + 53 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{452, 617}, {644, 238}} + + 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 + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + + + + SBFileImport + NSWindowController + + id + id + + + + addTracks: + id + + + closeWindow: + id + + + + NSButton + NSButton + NSProgressIndicator + NSTableView + + + + addTracksButton + NSButton + + + importMetadata + NSButton + + + loadProgressBar + NSProgressIndicator + + + tableView + NSTableView + + + + IBProjectSource + ./Classes/SBFileImport.h + + + + + 0 + IBCocoaFramework + YES + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + NSSwitch + {15, 15} + + + + + + NSCell + + + + diff --git a/English.lproj/InfoPlist.strings b/English.lproj/InfoPlist.strings new file mode 100755 index 0000000..5e45963 Binary files /dev/null and b/English.lproj/InfoPlist.strings differ diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib new file mode 100755 index 0000000..407ca24 --- /dev/null +++ b/English.lproj/MainMenu.xib @@ -0,0 +1,2354 @@ + + + + 1060 + 12F30 + 4488.2 + 1187.39 + 626.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 4488.2 + + + NSCustomObject + NSMenu + NSMenuItem + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + + + Subler + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + Subler + + + + About Subler + + 2147483647 + + + + + + Check for Updates… + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Donate… + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide Subler + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit Subler + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + File + + 1048576 + 2147483647 + + + submenuAction: + + File + + + + New + n + 1048576 + 2147483647 + + + + + + Open… + o + 1048576 + 2147483647 + + + + + + Open Recent + + 1048576 + 2147483647 + + + submenuAction: + + Open Recent + + + + Clear Menu + + 1048576 + 2147483647 + + + + + _NSRecentDocumentsMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Close + w + 1048576 + 2147483647 + + + + + + Save + s + 1048576 + 2147483647 + + + + + + Save As… + S + 1179648 + 2147483647 + + + + + + Optimize + O + 1048576 + 2147483647 + + + + + + Revert to Saved + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Send To Queue + + 2147483647 + + + + + + Send To iTunes + + 2147483647 + + + + + + Import + + 2147483647 + + + submenuAction: + + Import + + + + Search metadata online… + M + 1048576 + 2147483647 + + + + + + Metadata… + + 2147483647 + + + + + + File… + + 2147483647 + + + + + + + + + Export… + e + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Page Setup... + P + 1179648 + 2147483647 + + + + + + + Print… + p + 1048576 + 2147483647 + + + + + + + + + Edit + + 1048576 + 2147483647 + + + submenuAction: + + Edit + + + + Undo + z + 1048576 + 2147483647 + + + + + + Redo + Z + 1179648 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Cut + x + 1048576 + 2147483647 + + + + + + Copy + c + 1048576 + 2147483647 + + + + + + Paste + v + 1048576 + 2147483647 + + + + + + Delete + + 1048576 + 2147483647 + + + + + + Select All + a + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Offset… + + 2147483647 + + + + + + Insert a Chapter + + 2147483647 + + + submenuAction: + + Insert a Chapter + + + + Every + + 2147483647 + + + submenuAction: + + Every + + + + 1 minutes + + 2147483647 + + + 1 + + + + 2 minutes + + 2147483647 + + + 2 + + + + 5 minutes + + 2147483647 + + + 5 + + + + 10 minutes + + 2147483647 + + + 10 + + + + 15 minutes + + 2147483647 + + + 15 + + + + 20 minutes + + 2147483647 + + + 20 + + + + 30 minutes + + 2147483647 + + + 30 + + + + + + + At the begin + + 2147483647 + + + + + + + + + iTunes friendly groups + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Find + + 1048576 + 2147483647 + + + submenuAction: + + Find + + + + Find… + f + 1048576 + 2147483647 + + + 1 + + + + Find Next + g + 1048576 + 2147483647 + + + 2 + + + + Find Previous + G + 1179648 + 2147483647 + + + 3 + + + + Use Selection for Find + e + 1048576 + 2147483647 + + + 7 + + + + Jump to Selection + j + 1048576 + 2147483647 + + + + + + + + + Spelling and Grammar + + 1048576 + 2147483647 + + + submenuAction: + + Spelling and Grammar + + + + Show Spelling… + : + 1048576 + 2147483647 + + + + + + Check Spelling + ; + 1048576 + 2147483647 + + + + + + Check Spelling While Typing + + 1048576 + 2147483647 + + + + + + Check Grammar With Spelling + + 1048576 + 2147483647 + + + + + + + + + Substitutions + + 1048576 + 2147483647 + + + submenuAction: + + Substitutions + + + + Smart Copy/Paste + f + 1048576 + 2147483647 + + + 1 + + + + Smart Quotes + g + 1048576 + 2147483647 + + + 2 + + + + Smart Links + G + 1179648 + 2147483647 + + + 3 + + + + + + + Speech + + 1048576 + 2147483647 + + + submenuAction: + + Speech + + + + Start Speaking + + 1048576 + 2147483647 + + + + + + Stop Speaking + + 1048576 + 2147483647 + + + + + + + + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + + View + + + + Show Toolbar + t + 1572864 + 2147483647 + + + + + + Customize Toolbar… + + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Show Queue + p + 1572864 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 1048576 + 2147483647 + + + submenuAction: + + Help + + + + Subler Help + ? + 1048576 + 2147483647 + + + + + + + + _NSMainMenu + + + NSFontManager + + + SBAppDelegate + + + SUUpdater + + + + NO + + + + terminate: + + + + 448 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + delegate + + + + 450 + + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + runPageLayout: + + + + 87 + + + + clearRecentDocuments: + + + + 127 + + + + performClose: + + + + 193 + + + + toggleContinuousSpellChecking: + + + + 222 + + + + undo: + + + + 223 + + + + copy: + + + + 224 + + + + checkSpelling: + + + + 225 + + + + paste: + + + + 226 + + + + stopSpeaking: + + + + 227 + + + + cut: + + + + 228 + + + + showGuessPanel: + + + + 230 + + + + redo: + + + + 231 + + + + selectAll: + + + + 232 + + + + startSpeaking: + + + + 233 + + + + delete: + + + + 235 + + + + performZoom: + + + + 240 + + + + performFindPanelAction: + + + + 241 + + + + centerSelectionInVisibleArea: + + + + 245 + + + + toggleGrammarChecking: + + + + 347 + + + + toggleSmartInsertDelete: + + + + 355 + + + + toggleAutomaticQuoteSubstitution: + + + + 356 + + + + toggleAutomaticLinkDetection: + + + + 357 + + + + saveDocument: + + + + 362 + + + + saveDocumentAs: + + + + 363 + + + + revertDocumentToSaved: + + + + 364 + + + + runToolbarCustomizationPalette: + + + + 365 + + + + toggleToolbarShown: + + + + 366 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + openDocument: + + + + 372 + + + + printDocument: + + + + 373 + + + + saveAndOptimize: + + + + 452 + + + + selectFile: + + + + 551 + + + + newDocument: + + + + 556 + + + + showPrefsWindow: + + + + 558 + + + + selectMetadataFile: + + + + 565 + + + + showTrackOffsetSheet: + + + + 570 + + + + export: + + + + 591 + + + + searchMetadata: + + + + 593 + + + + showBatchWindow: + + + + 596 + + + + sendToExternalApp: + + + + 598 + + + + sendToQueue: + + + + 599 + + + + addChaptersEvery: + + + + 651 + + + + iTunesFriendlyTrackGroups: + + + + 654 + + + + addChaptersEvery: + + + + 663 + + + + addChaptersEvery: + + + + 664 + + + + addChaptersEvery: + + + + 665 + + + + addChaptersEvery: + + + + 666 + + + + addChaptersEvery: + + + + 667 + + + + addChaptersEvery: + + + + 668 + + + + addChaptersEvery: + + + + 669 + + + + donate: + + + + 528 + + + + help: + + + + 557 + + + + checkForUpdates: + + + + 531 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + + + + + + + + + MainMenu + + + 19 + + + + + + + + 56 + + + + + + + + 103 + + + + + + 1 + + + 217 + + + + + + + + 83 + + + + + + + + 81 + + + + + + + + + + + + + + + + + + + + + + + + 75 + + + 3 + + + 80 + + + 8 + + + 78 + + + 6 + + + 72 + + + + + 124 + + + + + + + + 77 + + + 5 + + + 73 + + + 1 + + + 79 + + + 7 + + + 112 + + + 10 + + + 74 + + + 2 + + + 125 + + + + + + + + 126 + + + + + 205 + + + + + + + + + + + + + + + + + + + + + + + + 202 + + + + + 198 + + + + + 207 + + + + + 199 + + + + + 203 + + + + + 197 + + + + + 206 + + + + + 215 + + + + + 218 + + + + + + + + 216 + + + + + + + + 200 + + + + + + + + + + + 219 + + + + + 201 + + + + + 204 + + + + + 220 + + + + + + + + + + + + 213 + + + + + 210 + + + + + 221 + + + + + 208 + + + + + 209 + + + + + 106 + + + + + + 2 + + + 111 + + + + + 57 + + + + + + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + 1111 + + + 144 + + + + + 129 + + + 121 + + + 143 + + + + + 236 + + + + + 131 + + + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + + + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + + + + + + 296 + + + + + + + + + 297 + + + + + 298 + + + + + 211 + + + + + + + + 212 + + + + + + + + + 195 + + + + + 196 + + + + + 346 + + + + + 348 + + + + + + + + 349 + + + + + + + + + + 350 + + + + + 351 + + + + + 354 + + + + + 419 + + + + + 449 + + + AppDelegate + + + 451 + + + 3 + + + 453 + + + + + 454 + + + + + 529 + + + + + 530 + + + + + 532 + + + + + 543 + + + + + 544 + + + + + + + + 545 + + + + + + + + + + 549 + + + + + 550 + + + + + 555 + + + + + 561 + + + 10 + + + 564 + + + + + 567 + + + + + 568 + + + + + 573 + + + + + + + + 589 + + + 10 + + + 594 + + + + + 595 + + + + + 597 + + + 10 + + + 574 + + + + + + + + + 633 + + + + + 634 + + + + + + + + 652 + + + + + 655 + + + + + + + + + + + + + + 656 + + + + + 657 + + + + + 658 + + + + + 659 + + + + + 660 + + + + + 661 + + + + + 662 + + + + + + + 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 + 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 + 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 + 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 + + + + + + + + 0 + IBCocoaFramework + YES + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + {11, 11} + {10, 3} + + + diff --git a/English.lproj/MetadataSearch.xib b/English.lproj/MetadataSearch.xib new file mode 100755 index 0000000..41298b4 --- /dev/null +++ b/English.lproj/MetadataSearch.xib @@ -0,0 +1,2191 @@ + + + + 1060 + 13A603 + 4511 + 1265 + 695.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 4511 + + + NSButton + NSButtonCell + NSComboBox + NSComboBoxCell + NSCustomObject + NSCustomView + NSMenu + NSMenuItem + NSPopUpButton + NSPopUpButtonCell + NSProgressIndicator + NSScrollView + NSScroller + NSSplitView + NSTabView + NSTabViewItem + NSTableColumn + NSTableHeaderView + NSTableView + NSTextField + NSTextFieldCell + NSView + NSWindowTemplate + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + SBMetadataSearchController + + + FirstResponder + + + NSApplication + + + 11 + 2 + {{252, 134}, {550, 468}} + 872416256 + Window + NSWindow + + + {550, 468} + + + 256 + + + + 289 + {{440, 12}, {96, 32}} + + + + YES + + 603979776 + 134217728 + Add + + .LucidaGrandeUI + 13 + 1044 + + + -2038284288 + 129 + + + 200 + 25 + + NO + + + + 289 + {{344, 12}, {96, 32}} + + + + YES + + 67108864 + 134217728 + Cancel + + + -2038284288 + 129 + + Gw + 200 + 25 + + NO + + + + 274 + + + + 256 + + + + 274 + + + + 2322 + + + + 256 + {508, 77} + + + + YES + NO + YES + + + 256 + {508, 17} + + + + + + + + -2147483392 + {{224, 0}, {16, 17}} + + + + + 505 + 40 + 1000 + + 75497536 + 2048 + Title + + .LucidaGrandeUI + 11 + 3100 + + + 3 + MC4zMzMzMzI5ODU2AA + + + 6 + System + headerTextColor + + 3 + MAA + + + + + 67108928 + 133120 + Text Cell + + + + 6 + System + controlBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + + + 3 + YES + YES + + + + 3 + 2 + + 3 + MQA + + + 6 + System + gridColor + + 3 + MC41AA + + + 14 + 1119879168 + + + 4 + 15 + 0 + YES + 0 + 1 + + + {{1, 17}, {508, 77}} + + + + + + 4 + + + + -2147483392 + {{224, 17}, {15, 102}} + + + + NO + + _doScroller: + 0.89795918367346939 + + + + -2147483392 + {{1, 149}, {438, 15}} + + + + NO + 1 + + _doScroller: + 1 + 0.99319727891156462 + + + + 2338 + + + + {{1, 0}, {508, 17}} + + + + + + 4 + + + {510, 95} + + + + 133682 + + + + + QSAAAEEgAABBgAAAQYAAAA + 0.25 + 4 + 1 + + + {510, 95} + + + + YES + NSView + + + + 256 + + + + 274 + + + + 2322 + + + + 256 + {508, 164} + + + + YES + NO + YES + + + 256 + {508, 17} + + + + + + + + -2147483392 + {{224, 0}, {16, 17}} + + + + + name + 101 + 40 + 1000 + + 75497536 + 2048 + Annotation + + + 3 + MC4zMzMzMzI5ODU2AA + + + + + 67108864 + 67239936 + Text Cell + + + + + + YES + + + + value + 401 + 40 + 1000 + + 75497536 + 2048 + Value + + + + + + 67108864 + 131072 + Text Cell + + + + + + 3 + YES + + + + 3 + 2 + + + 14 + 1925185536 + + + 1 + 4 + 15 + 0 + NO + 0 + 1 + + + {{1, 17}, {508, 164}} + + + + + + 4 + + + + -2147483392 + {{224, 17}, {15, 102}} + + + + NO + + _doScroller: + 0.97391304347826091 + + + + -2147483392 + {{1, 72}, {135, 15}} + + + + NO + 1 + + _doScroller: + 0.91836734693877553 + + + + 2338 + + + + {{1, 0}, {508, 17}} + + + + + + 4 + + + {510, 182} + + + + 133682 + + + + + QSAAAEEgAABBgAAAQYAAAA + 0.25 + 4 + 1 + + + {{0, 104}, {510, 182}} + + + + YES + NSView + + + {{20, 60}, {510, 286}} + + + + + + + -2147482332 + {{20, 20}, {16, 16}} + + + + 20746 + 100 + + + + 266 + {{13, 344}, {524, 110}} + + + + + + 1 + + + 274 + + + + 268 + {{14, 41}, {63, 17}} + + + + YES + + 68157504 + 71304192 + Movie: + + + + 6 + System + controlColor + + + + + NO + 1 + + + + 266 + {{82, 38}, {323, 22}} + + + + YES + + -1804599231 + 272630784 + + + + YES + + 6 + System + textBackgroundColor + + + + 6 + System + textColor + + + + NO + 1 + + + + 268 + {{80, 6}, {185, 26}} + + + + YES + + -2076180416 + 2048 + + + 109199360 + 129 + + + 400 + 75 + + + Item 1 + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + + YES + + OtherViews + + + + + Item 2 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Item 3 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + + 1 + YES + YES + 2 + + NO + + + + 265 + {{387, 8}, {102, 21}} + + + + _NS:9 + YES + + -2080374720 + 2048 + + _NS:9 + + 1211650304 + 2 + + NSImage + NSRadioButton + + + NSRadioButton + + + + 400 + 75 + + + iTunes Store + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + OtherViews + + + + + TheMovieDB + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + + 1 + YES + YES + 2 + + NO + + + {{10, 33}, {504, 64}} + + + + + Movie + + + + + 2 + + + 274 + + + + 268 + {{14, 42}, {63, 17}} + + + YES + + 68157504 + 71304192 + TV Show: + + + + + + NO + 1 + + + + 268 + {{14, 12}, {63, 17}} + + + YES + + 68157504 + 71304192 + Season # + + + + + + NO + 1 + + + + 268 + {{82, 9}, {30, 22}} + + + YES + + -1804599231 + 272630784 + + + + YES + + + + NO + 1 + + + + 268 + {{188, 9}, {30, 22}} + + + YES + + -1804599231 + 272630784 + + + + YES + + + + NO + 1 + + + + 268 + {{117, 12}, {66, 17}} + + + YES + + 68157504 + 71304192 + Episode # + + + + + + NO + 1 + + + + 266 + {{82, 37}, {326, 26}} + + + YES + + 342884416 + 272630784 + + + + YES + + + 5 + YES + YES + YES + + + + + 274 + {13, 0} + + + YES + NO + YES + + + 10 + 10 + 1000 + + 75497472 + 0 + + + LucidaGrande + 12 + 16 + + + 3 + MC4zMzMzMzI5ODU2AA + + + + + 338690112 + 268436480 + + + YES + + + + 3 + YES + + + + 3 + 2 + + + 19 + tableViewAction: + -765427712 + + + 1 + 15 + 0 + YES + 0 + 1 + + + NO + 1 + + + + + 268 + {{224, 6}, {157, 26}} + + + YES + + -2076180416 + 2048 + + + 109199360 + 129 + + + 400 + 75 + + + Item 1 + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + OtherViews + + + + + Item 2 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Item 3 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + + 1 + YES + YES + 2 + + NO + + + + 265 + {{387, 8}, {102, 21}} + + _NS:9 + YES + + -2080374720 + 2048 + + _NS:9 + + 1211650304 + 2 + + + + + 400 + 75 + + + iTunes Store + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + OtherViews + + + + + TheTVDB + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + + 1 + YES + YES + 2 + + NO + + + {{10, 33}, {504, 64}} + + + TV Episode + + + + + + + 0 + YES + YES + + + + + + + -2147483356 + {{41, 21}, {297, 14}} + + + + YES + + 68157504 + 272761856 + Progress status + + + + + + NO + 1 + + + + 269 + {{434, 389}, {82, 32}} + + + + YES + + 603979776 + 134217728 + Search + + + -2038284288 + 129 + + DQ + 200 + 25 + + NO + + + {550, 468} + + + + + {{0, 0}, {2560, 1418}} + {550, 490} + {10000000000000, 10000000000000} + searchWindow + YES + + + + NO + + + + closeWindow: + + + + 52 + + + + window + + + + 53 + + + + tvSeasonNum + + + + 110 + + + + tvEpisodeNum + + + + 111 + + + + progress + + + + 118 + + + + searchMode + + + + 120 + + + + addButton + + + + 130 + + + + tvSeriesName + + + + 138 + + + + movieName + + + + 154 + + + + progressText + + + + 178 + + + + loadAdditionalMetadata: + + + + 180 + + + + tvLanguage + + + + 198 + + + + movieLanguage + + + + 205 + + + + tvMetadataProvider + + + + 223 + + + + metadataProviderSelected: + + + + 224 + + + + metadataProviderLanguageSelected: + + + + 226 + + + + metadataProviderLanguageSelected: + + + + 227 + + + + metadataTable + + + + 127 + + + + resultsTable + + + + 123 + + + + metadataProviderSelected: + + + + Iyv-27-FbT + + + + movieMetadataProvider + + + + Bne-Rm-aiX + + + + searchForResults: + + + + 179 + + + + searchButton + + + + 112 + + + + delegate + + + + 126 + + + + dataSource + + + + 125 + + + + dataSource + + + + 121 + + + + delegate + + + + 122 + + + + delegate + + + + 119 + + + + delegate + + + + 115 + + + + delegate + + + + 116 + + + + delegate + + + + 137 + + + + dataSource + + + + 143 + + + + delegate + + + + 153 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 3 + + + + + + + + 4 + + + + + + + + + + + + + + 6 + + + + + 7 + + + + + + + + + 8 + + + + + + + + 9 + + + + + + + + 12 + + + + + 13 + + + + + 14 + + + + + + + + 15 + + + + + + + + 16 + + + + + + + + + + + 17 + + + + + 18 + + + + + 20 + + + + + 25 + + + + + + + + + + + 26 + + + + + 27 + + + + + 29 + + + + + 62 + + + + + + + + + 63 + + + + + + + + 64 + + + + + + + + 65 + + + + + + + + + + + 66 + + + + + + + + + + + + + + + 89 + + + + + + + + 90 + + + + + 96 + + + + + + + + 97 + + + + + 98 + + + + + + + + 99 + + + + + 100 + + + + + + + + 101 + + + + + 102 + + + + + + + + 103 + + + + + 135 + + + + + + + + 136 + + + + + 176 + + + + + + + + 177 + + + + + 192 + + + + + + + + 193 + + + + + + + + 194 + + + + + + + + + + 195 + + + + + 196 + + + + + 197 + + + + + 199 + + + + + + + + 200 + + + + + + + + 201 + + + + + + + + + + 202 + + + + + 203 + + + + + 204 + + + + + 217 + + + + + + + + 218 + + + + + + + + 219 + + + + + + + + + 220 + + + + + 221 + + + + + 19 + + + + + + + + + 21 + + + + + + + + 22 + + + + + + + + 23 + + + + + 24 + + + + + 28 + + + + + + + + 30 + + + + + + + + 31 + + + + + 151 + + + + + + + + 152 + + + + + 145 + + + + + + + + 148 + + + + + Dqq-15-Mee + + + + + + + + MaT-Se-EGC + + + + + + + + g4k-W3-b6M + + + + + + + + + 5jG-kG-wLF + + + + + giP-a2-HBU + + + + + 67 + + + + + + + + 68 + + + + + + + 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 + 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 + {{252, 134}, {550, 468}} + + 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 + + + + + + + + + + SBMetadataSearchController + NSWindowController + + id + id + id + id + id + + + + closeWindow: + id + + + loadAdditionalMetadata: + id + + + metadataProviderLanguageSelected: + id + + + metadataProviderSelected: + id + + + searchForResults: + id + + + + NSButton + SBTableView + NSPopUpButton + NSPopUpButton + NSTextField + NSProgressIndicator + NSTextField + NSTableView + NSButton + NSTabView + NSTextField + NSPopUpButton + NSPopUpButton + NSTextField + NSComboBox + + + + addButton + NSButton + + + metadataTable + SBTableView + + + movieLanguage + NSPopUpButton + + + movieMetadataProvider + NSPopUpButton + + + movieName + NSTextField + + + progress + NSProgressIndicator + + + progressText + NSTextField + + + resultsTable + NSTableView + + + searchButton + NSButton + + + searchMode + NSTabView + + + tvEpisodeNum + NSTextField + + + tvLanguage + NSPopUpButton + + + tvMetadataProvider + NSPopUpButton + + + tvSeasonNum + NSTextField + + + tvSeriesName + NSComboBox + + + + IBProjectSource + ./Classes/SBMetadataSearchController.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 + + {11, 11} + {10, 3} + {16, 15} + + + diff --git a/English.lproj/Prefs.xib b/English.lproj/Prefs.xib new file mode 100755 index 0000000..025eaba --- /dev/null +++ b/English.lproj/Prefs.xib @@ -0,0 +1,2250 @@ + + + + 1060 + 13A603 + 4511 + 1265 + 695.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 4511 + + + NSButton + NSButtonCell + NSCustomObject + NSCustomView + NSMenu + NSMenuItem + NSPopUpButton + NSPopUpButtonCell + NSScrollView + NSScroller + NSTableColumn + NSTableView + NSTextField + NSTextFieldCell + NSUserDefaultsController + NSView + NSWindowTemplate + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + SBPrefsController + + + FirstResponder + + + NSApplication + + + 7 + 2 + {{625, 992}, {400, 130}} + -1334311936 + Preferences + NSWindow + + + + + 256 + {400, 130} + + {{0, 0}, {2560, 1418}} + {10000000000000, 10000000000000} + YES + + + + defaultPreset + checkForUpdate + SUEnableAutomaticChecks + windowSize + rememberWindowSize + chaptersPreviewTrack + + YES + + + + 292 + + + + 268 + {{161, 96}, {167, 14}} + + + _NS:1535 + YES + + 68157504 + 272630784 + USA ratings are always shown. + + .LucidaGrandeUI + 11 + 3100 + + _NS:1535 + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + NO + 1 + + + + 268 + {{160, 109}, {185, 26}} + + + _NS:9 + YES + + -2076180416 + 2048 + + .LucidaGrandeUI + 13 + 1044 + + _NS:9 + + 109199360 + 129 + + + 400 + 75 + + + Item 1 + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + + YES + + OtherViews + + + + + Item 2 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Item 3 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + + 1 + YES + YES + 2 + + NO + + + + 268 + {{156, 13}, {192, 32}} + + YES + + 67108864 + 134217728 + Delete cached metadata + + + -2038284288 + 129 + + + 200 + 25 + + NO + + + + 268 + {{156, 44}, {192, 32}} + + + YES + + 67108864 + 134217728 + Clear recent searches + + + -2038284288 + 129 + + + 200 + 25 + + NO + + + + 301 + {{160, 154}, {192, 18}} + + + YES + + 67108864 + 0 + Create Preview Images + + + 1211912448 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + NO + + + + 301 + {{92, 54}, {65, 17}} + + + YES + + 68157504 + 71304192 + Privacy: + + + + + + NO + 1 + + + + 301 + {{47, 115}, {110, 17}} + + + YES + + 68157504 + 272630784 + Show ratings for: + + + + + + NO + 1 + + + + 301 + {{92, 155}, {65, 17}} + + + YES + + 68157504 + 272630784 + Chapters: + + + + + + NO + 1 + + + + 301 + {{160, 179}, {192, 18}} + + + YES + + -2080374784 + 0 + Remember Size + + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + + 301 + {{160, 204}, {192, 18}} + + + YES + + -2080374784 + 0 + Automatically check daily + + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + + 301 + {{99, 180}, {58, 17}} + + + YES + + 68157504 + 272630784 + Window: + + + + + + NO + 1 + + + + 301 + {{40, 205}, {117, 17}} + + + YES + + 68157504 + 272630784 + Check for update: + + + + + + NO + 1 + + + {396, 242} + + NSView + + + + 292 + + + + 301 + {{172, 167}, {169, 18}} + + + + YES + + 67108864 + 0 + Keep groups organized + + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + + 301 + {{53, 168}, {115, 17}} + + + + YES + + 68157504 + 272630784 + Alternate Groups: + + + + + + NO + 1 + + + + 268 + {{172, 17}, {63, 26}} + + + + _NS:179 + YES + + -2076180416 + 2048 + + _NS:179 + + 109199360 + 129 + + + 400 + 75 + + + 80 + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + 80 + + + YES + + OtherViews + + + + 64 + + 1048576 + 2147483647 + + + _popUpItemAction: + 64 + + + + + + 96 + + 1048576 + 2147483647 + + + _popUpItemAction: + 96 + + + + + 112 + + 1048576 + 2147483647 + + + _popUpItemAction: + 112 + + + + + 128 + + 1048576 + 2147483647 + + + _popUpItemAction: + 128 + + + + + 144 + + 1048576 + 2147483647 + + + _popUpItemAction: + 144 + + + + + 160 + + 1048576 + 2147483647 + + + _popUpItemAction: + 160 + + + + + + 1 + 1 + YES + YES + 2 + + NO + + + + 268 + {{172, 47}, {178, 26}} + + + + YES + + -2076180416 + 2048 + + + 109199360 + 129 + + + 400 + 75 + + + Dolby Pro Logic II + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + 1 + + + YES + + OtherViews + + + + + Dolby Pro Logic + + 1048576 + 2147483647 + + + _popUpItemAction: + 2 + + + + + Stereo + + 1048576 + 2147483647 + + + _popUpItemAction: + 3 + + + + + Mono + + 1048576 + 2147483647 + + + _popUpItemAction: + 4 + + + + + Multi-Channel + + 1048576 + 2147483647 + + + _popUpItemAction: + 5 + + + + + + 1 + YES + YES + 2 + + NO + + + + 301 + {{172, 133}, {124, 18}} + + + + YES + + 67108864 + 0 + VobSub to Tx3g + + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + + 301 + {{190, 93}, {91, 18}} + + + + YES + + 67108864 + 0 + Keep AC-3 + + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + + 301 + {{172, 113}, {143, 18}} + + + + YES + + 67108864 + 0 + AC-3 audio to AAC + + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + + 301 + {{237, 24}, {35, 17}} + + + YES + + 68157504 + 272630784 + kbps + + + + + + NO + 1 + + + + 301 + {{33, 24}, {136, 17}} + + + + YES + + 68157504 + 272630784 + Bitrate (per channel): + + + + + + NO + 1 + + + + 301 + {{44, 53}, {125, 17}} + + + + YES + + 68157504 + 272630784 + Downmix audio to: + + + + + + NO + 1 + + + + 301 + {{111, 134}, {58, 17}} + + + + YES + + 68157504 + 272630784 + Convert: + + + + + + NO + 1 + + + {400, 203} + + + + NSView + + + YES + + + + 292 + + + + 268 + {{20, 19}, {25, 21}} + + YES + + -1543503872 + 134217728 + + + + -2033434624 + 162 + + NSImage + NSRemoveTemplate + + + + 400 + 75 + + NO + + + + 268 + + + + 2322 + + + + 256 + {354, 195} + + + YES + NO + YES + + + -2147483392 + {{224, 0}, {16, 17}} + + + + name + 328 + 40 + 1000 + + 75497536 + 2048 + + + + 3 + MC4zMzMzMzI5ODU2AA + + + 6 + System + headerTextColor + + + + + 337641536 + 2048 + Text Cell + + + + 6 + System + controlBackgroundColor + + + + + 3 + YES + + + + info + 20 + 20 + 20 + + 75497536 + 2048 + + + + + + + 67108864 + 134217728 + + + + 141836288 + 45 + + NSImage + info + + + NSImage + info-pressed + + + + 200 + 25 + + 3 + YES + YES + + + + 3 + 2 + + 6 + System + _sourceListBackgroundColor + + 6 + System + alternateSelectedControlColor + + 1 + MCAwIDEAA + + + + + 6 + System + gridColor + + 3 + MC41AA + + + 17 + 314572800 + + + 5 + 15 + 0 + NO + 1 + 1 + + + {{1, 1}, {354, 195}} + + + + + 4 + + + + -2147483392 + {{224, 17}, {15, 102}} + + + NO + + _doScroller: + 0.99489795918367352 + + + + -2147483392 + {{1, 181}, {354, 15}} + + + NO + 1 + + _doScroller: + 0.9971830985915493 + + + {{20, 46}, {356, 197}} + + + 133682 + + + + QSAAAEEgAABBmAAAQZgAAA + 0.25 + 4 + 1 + + + {396, 263} + + NSView + + + + + + + Show in Finder + + 2147483647 + + + + + + Delete + + 2147483647 + + + + + + + + NO + + + + window + + + + 6 + + + + generalView + + + + 93 + + + + clearRecentSearches: + + + + 135 + + + + deleteCachedMetadata: + + + + 141 + + + + setsView + + + + 172 + + + + removeSet + + + + 188 + + + + updateRatingsCountry: + + + + 242 + + + + tableView + + + + 182 + + + + toggleInfoWindow: + + + + 187 + + + + advancedView + + + + A3V-qO-eaD + + + + deletePreset: + + + + 28m-Sn-BGs + + + + deletePreset: + + + + 186 + + + + value: values.SUEnableAutomaticChecks + + + + + + value: values.SUEnableAutomaticChecks + value + values.SUEnableAutomaticChecks + 2 + + + 90 + + + + value: values.rememberWindowSize + + + + + + value: values.rememberWindowSize + value + values.rememberWindowSize + + NSValidatesImmediately + + + 2 + + + 92 + + + + value: values.chaptersPreviewTrack + + + + + + value: values.chaptersPreviewTrack + value + values.chaptersPreviewTrack + + NSValidatesImmediately + + + 2 + + + 91 + + + + value: values.SBAudioConvertAC3 + + + + + + value: values.SBAudioConvertAC3 + value + values.SBAudioConvertAC3 + 2 + + + 112 + + + + selectedTag: values.SBAudioMixdown + + + + + + selectedTag: values.SBAudioMixdown + selectedTag + values.SBAudioMixdown + 2 + + + 129 + + + + dataSource + + + + 173 + + + + delegate + + + + 183 + + + + menu + + + + mip-SD-ob5 + + + + selectedTag: values.SBAudioBitrate + + + + + + selectedTag: values.SBAudioBitrate + selectedTag + values.SBAudioBitrate + 2 + + + 205 + + + + content: ratingsCountries + + + + + + content: ratingsCountries + content + ratingsCountries + 2 + + + 245 + + + + selectedValue: values.SBRatingsCountry + + + + + + selectedValue: values.SBRatingsCountry + selectedValue + values.SBRatingsCountry + + 2 + + + 248 + + + + value: values.SBOrganizeAlternateGroups + + + + + + value: values.SBOrganizeAlternateGroups + value + values.SBOrganizeAlternateGroups + 2 + + + dwA-nR-J68 + + + + value: values.SBAudioKeepAC3 + + + + + + value: values.SBAudioKeepAC3 + value + values.SBAudioKeepAC3 + 2 + + + W2T-se-Fud + + + + enabled: values.SBAudioConvertAC3 + + + + + + enabled: values.SBAudioConvertAC3 + enabled + values.SBAudioConvertAC3 + 2 + + + st6-D0-eUe + + + + value: values.SBSubtitleConvertBitmap + + + + + + value: values.SBSubtitleConvertBitmap + value + values.SBSubtitleConvertBitmap + 2 + + + beC-0w-uVY + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + + + + 2 + + + + + + 3 + + + + + 76 + + + + + + + + + + + + + + + + + General View + + + 77 + + + + + + + + 78 + + + + + + + + 79 + + + + + + + + 80 + + + + + + + + 81 + + + + + + + + 82 + + + + + + + + 84 + + + + + 85 + + + + + 86 + + + + + 87 + + + + + 88 + + + + + 89 + + + + + 94 + + + + + + + + + + + + + + + + Advanced View + + + 99 + + + + + + + + 101 + + + + + + + + 102 + + + + + 104 + + + + + 113 + + + + + + + + 114 + + + + + 115 + + + + + + + + 116 + + + + + + + + 117 + + + + + + + + + + + + 118 + + + + + 119 + + + + + 120 + + + + + 121 + + + + + 122 + + + + + 123 + + + + + 133 + + + + + + + + 134 + + + + + 136 + + + + + + + + 137 + + + + + 139 + + + + + + + + 140 + + + + + 142 + + + + + + + Sets View + + + 163 + + + + + + + + + + 164 + + + + + 165 + + + + + 184 + + + + + + + + 185 + + + + + 189 + + + + + + + + 190 + + + + + 191 + + + + + + + + 192 + + + + + + + + 193 + + + + + + + + + + + + + + 194 + + + + + 195 + + + + + 196 + + + + + 197 + + + + + 198 + + + + + 199 + + + + + 200 + + + + + 201 + + + + + + + + 202 + + + + + 206 + + + + + + + + 207 + + + + + 236 + + + + + + + + 237 + + + + + + + + 238 + + + + + + + + + + 239 + + + + + 240 + + + + + 241 + + + + + 249 + + + + + + + + 250 + + + + + 166 + + + + + + + + + 168 + + + + + + + + 169 + + + + + + + + 176 + + + + + 171 + + + + + hjZ-wQ-Sbb + + + + + + + + wgy-N5-9cB + + + + + pzR-CP-Gdo + + + + + + + + + VmF-vH-DSp + + + + + Vwo-bW-szV + + + + + edJ-A5-eyf + + + + + + + + Zgy-z5-6UG + + + + + hgg-QV-i0I + + + + + + + + 3fA-qQ-VvX + + + + + + + + Yld-Or-7Hu + + + + + agM-jg-8mH + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + {{625, 724}, {400, 130}} + + 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 + 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 + 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 + + + + + + + + + + SBPrefsController + NSWindowController + + id + id + id + id + id + id + + + + clearRecentSearches: + id + + + closePopOver: + id + + + deleteCachedMetadata: + id + + + deletePreset: + id + + + toggleInfoWindow: + id + + + updateRatingsCountry: + id + + + + NSView + NSView + NSButton + NSView + SBTableView + + + + advancedView + NSView + + + generalView + NSView + + + removeSet + NSButton + + + setsView + NSView + + + tableView + SBTableView + + + + IBProjectSource + ./Classes/SBPrefsController.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 + + {11, 11} + {10, 3} + {8, 8} + {15, 15} + {16, 16} + {16, 16} + + + diff --git a/English.lproj/Queue.xib b/English.lproj/Queue.xib new file mode 100755 index 0000000..2cb482f --- /dev/null +++ b/English.lproj/Queue.xib @@ -0,0 +1,1561 @@ + + + + 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} + + + diff --git a/English.lproj/SBDocument.xib b/English.lproj/SBDocument.xib new file mode 100755 index 0000000..dc6584a --- /dev/null +++ b/English.lproj/SBDocument.xib @@ -0,0 +1,2774 @@ + + + + 1060 + 12F37 + 4510 + 1187.39 + 626.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 4510 + + + NSButton + NSButtonCell + NSComboBoxCell + NSCustomObject + NSCustomView + NSMenu + NSMenuItem + NSPopUpButton + NSPopUpButtonCell + NSProgressIndicator + NSScrollView + NSScroller + NSSplitView + NSTableColumn + NSTableHeaderView + NSTableView + NSTextField + NSTextFieldCell + NSToolbar + NSToolbarFlexibleSpaceItem + NSToolbarItem + NSToolbarSeparatorItem + NSToolbarSpaceItem + NSUserDefaultsController + NSView + NSWindowTemplate + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + SBDocument + + + FirstResponder + + + 15 + 2 + {{120, 866}, {620, 450}} + 1886912512 + Window + NSWindow + + + 61E0A00C-CBF2-4937-9418-AC0758672070 + + + YES + YES + YES + NO + 2 + 1 + + + + 1A1981DF-4B61-4138-AF89-2C08EB9862B2 + + Delete Track + Delete Track + + + + 268 + {{20, 14}, {34, 25}} + YES + + 67108864 + 134217728 + + + LucidaGrande + 13 + 1044 + + + -2031337472 + 163 + + NSImage + ToolbarRemoveTemplate + + + + 200 + 25 + + NO + + + + + {34, 25} + {34, 25} + YES + YES + 0 + YES + 0 + + + + 3594B023-F131-4DE6-8067-263D9BF3F6BB + + Add Track + Add Track + + + + 268 + {{14, 14}, {34, 25}} + YES + + 67108864 + 134217728 + + + + -2031337472 + 163 + + NSImage + NSAddTemplate + + + + 200 + 25 + + NO + + + + + {34, 25} + {34, 25} + YES + YES + 0 + YES + 0 + + + + 81E322E1-B40D-46EB-A3CD-24C0B28B5EDA + + Search + Search + + + + 268 + {{5, 14}, {34, 25}} + YES + + 67108864 + 134217728 + + + + -2031337472 + 163 + + NSImage + NSRevealFreestandingTemplate + + + + 200 + 25 + + NO + + + + + {34, 25} + {34, 25} + YES + YES + 0 + YES + 0 + + + + 864986A8-F5EB-412B-A345-094EA449A2EA + + Send to Queue + Send to Queue + + + + 268 + {{26, 14}, {34, 25}} + YES + + 67108864 + 134217728 + + + + -2031337472 + 163 + + NSImage + ToolbarActionTemplate + + + + 200 + 25 + + NO + + + + + {34, 25} + {34, 25} + YES + YES + 0 + YES + 0 + + + + D956CBF5-52FB-4FBD-934D-00EAD20DF4D4 + + Action + Action + + + + 268 + {{2, 14}, {38, 25}} + _NS:9 + YES + + -2080374720 + 2048 + + _NS:9 + + -2038284288 + 163 + + + 400 + 75 + + + YES + + + 1048576 + 2147483647 + 1 + + NSImage + NSActionTemplate + + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + + YES + + OtherViews + + + + + Insert a chapter every + + 2147483647 + + + submenuAction: + + Insert a chapter every + + + + 1 minute + + 2147483647 + + + _popUpItemAction: + 1 + + + + + 2 minutes + + 2147483647 + + + _popUpItemAction: + 2 + + + + + 5 minutes + + 2147483647 + + + _popUpItemAction: + 5 + + + + + 10 minutes + + 2147483647 + + + _popUpItemAction: + 10 + + + + + 15 minutes + + 2147483647 + + + _popUpItemAction: + 15 + + + + + 20 minutes + + 2147483647 + + + _popUpItemAction: + 20 + + + + + 30 minutes + + 2147483647 + + + _popUpItemAction: + 30 + + + + + + + + iTunes friendly groups + + 2147483647 + + + _popUpItemAction: + + + + + Offset… + + 2147483647 + + + _popUpItemAction: + + + + + + YES + 1 + YES + YES + 1 + + NO + + + + + {30, 25} + {38, 25} + YES + YES + 0 + YES + 0 + + + NSToolbarFlexibleSpaceItem + + Flexible Space + + + + + + {1, 5} + {20000, 32} + YES + YES + -1 + YES + 0 + + YES + YES + + + 1048576 + 2147483647 + + + + + + NSToolbarSeparatorItem + + Separator + + + + + + {12, 5} + {12, 1000} + YES + YES + -1 + YES + 0 + + YES + YES + + + 1048576 + 2147483647 + + + + + + NSToolbarSpaceItem + + Space + + + + + + {32, 5} + {32, 32} + YES + YES + -1 + YES + 0 + + YES + YES + + + 1048576 + 2147483647 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {350, 200} + + + 256 + + + + 274 + + + + 256 + + + + 274 + + + + 2304 + + + + 256 + {620, 17} + + + + + + + {{1, 0}, {620, 17}} + + + + + + 6 + System + controlBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + 4 + + + + 2322 + + + + 256 + {620, 115} + + + + YES + NO + YES + + + + -2147483392 + {{-26, 0}, {16, 17}} + + + + trackId + 30 + 30 + 38 + + 75497536 + 2048 + Id + + LucidaGrande + 11 + 3100 + + + 3 + MC4zMzMzMzI5ODU2AA + + + 6 + System + headerTextColor + + 3 + MAA + + + + + 337641536 + 2048 + Text Cell + + + + + 6 + System + controlTextColor + + + + 3 + YES + + + + trackEnabled + 18 + 18 + 50 + + 75497536 + 2048 + Enabled + + + 6 + System + headerColor + + 3 + MQA + + + + + + 67108864 + 131072 + + + + 1211912448 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + 3 + YES + YES + + + + trackName + 199 + 100 + 1000 + + 75497536 + 2048 + Name + + + + + + 337641536 + 2048 + Text Cell + + + + + + 3 + YES + YES + + + + trackDuration + 92 + 92 + 92 + + 75497536 + 67110912 + Duration + + + + + + 67108928 + 71304192 + Text + + + + 6 + System + controlColor + + + + + 3 + YES + + + + trackLanguage + 130 + 130 + 150 + + 75497536 + 67110912 + Language + + + + + + 338690112 + 71304192 + + + + + 6 + System + textBackgroundColor + + + + 8 + YES + YES + YES + + + + 274 + {13, 0} + + + YES + NO + YES + + + 10 + 10 + 1000 + + 75497472 + 0 + + + LucidaGrande + 12 + 16 + + + 3 + MC4zMzMzMzI5ODU2AA + + + + + 338690112 + 1024 + + + YES + + + + 3 + YES + + + + 3 + 2 + + + 6 + System + gridColor + + 3 + MC41AA + + + 19 + tableViewAction: + -765427712 + + + 1 + 15 + 0 + YES + 0 + 1 + + NO + + 3 + YES + YES + + + + trackInfo + 133 + 80 + 440 + + 75497536 + 67110912 + Format + + + + + + 337641536 + 67110912 + Text Cell + + + + + + 3 + YES + + + + 3 + 2 + + + 17 + -692027392 + + + 1 + 15 + 0 + YES + 0 + 1 + + + {{1, 17}, {620, 115}} + + + + + + 4 + + + + -2147483392 + {{606, 17}, {15, 99}} + + + + NO + + _doScroller: + 0.84375 + + + + -2147483392 + {{1, 116}, {605, 15}} + + + + NO + 1 + + _doScroller: + 0.90247452259063721 + + + {622, 133} + + + + 133682 + + + + + QSAAAEEgAABBmAAAQZgAAA + 0.25 + 4 + 1 + + + {622, 133} + + + + YES + NSView + + + + 264 + {{0, 142}, {622, 309}} + + + + YES + NSView + + + {{-1, 0}, {622, 451}} + + + + + + {620, 450} + + + + + {{0, 0}, {2560, 1418}} + {350, 255} + {10000000000000, 10000000000000} + + YES + + + NSApplication + + + 7 + 2 + {{196, 389}, {297, 121}} + 603979776 + Window + NSWindow + + + + + 256 + + + + 268 + {{17, 84}, {88, 17}} + + + YES + + 68157504 + 272630784 + Optimizing… + + + + + + NO + + + + 1290 + {{18, 56}, {261, 20}} + + + 16394 + 100 + + + + 268 + {{201, 12}, {82, 32}} + + YES + + 67108864 + 134217728 + Cancel + + + -2038284288 + 129 + + Gw + 200 + 25 + + NO + + + {297, 121} + + + {{0, 0}, {2560, 1418}} + {10000000000000, 10000000000000} + YES + + + 7 + 2 + {{196, 400}, {346, 102}} + 611844096 + Window + NSWindow + + + + + 256 + + + + 268 + {{17, 62}, {47, 17}} + + + YES + + 68157504 + 272630784 + Offset: + + + + + + NO + + + + 268 + {{306, 62}, {23, 17}} + + + YES + + 68157504 + 272630784 + ms + + + + + + NO + + + + 268 + {{69, 60}, {232, 22}} + + + YES + + -1804599231 + 272630784 + + + + YES + + + 6 + System + textColor + + + + NO + + + + 289 + {{236, 12}, {96, 32}} + + YES + + 67108864 + 134217728 + OK + + + -2038284288 + 129 + + DQ + 200 + 25 + + NO + + + + 289 + {{140, 12}, {96, 32}} + + + YES + + 67108864 + 134217728 + Cancel + + + -2038284288 + 129 + + Gw + 200 + 25 + + NO + + + {{7, 11}, {346, 102}} + + + {{0, 0}, {2560, 1418}} + {10000000000000, 10000000000000} + YES + + + + 268 + + + + 301 + {{89, 28}, {149, 18}} + + + YES + + 67108864 + 0 + 64 bits chunk offset + + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + + 301 + {{89, 8}, {105, 18}} + + YES + + 67108864 + 0 + 64 bits times + + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + + 268 + {{88, 48}, {225, 26}} + + + YES + + 71303232 + 2048 + + + 109199360 + 129 + + + 400 + 75 + + + Item 1 + + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + OtherViews + + + + + Item 2 + + 2147483647 + + + _popUpItemAction: + 1 + + + + + Item 3 + + 2147483647 + + + _popUpItemAction: + 2 + + + + YES + + 1 + YES + YES + 2 + + NO + + + + 268 + {{7, 54}, {79, 17}} + + + YES + + 68157504 + 272630784 + File Format: + + + + + + NO + + + + 268 + {{29, 29}, {58, 17}} + + + YES + + 68157504 + 272630784 + Options: + + + + + + NO + + + {320, 82} + + NSView + + + YES + + + + NO + + + + window + + + + 18 + + + + documentWindow + + + + 100064 + + + + targetView + + + + 100142 + + + + deleteTrack + + + + 100170 + + + + deleteTrack: + + + + 100171 + + + + savingWindow + + + + 100180 + + + + optBar + + + + 100181 + + + + saveOperationName + + + + 100186 + + + + saveView + + + + 100192 + + + + fileFormat + + + + 100225 + + + + setSaveFormat: + + + + 100242 + + + + setSaveFormat: + + + + 100243 + + + + selectFile: + + + + 100250 + + + + addTracks + + + + 100251 + + + + cancelSaveOperation: + + + + 100254 + + + + cancelSave + + + + 100255 + + + + splitView + + + + 100262 + + + + offsetWindow + + + + 100285 + + + + closeOffsetSheet: + + + + 100287 + + + + offset + + + + 100288 + + + + setTrackOffset: + + + + 100289 + + + + _64bit_data + + + + 100290 + + + + _64bit_time + + + + 100291 + + + + searchMetadata: + + + + 100309 + + + + searchMetadata + + + + 100310 + + + + sendToQueue + + + + 100316 + + + + sendToQueue: + + + + 100317 + + + + iTunesFriendlyTrackGroups: + + + + 100348 + + + + showTrackOffsetSheet: + + + + 100350 + + + + addChaptersEvery: + + + + 100351 + + + + addChaptersEvery: + + + + 100352 + + + + addChaptersEvery: + + + + 100353 + + + + addChaptersEvery: + + + + 100354 + + + + addChaptersEvery: + + + + 100355 + + + + addChaptersEvery: + + + + 100356 + + + + addChaptersEvery: + + + + 100357 + + + + fileTracksTable + + + + 100037 + + + + delegate + + + + 17 + + + + delegate + + + + 100039 + + + + dataSource + + + + 100038 + + + + dataSource + + + + 100125 + + + + value: values.mp464bitOffset + + + + + + value: values.mp464bitOffset + value + values.mp464bitOffset + 2 + + + 100265 + + + + value: values.mp464bitTimes + + + + + + value: values.mp464bitTimes + value + values.mp464bitTimes + 2 + + + 100266 + + + + selectedIndex: values.defaultSaveFormat + + + + + + selectedIndex: values.defaultSaveFormat + selectedIndex + values.defaultSaveFormat + + NSValidatesImmediately + + + 2 + + + 100294 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + 5 + + + + + + + Window + + + 6 + + + + + + + + -3 + + + Application + + + 100097 + + + + + + + + + + + + + + + 100127 + + + + + + + + + 100128 + + + + + + + + 100129 + + + + + 100028 + + + + + + + + + + + 100029 + + + + + 100030 + + + + + 100032 + + + + + 100164 + + + + + + + + 100162 + + + + + + + + 100163 + + + + + 100175 + + + + + + Saving + + + 100176 + + + + + + + + + + 100177 + + + + + + + + 100178 + + + + + 100179 + + + + + 100187 + + + + + + + + + + + + 100188 + + + + + + + + 100189 + + + + + 100190 + + + + + + + + 100191 + + + + + 100221 + + + + + + + + 100222 + + + + + 100223 + + + + + + + + 100224 + + + + + 100215 + + + + + + + + 100216 + + + + + + + + 100217 + + + + + + + + + + 100218 + + + + + 100219 + + + + + 100220 + + + + + 100247 + + + + + + + + 100248 + + + + + + + + 100249 + + + + + 100252 + + + + + + + + 100253 + + + + + 100263 + + + + + 100271 + + + + + + Offset + + + 100272 + + + + + + + + + + + + 100273 + + + + + + + + 100274 + + + + + 100275 + + + + + + + + 100276 + + + + + 100277 + + + + + + + + 100278 + + + + + 100279 + + + + + + + + 100282 + + + + + 100280 + + + + + + + + 100281 + + + + + 100302 + + + + + + + + 100303 + + + + + + + + 100304 + + + + + 100312 + + + + + + + + 100313 + + + + + + + + 100314 + + + + + 100319 + + + + + 100320 + + + + + 100321 + + + + + 100338 + + + + + + + + 100332 + + + + + + + + 100333 + + + + + + + + 100334 + + + + + + + + + + + 100337 + + + + + 100336 + + + + + 100335 + + + + + 100339 + + + + + + + + 100340 + + + + + + + + + + + + + + 100341 + + + + + 100342 + + + + + 100343 + + + + + 100344 + + + + + 100345 + + + + + 100346 + + + + + 100347 + + + + + 100031 + + + + + + + + + + + + + 100033 + + + + + + + + 100034 + + + + + + + + 100042 + + + + + + + + 100044 + + + + + + + + 100040 + + + + + + + + 100244 + + + + + + + + 100246 + + + + + 100041 + + + + + 100124 + + + + + 100123 + + + + + 100035 + + + + + 100036 + + + + + + + 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 + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + ButtonToolbarItem + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{471, 678}, {297, 121}} + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Needed for mp4 larger than 4GB. + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Enable 64bit timescale and duration support. Normally it's only needed if a tracks will be longer than 10 hours. + + + 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 + ButtonToolbarItem + 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 + {{474, 543}, {346, 110}} + + 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 + ButtonToolbarItem + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + ButtonToolbarItem + 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 + {{176, -38}, {620, 450}} + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + + + + ButtonToolbarItem + NSToolbarItem + + IBProjectSource + ./Classes/ButtonToolbarItem.h + + + + SBDocument + NSDocument + + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + addChaptersEvery: + id + + + cancelSaveOperation: + id + + + closeOffsetSheet: + id + + + deleteTrack: + id + + + export: + id + + + iTunesFriendlyTrackGroups: + id + + + saveAndOptimize: + id + + + searchMetadata: + id + + + selectFile: + id + + + selectMetadataFile: + id + + + sendToExternalApp: + id + + + sendToQueue: + id + + + setSaveFormat: + id + + + setTrackOffset: + id + + + showTrackOffsetSheet: + id + + + + NSButton + NSButton + NSToolbarItem + NSButton + NSToolbarItem + NSWindow + NSPopUpButton + NSTableView + NSTextField + NSWindow + NSProgressIndicator + NSTextField + NSView + NSWindow + NSToolbarItem + NSToolbarItem + NSSplitView + NSView + + + + _64bit_data + NSButton + + + _64bit_time + NSButton + + + addTracks + NSToolbarItem + + + cancelSave + NSButton + + + deleteTrack + NSToolbarItem + + + documentWindow + NSWindow + + + fileFormat + NSPopUpButton + + + fileTracksTable + NSTableView + + + offset + NSTextField + + + offsetWindow + NSWindow + + + optBar + NSProgressIndicator + + + saveOperationName + NSTextField + + + saveView + NSView + + + savingWindow + NSWindow + + + searchMetadata + NSToolbarItem + + + sendToQueue + NSToolbarItem + + + splitView + NSSplitView + + + targetView + NSView + + + + IBProjectSource + ./Classes/SBDocument.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 + + {15, 15} + {8, 8} + {11, 11} + {10, 3} + {14, 14} + {15, 15} + {24, 24} + {16, 16} + + + diff --git a/Info.plist b/Info.plist new file mode 100755 index 0000000..6cafd61 --- /dev/null +++ b/Info.plist @@ -0,0 +1,185 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + m4v + + CFBundleTypeMIMETypes + + video/x-m4v + + CFBundleTypeName + Video-MPEG4 + CFBundleTypeOSTypes + + M4V + + CFBundleTypeRole + Editor + LSTypeIsPackage + + NSDocumentClass + SBDocument + NSPersistentStoreTypeKey + Binary + + + CFBundleTypeExtensions + + mp4 + mpg4 + mqv + + CFBundleTypeMIMETypes + + audio/mp4 + video/mp4 + + CFBundleTypeName + Movie-MPEG4 + CFBundleTypeOSTypes + + mpg4 + + CFBundleTypeRole + Editor + LSTypeIsPackage + + NSDocumentClass + SBDocument + NSPersistentStoreTypeKey + Binary + + + CFBundleTypeExtensions + + m4a + + CFBundleTypeMIMETypes + + audio/x-m4a + audio/x-m4v + + CFBundleTypeName + Audio-MPEG4 + CFBundleTypeOSTypes + + M4A + + CFBundleTypeRole + Editor + LSTypeIsPackage + + NSDocumentClass + SBDocument + NSPersistentStoreTypeKey + Binary + + + CFBundleTypeExtensions + + m4b + + CFBundleTypeMIMETypes + + audio/x-m4b + audio/x-m4v + + CFBundleTypeName + Audiobook-MPEG4 + CFBundleTypeRole + Editor + NSDocumentClass + SBDocument + + + CFBundleTypeExtensions + + mkv + mka + mks + + CFBundleTypeName + Matroska video + CFBundleTypeRole + Viewer + NSDocumentClass + SBDocument + + + CFBundleTypeExtensions + + mov + + CFBundleTypeName + QuickTime Movie + CFBundleTypeRole + Viewer + NSDocumentClass + SBDocument + + + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleGetInfoString + 0.24, Copyright 2013 Damiano Galassi + CFBundleIconFile + Subler.icns + CFBundleIdentifier + org.galad.${PRODUCT_NAME:identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 0.24 + CFBundleSignature + ???? + CFBundleVersion + 0.24 + LSApplicationCategoryType + public.app-category.video + NSHumanReadableCopyright + Copyright © 2009-2013, Damiano Galassi + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + SUFeedURL + http://subler.googlecode.com/svn/doc/appcast.xml + SUPublicDSAKeyFile + dsa_pub.pem + UTImportedTypeDeclarations + + + UTTypeConformsTo + + public.movie + + UTTypeDescription + Matroska video + UTTypeIdentifier + org.perian.matroska + UTTypeReferenceURL + http://www.matroska.org/ + UTTypeTagSpecification + + public.filename-extension + + mkv + mka + + + + + + diff --git a/Others/ButtonToolbarItem.h b/Others/ButtonToolbarItem.h new file mode 100755 index 0000000..e11223f --- /dev/null +++ b/Others/ButtonToolbarItem.h @@ -0,0 +1,31 @@ +/****************************************************************************** + * $Id: ButtonToolbarItem.h 7659 2009-01-10 23:37:37Z livings124 $ + * + * Copyright (c) 2007-2009 Transmission authors and contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + *****************************************************************************/ + +#import + +@interface ButtonToolbarItem : NSToolbarItem +{ +} + +@end diff --git a/Others/ButtonToolbarItem.m b/Others/ButtonToolbarItem.m new file mode 100755 index 0000000..89344ec --- /dev/null +++ b/Others/ButtonToolbarItem.m @@ -0,0 +1,43 @@ +/****************************************************************************** + * $Id: ButtonToolbarItem.m 7659 2009-01-10 23:37:37Z livings124 $ + * + * Copyright (c) 2007-2009 Transmission authors and contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + *****************************************************************************/ + +#import "ButtonToolbarItem.h" + +@implementation ButtonToolbarItem + +- (void) validate +{ + [self setEnabled: [[self target] validateToolbarItem: self]]; +} + +- (NSMenuItem *) menuFormRepresentation +{ + NSMenuItem * menuItem = [[NSMenuItem alloc] initWithTitle: [self label] action: [self action] keyEquivalent: @""]; + [menuItem setTarget: [self target]]; + [menuItem setEnabled: [[self target] validateToolbarItem: self]]; + + return [menuItem autorelease]; +} + +@end diff --git a/Others/MAAttachedWindow.h b/Others/MAAttachedWindow.h new file mode 100755 index 0000000..5740abe --- /dev/null +++ b/Others/MAAttachedWindow.h @@ -0,0 +1,183 @@ +// +// MAAttachedWindow.h +// +// Created by Matt Gemmell on 27/09/2007. +// Copyright 2007 Magic Aubergine. +// + +#import + +/* + Below are the positions the attached window can be displayed at. + + Note that these positions are relative to the point passed to the constructor, + e.g. MAPositionBottomRight will put the window below the point and towards the right, + MAPositionTop will horizontally center the window above the point, + MAPositionRightTop will put the window to the right and above the point, + and so on. + + You can also pass MAPositionAutomatic (or use an initializer which omits the 'onSide:' + argument) and the attached window will try to position itself sensibly, based on + available screen-space. + + Notes regarding automatically-positioned attached windows: + + (a) The window prefers to position itself horizontally centered below the specified point. + This gives a certain enhanced visual sense of an attachment/relationship. + + (b) The window will try to align itself with its parent window (if any); i.e. it will + attempt to stay within its parent window's frame if it can. + + (c) The algorithm isn't perfect. :) If in doubt, do your own calculations and then + explicitly request that the window attach itself to a particular side. + */ + +typedef enum _MAWindowPosition { + // The four primary sides are compatible with the preferredEdge of NSDrawer. + MAPositionLeft = NSMinXEdge, // 0 + MAPositionRight = NSMaxXEdge, // 2 + MAPositionTop = NSMaxYEdge, // 3 + MAPositionBottom = NSMinYEdge, // 1 + MAPositionLeftTop = 4, + MAPositionLeftBottom = 5, + MAPositionRightTop = 6, + MAPositionRightBottom = 7, + MAPositionTopLeft = 8, + MAPositionTopRight = 9, + MAPositionBottomLeft = 10, + MAPositionBottomRight = 11, + MAPositionAutomatic = 12 +} MAWindowPosition; + +@interface MAAttachedWindow : NSWindow { + NSColor *borderColor; + float borderWidth; + float viewMargin; + float arrowBaseWidth; + float arrowHeight; + BOOL hasArrow; + float cornerRadius; + BOOL drawsRoundCornerBesideArrow; + +@private + NSColor *_MABackgroundColor; + __weak NSView *_view; + __weak NSWindow *_window; + NSPoint _point; + MAWindowPosition _side; + float _distance; + NSRect _viewFrame; + BOOL _resizing; +} + +/* + Initialization methods + + Parameters: + + view The view to display in the attached window. Must not be nil. + + point The point to which the attached window should be attached. If you + are also specifying a parent window, the point should be in the + coordinate system of that parent window. If you are not specifying + a window, the point should be in the screen's coordinate space. + This value is required. + + window The parent window to attach this one to. Note that no actual + relationship is created (particularly, this window is not made + a childWindow of the parent window). + Default: nil. + + side The side of the specified point on which to attach this window. + Default: MAPositionAutomatic. + + distance How far from the specified point this window should be. + Default: 0. + */ + +- (MAAttachedWindow *)initWithView:(NSView *)view // designated initializer + attachedToPoint:(NSPoint)point + inWindow:(NSWindow *)window + onSide:(MAWindowPosition)side + atDistance:(float)distance; +- (MAAttachedWindow *)initWithView:(NSView *)view + attachedToPoint:(NSPoint)point + inWindow:(NSWindow *)window + atDistance:(float)distance; +- (MAAttachedWindow *)initWithView:(NSView *)view + attachedToPoint:(NSPoint)point + onSide:(MAWindowPosition)side + atDistance:(float)distance; +- (MAAttachedWindow *)initWithView:(NSView *)view + attachedToPoint:(NSPoint)point + atDistance:(float)distance; +- (MAAttachedWindow *)initWithView:(NSView *)view + attachedToPoint:(NSPoint)point + inWindow:(NSWindow *)window; +- (MAAttachedWindow *)initWithView:(NSView *)view + attachedToPoint:(NSPoint)point + onSide:(MAWindowPosition)side; +- (MAAttachedWindow *)initWithView:(NSView *)view + attachedToPoint:(NSPoint)point; + +// Accessor methods +- (NSColor *)borderColor; +- (void)setBorderColor:(NSColor *)value; +- (float)borderWidth; +- (void)setBorderWidth:(float)value; // See note 1 below. +- (float)viewMargin; +- (void)setViewMargin:(float)value; // See note 2 below. +- (float)arrowBaseWidth; +- (void)setArrowBaseWidth:(float)value; // See note 2 below. +- (float)arrowHeight; +- (void)setArrowHeight:(float)value; // See note 2 below. +- (float)hasArrow; +- (void)setHasArrow:(float)value; +- (float)cornerRadius; +- (void)setCornerRadius:(float)value; // See note 2 below. +- (float)drawsRoundCornerBesideArrow; // See note 3 below. +- (void)setDrawsRoundCornerBesideArrow:(float)value; // See note 2 below. +- (void)setBackgroundImage:(NSImage *)value; +- (NSColor *)windowBackgroundColor; // See note 4 below. +- (void)setBackgroundColor:(NSColor *)value; + +/* + Notes regarding accessor methods: + + 1. The border is drawn inside the viewMargin area, expanding inwards; it does not + increase the width/height of the window. You can use the -setBorderWidth: and + -setViewMargin: methods together to achieve the exact look/geometry you want. + (viewMargin is the distance between the edge of the view and the window edge.) + + 2. The specified setter methods are primarily intended to be used _before_ the window + is first shown. If you use them while the window is already visible, be aware + that they may cause the window to move and/or resize, in order to stay anchored + to the point specified in the initializer. They may also cause the view to move + within the window, in order to remain centered there. + + Note that the -setHasArrow: method can safely be used at any time, and will not + cause moving/resizing of the window. This is for convenience, in case you want + to add or remove the arrow in response to user interaction. For example, you + could make the attached window movable by its background, and if the user dragged + it away from its initial point, the arrow could be removed. This would duplicate + how Aperture's attached windows behave. + + 3. drawsRoundCornerBesideArrow takes effect when the arrow is being drawn at a corner, + i.e. when it's not at one of the four primary compass directions. In this situation, + if drawsRoundCornerBesideArrow is YES (the default), then that corner of the window + will be rounded just like the other three corners, thus the arrow will be inset + slightly from the edge of the window to allow room for the rounded corner. If this + value is NO, the corner beside the arrow will be a square corner, and the other + three corners will be rounded. + + This is useful when you want to attach a window very near the edge of another window, + and don't want the attached window's edge to be visually outside the frame of the + parent window. + + 4. Note that to retrieve the background color of the window, you should use the + -windowBackgroundColor method, instead of -backgroundColor. This is because we draw + the entire background of the window (rounded path, arrow, etc) in an NSColor pattern + image, and set it as the backgroundColor of the window. + */ + +@end diff --git a/Others/MAAttachedWindow.m b/Others/MAAttachedWindow.m new file mode 100755 index 0000000..e34ee5f --- /dev/null +++ b/Others/MAAttachedWindow.m @@ -0,0 +1,939 @@ +// +// MAAttachedWindow.m +// +// Created by Matt Gemmell on 27/09/2007. +// Copyright 2007 Magic Aubergine. +// + +#import "MAAttachedWindow.h" + +#define MAATTACHEDWINDOW_DEFAULT_BACKGROUND_COLOR [NSColor colorWithCalibratedWhite:0.1 alpha:0.75] +#define MAATTACHEDWINDOW_DEFAULT_BORDER_COLOR [NSColor whiteColor] +#define MAATTACHEDWINDOW_SCALE_FACTOR [[NSScreen mainScreen] userSpaceScaleFactor] + +@interface MAAttachedWindow (MAPrivateMethods) + +// Geometry +- (void)_updateGeometry; +- (MAWindowPosition)_bestSideForAutomaticPosition; +- (float)_arrowInset; + +// Drawing +- (void)_updateBackground; +- (NSColor *)_backgroundColorPatternImage; +- (NSBezierPath *)_backgroundPath; +- (void)_appendArrowToPath:(NSBezierPath *)path; +- (void)_redisplay; + +@end + +@implementation MAAttachedWindow + + +#pragma mark Initializers + + +- (MAAttachedWindow *)initWithView:(NSView *)view + attachedToPoint:(NSPoint)point + inWindow:(NSWindow *)window + onSide:(MAWindowPosition)side + atDistance:(float)distance +{ + // Insist on having a valid view. + if (!view) { + return nil; + } + + // Create dummy initial contentRect for window. + NSRect contentRect = NSZeroRect; + contentRect.size = [view frame].size; + + if ((self = [super initWithContentRect:contentRect + styleMask:NSBorderlessWindowMask + backing:NSBackingStoreBuffered + defer:NO])) { + _view = view; + _window = window; + _point = point; + _side = side; + _distance = distance; + + // Configure window characteristics. + [super setBackgroundColor:[NSColor clearColor]]; + [self setMovableByWindowBackground:NO]; + [self setExcludedFromWindowsMenu:YES]; + [self setAlphaValue:1.0]; + [self setOpaque:NO]; + [self setHasShadow:YES]; + [self useOptimizedDrawing:YES]; + + // Set up some sensible defaults for display. + _MABackgroundColor = [MAATTACHEDWINDOW_DEFAULT_BACKGROUND_COLOR copy]; + borderColor = [MAATTACHEDWINDOW_DEFAULT_BORDER_COLOR copy]; + borderWidth = 2.0; + viewMargin = 2.0; + arrowBaseWidth = 20.0; + arrowHeight = 16.0; + hasArrow = YES; + cornerRadius = 8.0; + drawsRoundCornerBesideArrow = YES; + _resizing = NO; + + // Work out what side to put the window on if it's "automatic". + if (_side == MAPositionAutomatic) { + _side = [self _bestSideForAutomaticPosition]; + } + + // Configure our initial geometry. + [self _updateGeometry]; + + // Update the background. + [self _updateBackground]; + + // Add view as subview of our contentView. + [[self contentView] addSubview:_view]; + + // Subscribe to notifications for when we change size. + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(windowDidResize:) + name:NSWindowDidResizeNotification + object:self]; + } + return self; +} + + +- (MAAttachedWindow *)initWithView:(NSView *)view + attachedToPoint:(NSPoint)point + inWindow:(NSWindow *)window + atDistance:(float)distance +{ + return [self initWithView:view attachedToPoint:point + inWindow:window onSide:MAPositionAutomatic + atDistance:distance]; +} + + +- (MAAttachedWindow *)initWithView:(NSView *)view + attachedToPoint:(NSPoint)point + onSide:(MAWindowPosition)side + atDistance:(float)distance +{ + return [self initWithView:view attachedToPoint:point + inWindow:nil onSide:side + atDistance:distance]; +} + + +- (MAAttachedWindow *)initWithView:(NSView *)view + attachedToPoint:(NSPoint)point + atDistance:(float)distance +{ + return [self initWithView:view attachedToPoint:point + inWindow:nil onSide:MAPositionAutomatic + atDistance:distance]; +} + + +- (MAAttachedWindow *)initWithView:(NSView *)view + attachedToPoint:(NSPoint)point + inWindow:(NSWindow *)window +{ + return [self initWithView:view attachedToPoint:point + inWindow:window onSide:MAPositionAutomatic + atDistance:0]; +} + + +- (MAAttachedWindow *)initWithView:(NSView *)view + attachedToPoint:(NSPoint)point + onSide:(MAWindowPosition)side +{ + return [self initWithView:view attachedToPoint:point + inWindow:nil onSide:side + atDistance:0]; +} + + +- (MAAttachedWindow *)initWithView:(NSView *)view + attachedToPoint:(NSPoint)point +{ + return [self initWithView:view attachedToPoint:point + inWindow:nil onSide:MAPositionAutomatic + atDistance:0]; +} + + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [borderColor release]; + [_MABackgroundColor release]; + + [super dealloc]; +} + + +#pragma mark Geometry + + +- (void)_updateGeometry +{ + NSRect contentRect = NSZeroRect; + contentRect.size = [_view frame].size; + + // Account for viewMargin. + _viewFrame = NSMakeRect(viewMargin * MAATTACHEDWINDOW_SCALE_FACTOR, + viewMargin * MAATTACHEDWINDOW_SCALE_FACTOR, + [_view frame].size.width, [_view frame].size.height); + contentRect = NSInsetRect(contentRect, + -viewMargin * MAATTACHEDWINDOW_SCALE_FACTOR, + -viewMargin * MAATTACHEDWINDOW_SCALE_FACTOR); + + // Account for arrowHeight in new window frame. + // Note: we always leave room for the arrow, even if it currently set to + // not be shown. This is so it can easily be toggled whilst the window + // is visible, without altering the window's frame origin point. + float scaledArrowHeight = arrowHeight * MAATTACHEDWINDOW_SCALE_FACTOR; + switch (_side) { + case MAPositionLeft: + case MAPositionLeftTop: + case MAPositionLeftBottom: + contentRect.size.width += scaledArrowHeight; + break; + case MAPositionRight: + case MAPositionRightTop: + case MAPositionRightBottom: + _viewFrame.origin.x += scaledArrowHeight; + contentRect.size.width += scaledArrowHeight; + break; + case MAPositionTop: + case MAPositionTopLeft: + case MAPositionTopRight: + _viewFrame.origin.y += scaledArrowHeight; + contentRect.size.height += scaledArrowHeight; + break; + case MAPositionBottom: + case MAPositionBottomLeft: + case MAPositionBottomRight: + contentRect.size.height += scaledArrowHeight; + break; + default: + break; // won't happen, but this satisfies gcc with -Wall + } + + // Position frame origin appropriately for _side, accounting for arrow-inset. + contentRect.origin = (_window) ? [_window convertBaseToScreen:_point] : _point; + float arrowInset = [self _arrowInset]; + float halfWidth = contentRect.size.width / 2.0; + float halfHeight = contentRect.size.height / 2.0; + switch (_side) { + case MAPositionTopLeft: + contentRect.origin.x -= contentRect.size.width - arrowInset; + break; + case MAPositionTop: + contentRect.origin.x -= halfWidth; + break; + case MAPositionTopRight: + contentRect.origin.x -= arrowInset; + break; + case MAPositionBottomLeft: + contentRect.origin.y -= contentRect.size.height; + contentRect.origin.x -= contentRect.size.width - arrowInset; + break; + case MAPositionBottom: + contentRect.origin.y -= contentRect.size.height; + contentRect.origin.x -= halfWidth; + break; + case MAPositionBottomRight: + contentRect.origin.x -= arrowInset; + contentRect.origin.y -= contentRect.size.height; + break; + case MAPositionLeftTop: + contentRect.origin.x -= contentRect.size.width; + contentRect.origin.y -= arrowInset; + break; + case MAPositionLeft: + contentRect.origin.x -= contentRect.size.width; + contentRect.origin.y -= halfHeight; + break; + case MAPositionLeftBottom: + contentRect.origin.x -= contentRect.size.width; + contentRect.origin.y -= contentRect.size.height - arrowInset; + break; + case MAPositionRightTop: + contentRect.origin.y -= arrowInset; + break; + case MAPositionRight: + contentRect.origin.y -= halfHeight; + break; + case MAPositionRightBottom: + contentRect.origin.y -= contentRect.size.height - arrowInset; + break; + default: + break; // won't happen, but this satisfies gcc with -Wall + } + + // Account for _distance in new window frame. + switch (_side) { + case MAPositionLeft: + case MAPositionLeftTop: + case MAPositionLeftBottom: + contentRect.origin.x -= _distance; + break; + case MAPositionRight: + case MAPositionRightTop: + case MAPositionRightBottom: + contentRect.origin.x += _distance; + break; + case MAPositionTop: + case MAPositionTopLeft: + case MAPositionTopRight: + contentRect.origin.y += _distance; + break; + case MAPositionBottom: + case MAPositionBottomLeft: + case MAPositionBottomRight: + contentRect.origin.y -= _distance; + break; + default: + break; // won't happen, but this satisfies gcc with -Wall + } + + // Reconfigure window and view frames appropriately. + [self setFrame:contentRect display:NO]; + [_view setFrame:_viewFrame]; +} + + +- (MAWindowPosition)_bestSideForAutomaticPosition +{ + // Get all relevant geometry in screen coordinates. + NSRect screenFrame; + if (_window && [_window screen]) { + screenFrame = [[_window screen] visibleFrame]; + } else { + screenFrame = [[NSScreen mainScreen] visibleFrame]; + } + NSPoint pointOnScreen = (_window) ? [_window convertBaseToScreen:_point] : _point; + NSSize viewSize = [_view frame].size; + viewSize.width += (viewMargin * MAATTACHEDWINDOW_SCALE_FACTOR) * 2.0; + viewSize.height += (viewMargin * MAATTACHEDWINDOW_SCALE_FACTOR) * 2.0; + MAWindowPosition side = MAPositionBottom; // By default, position us centered below. + float scaledArrowHeight = (arrowHeight * MAATTACHEDWINDOW_SCALE_FACTOR) + _distance; + + // We'd like to display directly below the specified point, since this gives a + // sense of a relationship between the point and this window. Check there's room. + if (pointOnScreen.y - viewSize.height - scaledArrowHeight < NSMinY(screenFrame)) { + // We'd go off the bottom of the screen. Try the right. + if (pointOnScreen.x + viewSize.width + scaledArrowHeight >= NSMaxX(screenFrame)) { + // We'd go off the right of the screen. Try the left. + if (pointOnScreen.x - viewSize.width - scaledArrowHeight < NSMinX(screenFrame)) { + // We'd go off the left of the screen. Try the top. + if (pointOnScreen.y + viewSize.height + scaledArrowHeight < NSMaxY(screenFrame)) { + side = MAPositionTop; + } + } else { + side = MAPositionLeft; + } + } else { + side = MAPositionRight; + } + } + + float halfWidth = viewSize.width / 2.0; + float halfHeight = viewSize.height / 2.0; + + NSRect parentFrame = (_window) ? [_window frame] : screenFrame; + float arrowInset = [self _arrowInset]; + + // We're currently at a primary side. + // Try to avoid going outwith the parent area in the secondary dimension, + // by checking to see if an appropriate corner side would be better. + switch (side) { + case MAPositionBottom: + case MAPositionTop: + // Check to see if we go beyond the left edge of the parent area. + if (pointOnScreen.x - halfWidth < NSMinX(parentFrame)) { + // We go beyond the left edge. Try using right position. + if (pointOnScreen.x + viewSize.width - arrowInset < NSMaxX(screenFrame)) { + // We'd still be on-screen using right, so use it. + if (side == MAPositionBottom) { + side = MAPositionBottomRight; + } else { + side = MAPositionTopRight; + } + } + } else if (pointOnScreen.x + halfWidth >= NSMaxX(parentFrame)) { + // We go beyond the right edge. Try using left position. + if (pointOnScreen.x - viewSize.width + arrowInset >= NSMinX(screenFrame)) { + // We'd still be on-screen using left, so use it. + if (side == MAPositionBottom) { + side = MAPositionBottomLeft; + } else { + side = MAPositionTopLeft; + } + } + } + break; + case MAPositionRight: + case MAPositionLeft: + // Check to see if we go beyond the bottom edge of the parent area. + if (pointOnScreen.y - halfHeight < NSMinY(parentFrame)) { + // We go beyond the bottom edge. Try using top position. + if (pointOnScreen.y + viewSize.height - arrowInset < NSMaxY(screenFrame)) { + // We'd still be on-screen using top, so use it. + if (side == MAPositionRight) { + side = MAPositionRightTop; + } else { + side = MAPositionLeftTop; + } + } + } else if (pointOnScreen.y + halfHeight >= NSMaxY(parentFrame)) { + // We go beyond the top edge. Try using bottom position. + if (pointOnScreen.y - viewSize.height + arrowInset >= NSMinY(screenFrame)) { + // We'd still be on-screen using bottom, so use it. + if (side == MAPositionRight) { + side = MAPositionRightBottom; + } else { + side = MAPositionLeftBottom; + } + } + } + break; + default: + break; // won't happen, but this satisfies gcc with -Wall + } + + return side; +} + + +- (float)_arrowInset +{ + float cornerInset = (drawsRoundCornerBesideArrow) ? cornerRadius : 0; + return (cornerInset + (arrowBaseWidth / 2.0)) * MAATTACHEDWINDOW_SCALE_FACTOR; +} + + +#pragma mark Drawing + + +- (void)_updateBackground +{ + // Call NSWindow's implementation of -setBackgroundColor: because we override + // it in this class to let us set the entire background image of the window + // as an NSColor patternImage. + NSDisableScreenUpdates(); + [super setBackgroundColor:[self _backgroundColorPatternImage]]; + if ([self isVisible]) { + [self display]; + [self invalidateShadow]; + } + NSEnableScreenUpdates(); +} + + +- (NSColor *)_backgroundColorPatternImage +{ + NSImage *bg = [[NSImage alloc] initWithSize:[self frame].size]; + NSRect bgRect = NSZeroRect; + bgRect.size = [bg size]; + + [bg lockFocus]; + NSBezierPath *bgPath = [self _backgroundPath]; + [NSGraphicsContext saveGraphicsState]; + [bgPath addClip]; + + // Draw background. + [_MABackgroundColor set]; + [bgPath fill]; + + // Draw border if appropriate. + if (borderWidth > 0) { + // Double the borderWidth since we're drawing inside the path. + [bgPath setLineWidth:(borderWidth * 2.0) * MAATTACHEDWINDOW_SCALE_FACTOR]; + [borderColor set]; + [bgPath stroke]; + } + + [NSGraphicsContext restoreGraphicsState]; + [bg unlockFocus]; + + return [NSColor colorWithPatternImage:[bg autorelease]]; +} + + +- (NSBezierPath *)_backgroundPath +{ + /* + Construct path for window background, taking account of: + 1. hasArrow + 2. _side + 3. drawsRoundCornerBesideArrow + 4. arrowBaseWidth + 5. arrowHeight + 6. cornerRadius + */ + + float scaleFactor = MAATTACHEDWINDOW_SCALE_FACTOR; + float scaledRadius = cornerRadius * scaleFactor; + float scaledArrowWidth = arrowBaseWidth * scaleFactor; + float halfArrowWidth = scaledArrowWidth / 2.0; + NSRect contentArea = NSInsetRect(_viewFrame, + -viewMargin * scaleFactor, + -viewMargin * scaleFactor); + float minX = NSMinX(contentArea) * scaleFactor; + float midX = NSMidX(contentArea) * scaleFactor; + float maxX = NSMaxX(contentArea) * scaleFactor; + float minY = NSMinY(contentArea) * scaleFactor; + float midY = NSMidY(contentArea) * scaleFactor; + float maxY = NSMaxY(contentArea) * scaleFactor; + + NSBezierPath *path = [NSBezierPath bezierPath]; + [path setLineJoinStyle:NSRoundLineJoinStyle]; + + // Begin at top-left. This will be either after the rounded corner, or + // at the top-left point if cornerRadius is zero and/or we're drawing + // the arrow at the top-left or left-top without a rounded corner. + NSPoint currPt = NSMakePoint(minX, maxY); + if (scaledRadius > 0 && + (drawsRoundCornerBesideArrow || + (_side != MAPositionBottomRight && _side != MAPositionRightBottom)) + ) { + currPt.x += scaledRadius; + } + + NSPoint endOfLine = NSMakePoint(maxX, maxY); + BOOL shouldDrawNextCorner = NO; + if (scaledRadius > 0 && + (drawsRoundCornerBesideArrow || + (_side != MAPositionBottomLeft && _side != MAPositionLeftBottom)) + ) { + endOfLine.x -= scaledRadius; + shouldDrawNextCorner = YES; + } + + [path moveToPoint:currPt]; + + // If arrow should be drawn at top-left point, draw it. + if (_side == MAPositionBottomRight) { + [self _appendArrowToPath:path]; + } else if (_side == MAPositionBottom) { + // Line to relevant point before arrow. + [path lineToPoint:NSMakePoint(midX - halfArrowWidth, maxY)]; + // Draw arrow. + [self _appendArrowToPath:path]; + } else if (_side == MAPositionBottomLeft) { + // Line to relevant point before arrow. + [path lineToPoint:NSMakePoint(endOfLine.x - scaledArrowWidth, maxY)]; + // Draw arrow. + [self _appendArrowToPath:path]; + } + + // Line to end of this side. + [path lineToPoint:endOfLine]; + + // Rounded corner on top-right. + if (shouldDrawNextCorner) { + [path appendBezierPathWithArcFromPoint:NSMakePoint(maxX, maxY) + toPoint:NSMakePoint(maxX, maxY - scaledRadius) + radius:scaledRadius]; + } + + + // Draw the right side, beginning at the top-right. + endOfLine = NSMakePoint(maxX, minY); + shouldDrawNextCorner = NO; + if (scaledRadius > 0 && + (drawsRoundCornerBesideArrow || + (_side != MAPositionTopLeft && _side != MAPositionLeftTop)) + ) { + endOfLine.y += scaledRadius; + shouldDrawNextCorner = YES; + } + + // If arrow should be drawn at right-top point, draw it. + if (_side == MAPositionLeftBottom) { + [self _appendArrowToPath:path]; + } else if (_side == MAPositionLeft) { + // Line to relevant point before arrow. + [path lineToPoint:NSMakePoint(maxX, midY + halfArrowWidth)]; + // Draw arrow. + [self _appendArrowToPath:path]; + } else if (_side == MAPositionLeftTop) { + // Line to relevant point before arrow. + [path lineToPoint:NSMakePoint(maxX, endOfLine.y + scaledArrowWidth)]; + // Draw arrow. + [self _appendArrowToPath:path]; + } + + // Line to end of this side. + [path lineToPoint:endOfLine]; + + // Rounded corner on bottom-right. + if (shouldDrawNextCorner) { + [path appendBezierPathWithArcFromPoint:NSMakePoint(maxX, minY) + toPoint:NSMakePoint(maxX - scaledRadius, minY) + radius:scaledRadius]; + } + + + // Draw the bottom side, beginning at the bottom-right. + endOfLine = NSMakePoint(minX, minY); + shouldDrawNextCorner = NO; + if (scaledRadius > 0 && + (drawsRoundCornerBesideArrow || + (_side != MAPositionTopRight && _side != MAPositionRightTop)) + ) { + endOfLine.x += scaledRadius; + shouldDrawNextCorner = YES; + } + + // If arrow should be drawn at bottom-right point, draw it. + if (_side == MAPositionTopLeft) { + [self _appendArrowToPath:path]; + } else if (_side == MAPositionTop) { + // Line to relevant point before arrow. + [path lineToPoint:NSMakePoint(midX + halfArrowWidth, minY)]; + // Draw arrow. + [self _appendArrowToPath:path]; + } else if (_side == MAPositionTopRight) { + // Line to relevant point before arrow. + [path lineToPoint:NSMakePoint(endOfLine.x + scaledArrowWidth, minY)]; + // Draw arrow. + [self _appendArrowToPath:path]; + } + + // Line to end of this side. + [path lineToPoint:endOfLine]; + + // Rounded corner on bottom-left. + if (shouldDrawNextCorner) { + [path appendBezierPathWithArcFromPoint:NSMakePoint(minX, minY) + toPoint:NSMakePoint(minX, minY + scaledRadius) + radius:scaledRadius]; + } + + + // Draw the left side, beginning at the bottom-left. + endOfLine = NSMakePoint(minX, maxY); + shouldDrawNextCorner = NO; + if (scaledRadius > 0 && + (drawsRoundCornerBesideArrow || + (_side != MAPositionRightBottom && _side != MAPositionBottomRight)) + ) { + endOfLine.y -= scaledRadius; + shouldDrawNextCorner = YES; + } + + // If arrow should be drawn at left-bottom point, draw it. + if (_side == MAPositionRightTop) { + [self _appendArrowToPath:path]; + } else if (_side == MAPositionRight) { + // Line to relevant point before arrow. + [path lineToPoint:NSMakePoint(minX, midY - halfArrowWidth)]; + // Draw arrow. + [self _appendArrowToPath:path]; + } else if (_side == MAPositionRightBottom) { + // Line to relevant point before arrow. + [path lineToPoint:NSMakePoint(minX, endOfLine.y - scaledArrowWidth)]; + // Draw arrow. + [self _appendArrowToPath:path]; + } + + // Line to end of this side. + [path lineToPoint:endOfLine]; + + // Rounded corner on top-left. + if (shouldDrawNextCorner) { + [path appendBezierPathWithArcFromPoint:NSMakePoint(minX, maxY) + toPoint:NSMakePoint(minX + scaledRadius, maxY) + radius:scaledRadius]; + } + + [path closePath]; + return path; +} + + +- (void)_appendArrowToPath:(NSBezierPath *)path +{ + if (!hasArrow) { + return; + } + + float scaleFactor = MAATTACHEDWINDOW_SCALE_FACTOR; + float scaledArrowWidth = arrowBaseWidth * scaleFactor; + float halfArrowWidth = scaledArrowWidth / 2.0; + float scaledArrowHeight = arrowHeight * scaleFactor; + NSPoint currPt = [path currentPoint]; + NSPoint tipPt = currPt; + NSPoint endPt = currPt; + + // Note: we always build the arrow path in a clockwise direction. + switch (_side) { + case MAPositionLeft: + case MAPositionLeftTop: + case MAPositionLeftBottom: + // Arrow points towards right. We're starting from the top. + tipPt.x += scaledArrowHeight; + tipPt.y -= halfArrowWidth; + endPt.y -= scaledArrowWidth; + break; + case MAPositionRight: + case MAPositionRightTop: + case MAPositionRightBottom: + // Arrow points towards left. We're starting from the bottom. + tipPt.x -= scaledArrowHeight; + tipPt.y += halfArrowWidth; + endPt.y += scaledArrowWidth; + break; + case MAPositionTop: + case MAPositionTopLeft: + case MAPositionTopRight: + // Arrow points towards bottom. We're starting from the right. + tipPt.y -= scaledArrowHeight; + tipPt.x -= halfArrowWidth; + endPt.x -= scaledArrowWidth; + break; + case MAPositionBottom: + case MAPositionBottomLeft: + case MAPositionBottomRight: + // Arrow points towards top. We're starting from the left. + tipPt.y += scaledArrowHeight; + tipPt.x += halfArrowWidth; + endPt.x += scaledArrowWidth; + break; + default: + break; // won't happen, but this satisfies gcc with -Wall + } + + [path lineToPoint:tipPt]; + [path lineToPoint:endPt]; +} + + +- (void)_redisplay +{ + if (_resizing) { + return; + } + + _resizing = YES; + NSDisableScreenUpdates(); + [self _updateGeometry]; + [self _updateBackground]; + NSEnableScreenUpdates(); + _resizing = NO; +} + + +# pragma mark Window Behaviour + + +- (BOOL)canBecomeMainWindow +{ + return NO; +} + + +- (BOOL)canBecomeKeyWindow +{ + return YES; +} + + +- (BOOL)isExcludedFromWindowsMenu +{ + return YES; +} + + +- (BOOL)validateMenuItem:(NSMenuItem *)item +{ + if (_window) { + return [_window validateMenuItem:item]; + } + return [super validateMenuItem:item]; +} + + +- (IBAction)performClose:(id)sender +{ + if (_window) { + [_window performClose:sender]; + } else { + [super performClose:sender]; + } +} + + +# pragma mark Notification handlers + + +- (void)windowDidResize:(NSNotification *)note +{ + [self _redisplay]; +} + + +#pragma mark Accessors + + +- (NSColor *)windowBackgroundColor { + return [[_MABackgroundColor retain] autorelease]; +} + + +- (void)setBackgroundColor:(NSColor *)value { + if (_MABackgroundColor != value) { + [_MABackgroundColor release]; + _MABackgroundColor = [value copy]; + + [self _updateBackground]; + } +} + + +- (NSColor *)borderColor { + return [[borderColor retain] autorelease]; +} + + +- (void)setBorderColor:(NSColor *)value { + if (borderColor != value) { + [borderColor release]; + borderColor = [value copy]; + + [self _updateBackground]; + } +} + + +- (float)borderWidth { + return borderWidth; +} + + +- (void)setBorderWidth:(float)value { + if (borderWidth != value) { + float maxBorderWidth = viewMargin; + if (value <= maxBorderWidth) { + borderWidth = value; + } else { + borderWidth = maxBorderWidth; + } + + [self _updateBackground]; + } +} + + +- (float)viewMargin { + return viewMargin; +} + + +- (void)setViewMargin:(float)value { + if (viewMargin != value) { + viewMargin = MAX(value, 0.0); + + // Adjust cornerRadius appropriately (which will also adjust arrowBaseWidth). + [self setCornerRadius:cornerRadius]; + } +} + + +- (float)arrowBaseWidth { + return arrowBaseWidth; +} + + +- (void)setArrowBaseWidth:(float)value { + float maxWidth = (MIN(_viewFrame.size.width, _viewFrame.size.height) + + (viewMargin * 2.0)) - cornerRadius; + if (drawsRoundCornerBesideArrow) { + maxWidth -= cornerRadius; + } + if (value <= maxWidth) { + arrowBaseWidth = value; + } else { + arrowBaseWidth = maxWidth; + } + + [self _redisplay]; +} + + +- (float)arrowHeight { + return arrowHeight; +} + + +- (void)setArrowHeight:(float)value { + if (arrowHeight != value) { + arrowHeight = value; + + [self _redisplay]; + } +} + + +- (float)hasArrow { + return hasArrow; +} + + +- (void)setHasArrow:(float)value { + if (hasArrow != value) { + hasArrow = value; + + [self _updateBackground]; + } +} + + +- (float)cornerRadius { + return cornerRadius; +} + + +- (void)setCornerRadius:(float)value { + float maxRadius = ((MIN(_viewFrame.size.width, _viewFrame.size.height) + + (viewMargin * 2.0)) - arrowBaseWidth) / 2.0; + if (value <= maxRadius) { + cornerRadius = value; + } else { + cornerRadius = maxRadius; + } + cornerRadius = MAX(cornerRadius, 0.0); + + // Adjust arrowBaseWidth appropriately. + [self setArrowBaseWidth:arrowBaseWidth]; +} + + +- (float)drawsRoundCornerBesideArrow { + return drawsRoundCornerBesideArrow; +} + + +- (void)setDrawsRoundCornerBesideArrow:(float)value { + if (drawsRoundCornerBesideArrow != value) { + drawsRoundCornerBesideArrow = value; + + [self _redisplay]; + } +} + + +- (void)setBackgroundImage:(NSImage *)value +{ + if (value) { + [self setBackgroundColor:[NSColor colorWithPatternImage:value]]; + } +} + + +@end diff --git a/Others/XMLReader.h b/Others/XMLReader.h new file mode 100755 index 0000000..b920cc7 --- /dev/null +++ b/Others/XMLReader.h @@ -0,0 +1,47 @@ +// +// XMLReader.h +// +// Downloaded from https://github.com/cbpowell/XML-to-NSDictionary +// Originally from http://troybrant.net/blog/2010/09/simple-xml-to-nsdictionary-converter/ +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import + + +@interface XMLReader : NSObject { + + NSMutableArray *dictionaryStack; + NSMutableString *textInProgress; + NSError **errorPointer; +} + ++ (NSDictionary *)dictionaryForXMLData:(NSData *)data error:(NSError **)errorPointer; ++ (NSDictionary *)dictionaryForXMLString:(NSString *)string error:(NSError **)errorPointer; + +@end + +@interface NSDictionary (XMLReaderNavigation) + +- (id)retrieveForPath:(NSString *)navPath; +- (NSArray *)retrieveArrayForPath:(NSString *)navPath; + +@end + diff --git a/Others/XMLReader.m b/Others/XMLReader.m new file mode 100755 index 0000000..933fc39 --- /dev/null +++ b/Others/XMLReader.m @@ -0,0 +1,232 @@ +// +// XMLReader.m +// +// Downloaded from https://github.com/cbpowell/XML-to-NSDictionary +// Originally from http://troybrant.net/blog/2010/09/simple-xml-to-nsdictionary-converter/ +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +#import "XMLReader.h" + +NSString *const kXMLReaderTextNodeKey = @"text"; + +@interface XMLReader (Internal) + +- (id)initWithError:(NSError **)error; +- (NSDictionary *)objectWithData:(NSData *)data; + +@end + +@implementation NSDictionary (XMLReaderNavigation) + +- (id)retrieveForPath:(NSString *)navPath { + + // Split path on dots + NSArray *pathItems = [navPath componentsSeparatedByString:@"."]; + + // Enumerate through array + NSEnumerator *e = [pathItems objectEnumerator]; + NSString *path; + + // Set first branch from self + id branch = [self objectForKey:[e nextObject]]; + int count = 1; + while (path = [e nextObject]) { + + // Check if this branch is an NSArray + if ([branch isKindOfClass:[NSArray class]]) { + + if ([path isEqualToString:@"last"]) { + branch = [branch lastObject]; + } else { + if ([branch count] > [path intValue]) { + branch = [branch objectAtIndex:[path intValue]]; + } else { + branch = nil; + } + } + + } else { + + //branch is assumed to be an NSDictionary + branch = [branch objectForKey:path]; + + } + + count++; + } + + return branch; +} + +- (NSArray *)retrieveArrayForPath:(NSString *)navPath { + NSObject *r = [self retrieveForPath:navPath]; + if ([r isKindOfClass:[NSDictionary class]]) { + return [NSArray arrayWithObject:r]; + } else { + return (NSArray *) r; + } +} + +@end + + + +@implementation XMLReader + +#pragma mark - +#pragma mark Public methods + ++ (NSDictionary *)dictionaryForXMLData:(NSData *)data error:(NSError **)error { + + XMLReader *reader = [[XMLReader alloc] initWithError:error]; + NSDictionary *rootDictionary = [reader objectWithData:data]; + [reader release]; + return rootDictionary; +} + ++ (NSDictionary *)dictionaryForXMLString:(NSString *)string error:(NSError **)error { + + NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding]; + return [XMLReader dictionaryForXMLData:data error:error]; +} + +#pragma mark - +#pragma mark Parsing + +- (id)initWithError:(NSError **)error { + + if (self = [super init]) { + + errorPointer = error; + } + return self; +} + +- (void)dealloc { + + [dictionaryStack release]; + [textInProgress release]; + [super dealloc]; +} + +- (NSDictionary *)objectWithData:(NSData *)data { + + // Clear out any old data + [dictionaryStack release]; + [textInProgress release]; + + dictionaryStack = [[NSMutableArray alloc] init]; + textInProgress = [[NSMutableString alloc] init]; + + // Initialize the stack with a fresh dictionary + [dictionaryStack addObject:[NSMutableDictionary dictionary]]; + + // Parse the XML + NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data]; + parser.delegate = self; + BOOL success = [parser parse]; + + // Return the stack's root dictionary on success + if (success){ + + NSDictionary *resultDict = [dictionaryStack objectAtIndex:0]; + + [parser release]; + return resultDict; + } + + [parser release]; + return nil; +} + +#pragma mark - +#pragma mark NSXMLParserDelegate methods + +- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict { + + // Get the dictionary for the current level in the stack + NSMutableDictionary *parentDict = [dictionaryStack lastObject]; + + // Create the child dictionary for the new element, and initilaize it with the attributes + NSMutableDictionary *childDict = [NSMutableDictionary dictionary]; + [childDict addEntriesFromDictionary:attributeDict]; + + // If there's already an item for this key, it means we need to create an array + id existingValue = [parentDict objectForKey:elementName]; + if (existingValue) { + NSMutableArray *array = nil; + if ([existingValue isKindOfClass:[NSMutableArray class]]) + { + // The array exists, so use it + array = (NSMutableArray *) existingValue; + } + else + { + // Create an array if it doesn't exist + array = [NSMutableArray array]; + [array addObject:existingValue]; + + // Replace the child dictionary with an array of children dictionaries + [parentDict setObject:array forKey:elementName]; + } + + // Add the new child dictionary to the array + [array addObject:childDict]; + } + else { + + // No existing value, so update the dictionary + [parentDict setObject:childDict forKey:elementName]; + } + + // Update the stack + [dictionaryStack addObject:childDict]; +} + +- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { + + // Update the parent dict with text info + NSMutableDictionary *dictInProgress = [dictionaryStack lastObject]; + + // Set the text property + if ([textInProgress length] > 0) { + + [dictInProgress setObject:[textInProgress stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] forKey:kXMLReaderTextNodeKey]; + + // Reset the text + [textInProgress release]; + textInProgress = [[NSMutableString alloc] init]; + } + + // Pop the current dict + [dictionaryStack removeLastObject]; +} + +- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { + // Build the text value + [textInProgress appendString:string]; +} + +- (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError { + // Set the error pointer to the parser's error object + if (errorPointer) + *errorPointer = parseError; +} + +@end \ No newline at end of file diff --git a/Sparkle.framework/.DS_Store b/Sparkle.framework/.DS_Store new file mode 100644 index 0000000..4caedb1 Binary files /dev/null and b/Sparkle.framework/.DS_Store differ diff --git a/Sparkle.framework/Headers b/Sparkle.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/Sparkle.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Sparkle.framework/Resources b/Sparkle.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/Sparkle.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/Sparkle.framework/Sparkle b/Sparkle.framework/Sparkle new file mode 120000 index 0000000..b2c5273 --- /dev/null +++ b/Sparkle.framework/Sparkle @@ -0,0 +1 @@ +Versions/Current/Sparkle \ No newline at end of file diff --git a/Sparkle.framework/Versions/A/Headers/SUAppcast.h b/Sparkle.framework/Versions/A/Headers/SUAppcast.h new file mode 100755 index 0000000..171148a --- /dev/null +++ b/Sparkle.framework/Versions/A/Headers/SUAppcast.h @@ -0,0 +1,33 @@ +// +// SUAppcast.h +// Sparkle +// +// Created by Andy Matuschak on 3/12/06. +// Copyright 2006 Andy Matuschak. All rights reserved. +// + +#ifndef SUAPPCAST_H +#define SUAPPCAST_H + +@class SUAppcastItem; +@interface SUAppcast : NSObject { + NSArray *items; + NSString *userAgentString; + id delegate; + NSMutableData *incrementalData; +} + +- (void)fetchAppcastFromURL:(NSURL *)url; +- (void)setDelegate:delegate; +- (void)setUserAgentString:(NSString *)userAgentString; + +- (NSArray *)items; + +@end + +@interface NSObject (SUAppcastDelegate) +- (void)appcastDidFinishLoading:(SUAppcast *)appcast; +- (void)appcast:(SUAppcast *)appcast failedToLoadWithError:(NSError *)error; +@end + +#endif diff --git a/Sparkle.framework/Versions/A/Headers/SUAppcastItem.h b/Sparkle.framework/Versions/A/Headers/SUAppcastItem.h new file mode 100755 index 0000000..7f1ca65 --- /dev/null +++ b/Sparkle.framework/Versions/A/Headers/SUAppcastItem.h @@ -0,0 +1,47 @@ +// +// SUAppcastItem.h +// Sparkle +// +// Created by Andy Matuschak on 3/12/06. +// Copyright 2006 Andy Matuschak. All rights reserved. +// + +#ifndef SUAPPCASTITEM_H +#define SUAPPCASTITEM_H + +@interface SUAppcastItem : NSObject { + NSString *title; + NSDate *date; + NSString *itemDescription; + + NSURL *releaseNotesURL; + + NSString *DSASignature; + NSString *minimumSystemVersion; + + NSURL *fileURL; + NSString *versionString; + NSString *displayVersionString; + + NSDictionary *propertiesDictionary; +} + +// Initializes with data from a dictionary provided by the RSS class. +- initWithDictionary:(NSDictionary *)dict; + +- (NSString *)title; +- (NSString *)versionString; +- (NSString *)displayVersionString; +- (NSDate *)date; +- (NSString *)itemDescription; +- (NSURL *)releaseNotesURL; +- (NSURL *)fileURL; +- (NSString *)DSASignature; +- (NSString *)minimumSystemVersion; + +// Returns the dictionary provided in initWithDictionary; this might be useful later for extensions. +- (NSDictionary *)propertiesDictionary; + +@end + +#endif diff --git a/Sparkle.framework/Versions/A/Headers/SUUpdater.h b/Sparkle.framework/Versions/A/Headers/SUUpdater.h new file mode 100755 index 0000000..e78c4d3 --- /dev/null +++ b/Sparkle.framework/Versions/A/Headers/SUUpdater.h @@ -0,0 +1,118 @@ +// +// SUUpdater.h +// Sparkle +// +// Created by Andy Matuschak on 1/4/06. +// Copyright 2006 Andy Matuschak. All rights reserved. +// + +#ifndef SUUPDATER_H +#define SUUPDATER_H + +#import + +@class SUUpdateDriver, SUAppcastItem, SUHost, SUAppcast; +@interface SUUpdater : NSObject { + NSTimer *checkTimer; + SUUpdateDriver *driver; + + SUHost *host; + IBOutlet id delegate; +} + ++ (SUUpdater *)sharedUpdater; ++ (SUUpdater *)updaterForBundle:(NSBundle *)bundle; +- (NSBundle *)hostBundle; + +- (void)setDelegate:(id)delegate; +- delegate; + +- (void)setAutomaticallyChecksForUpdates:(BOOL)automaticallyChecks; +- (BOOL)automaticallyChecksForUpdates; + +- (void)setUpdateCheckInterval:(NSTimeInterval)interval; +- (NSTimeInterval)updateCheckInterval; + +- (void)setFeedURL:(NSURL *)feedURL; +- (NSURL *)feedURL; + +- (void)setSendsSystemProfile:(BOOL)sendsSystemProfile; +- (BOOL)sendsSystemProfile; + +- (void)setAutomaticallyDownloadsUpdates:(BOOL)automaticallyDownloadsUpdates; +- (BOOL)automaticallyDownloadsUpdates; + +// This IBAction is meant for a main menu item. Hook up any menu item to this action, +// and Sparkle will check for updates and report back its findings verbosely. +- (IBAction)checkForUpdates:sender; + +// This kicks off an update meant to be programmatically initiated. That is, it will display no UI unless it actually finds an update, +// in which case it proceeds as usual. If the fully automated updating is turned on, however, this will invoke that behavior, and if an +// update is found, it will be downloaded and prepped for installation. +- (void)checkForUpdatesInBackground; + +// Date of last update check. Returns null if no check has been performed. +- (NSDate*)lastUpdateCheckDate; + +// This begins a "probing" check for updates which will not actually offer to update to that version. The delegate methods, though, +// (up to updater:didFindValidUpdate: and updaterDidNotFindUpdate:), are called, so you can use that information in your UI. +- (void)checkForUpdateInformation; + +// Call this to appropriately schedule or cancel the update checking timer according to the preferences for time interval and automatic checks. This call does not change the date of the next check, but only the internal NSTimer. +- (void)resetUpdateCycle; + +- (BOOL)updateInProgress; +@end + +@interface NSObject (SUUpdaterDelegateInformalProtocol) +// This method allows you to add extra parameters to the appcast URL, potentially based on whether or not Sparkle will also be sending along the system profile. This method should return an array of dictionaries with keys: "key", "value", "displayKey", "displayValue", the latter two being specifically for display to the user. +- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile; + +// Use this to override the default behavior for Sparkle prompting the user about automatic update checks. +- (BOOL)updaterShouldPromptForPermissionToCheckForUpdates:(SUUpdater *)bundle; + +// Implement this if you want to do some special handling with the appcast once it finishes loading. +- (void)updater:(SUUpdater *)updater didFinishLoadingAppcast:(SUAppcast *)appcast; + +// If you're using special logic or extensions in your appcast, implement this to use your own logic for finding +// a valid update, if any, in the given appcast. +- (SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast forUpdater:(SUUpdater *)bundle; + +// Sent when a valid update is found by the update driver. +- (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)update; + +// Sent when a valid update is not found. +- (void)updaterDidNotFindUpdate:(SUUpdater *)update; + +// Sent immediately before installing the specified update. +- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update; + +// Return YES to delay the relaunch until you do some processing; invoke the given NSInvocation to continue. +- (BOOL)updater:(SUUpdater *)updater shouldPostponeRelaunchForUpdate:(SUAppcastItem *)update untilInvoking:(NSInvocation *)invocation; + +// Called immediately before relaunching. +- (void)updaterWillRelaunchApplication:(SUUpdater *)updater; + +// This method allows you to provide a custom version comparator. +// If you don't implement this method or return nil, the standard version comparator will be used. +- (id )versionComparatorForUpdater:(SUUpdater *)updater; + +// Returns the path which is used to relaunch the client after the update is installed. By default, the path of the host bundle. +- (NSString *)pathToRelaunchForUpdater:(SUUpdater *)updater; + +@end + +// Define some minimum intervals to avoid DOS-like checking attacks. These are in seconds. +#ifdef DEBUG +#define SU_MIN_CHECK_INTERVAL 60 +#else +#define SU_MIN_CHECK_INTERVAL 60*60 +#endif + +#ifdef DEBUG +#define SU_DEFAULT_CHECK_INTERVAL 60 +#else +#define SU_DEFAULT_CHECK_INTERVAL 60*60*24 +#endif + +#endif diff --git a/Sparkle.framework/Versions/A/Headers/SUVersionComparisonProtocol.h b/Sparkle.framework/Versions/A/Headers/SUVersionComparisonProtocol.h new file mode 100755 index 0000000..3d11ae8 --- /dev/null +++ b/Sparkle.framework/Versions/A/Headers/SUVersionComparisonProtocol.h @@ -0,0 +1,27 @@ +// +// SUVersionComparisonProtocol.h +// Sparkle +// +// Created by Andy Matuschak on 12/21/07. +// Copyright 2007 Andy Matuschak. All rights reserved. +// + +#ifndef SUVERSIONCOMPARISONPROTOCOL_H +#define SUVERSIONCOMPARISONPROTOCOL_H + +/*! + @protocol + @abstract Implement this protocol to provide version comparison facilities for Sparkle. +*/ +@protocol SUVersionComparison + +/*! + @method + @abstract An abstract method to compare two version strings. + @discussion Should return NSOrderedAscending if b > a, NSOrderedDescending if b < a, and NSOrderedSame if they are equivalent. +*/ +- (NSComparisonResult)compareVersion:(NSString *)versionA toVersion:(NSString *)versionB; + +@end + +#endif diff --git a/Sparkle.framework/Versions/A/Headers/Sparkle.h b/Sparkle.framework/Versions/A/Headers/Sparkle.h new file mode 100755 index 0000000..08dd577 --- /dev/null +++ b/Sparkle.framework/Versions/A/Headers/Sparkle.h @@ -0,0 +1,21 @@ +// +// Sparkle.h +// Sparkle +// +// Created by Andy Matuschak on 3/16/06. (Modified by CDHW on 23/12/07) +// Copyright 2006 Andy Matuschak. All rights reserved. +// + +#ifndef SPARKLE_H +#define SPARKLE_H + +// This list should include the shared headers. It doesn't matter if some of them aren't shared (unless +// there are name-space collisions) so we can list all of them to start with: + +#import + +#import +#import +#import + +#endif diff --git a/Sparkle.framework/Versions/A/Resources/Info.plist b/Sparkle.framework/Versions/A/Resources/Info.plist new file mode 100755 index 0000000..c7f277d --- /dev/null +++ b/Sparkle.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + Sparkle + CFBundleIdentifier + org.andymatuschak.Sparkle + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Sparkle + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.5 Beta 6 + CFBundleSignature + ???? + CFBundleVersion + 313 + + diff --git a/Sparkle.framework/Versions/A/Resources/License.txt b/Sparkle.framework/Versions/A/Resources/License.txt new file mode 100755 index 0000000..20466c4 --- /dev/null +++ b/Sparkle.framework/Versions/A/Resources/License.txt @@ -0,0 +1,7 @@ +Copyright (c) 2006 Andy Matuschak + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Sparkle.framework/Versions/A/Resources/SUModelTranslation.plist b/Sparkle.framework/Versions/A/Resources/SUModelTranslation.plist new file mode 100755 index 0000000..92ef947 --- /dev/null +++ b/Sparkle.framework/Versions/A/Resources/SUModelTranslation.plist @@ -0,0 +1,174 @@ + + + + + ADP2,1 + Developer Transition Kit + MacBook1,1 + MacBook (Core Duo) + MacBook2,1 + MacBook (Core 2 Duo) + MacBook4,1 + MacBook (Core 2 Duo Feb 2008) + MacBookAir1,1 + MacBook Air (January 2008) + MacBookPro1,1 + MacBook Pro Core Duo (15-inch) + MacBookPro1,2 + MacBook Pro Core Duo (17-inch) + MacBookPro2,1 + MacBook Pro Core 2 Duo (17-inch) + MacBookPro2,2 + MacBook Pro Core 2 Duo (15-inch) + MacBookPro3,1 + MacBook Pro Core 2 Duo (15-inch LED, Core 2 Duo) + MacBookPro3,2 + MacBook Pro Core 2 Duo (17-inch HD, Core 2 Duo) + MacBookPro4,1 + MacBook Pro (Core 2 Duo Feb 2008) + MacPro1,1 + Mac Pro (four-core) + MacPro2,1 + Mac Pro (eight-core) + MacPro3,1 + Mac Pro (January 2008 4- or 8- core "Harpertown") + Macmini1,1 + Mac Mini (Core Solo/Duo) + PowerBook1,1 + PowerBook G3 + PowerBook2,1 + iBook G3 + PowerBook2,2 + iBook G3 (FireWire) + PowerBook2,3 + iBook G3 + PowerBook2,4 + iBook G3 + PowerBook3,1 + PowerBook G3 (FireWire) + PowerBook3,2 + PowerBook G4 + PowerBook3,3 + PowerBook G4 (Gigabit Ethernet) + PowerBook3,4 + PowerBook G4 (DVI) + PowerBook3,5 + PowerBook G4 (1GHz / 867MHz) + PowerBook4,1 + iBook G3 (Dual USB, Late 2001) + PowerBook4,2 + iBook G3 (16MB VRAM) + PowerBook4,3 + iBook G3 Opaque 16MB VRAM, 32MB VRAM, Early 2003) + PowerBook5,1 + PowerBook G4 (17 inch) + PowerBook5,2 + PowerBook G4 (15 inch FW 800) + PowerBook5,3 + PowerBook G4 (17-inch 1.33GHz) + PowerBook5,4 + PowerBook G4 (15 inch 1.5/1.33GHz) + PowerBook5,5 + PowerBook G4 (17-inch 1.5GHz) + PowerBook5,6 + PowerBook G4 (15 inch 1.67GHz/1.5GHz) + PowerBook5,7 + PowerBook G4 (17-inch 1.67GHz) + PowerBook5,8 + PowerBook G4 (Double layer SD, 15 inch) + PowerBook5,9 + PowerBook G4 (Double layer SD, 17 inch) + PowerBook6,1 + PowerBook G4 (12 inch) + PowerBook6,2 + PowerBook G4 (12 inch, DVI) + PowerBook6,3 + iBook G4 + PowerBook6,4 + PowerBook G4 (12 inch 1.33GHz) + PowerBook6,5 + iBook G4 (Early-Late 2004) + PowerBook6,7 + iBook G4 (Mid 2005) + PowerBook6,8 + PowerBook G4 (12 inch 1.5GHz) + PowerMac1,1 + Power Macintosh G3 (Blue & White) + PowerMac1,2 + Power Macintosh G4 (PCI Graphics) + PowerMac10,1 + Mac Mini G4 + PowerMac10,2 + Mac Mini (Late 2005) + PowerMac11,2 + Power Macintosh G5 (Late 2005) + PowerMac12,1 + iMac G5 (iSight) + PowerMac2,1 + iMac G3 (Slot-loading CD-ROM) + PowerMac2,2 + iMac G3 (Summer 2000) + PowerMac3,1 + Power Macintosh G4 (AGP Graphics) + PowerMac3,2 + Power Macintosh G4 (AGP Graphics) + PowerMac3,3 + Power Macintosh G4 (Gigabit Ethernet) + PowerMac3,4 + Power Macintosh G4 (Digital Audio) + PowerMac3,5 + Power Macintosh G4 (Quick Silver) + PowerMac3,6 + Power Macintosh G4 (Mirrored Drive Door) + PowerMac4,1 + iMac G3 (Early/Summer 2001) + PowerMac4,2 + iMac G4 (Flat Panel) + PowerMac4,4 + eMac + PowerMac4,5 + iMac G4 (17-inch Flat Panel) + PowerMac5,1 + Power Macintosh G4 Cube + PowerMac6,1 + iMac G4 (USB 2.0) + PowerMac6,3 + iMac G4 (20-inch Flat Panel) + PowerMac6,4 + eMac (USB 2.0, 2005) + PowerMac7,2 + Power Macintosh G5 + PowerMac7,3 + Power Macintosh G5 + PowerMac8,1 + iMac G5 + PowerMac8,2 + iMac G5 (Ambient Light Sensor) + PowerMac9,1 + Power Macintosh G5 (Late 2005) + RackMac1,1 + Xserve G4 + RackMac1,2 + Xserve G4 (slot-loading, cluster node) + RackMac3,1 + Xserve G5 + Xserve1,1 + Xserve (Intel Xeon) + Xserve2,1 + Xserve (January 2008 quad-core) + iMac1,1 + iMac G3 (Rev A-D) + iMac4,1 + iMac (Core Duo) + iMac4,2 + iMac for Education (17-inch, Core Duo) + iMac5,1 + iMac (Core 2 Duo, 17 or 20 inch, SuperDrive) + iMac5,2 + iMac (Core 2 Duo, 17 inch, Combo Drive) + iMac6,1 + iMac (Core 2 Duo, 24 inch, SuperDrive) + iMac8,1 + iMac (April 2008) + + diff --git a/Sparkle.framework/Versions/A/Resources/SUStatus.nib/keyedobjects.nib b/Sparkle.framework/Versions/A/Resources/SUStatus.nib/keyedobjects.nib new file mode 100755 index 0000000..4f1d598 Binary files /dev/null and b/Sparkle.framework/Versions/A/Resources/SUStatus.nib/keyedobjects.nib differ diff --git a/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib b/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib new file mode 100755 index 0000000..7630390 Binary files /dev/null and b/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib differ diff --git a/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/keyedobjects.nib b/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/keyedobjects.nib new file mode 100755 index 0000000..e7e7497 Binary files /dev/null and b/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/keyedobjects.nib differ diff --git a/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib b/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib new file mode 100755 index 0000000..e8dc5b8 Binary files /dev/null and b/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib differ diff --git a/Sparkle.framework/Versions/A/Resources/en.lproj/Sparkle.strings b/Sparkle.framework/Versions/A/Resources/en.lproj/Sparkle.strings new file mode 100755 index 0000000..16e0787 Binary files /dev/null and b/Sparkle.framework/Versions/A/Resources/en.lproj/Sparkle.strings differ diff --git a/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib b/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib new file mode 100755 index 0000000..15ba8f4 Binary files /dev/null and b/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib differ diff --git a/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/keyedobjects.nib b/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/keyedobjects.nib new file mode 100755 index 0000000..2984064 Binary files /dev/null and b/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/keyedobjects.nib differ diff --git a/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib b/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib new file mode 100755 index 0000000..55cc2c2 Binary files /dev/null and b/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib differ diff --git a/Sparkle.framework/Versions/A/Resources/it.lproj/Sparkle.strings b/Sparkle.framework/Versions/A/Resources/it.lproj/Sparkle.strings new file mode 100755 index 0000000..5c410d0 Binary files /dev/null and b/Sparkle.framework/Versions/A/Resources/it.lproj/Sparkle.strings differ diff --git a/Sparkle.framework/Versions/A/Resources/relaunch b/Sparkle.framework/Versions/A/Resources/relaunch new file mode 100755 index 0000000..e7b96d6 Binary files /dev/null and b/Sparkle.framework/Versions/A/Resources/relaunch differ diff --git a/Sparkle.framework/Versions/A/Sparkle b/Sparkle.framework/Versions/A/Sparkle new file mode 100755 index 0000000..0db0a8f Binary files /dev/null and b/Sparkle.framework/Versions/A/Sparkle differ diff --git a/Sparkle.framework/Versions/Current b/Sparkle.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/Sparkle.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/Subler.entitlements b/Subler.entitlements new file mode 100755 index 0000000..49d374f --- /dev/null +++ b/Subler.entitlements @@ -0,0 +1,16 @@ + + + + + com.apple.security.assets.movies.read-write + + com.apple.security.files.bookmarks.app-scope + + com.apple.security.files.user-selected.read-write + + com.apple.security.network.client + + com.apple.security.temporary-exception.audio-unit-host + + + diff --git a/Subler.xcodeproj/project.pbxproj b/Subler.xcodeproj/project.pbxproj new file mode 100755 index 0000000..da56210 --- /dev/null +++ b/Subler.xcodeproj/project.pbxproj @@ -0,0 +1,935 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */; }; + 8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */; }; + 8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165FFE840EACC02AAC07 /* InfoPlist.strings */; }; + 8D15AC320486D014006FF6A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4B0FDCFA73011CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; + 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; }; + A90B023B10F3290A000416F3 /* Prefs.xib in Resources */ = {isa = PBXBuildFile; fileRef = A90B023910F3290A000416F3 /* Prefs.xib */; }; + 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 */; }; + A936E03E130BE10200CA5527 /* MAAttachedWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = A936E03D130BE10200CA5527 /* MAAttachedWindow.m */; }; + A95C881D0F827BFB00F51A22 /* ToolbarRemoveTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A95C881C0F827BFB00F51A22 /* ToolbarRemoveTemplate.png */; }; + A960E96317D4B00900FC6ED9 /* SBImageBrowserView.m in Sources */ = {isa = PBXBuildFile; fileRef = A960E96217D4B00900FC6ED9 /* SBImageBrowserView.m */; }; + A961476313F567E10068F161 /* SBQueueController.m in Sources */ = {isa = PBXBuildFile; fileRef = A961476013F567E10068F161 /* SBQueueController.m */; }; + A961476413F567E10068F161 /* SBPresetManager.m in Sources */ = {isa = PBXBuildFile; fileRef = A961476213F567E10068F161 /* SBPresetManager.m */; }; + A961476713F568210068F161 /* Queue.xib in Resources */ = {isa = PBXBuildFile; fileRef = A961476513F568210068F161 /* Queue.xib */; }; + A96371B8164695070083BB80 /* ToolbarRemoveTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A96371B7164695070083BB80 /* ToolbarRemoveTemplate@2x.png */; }; + A9707B9317B139780010F3DB /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD56966E12FAAFA90029FADB /* Quartz.framework */; }; + A975644D132A325C0051ED08 /* info.pdf in Resources */ = {isa = PBXBuildFile; fileRef = A975644A132A325C0051ED08 /* info.pdf */; }; + A975644E132A325C0051ED08 /* info-over.pdf in Resources */ = {isa = PBXBuildFile; fileRef = A975644B132A325C0051ED08 /* info-over.pdf */; }; + 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 */; }; + A984DB740F52DD4B001A20B2 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = A984DB730F52DD4B001A20B2 /* dsa_pub.pem */; }; + A98739FE13FBB09B00B795A7 /* ToolbarActionTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A98739FD13FBB09B00B795A7 /* ToolbarActionTemplate.png */; }; + A99EEA3F12B801AE002367D3 /* SBDocument.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9B46AC012B79E230040517A /* SBDocument.xib */; }; + A9AB484917F0AEA2000AA72E /* SBAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A9AB484817F0AEA2000AA72E /* SBAppDelegate.m */; }; + A9AB485417F0AEAC000AA72E /* SBChapterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9AB484B17F0AEAC000AA72E /* SBChapterViewController.m */; }; + A9AB485517F0AEAC000AA72E /* SBEmptyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9AB484D17F0AEAC000AA72E /* SBEmptyViewController.m */; }; + A9AB485617F0AEAC000AA72E /* SBMovieViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9AB484F17F0AEAC000AA72E /* SBMovieViewController.m */; }; + A9AB485717F0AEAC000AA72E /* SBSoundViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9AB485117F0AEAC000AA72E /* SBSoundViewController.m */; }; + A9AB485817F0AEAC000AA72E /* SBVideoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9AB485317F0AEAC000AA72E /* SBVideoViewController.m */; }; + A9AB486417F0AEFD000AA72E /* ChapterView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9AB485A17F0AEFD000AA72E /* ChapterView.xib */; }; + A9AB486517F0AEFD000AA72E /* EmptyView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9AB485C17F0AEFD000AA72E /* EmptyView.xib */; }; + A9AB486617F0AEFD000AA72E /* MovieView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9AB485E17F0AEFD000AA72E /* MovieView.xib */; }; + A9AB486717F0AEFD000AA72E /* SoundView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9AB486017F0AEFD000AA72E /* SoundView.xib */; }; + A9AB486817F0AEFD000AA72E /* VideoView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9AB486217F0AEFD000AA72E /* VideoView.xib */; }; + A9B46A8C12B79B240040517A /* SBFileImport.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B46A7F12B79B240040517A /* SBFileImport.m */; }; + A9B46A8E12B79B240040517A /* SBPrefsController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B46A8312B79B240040517A /* SBPrefsController.m */; }; + A9B46A8F12B79B240040517A /* SBTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B46A8512B79B240040517A /* SBTableView.m */; }; + A9B46A9012B79B240040517A /* SBView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B46A8712B79B240040517A /* SBView.m */; }; + A9B46A9E12B79B990040517A /* ButtonToolbarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B46A9412B79B990040517A /* ButtonToolbarItem.m */; }; + A9B46AA412B79BB10040517A /* Subler.icns in Resources */ = {isa = PBXBuildFile; fileRef = A9B46AA312B79BB10040517A /* Subler.icns */; }; + A9B46ABF12B79D1C0040517A /* SBDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B46ABE12B79D1C0040517A /* SBDocument.m */; }; + A9C055370F6D395B00AF15B5 /* FileImport.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9C055360F6D395B00AF15B5 /* FileImport.xib */; }; + A9C9E34413FBC1EB00CA3B4E /* EncodeWorking.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C9E34113FBC1EB00CA3B4E /* EncodeWorking.png */; }; + A9D47B5817B239E200900BCA /* EncodeCanceled.png in Resources */ = {isa = PBXBuildFile; fileRef = A9D47B5417B239E200900BCA /* EncodeCanceled.png */; }; + A9D47B5917B239E200900BCA /* EncodeCanceled@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9D47B5517B239E200900BCA /* EncodeCanceled@2x.png */; }; + A9D47B5A17B239E200900BCA /* EncodeComplete.png in Resources */ = {isa = PBXBuildFile; fileRef = A9D47B5617B239E200900BCA /* EncodeComplete.png */; }; + A9D47B5B17B239E200900BCA /* EncodeComplete@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9D47B5717B239E200900BCA /* EncodeComplete@2x.png */; }; + A9F284A0133C9F6E00F10951 /* close.pdf in Resources */ = {isa = PBXBuildFile; fileRef = A9F2849D133C9F6E00F10951 /* close.pdf */; }; + A9F284A1133C9F6E00F10951 /* close-over.pdf in Resources */ = {isa = PBXBuildFile; fileRef = A9F2849E133C9F6E00F10951 /* close-over.pdf */; }; + A9F284A2133C9F6E00F10951 /* close-pressed.pdf in Resources */ = {isa = PBXBuildFile; fileRef = A9F2849F133C9F6E00F10951 /* close-pressed.pdf */; }; + A9F7F8E01837C44B0036AE7E /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9ED7B21180067A2008FD3A8 /* IOKit.framework */; }; + CD03087417576A550093A0BE /* TheMovieDB3.m in Sources */ = {isa = PBXBuildFile; fileRef = CD03087317576A550093A0BE /* TheMovieDB3.m */; }; + CD03087917576AE50093A0BE /* MetadataImporter.m in Sources */ = {isa = PBXBuildFile; fileRef = CD03087817576AE50093A0BE /* MetadataImporter.m */; }; + CD3F2A881761A143000D4C73 /* XMLReader.m in Sources */ = {isa = PBXBuildFile; fileRef = CD3F2A871761A143000D4C73 /* XMLReader.m */; }; + CD4E6E5D12F744210095C84F /* ArtworkSelector.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD4E6E5B12F744210095C84F /* ArtworkSelector.xib */; }; + CD56963212FAAD680029FADB /* SBArtworkSelector.m in Sources */ = {isa = PBXBuildFile; fileRef = CD56963112FAAD680029FADB /* SBArtworkSelector.m */; }; + CD71FEA312F1B5AF00F0A98D /* SBMetadataSearchController.m in Sources */ = {isa = PBXBuildFile; fileRef = CD71FEA212F1B5AF00F0A98D /* SBMetadataSearchController.m */; }; + CD71FEA612F1B62600F0A98D /* MetadataSearch.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD71FEA412F1B62600F0A98D /* MetadataSearch.xib */; }; + CD71FF1D12F1C4A900F0A98D /* TheTVDB.m in Sources */ = {isa = PBXBuildFile; fileRef = CD71FF1C12F1C4A900F0A98D /* TheTVDB.m */; }; + CDC06FCE1747494D003C1D0A /* iTunesStore.m in Sources */ = {isa = PBXBuildFile; fileRef = CDC06FCD1747494D003C1D0A /* iTunesStore.m */; }; + CDE8E452174CBBD4009410B5 /* iTunesStores.json in Resources */ = {isa = PBXBuildFile; fileRef = CDE8E451174CBBD4009410B5 /* iTunesStores.json */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + A925AA8118378D7900BE84D4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A925AA7B18378D7800BE84D4 /* MP42Foundation.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A9B9C1ED182391DF00416A4E; + remoteInfo = MP42Foundation; + }; + A925AA8318378D7900BE84D4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A925AA7B18378D7800BE84D4 /* MP42Foundation.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A9B9C204182391DF00416A4E; + remoteInfo = MP42FoundationTests; + }; + A925AA8618378DC400BE84D4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A925AA7B18378D7800BE84D4 /* MP42Foundation.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A9B9C1EC182391DF00416A4E; + remoteInfo = MP42Foundation; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + A941B4DF134A531400E22F45 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = tessdata; + dstSubfolderSpec = 7; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A984DB5E0F52D68E001A20B2 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + A984DB530F52D679001A20B2 /* Sparkle.framework in CopyFiles */, + A925AA8818378DD000BE84D4 /* MP42Foundation.framework in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 089C1660FE840EACC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; + 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; + 1DDD582B0DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; + 2A37F4B0FDCFA73011CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 2A37F4BAFDCFA73011CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = ""; }; + 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 32DBCF750370BD2300C91783 /* Subler_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Subler_Prefix.pch; sourceTree = ""; }; + 8D15AC360486D014006FF6A4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8D15AC370486D014006FF6A4 /* Subler.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Subler.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 948058B5106E07990037A911 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = ""; }; + A90B023A10F3290A000416F3 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Prefs.xib; sourceTree = ""; }; + A91F622C0FB0A56F00B96B33 /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = /usr/lib/libicucore.dylib; sourceTree = ""; }; + A925AA7B18378D7800BE84D4 /* MP42Foundation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MP42Foundation.xcodeproj; path = MP42Foundation/MP42Foundation.xcodeproj; sourceTree = ""; }; + A936E03C130BE10200CA5527 /* MAAttachedWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MAAttachedWindow.h; path = Others/MAAttachedWindow.h; sourceTree = ""; }; + A936E03D130BE10200CA5527 /* MAAttachedWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MAAttachedWindow.m; path = Others/MAAttachedWindow.m; sourceTree = ""; }; + A95C881C0F827BFB00F51A22 /* ToolbarRemoveTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ToolbarRemoveTemplate.png; path = images/ToolbarRemoveTemplate.png; sourceTree = ""; }; + A960E96117D4B00900FC6ED9 /* SBImageBrowserView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBImageBrowserView.h; path = Classes/SBImageBrowserView.h; sourceTree = ""; }; + A960E96217D4B00900FC6ED9 /* SBImageBrowserView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBImageBrowserView.m; path = Classes/SBImageBrowserView.m; sourceTree = ""; }; + A961475F13F567E10068F161 /* SBQueueController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBQueueController.h; path = Classes/SBQueueController.h; sourceTree = ""; }; + A961476013F567E10068F161 /* SBQueueController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = SBQueueController.m; path = Classes/SBQueueController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + A961476113F567E10068F161 /* SBPresetManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBPresetManager.h; path = Classes/SBPresetManager.h; sourceTree = ""; }; + A961476213F567E10068F161 /* SBPresetManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBPresetManager.m; path = Classes/SBPresetManager.m; sourceTree = ""; }; + A961476613F568210068F161 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Queue.xib; sourceTree = ""; }; + A96371B7164695070083BB80 /* ToolbarRemoveTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ToolbarRemoveTemplate@2x.png"; path = "images/ToolbarRemoveTemplate@2x.png"; sourceTree = ""; }; + A975644A132A325C0051ED08 /* info.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = info.pdf; path = images/info.pdf; sourceTree = ""; }; + A975644B132A325C0051ED08 /* info-over.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = "info-over.pdf"; path = "images/info-over.pdf"; sourceTree = ""; }; + A975644C132A325C0051ED08 /* info-pressed.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = "info-pressed.pdf"; path = "images/info-pressed.pdf"; sourceTree = ""; }; + A97BE36E0F73D72E00652CBD /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; }; + A982D0BE140AB66400B92357 /* SBQueueItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBQueueItem.h; path = Classes/SBQueueItem.h; sourceTree = ""; }; + A982D0BF140AB66400B92357 /* SBQueueItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBQueueItem.m; path = Classes/SBQueueItem.m; sourceTree = ""; }; + A984DB4A0F52D644001A20B2 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Sparkle.framework; sourceTree = ""; }; + A984DB730F52DD4B001A20B2 /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dsa_pub.pem; sourceTree = ""; }; + A98739FD13FBB09B00B795A7 /* ToolbarActionTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ToolbarActionTemplate.png; path = images/ToolbarActionTemplate.png; sourceTree = ""; }; + A991319913F0615700DCAA12 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + A991319B13F0668300DCAA12 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; + A9AB484717F0AEA2000AA72E /* SBAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBAppDelegate.h; path = Classes/SBAppDelegate.h; sourceTree = ""; }; + A9AB484817F0AEA2000AA72E /* SBAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBAppDelegate.m; path = Classes/SBAppDelegate.m; sourceTree = ""; }; + A9AB484A17F0AEAC000AA72E /* SBChapterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBChapterViewController.h; path = Classes/PropertyView/SBChapterViewController.h; sourceTree = ""; }; + A9AB484B17F0AEAC000AA72E /* SBChapterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBChapterViewController.m; path = Classes/PropertyView/SBChapterViewController.m; sourceTree = ""; }; + A9AB484C17F0AEAC000AA72E /* SBEmptyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBEmptyViewController.h; path = Classes/PropertyView/SBEmptyViewController.h; sourceTree = ""; }; + A9AB484D17F0AEAC000AA72E /* SBEmptyViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBEmptyViewController.m; path = Classes/PropertyView/SBEmptyViewController.m; sourceTree = ""; }; + A9AB484E17F0AEAC000AA72E /* SBMovieViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBMovieViewController.h; path = Classes/PropertyView/SBMovieViewController.h; sourceTree = ""; }; + A9AB484F17F0AEAC000AA72E /* SBMovieViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBMovieViewController.m; path = Classes/PropertyView/SBMovieViewController.m; sourceTree = ""; }; + A9AB485017F0AEAC000AA72E /* SBSoundViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBSoundViewController.h; path = Classes/PropertyView/SBSoundViewController.h; sourceTree = ""; }; + A9AB485117F0AEAC000AA72E /* SBSoundViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBSoundViewController.m; path = Classes/PropertyView/SBSoundViewController.m; sourceTree = ""; }; + A9AB485217F0AEAC000AA72E /* SBVideoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBVideoViewController.h; path = Classes/PropertyView/SBVideoViewController.h; sourceTree = ""; }; + A9AB485317F0AEAC000AA72E /* SBVideoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBVideoViewController.m; path = Classes/PropertyView/SBVideoViewController.m; sourceTree = ""; }; + A9AB485B17F0AEFD000AA72E /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Classes/PropertyView/English.lproj/ChapterView.xib; sourceTree = ""; }; + A9AB485D17F0AEFD000AA72E /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Classes/PropertyView/English.lproj/EmptyView.xib; sourceTree = ""; }; + A9AB485F17F0AEFD000AA72E /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Classes/PropertyView/English.lproj/MovieView.xib; sourceTree = ""; }; + A9AB486117F0AEFD000AA72E /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Classes/PropertyView/English.lproj/SoundView.xib; sourceTree = ""; }; + A9AB486317F0AEFD000AA72E /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Classes/PropertyView/English.lproj/VideoView.xib; sourceTree = ""; }; + A9B3411B1679CA3E00E6EE0C /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = System/Library/Frameworks/QTKit.framework; sourceTree = SDKROOT; }; + A9B46A7E12B79B240040517A /* SBFileImport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBFileImport.h; path = Classes/SBFileImport.h; sourceTree = ""; }; + A9B46A7F12B79B240040517A /* SBFileImport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBFileImport.m; path = Classes/SBFileImport.m; sourceTree = ""; }; + A9B46A8212B79B240040517A /* SBPrefsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBPrefsController.h; path = Classes/SBPrefsController.h; sourceTree = ""; }; + A9B46A8312B79B240040517A /* SBPrefsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBPrefsController.m; path = Classes/SBPrefsController.m; sourceTree = ""; }; + A9B46A8412B79B240040517A /* SBTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBTableView.h; path = Classes/SBTableView.h; sourceTree = ""; }; + A9B46A8512B79B240040517A /* SBTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBTableView.m; path = Classes/SBTableView.m; sourceTree = ""; }; + A9B46A8612B79B240040517A /* SBView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBView.h; path = Classes/SBView.h; sourceTree = ""; }; + A9B46A8712B79B240040517A /* SBView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBView.m; path = Classes/SBView.m; sourceTree = ""; }; + A9B46A9312B79B990040517A /* ButtonToolbarItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ButtonToolbarItem.h; path = Others/ButtonToolbarItem.h; sourceTree = ""; }; + A9B46A9412B79B990040517A /* ButtonToolbarItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ButtonToolbarItem.m; path = Others/ButtonToolbarItem.m; sourceTree = ""; }; + A9B46AA312B79BB10040517A /* Subler.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = Subler.icns; path = images/Subler.icns; sourceTree = ""; }; + A9B46ABD12B79D1C0040517A /* SBDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBDocument.h; path = Classes/SBDocument.h; sourceTree = ""; }; + A9B46ABE12B79D1C0040517A /* SBDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = SBDocument.m; path = Classes/SBDocument.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + A9B46AC112B79E230040517A /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = English; path = English.lproj/SBDocument.xib; sourceTree = ""; }; + A9B4EE4E1643EBF3009AF6BC /* Subler.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Subler.entitlements; sourceTree = ""; }; + A9C055330F6D394F00AF15B5 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/FileImport.xib; sourceTree = ""; }; + A9C0603F168315C500FE3D98 /* libbz2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbz2.dylib; path = usr/lib/libbz2.dylib; sourceTree = SDKROOT; }; + A9C0957F0F7B6C8C00170CAF /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; + A9C8182C0F74D6E300019BFF /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; + A9C9E34113FBC1EB00CA3B4E /* EncodeWorking.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = EncodeWorking.png; path = images/EncodeWorking.png; sourceTree = ""; }; + A9D47B5417B239E200900BCA /* EncodeCanceled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = EncodeCanceled.png; path = images/EncodeCanceled.png; sourceTree = ""; }; + A9D47B5517B239E200900BCA /* EncodeCanceled@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "EncodeCanceled@2x.png"; path = "images/EncodeCanceled@2x.png"; sourceTree = ""; }; + A9D47B5617B239E200900BCA /* EncodeComplete.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = EncodeComplete.png; path = images/EncodeComplete.png; sourceTree = ""; }; + A9D47B5717B239E200900BCA /* EncodeComplete@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "EncodeComplete@2x.png"; path = "images/EncodeComplete@2x.png"; sourceTree = ""; }; + A9ED7B21180067A2008FD3A8 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; + A9F2849D133C9F6E00F10951 /* close.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = close.pdf; path = images/close.pdf; sourceTree = ""; }; + A9F2849E133C9F6E00F10951 /* close-over.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = "close-over.pdf"; path = "images/close-over.pdf"; sourceTree = ""; }; + A9F2849F133C9F6E00F10951 /* close-pressed.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = "close-pressed.pdf"; path = "images/close-pressed.pdf"; sourceTree = ""; }; + CD03087217576A550093A0BE /* TheMovieDB3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TheMovieDB3.h; path = Classes/MetadataImporters/TheMovieDB3.h; sourceTree = ""; }; + CD03087317576A550093A0BE /* TheMovieDB3.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TheMovieDB3.m; path = Classes/MetadataImporters/TheMovieDB3.m; sourceTree = ""; }; + CD03087717576AE50093A0BE /* MetadataImporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MetadataImporter.h; path = Classes/MetadataImporters/MetadataImporter.h; sourceTree = ""; }; + CD03087817576AE50093A0BE /* MetadataImporter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MetadataImporter.m; path = Classes/MetadataImporters/MetadataImporter.m; sourceTree = ""; }; + CD3F2A861761A143000D4C73 /* XMLReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMLReader.h; path = Others/XMLReader.h; sourceTree = ""; }; + CD3F2A871761A143000D4C73 /* XMLReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = XMLReader.m; path = Others/XMLReader.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + CD4A86AA1234AFA10054970A /* Simple.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Simple.pm; sourceTree = ""; }; + CD4A86AC1234AFA10054970A /* Roman.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Roman.pm; sourceTree = ""; }; + CD4A86AF1234AFA10054970A /* Filename.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Filename.pm; sourceTree = ""; }; + CD4A86B01234AFA10054970A /* ParseFilename.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = ParseFilename.pl; sourceTree = ""; }; + CD4E6E5C12F744210095C84F /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/ArtworkSelector.xib; sourceTree = ""; }; + CD56963012FAAD680029FADB /* SBArtworkSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBArtworkSelector.h; path = Classes/SBArtworkSelector.h; sourceTree = ""; }; + CD56963112FAAD680029FADB /* SBArtworkSelector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBArtworkSelector.m; path = Classes/SBArtworkSelector.m; sourceTree = ""; }; + CD56966E12FAAFA90029FADB /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; }; + CD71FEA112F1B5AF00F0A98D /* SBMetadataSearchController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBMetadataSearchController.h; path = Classes/SBMetadataSearchController.h; sourceTree = ""; }; + CD71FEA212F1B5AF00F0A98D /* SBMetadataSearchController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBMetadataSearchController.m; path = Classes/SBMetadataSearchController.m; sourceTree = ""; }; + CD71FEA512F1B62600F0A98D /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MetadataSearch.xib; sourceTree = ""; }; + CD71FF1B12F1C4A900F0A98D /* TheTVDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TheTVDB.h; path = Classes/MetadataImporters/TheTVDB.h; sourceTree = ""; }; + CD71FF1C12F1C4A900F0A98D /* TheTVDB.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TheTVDB.m; path = Classes/MetadataImporters/TheTVDB.m; sourceTree = ""; }; + CDC06FCC1747494D003C1D0A /* iTunesStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = iTunesStore.h; path = Classes/MetadataImporters/iTunesStore.h; sourceTree = ""; }; + CDC06FCD1747494D003C1D0A /* iTunesStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = iTunesStore.m; path = Classes/MetadataImporters/iTunesStore.m; sourceTree = ""; }; + CDE8E451174CBBD4009410B5 /* iTunesStores.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = iTunesStores.json; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D15AC330486D014006FF6A4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A9707B9317B139780010F3DB /* Quartz.framework in Frameworks */, + 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */, + A9F7F8E01837C44B0036AE7E /* IOKit.framework in Frameworks */, + A925AA8518378D8A00BE84D4 /* MP42Foundation.framework in Frameworks */, + A984DB4B0F52D644001A20B2 /* Sparkle.framework in Frameworks */, + A91F622D0FB0A56F00B96B33 /* libicucore.dylib in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */ = { + isa = PBXGroup; + children = ( + A9ED7B21180067A2008FD3A8 /* IOKit.framework */, + A9C0603F168315C500FE3D98 /* libbz2.dylib */, + 948058B5106E07990037A911 /* libz.dylib */, + A91F622C0FB0A56F00B96B33 /* libicucore.dylib */, + 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */, + 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */, + 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */, + A9B3411B1679CA3E00E6EE0C /* QTKit.framework */, + A991319B13F0668300DCAA12 /* CoreMedia.framework */, + A991319913F0615700DCAA12 /* AVFoundation.framework */, + CD56966E12FAAFA90029FADB /* Quartz.framework */, + A9C0957F0F7B6C8C00170CAF /* AudioToolbox.framework */, + A9C8182C0F74D6E300019BFF /* QuickTime.framework */, + A97BE36E0F73D72E00652CBD /* QTKit.framework */, + A984DB4A0F52D644001A20B2 /* Sparkle.framework */, + 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */, + ); + name = "Linked Frameworks"; + sourceTree = ""; + }; + 1058C7A8FEA54F5311CA2CBB /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 19C28FB0FE9D524F11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D15AC370486D014006FF6A4 /* Subler.app */, + ); + name = Products; + sourceTree = ""; + }; + 2A37F4AAFDCFA73011CA2CEA /* MP4Sub */ = { + isa = PBXGroup; + children = ( + A9B4EE4E1643EBF3009AF6BC /* Subler.entitlements */, + 2A37F4ABFDCFA73011CA2CEA /* Classes */, + 2A37F4AFFDCFA73011CA2CEA /* Other Sources */, + A961475E13F5676E0068F161 /* NIBs */, + 2A37F4B8FDCFA73011CA2CEA /* Resources */, + 2A37F4C3FDCFA73011CA2CEA /* Frameworks */, + 19C28FB0FE9D524F11CA2CBB /* Products */, + ); + name = MP4Sub; + sourceTree = ""; + }; + 2A37F4ABFDCFA73011CA2CEA /* Classes */ = { + isa = PBXGroup; + children = ( + A9B46ABD12B79D1C0040517A /* SBDocument.h */, + A9B46ABE12B79D1C0040517A /* SBDocument.m */, + A961475F13F567E10068F161 /* SBQueueController.h */, + A961476013F567E10068F161 /* SBQueueController.m */, + A982D0BE140AB66400B92357 /* SBQueueItem.h */, + A982D0BF140AB66400B92357 /* SBQueueItem.m */, + A961476113F567E10068F161 /* SBPresetManager.h */, + A961476213F567E10068F161 /* SBPresetManager.m */, + A9B46A7E12B79B240040517A /* SBFileImport.h */, + A9B46A7F12B79B240040517A /* SBFileImport.m */, + CD71FEA112F1B5AF00F0A98D /* SBMetadataSearchController.h */, + CD71FEA212F1B5AF00F0A98D /* SBMetadataSearchController.m */, + CD56963012FAAD680029FADB /* SBArtworkSelector.h */, + CD56963112FAAD680029FADB /* SBArtworkSelector.m */, + A9B46A8212B79B240040517A /* SBPrefsController.h */, + A9B46A8312B79B240040517A /* SBPrefsController.m */, + A9AB484717F0AEA2000AA72E /* SBAppDelegate.h */, + A9AB484817F0AEA2000AA72E /* SBAppDelegate.m */, + CD71FF1A12F1C46900F0A98D /* MetadataImporters */, + A9FD5D150F3C692400817716 /* PropertyView */, + ); + name = Classes; + sourceTree = ""; + }; + 2A37F4AFFDCFA73011CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + CD3F2A861761A143000D4C73 /* XMLReader.h */, + CD3F2A871761A143000D4C73 /* XMLReader.m */, + 32DBCF750370BD2300C91783 /* Subler_Prefix.pch */, + A9B46A9312B79B990040517A /* ButtonToolbarItem.h */, + A9B46A9412B79B990040517A /* ButtonToolbarItem.m */, + A936E03C130BE10200CA5527 /* MAAttachedWindow.h */, + A936E03D130BE10200CA5527 /* MAAttachedWindow.m */, + 2A37F4B0FDCFA73011CA2CEA /* main.m */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 2A37F4B8FDCFA73011CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */, + A984DB730F52DD4B001A20B2 /* dsa_pub.pem */, + 089C165FFE840EACC02AAC07 /* InfoPlist.strings */, + 8D15AC360486D014006FF6A4 /* Info.plist */, + A9F2849D133C9F6E00F10951 /* close.pdf */, + A9F2849E133C9F6E00F10951 /* close-over.pdf */, + A9F2849F133C9F6E00F10951 /* close-pressed.pdf */, + A975644A132A325C0051ED08 /* info.pdf */, + A975644B132A325C0051ED08 /* info-over.pdf */, + A975644C132A325C0051ED08 /* info-pressed.pdf */, + A9B46AA312B79BB10040517A /* Subler.icns */, + A95C881C0F827BFB00F51A22 /* ToolbarRemoveTemplate.png */, + A96371B7164695070083BB80 /* ToolbarRemoveTemplate@2x.png */, + A98739FD13FBB09B00B795A7 /* ToolbarActionTemplate.png */, + A9D47B5417B239E200900BCA /* EncodeCanceled.png */, + A9D47B5517B239E200900BCA /* EncodeCanceled@2x.png */, + A9D47B5617B239E200900BCA /* EncodeComplete.png */, + A9D47B5717B239E200900BCA /* EncodeComplete@2x.png */, + A9C9E34113FBC1EB00CA3B4E /* EncodeWorking.png */, + CD4A86A71234AFA10054970A /* ParseFilename */, + CDE8E451174CBBD4009410B5 /* iTunesStores.json */, + ); + name = Resources; + sourceTree = ""; + }; + 2A37F4C3FDCFA73011CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + A925AA7B18378D7800BE84D4 /* MP42Foundation.xcodeproj */, + 1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */, + 1058C7A8FEA54F5311CA2CBB /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; + A925AA7C18378D7800BE84D4 /* Products */ = { + isa = PBXGroup; + children = ( + A925AA8218378D7900BE84D4 /* MP42Foundation.framework */, + A925AA8418378D7900BE84D4 /* MP42FoundationFoundationTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + A961475E13F5676E0068F161 /* NIBs */ = { + isa = PBXGroup; + children = ( + A9B46AC012B79E230040517A /* SBDocument.xib */, + A9AB485A17F0AEFD000AA72E /* ChapterView.xib */, + A9AB485C17F0AEFD000AA72E /* EmptyView.xib */, + A9AB485E17F0AEFD000AA72E /* MovieView.xib */, + A9AB486017F0AEFD000AA72E /* SoundView.xib */, + A9AB486217F0AEFD000AA72E /* VideoView.xib */, + 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */, + A9C055360F6D395B00AF15B5 /* FileImport.xib */, + CD71FEA412F1B62600F0A98D /* MetadataSearch.xib */, + CD4E6E5B12F744210095C84F /* ArtworkSelector.xib */, + A961476513F568210068F161 /* Queue.xib */, + A90B023910F3290A000416F3 /* Prefs.xib */, + ); + name = NIBs; + sourceTree = ""; + }; + A9FD5D150F3C692400817716 /* PropertyView */ = { + isa = PBXGroup; + children = ( + A9AB484A17F0AEAC000AA72E /* SBChapterViewController.h */, + A9AB484B17F0AEAC000AA72E /* SBChapterViewController.m */, + A9AB484C17F0AEAC000AA72E /* SBEmptyViewController.h */, + A9AB484D17F0AEAC000AA72E /* SBEmptyViewController.m */, + A9AB484E17F0AEAC000AA72E /* SBMovieViewController.h */, + A9AB484F17F0AEAC000AA72E /* SBMovieViewController.m */, + A9AB485017F0AEAC000AA72E /* SBSoundViewController.h */, + A9AB485117F0AEAC000AA72E /* SBSoundViewController.m */, + A9AB485217F0AEAC000AA72E /* SBVideoViewController.h */, + A9AB485317F0AEAC000AA72E /* SBVideoViewController.m */, + A960E96117D4B00900FC6ED9 /* SBImageBrowserView.h */, + A960E96217D4B00900FC6ED9 /* SBImageBrowserView.m */, + A9B46A8412B79B240040517A /* SBTableView.h */, + A9B46A8512B79B240040517A /* SBTableView.m */, + A9B46A8612B79B240040517A /* SBView.h */, + A9B46A8712B79B240040517A /* SBView.m */, + ); + name = PropertyView; + sourceTree = ""; + }; + CD4A86A71234AFA10054970A /* ParseFilename */ = { + isa = PBXGroup; + children = ( + CD4A86A81234AFA10054970A /* lib */, + CD4A86B01234AFA10054970A /* ParseFilename.pl */, + ); + name = ParseFilename; + path = Utilities/ParseFilename; + sourceTree = ""; + }; + CD4A86A81234AFA10054970A /* lib */ = { + isa = PBXGroup; + children = ( + CD4A86A91234AFA10054970A /* Debug */, + CD4A86AB1234AFA10054970A /* Text */, + CD4A86AD1234AFA10054970A /* Video */, + ); + path = lib; + sourceTree = ""; + }; + CD4A86A91234AFA10054970A /* Debug */ = { + isa = PBXGroup; + children = ( + CD4A86AA1234AFA10054970A /* Simple.pm */, + ); + path = Debug; + sourceTree = ""; + }; + CD4A86AB1234AFA10054970A /* Text */ = { + isa = PBXGroup; + children = ( + CD4A86AC1234AFA10054970A /* Roman.pm */, + ); + path = Text; + sourceTree = ""; + }; + CD4A86AD1234AFA10054970A /* Video */ = { + isa = PBXGroup; + children = ( + CD4A86AF1234AFA10054970A /* Filename.pm */, + ); + path = Video; + sourceTree = ""; + }; + CD71FF1A12F1C46900F0A98D /* MetadataImporters */ = { + isa = PBXGroup; + children = ( + CD03087717576AE50093A0BE /* MetadataImporter.h */, + CD03087817576AE50093A0BE /* MetadataImporter.m */, + CDC06FCC1747494D003C1D0A /* iTunesStore.h */, + CDC06FCD1747494D003C1D0A /* iTunesStore.m */, + CD03087217576A550093A0BE /* TheMovieDB3.h */, + CD03087317576A550093A0BE /* TheMovieDB3.m */, + CD71FF1B12F1C4A900F0A98D /* TheTVDB.h */, + CD71FF1C12F1C4A900F0A98D /* TheTVDB.m */, + ); + name = MetadataImporters; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8D15AC270486D014006FF6A4 /* Subler */ = { + isa = PBXNativeTarget; + buildConfigurationList = C05733C708A9546B00998B17 /* Build configuration list for PBXNativeTarget "Subler" */; + buildPhases = ( + 8D15AC2B0486D014006FF6A4 /* Resources */, + A941B4DF134A531400E22F45 /* CopyFiles */, + CD71C7691234BE7D004A5383 /* Copy ParseFilename */, + 8D15AC300486D014006FF6A4 /* Sources */, + 8D15AC330486D014006FF6A4 /* Frameworks */, + A984DB5E0F52D68E001A20B2 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + A925AA8718378DC400BE84D4 /* PBXTargetDependency */, + ); + name = Subler; + productInstallPath = "$(HOME)/Applications"; + productName = MP4Sub; + productReference = 8D15AC370486D014006FF6A4 /* Subler.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 2A37F4A9FDCFA73011CA2CEA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + }; + buildConfigurationList = C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "Subler" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 2A37F4AAFDCFA73011CA2CEA /* MP4Sub */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = A925AA7C18378D7800BE84D4 /* Products */; + ProjectRef = A925AA7B18378D7800BE84D4 /* MP42Foundation.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 8D15AC270486D014006FF6A4 /* Subler */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + A925AA8218378D7900BE84D4 /* MP42Foundation.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = MP42Foundation.framework; + remoteRef = A925AA8118378D7900BE84D4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + A925AA8418378D7900BE84D4 /* MP42FoundationFoundationTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = MP42FoundationFoundationTests.xctest; + remoteRef = A925AA8318378D7900BE84D4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D15AC2B0486D014006FF6A4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A9AB486617F0AEFD000AA72E /* MovieView.xib in Resources */, + 8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */, + A9AB486717F0AEFD000AA72E /* SoundView.xib in Resources */, + 8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */, + A9D47B5817B239E200900BCA /* EncodeCanceled.png in Resources */, + A99EEA3F12B801AE002367D3 /* SBDocument.xib in Resources */, + A9AB486517F0AEFD000AA72E /* EmptyView.xib in Resources */, + 1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */, + A9D47B5917B239E200900BCA /* EncodeCanceled@2x.png in Resources */, + A984DB740F52DD4B001A20B2 /* dsa_pub.pem in Resources */, + A9C055370F6D395B00AF15B5 /* FileImport.xib in Resources */, + A95C881D0F827BFB00F51A22 /* ToolbarRemoveTemplate.png in Resources */, + A90B023B10F3290A000416F3 /* Prefs.xib in Resources */, + A9AB486417F0AEFD000AA72E /* ChapterView.xib in Resources */, + A9AB486817F0AEFD000AA72E /* VideoView.xib in Resources */, + A9B46AA412B79BB10040517A /* Subler.icns in Resources */, + CD71FEA612F1B62600F0A98D /* MetadataSearch.xib in Resources */, + CD4E6E5D12F744210095C84F /* ArtworkSelector.xib in Resources */, + A975644D132A325C0051ED08 /* info.pdf in Resources */, + A9D47B5A17B239E200900BCA /* EncodeComplete.png in Resources */, + A975644E132A325C0051ED08 /* info-over.pdf in Resources */, + A975644F132A325C0051ED08 /* info-pressed.pdf in Resources */, + A9F284A0133C9F6E00F10951 /* close.pdf in Resources */, + A9F284A1133C9F6E00F10951 /* close-over.pdf in Resources */, + A9F284A2133C9F6E00F10951 /* close-pressed.pdf in Resources */, + A961476713F568210068F161 /* Queue.xib in Resources */, + A98739FE13FBB09B00B795A7 /* ToolbarActionTemplate.png in Resources */, + A9D47B5B17B239E200900BCA /* EncodeComplete@2x.png in Resources */, + A9C9E34413FBC1EB00CA3B4E /* EncodeWorking.png in Resources */, + A96371B8164695070083BB80 /* ToolbarRemoveTemplate@2x.png in Resources */, + CDE8E452174CBBD4009410B5 /* iTunesStores.json in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + CD71C7691234BE7D004A5383 /* Copy ParseFilename */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy ParseFilename"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = "SRC=\"${SRCROOT}/Utilities/ParseFilename\"\nDEST=\"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ParseFilename\"\n\nmkdir -p \"${DEST}/lib\"\nmkdir -p \"${DEST}/lib/Debug\"\nmkdir -p \"${DEST}/lib/Text\"\nmkdir -p \"${DEST}/lib/Video\"\ncp -p \"${SRC}/ParseFilename.pl\" \"${DEST}\"\ncp -p \"${SRC}/lib/Debug/Simple.pm\" \"${DEST}/lib/Debug/\"\ncp -p \"${SRC}/lib/Text/Roman.pm\" \"${DEST}/lib/Text/\"\ncp -p \"${SRC}/lib/Video/Filename.pm\" \"${DEST}/lib/Video/\""; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D15AC300486D014006FF6A4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D15AC320486D014006FF6A4 /* main.m in Sources */, + A9AB485617F0AEAC000AA72E /* SBMovieViewController.m in Sources */, + A960E96317D4B00900FC6ED9 /* SBImageBrowserView.m in Sources */, + A9AB484917F0AEA2000AA72E /* SBAppDelegate.m in Sources */, + A9B46A8C12B79B240040517A /* SBFileImport.m in Sources */, + A9B46A8E12B79B240040517A /* SBPrefsController.m in Sources */, + A9B46A8F12B79B240040517A /* SBTableView.m in Sources */, + A9B46A9012B79B240040517A /* SBView.m in Sources */, + A9B46A9E12B79B990040517A /* ButtonToolbarItem.m in Sources */, + A9AB485417F0AEAC000AA72E /* SBChapterViewController.m in Sources */, + A9AB485817F0AEAC000AA72E /* SBVideoViewController.m in Sources */, + A9B46ABF12B79D1C0040517A /* SBDocument.m in Sources */, + CD71FEA312F1B5AF00F0A98D /* SBMetadataSearchController.m in Sources */, + CD71FF1D12F1C4A900F0A98D /* TheTVDB.m in Sources */, + A9AB485717F0AEAC000AA72E /* SBSoundViewController.m in Sources */, + CD56963212FAAD680029FADB /* SBArtworkSelector.m in Sources */, + A936E03E130BE10200CA5527 /* MAAttachedWindow.m in Sources */, + A961476313F567E10068F161 /* SBQueueController.m in Sources */, + A961476413F567E10068F161 /* SBPresetManager.m in Sources */, + A982D0C0140AB66400B92357 /* SBQueueItem.m in Sources */, + CDC06FCE1747494D003C1D0A /* iTunesStore.m in Sources */, + CD03087417576A550093A0BE /* TheMovieDB3.m in Sources */, + CD03087917576AE50093A0BE /* MetadataImporter.m in Sources */, + CD3F2A881761A143000D4C73 /* XMLReader.m in Sources */, + A9AB485517F0AEAC000AA72E /* SBEmptyViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + A925AA8718378DC400BE84D4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = MP42Foundation; + targetProxy = A925AA8618378DC400BE84D4 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 089C165FFE840EACC02AAC07 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 089C1660FE840EACC02AAC07 /* English */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 1DDD582B0DA1D0D100B32029 /* English */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; + 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */ = { + isa = PBXVariantGroup; + children = ( + 2A37F4BAFDCFA73011CA2CEA /* English */, + ); + name = Credits.rtf; + sourceTree = ""; + }; + A90B023910F3290A000416F3 /* Prefs.xib */ = { + isa = PBXVariantGroup; + children = ( + A90B023A10F3290A000416F3 /* English */, + ); + name = Prefs.xib; + sourceTree = ""; + }; + A961476513F568210068F161 /* Queue.xib */ = { + isa = PBXVariantGroup; + children = ( + A961476613F568210068F161 /* English */, + ); + name = Queue.xib; + sourceTree = ""; + }; + A9AB485A17F0AEFD000AA72E /* ChapterView.xib */ = { + isa = PBXVariantGroup; + children = ( + A9AB485B17F0AEFD000AA72E /* English */, + ); + name = ChapterView.xib; + sourceTree = ""; + }; + A9AB485C17F0AEFD000AA72E /* EmptyView.xib */ = { + isa = PBXVariantGroup; + children = ( + A9AB485D17F0AEFD000AA72E /* English */, + ); + name = EmptyView.xib; + sourceTree = ""; + }; + A9AB485E17F0AEFD000AA72E /* MovieView.xib */ = { + isa = PBXVariantGroup; + children = ( + A9AB485F17F0AEFD000AA72E /* English */, + ); + name = MovieView.xib; + sourceTree = ""; + }; + A9AB486017F0AEFD000AA72E /* SoundView.xib */ = { + isa = PBXVariantGroup; + children = ( + A9AB486117F0AEFD000AA72E /* English */, + ); + name = SoundView.xib; + sourceTree = ""; + }; + A9AB486217F0AEFD000AA72E /* VideoView.xib */ = { + isa = PBXVariantGroup; + children = ( + A9AB486317F0AEFD000AA72E /* English */, + ); + name = VideoView.xib; + sourceTree = ""; + }; + A9B46AC012B79E230040517A /* SBDocument.xib */ = { + isa = PBXVariantGroup; + children = ( + A9B46AC112B79E230040517A /* English */, + ); + name = SBDocument.xib; + sourceTree = ""; + }; + A9C055360F6D395B00AF15B5 /* FileImport.xib */ = { + isa = PBXVariantGroup; + children = ( + A9C055330F6D394F00AF15B5 /* English */, + ); + name = FileImport.xib; + sourceTree = ""; + }; + CD4E6E5B12F744210095C84F /* ArtworkSelector.xib */ = { + isa = PBXVariantGroup; + children = ( + CD4E6E5C12F744210095C84F /* English */, + ); + name = ArtworkSelector.xib; + sourceTree = ""; + }; + CD71FEA412F1B62600F0A98D /* MetadataSearch.xib */ = { + isa = PBXVariantGroup; + children = ( + CD71FEA512F1B62600F0A98D /* English */, + ); + name = MetadataSearch.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + C05733C808A9546B00998B17 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CODE_SIGN_ENTITLEMENTS = ""; + CODE_SIGN_IDENTITY = ""; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)\"", + ); + GCC_DYNAMIC_NO_PIC = NO; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Subler_Prefix.pch; + GCC_VERSION = ""; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + LD_RUNPATH_SEARCH_PATHS = ""; + LIBRARY_SEARCH_PATHS = "$(inherited)"; + MACOSX_DEPLOYMENT_TARGET = 10.6; + PRODUCT_NAME = Subler; + SDKROOT = macosx; + }; + name = Debug; + }; + C05733C908A9546B00998B17 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CODE_SIGN_ENTITLEMENTS = ""; + CODE_SIGN_IDENTITY = ""; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)\"", + ); + GCC_DYNAMIC_NO_PIC = YES; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Subler_Prefix.pch; + GCC_VERSION = ""; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + LD_RUNPATH_SEARCH_PATHS = ""; + LIBRARY_SEARCH_PATHS = "$(inherited)"; + MACOSX_DEPLOYMENT_TARGET = 10.6; + PRODUCT_NAME = Subler; + SDKROOT = macosx; + }; + name = Release; + }; + C05733CC08A9546B00998B17 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_ENTITLEMENTS = ""; + CODE_SIGN_IDENTITY = ""; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_SIGN_COMPARE = NO; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNUSED_FUNCTION = NO; + GCC_WARN_UNUSED_PARAMETER = NO; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ""; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.6; + ONLY_ACTIVE_ARCH = YES; + RUN_CLANG_STATIC_ANALYZER = NO; + SDKROOT = macosx; + STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = dynamic; + STRIP_INSTALLED_PRODUCT = NO; + USER_HEADER_SEARCH_PATHS = ""; + }; + name = Debug; + }; + C05733CD08A9546B00998B17 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_ENTITLEMENTS = ""; + CODE_SIGN_IDENTITY = ""; + COMBINE_HIDPI_IMAGES = YES; + GCC_AUTO_VECTORIZATION = YES; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_ENABLE_SSE3_EXTENSIONS = YES; + GCC_OPTIMIZATION_LEVEL = 3; + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_PEDANTIC = NO; + GCC_WARN_SIGN_COMPARE = NO; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = NO; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_PARAMETER = NO; + GCC_WARN_UNUSED_VALUE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ""; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.6; + RUN_CLANG_STATIC_ANALYZER = NO; + SDKROOT = macosx; + STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = dynamic; + USER_HEADER_SEARCH_PATHS = ""; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C05733C708A9546B00998B17 /* Build configuration list for PBXNativeTarget "Subler" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C05733C808A9546B00998B17 /* Debug */, + C05733C908A9546B00998B17 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "Subler" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C05733CC08A9546B00998B17 /* Debug */, + C05733CD08A9546B00998B17 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 2A37F4A9FDCFA73011CA2CEA /* Project object */; +} diff --git a/Subler.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Subler.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..3308628 --- /dev/null +++ b/Subler.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Subler.xcodeproj/project.xcworkspace/xcshareddata/Subler.xccheckout b/Subler.xcodeproj/project.xcworkspace/xcshareddata/Subler.xccheckout new file mode 100644 index 0000000..7bd0556 --- /dev/null +++ b/Subler.xcodeproj/project.xcworkspace/xcshareddata/Subler.xccheckout @@ -0,0 +1,53 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + 79910F69-D926-420C-87F4-45E46A043317 + IDESourceControlProjectName + Subler + IDESourceControlProjectOriginsDictionary + + 413BD4C0-709D-4035-9152-58F525872B43 + https://bitbucket.org/galad87/subler.git + 4F7F3B2A-353A-4C24-AE95-179BCDD341D8 + https://bitbucket.org/galad87/mp42foundation.git + + IDESourceControlProjectPath + Subler.xcodeproj/project.xcworkspace + IDESourceControlProjectRelativeInstallPathDictionary + + 413BD4C0-709D-4035-9152-58F525872B43 + ../.. + 4F7F3B2A-353A-4C24-AE95-179BCDD341D8 + ../../MP42Foundation + + IDESourceControlProjectURL + https://bitbucket.org/galad87/subler.git + IDESourceControlProjectVersion + 110 + IDESourceControlProjectWCCIdentifier + 413BD4C0-709D-4035-9152-58F525872B43 + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 4F7F3B2A-353A-4C24-AE95-179BCDD341D8 + IDESourceControlWCCName + MP42Foundation + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 413BD4C0-709D-4035-9152-58F525872B43 + IDESourceControlWCCName + subler + + + + diff --git a/Subler.xcodeproj/project.xcworkspace/xcuserdata/damians.xcuserdatad/UserInterfaceState.xcuserstate b/Subler.xcodeproj/project.xcworkspace/xcuserdata/damians.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..813fc25 Binary files /dev/null and b/Subler.xcodeproj/project.xcworkspace/xcuserdata/damians.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Subler.xcodeproj/xcuserdata/damians.xcuserdatad/xcschemes/Subler.xcscheme b/Subler.xcodeproj/xcuserdata/damians.xcuserdatad/xcschemes/Subler.xcscheme new file mode 100644 index 0000000..b173124 --- /dev/null +++ b/Subler.xcodeproj/xcuserdata/damians.xcuserdatad/xcschemes/Subler.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Subler.xcodeproj/xcuserdata/damians.xcuserdatad/xcschemes/xcschememanagement.plist b/Subler.xcodeproj/xcuserdata/damians.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..fc443d0 --- /dev/null +++ b/Subler.xcodeproj/xcuserdata/damians.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + Subler.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8D15AC270486D014006FF6A4 + + primary + + + + + diff --git a/Subler_Prefix.pch b/Subler_Prefix.pch new file mode 100755 index 0000000..40b1b4c --- /dev/null +++ b/Subler_Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'Subler' target in the 'Subler' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/Utilities/.DS_Store b/Utilities/.DS_Store new file mode 100644 index 0000000..35ed5b6 Binary files /dev/null and b/Utilities/.DS_Store differ diff --git a/Utilities/MP4Dump/AppDelegate.h b/Utilities/MP4Dump/AppDelegate.h new file mode 100755 index 0000000..c3910d9 --- /dev/null +++ b/Utilities/MP4Dump/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// MP4Dump +// +// Created by Damiano Galassi on 17/03/11. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import + + +@interface AppDelegate : NSObject { +} + +@end diff --git a/Utilities/MP4Dump/AppDelegate.m b/Utilities/MP4Dump/AppDelegate.m new file mode 100755 index 0000000..91da48e --- /dev/null +++ b/Utilities/MP4Dump/AppDelegate.m @@ -0,0 +1,53 @@ +// +// AppDelegate.m +// MP4Dump +// +// Created by Damiano Galassi on 17/03/11. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import "AppDelegate.h" +#include "mp4v2.h" + +NSString *libraryPath = nil; + +void logCallback(MP4LogLevel loglevel, const char* fmt, va_list ap) +{ + if (!libraryPath) { + NSString * libraryDir = [NSSearchPathForDirectoriesInDomains( NSLibraryDirectory, + NSUserDomainMask, + YES ) objectAtIndex:0]; + NSString * AppSupportDirectory = [[libraryDir stringByAppendingPathComponent:@"Application Support"] + stringByAppendingPathComponent:@"MP4Dump"]; + if( ![[NSFileManager defaultManager] fileExistsAtPath:AppSupportDirectory] ) + { + [[NSFileManager defaultManager] createDirectoryAtPath:AppSupportDirectory + attributes:nil]; + } + libraryPath = [[AppSupportDirectory stringByAppendingPathComponent:@"temp.txt"] retain]; + + } + + FILE * file = fopen([libraryPath UTF8String], "a"); + + vfprintf(file, fmt, ap); + fprintf(file, "\n"); + + fclose(file); + +} + +@implementation AppDelegate + +- (void)applicationWillFinishLaunching:(NSNotification *)aNotification +{ + MP4LogSetLevel(MP4_LOG_INFO); + MP4SetLogCallback(logCallback); +} + +- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender +{ + return NO; +} + +@end diff --git a/Utilities/MP4Dump/English.lproj/Credits.rtf b/Utilities/MP4Dump/English.lproj/Credits.rtf new file mode 100755 index 0000000..1c84aad --- /dev/null +++ b/Utilities/MP4Dump/English.lproj/Credits.rtf @@ -0,0 +1,24 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs24 \cf0 Engineering: +\b0 \ + Damiano Galassi\ +\ + +\b Human Interface Design: +\b0 \ + Damiano Galassi\ +\ + +\b Testing: +\b0 \ + Hopefully not nobody\ +\ + +\b With special thanks to: +\b0 \ + mp4v2\ + {\field{\*\fldinst{HYPERLINK "http://code.google.com/p/mp4v2"}}{\fldrslt http://code.google.com/p/mp4v2}}} \ No newline at end of file diff --git a/Utilities/MP4Dump/English.lproj/InfoPlist.strings b/Utilities/MP4Dump/English.lproj/InfoPlist.strings new file mode 100755 index 0000000..477b28f --- /dev/null +++ b/Utilities/MP4Dump/English.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Utilities/MP4Dump/English.lproj/MainMenu.xib b/Utilities/MP4Dump/English.lproj/MainMenu.xib new file mode 100755 index 0000000..0e236fc --- /dev/null +++ b/Utilities/MP4Dump/English.lproj/MainMenu.xib @@ -0,0 +1,4085 @@ + + + + 1050 + 10J860 + 823 + 1038.35 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 823 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + MP4Dump + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + MP4Dump + + YES + + + About MP4Dump + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide MP4Dump + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit MP4Dump + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + File + + 1048576 + 2147483647 + + + submenuAction: + + File + + YES + + + Open… + o + 1048576 + 2147483647 + + + + + + Open Recent + + 1048576 + 2147483647 + + + submenuAction: + + Open Recent + + YES + + + Clear Menu + + 1048576 + 2147483647 + + + + + _NSRecentDocumentsMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Close + w + 1048576 + 2147483647 + + + + + + Save As… + S + 1179648 + 2147483647 + + + + + + Revert to Saved + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Page Setup... + P + 1179648 + 2147483647 + + + + + + + Print… + p + 1048576 + 2147483647 + + + + + + + + + Edit + + 1048576 + 2147483647 + + + submenuAction: + + Edit + + YES + + + Undo + z + 1048576 + 2147483647 + + + + + + Redo + Z + 1179648 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Cut + x + 1048576 + 2147483647 + + + + + + Copy + c + 1048576 + 2147483647 + + + + + + Paste + v + 1048576 + 2147483647 + + + + + + Paste and Match Style + V + 1572864 + 2147483647 + + + + + + Delete + + 1048576 + 2147483647 + + + + + + Select All + a + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Find + + 1048576 + 2147483647 + + + submenuAction: + + Find + + YES + + + Find… + f + 1048576 + 2147483647 + + + 1 + + + + Find Next + g + 1048576 + 2147483647 + + + 2 + + + + Find Previous + G + 1179648 + 2147483647 + + + 3 + + + + Use Selection for Find + e + 1048576 + 2147483647 + + + 7 + + + + Jump to Selection + j + 1048576 + 2147483647 + + + + + + + + + Spelling and Grammar + + 1048576 + 2147483647 + + + submenuAction: + + Spelling and Grammar + + YES + + + Show Spelling and Grammar + : + 1048576 + 2147483647 + + + + + + Check Document Now + ; + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Check Spelling While Typing + + 1048576 + 2147483647 + + + + + + Check Grammar With Spelling + + 1048576 + 2147483647 + + + + + + Correct Spelling Automatically + + 2147483647 + + + + + + + + + Substitutions + + 1048576 + 2147483647 + + + submenuAction: + + Substitutions + + YES + + + Show Substitutions + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Smart Copy/Paste + f + 1048576 + 2147483647 + + + 1 + + + + Smart Quotes + g + 1048576 + 2147483647 + + + 2 + + + + Smart Dashes + + 2147483647 + + + + + + Smart Links + G + 1179648 + 2147483647 + + + 3 + + + + Text Replacement + + 2147483647 + + + + + + + + + Transformations + + 2147483647 + + + submenuAction: + + Transformations + + YES + + + Make Upper Case + + 2147483647 + + + + + + Make Lower Case + + 2147483647 + + + + + + Capitalize + + 2147483647 + + + + + + + + + Speech + + 1048576 + 2147483647 + + + submenuAction: + + Speech + + YES + + + Start Speaking + + 1048576 + 2147483647 + + + + + + Stop Speaking + + 1048576 + 2147483647 + + + + + + + + + + + + Format + + 2147483647 + + + submenuAction: + + Format + + YES + + + Font + + 2147483647 + + + submenuAction: + + Font + + YES + + + Show Fonts + t + 1048576 + 2147483647 + + + + + + Bold + b + 1048576 + 2147483647 + + + 2 + + + + Italic + i + 1048576 + 2147483647 + + + 1 + + + + Underline + u + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Bigger + + + 1048576 + 2147483647 + + + 3 + + + + Smaller + - + 1048576 + 2147483647 + + + 4 + + + + YES + YES + + + 2147483647 + + + + + + Kern + + 2147483647 + + + submenuAction: + + Kern + + YES + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Tighten + + 2147483647 + + + + + + Loosen + + 2147483647 + + + + + + + + + Ligature + + 2147483647 + + + submenuAction: + + Ligature + + YES + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Use All + + 2147483647 + + + + + + + + + Baseline + + 2147483647 + + + submenuAction: + + Baseline + + YES + + + Use Default + + 2147483647 + + + + + + Superscript + + 2147483647 + + + + + + Subscript + + 2147483647 + + + + + + Raise + + 2147483647 + + + + + + Lower + + 2147483647 + + + + + + + + + YES + YES + + + 2147483647 + + + + + + Show Colors + C + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Copy Style + c + 1572864 + 2147483647 + + + + + + Paste Style + v + 1572864 + 2147483647 + + + + + _NSFontMenu + + + + + Text + + 2147483647 + + + submenuAction: + + Text + + YES + + + Align Left + { + 1048576 + 2147483647 + + + + + + Center + | + 1048576 + 2147483647 + + + + + + Justify + + 2147483647 + + + + + + Align Right + } + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Writing Direction + + 2147483647 + + + submenuAction: + + Writing Direction + + YES + + + YES + Paragraph + + 2147483647 + + + + + + CURlZmF1bHQ + + 2147483647 + + + + + + CUxlZnQgdG8gUmlnaHQ + + 2147483647 + + + + + + CVJpZ2h0IHRvIExlZnQ + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + YES + Selection + + 2147483647 + + + + + + CURlZmF1bHQ + + 2147483647 + + + + + + CUxlZnQgdG8gUmlnaHQ + + 2147483647 + + + + + + CVJpZ2h0IHRvIExlZnQ + + 2147483647 + + + + + + + + + YES + YES + + + 2147483647 + + + + + + Show Ruler + + 2147483647 + + + + + + Copy Ruler + c + 1310720 + 2147483647 + + + + + + Paste Ruler + v + 1310720 + 2147483647 + + + + + + + + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + + View + + YES + + + Show Toolbar + t + 1572864 + 2147483647 + + + + + + Customize Toolbar… + + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + YES + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 2147483647 + + + submenuAction: + + Help + + YES + + + MP4Dump Help + ? + 1048576 + 2147483647 + + + + + _NSHelpMenu + + + + _NSMainMenu + + + NSFontManager + + + AppDelegate + + + + + YES + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + runPageLayout: + + + + 87 + + + + clearRecentDocuments: + + + + 127 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + performClose: + + + + 193 + + + + toggleContinuousSpellChecking: + + + + 222 + + + + undo: + + + + 223 + + + + copy: + + + + 224 + + + + checkSpelling: + + + + 225 + + + + paste: + + + + 226 + + + + stopSpeaking: + + + + 227 + + + + cut: + + + + 228 + + + + showGuessPanel: + + + + 230 + + + + redo: + + + + 231 + + + + selectAll: + + + + 232 + + + + startSpeaking: + + + + 233 + + + + delete: + + + + 235 + + + + performZoom: + + + + 240 + + + + performFindPanelAction: + + + + 241 + + + + centerSelectionInVisibleArea: + + + + 245 + + + + toggleGrammarChecking: + + + + 347 + + + + toggleSmartInsertDelete: + + + + 355 + + + + toggleAutomaticQuoteSubstitution: + + + + 356 + + + + toggleAutomaticLinkDetection: + + + + 357 + + + + saveDocumentAs: + + + + 363 + + + + revertDocumentToSaved: + + + + 364 + + + + runToolbarCustomizationPalette: + + + + 365 + + + + toggleToolbarShown: + + + + 366 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + openDocument: + + + + 372 + + + + printDocument: + + + + 373 + + + + addFontTrait: + + + + 420 + + + + addFontTrait: + + + + 421 + + + + modifyFont: + + + + 422 + + + + orderFrontFontPanel: + + + + 423 + + + + modifyFont: + + + + 424 + + + + raiseBaseline: + + + + 425 + + + + lowerBaseline: + + + + 426 + + + + copyFont: + + + + 427 + + + + subscript: + + + + 428 + + + + superscript: + + + + 429 + + + + tightenKerning: + + + + 430 + + + + underline: + + + + 431 + + + + orderFrontColorPanel: + + + + 432 + + + + useAllLigatures: + + + + 433 + + + + loosenKerning: + + + + 434 + + + + pasteFont: + + + + 435 + + + + unscript: + + + + 436 + + + + useStandardKerning: + + + + 437 + + + + useStandardLigatures: + + + + 438 + + + + turnOffLigatures: + + + + 439 + + + + turnOffKerning: + + + + 440 + + + + terminate: + + + + 448 + + + + capitalizeWord: + + + + 454 + + + + lowercaseWord: + + + + 455 + + + + uppercaseWord: + + + + 456 + + + + toggleAutomaticDashSubstitution: + + + + 460 + + + + orderFrontSubstitutionsPanel: + + + + 461 + + + + toggleAutomaticTextReplacement: + + + + 463 + + + + toggleAutomaticSpellingCorrection: + + + + 466 + + + + performFindPanelAction: + + + + 467 + + + + performFindPanelAction: + + + + 468 + + + + performFindPanelAction: + + + + 469 + + + + pasteAsPlainText: + + + + 471 + + + + showHelp: + + + + 494 + + + + alignCenter: + + + + 517 + + + + pasteRuler: + + + + 518 + + + + toggleRuler: + + + + 519 + + + + alignRight: + + + + 520 + + + + copyRuler: + + + + 521 + + + + alignJustified: + + + + 522 + + + + alignLeft: + + + + 523 + + + + makeBaseWritingDirectionNatural: + + + + 524 + + + + makeBaseWritingDirectionLeftToRight: + + + + 525 + + + + makeBaseWritingDirectionRightToLeft: + + + + 526 + + + + makeTextWritingDirectionNatural: + + + + 527 + + + + makeTextWritingDirectionLeftToRight: + + + + 528 + + + + makeTextWritingDirectionRightToLeft: + + + + 529 + + + + delegate + + + + 531 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + + + + + + + 19 + + + YES + + + + + + 56 + + + YES + + + + + + 217 + + + YES + + + + + + 83 + + + YES + + + + + + 205 + + + YES + + + + + + + + + + + + + + + + + + + + 202 + + + + + 198 + + + + + 207 + + + + + 214 + + + + + 199 + + + + + 203 + + + + + 197 + + + + + 206 + + + + + 215 + + + + + 218 + + + YES + + + + + + 216 + + + YES + + + + + + 200 + + + YES + + + + + + + + + + + 219 + + + + + 201 + + + + + 204 + + + + + 220 + + + YES + + + + + + + + + + 213 + + + + + 210 + + + + + 221 + + + + + 208 + + + + + 209 + + + + + 57 + + + YES + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + + + 144 + + + + + 129 + + + + + 143 + + + + + 236 + + + + + 131 + + + YES + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + YES + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + YES + + + + + + 296 + + + YES + + + + + + + 297 + + + + + 298 + + + + + 211 + + + YES + + + + + + 212 + + + YES + + + + + + + 195 + + + + + 196 + + + + + 346 + + + + + 348 + + + YES + + + + + + 349 + + + YES + + + + + + + + + + + + 350 + + + + + 351 + + + + + 354 + + + + + 374 + + + YES + + + + + + 375 + + + YES + + + + + + + 376 + + + YES + + + + + + 387 + + + YES + + + + + + + + + + + + + + + + + + + + + 388 + + + + + 389 + + + + + 390 + + + + + 391 + + + + + 392 + + + + + 393 + + + + + 394 + + + + + 395 + + + + + 396 + + + YES + + + + + + 397 + + + YES + + + + + + 398 + + + YES + + + + + + 399 + + + + + 400 + + + + + 401 + + + + + 402 + + + + + 403 + + + + + 404 + + + YES + + + + + + + + + + 405 + + + + + 406 + + + + + 407 + + + + + 408 + + + + + 409 + + + + + 410 + + + YES + + + + + + + + 411 + + + + + 412 + + + + + 413 + + + + + 414 + + + YES + + + + + + + + + 415 + + + + + 416 + + + + + 417 + + + + + 418 + + + + + 419 + + + + + 449 + + + YES + + + + + + 450 + + + YES + + + + + + + + 451 + + + + + 452 + + + + + 453 + + + + + 457 + + + + + 458 + + + + + 459 + + + + + 462 + + + + + 464 + + + + + 465 + + + + + 470 + + + + + 491 + + + YES + + + + + + 492 + + + YES + + + + + + 493 + + + + + 495 + + + YES + + + + + + 496 + + + YES + + + + + + + + + + + + + + + 497 + + + + + 498 + + + + + 499 + + + + + 500 + + + + + 501 + + + + + 502 + + + YES + + + + + + 503 + + + + + 504 + + + + + 505 + + + + + 506 + + + + + 507 + + + YES + + + + + + + + + + + + + + 508 + + + + + 509 + + + + + 510 + + + + + 511 + + + + + 512 + + + + + 513 + + + + + 514 + + + + + 515 + + + + + 516 + + + + + 81 + + + YES + + + + + + + + + + + + + + 74 + + + + + 112 + + + + + 79 + + + + + 73 + + + + + 77 + + + + + 124 + + + YES + + + + + + 125 + + + YES + + + + + + 126 + + + + + 72 + + + + + 78 + + + + + 80 + + + + + 530 + + + + + + + YES + + YES + -3.IBPluginDependency + 112.IBPluginDependency + 112.ImportedFromIB2 + 124.IBPluginDependency + 124.ImportedFromIB2 + 125.IBPluginDependency + 125.ImportedFromIB2 + 125.editorWindowContentRectSynchronizationRect + 126.IBPluginDependency + 126.ImportedFromIB2 + 129.IBPluginDependency + 129.ImportedFromIB2 + 130.IBPluginDependency + 130.ImportedFromIB2 + 130.editorWindowContentRectSynchronizationRect + 131.IBPluginDependency + 131.ImportedFromIB2 + 134.IBPluginDependency + 134.ImportedFromIB2 + 136.IBPluginDependency + 136.ImportedFromIB2 + 143.IBPluginDependency + 143.ImportedFromIB2 + 144.IBPluginDependency + 144.ImportedFromIB2 + 145.IBPluginDependency + 145.ImportedFromIB2 + 149.IBPluginDependency + 149.ImportedFromIB2 + 150.IBPluginDependency + 150.ImportedFromIB2 + 19.IBPluginDependency + 19.ImportedFromIB2 + 195.IBPluginDependency + 195.ImportedFromIB2 + 196.IBPluginDependency + 196.ImportedFromIB2 + 197.IBPluginDependency + 197.ImportedFromIB2 + 198.IBPluginDependency + 198.ImportedFromIB2 + 199.IBPluginDependency + 199.ImportedFromIB2 + 200.IBEditorWindowLastContentRect + 200.IBPluginDependency + 200.ImportedFromIB2 + 200.editorWindowContentRectSynchronizationRect + 201.IBPluginDependency + 201.ImportedFromIB2 + 202.IBPluginDependency + 202.ImportedFromIB2 + 203.IBPluginDependency + 203.ImportedFromIB2 + 204.IBPluginDependency + 204.ImportedFromIB2 + 205.IBEditorWindowLastContentRect + 205.IBPluginDependency + 205.ImportedFromIB2 + 205.editorWindowContentRectSynchronizationRect + 206.IBPluginDependency + 206.ImportedFromIB2 + 207.IBPluginDependency + 207.ImportedFromIB2 + 208.IBPluginDependency + 208.ImportedFromIB2 + 209.IBPluginDependency + 209.ImportedFromIB2 + 210.IBPluginDependency + 210.ImportedFromIB2 + 211.IBPluginDependency + 211.ImportedFromIB2 + 212.IBEditorWindowLastContentRect + 212.IBPluginDependency + 212.ImportedFromIB2 + 212.editorWindowContentRectSynchronizationRect + 213.IBPluginDependency + 213.ImportedFromIB2 + 214.IBPluginDependency + 214.ImportedFromIB2 + 215.IBPluginDependency + 215.ImportedFromIB2 + 216.IBPluginDependency + 216.ImportedFromIB2 + 217.IBPluginDependency + 217.ImportedFromIB2 + 218.IBPluginDependency + 218.ImportedFromIB2 + 219.IBPluginDependency + 219.ImportedFromIB2 + 220.IBEditorWindowLastContentRect + 220.IBPluginDependency + 220.ImportedFromIB2 + 220.editorWindowContentRectSynchronizationRect + 221.IBPluginDependency + 221.ImportedFromIB2 + 23.IBPluginDependency + 23.ImportedFromIB2 + 236.IBPluginDependency + 236.ImportedFromIB2 + 239.IBPluginDependency + 239.ImportedFromIB2 + 24.IBEditorWindowLastContentRect + 24.IBPluginDependency + 24.ImportedFromIB2 + 24.editorWindowContentRectSynchronizationRect + 29.IBEditorWindowLastContentRect + 29.IBPluginDependency + 29.ImportedFromIB2 + 29.WindowOrigin + 29.editorWindowContentRectSynchronizationRect + 295.IBPluginDependency + 296.IBPluginDependency + 296.editorWindowContentRectSynchronizationRect + 297.IBPluginDependency + 298.IBPluginDependency + 346.IBPluginDependency + 346.ImportedFromIB2 + 348.IBPluginDependency + 348.ImportedFromIB2 + 349.IBEditorWindowLastContentRect + 349.IBPluginDependency + 349.ImportedFromIB2 + 349.editorWindowContentRectSynchronizationRect + 350.IBPluginDependency + 350.ImportedFromIB2 + 351.IBPluginDependency + 351.ImportedFromIB2 + 354.IBPluginDependency + 354.ImportedFromIB2 + 374.IBPluginDependency + 375.IBEditorWindowLastContentRect + 375.IBPluginDependency + 376.IBPluginDependency + 387.IBPluginDependency + 388.IBPluginDependency + 389.IBPluginDependency + 390.IBPluginDependency + 391.IBPluginDependency + 392.IBPluginDependency + 393.IBPluginDependency + 394.IBPluginDependency + 395.IBPluginDependency + 396.IBPluginDependency + 397.IBPluginDependency + 398.IBPluginDependency + 399.IBPluginDependency + 400.IBPluginDependency + 401.IBPluginDependency + 402.IBPluginDependency + 403.IBPluginDependency + 404.IBPluginDependency + 405.IBPluginDependency + 406.IBPluginDependency + 407.IBPluginDependency + 408.IBPluginDependency + 409.IBPluginDependency + 410.IBPluginDependency + 411.IBPluginDependency + 412.IBPluginDependency + 413.IBPluginDependency + 414.IBPluginDependency + 415.IBPluginDependency + 416.IBPluginDependency + 417.IBPluginDependency + 418.IBPluginDependency + 449.IBPluginDependency + 450.IBEditorWindowLastContentRect + 450.IBPluginDependency + 451.IBPluginDependency + 452.IBPluginDependency + 453.IBPluginDependency + 457.IBPluginDependency + 458.IBPluginDependency + 459.IBPluginDependency + 462.IBPluginDependency + 464.IBPluginDependency + 465.IBPluginDependency + 470.IBPluginDependency + 491.IBPluginDependency + 492.IBEditorWindowLastContentRect + 492.IBPluginDependency + 493.IBPluginDependency + 495.IBPluginDependency + 496.IBEditorWindowLastContentRect + 496.IBPluginDependency + 497.IBPluginDependency + 498.IBPluginDependency + 499.IBPluginDependency + 5.IBPluginDependency + 5.ImportedFromIB2 + 500.IBPluginDependency + 501.IBPluginDependency + 502.IBPluginDependency + 503.IBPluginDependency + 504.IBPluginDependency + 505.IBPluginDependency + 506.IBPluginDependency + 507.IBEditorWindowLastContentRect + 507.IBPluginDependency + 508.IBPluginDependency + 509.IBPluginDependency + 510.IBPluginDependency + 511.IBPluginDependency + 512.IBPluginDependency + 513.IBPluginDependency + 514.IBPluginDependency + 515.IBPluginDependency + 516.IBPluginDependency + 530.IBPluginDependency + 56.IBPluginDependency + 56.ImportedFromIB2 + 57.IBEditorWindowLastContentRect + 57.IBPluginDependency + 57.ImportedFromIB2 + 57.editorWindowContentRectSynchronizationRect + 58.IBPluginDependency + 58.ImportedFromIB2 + 72.IBPluginDependency + 72.ImportedFromIB2 + 73.IBPluginDependency + 73.ImportedFromIB2 + 74.IBPluginDependency + 74.ImportedFromIB2 + 77.IBPluginDependency + 77.ImportedFromIB2 + 78.IBPluginDependency + 78.ImportedFromIB2 + 79.IBPluginDependency + 79.ImportedFromIB2 + 80.IBPluginDependency + 80.ImportedFromIB2 + 81.IBEditorWindowLastContentRect + 81.IBPluginDependency + 81.ImportedFromIB2 + 81.editorWindowContentRectSynchronizationRect + 83.IBPluginDependency + 83.ImportedFromIB2 + 92.IBPluginDependency + 92.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{522, 812}, {146, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{436, 809}, {64, 6}} + 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 + + {{656, 201}, {275, 113}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {275, 83}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{549, 295}, {254, 283}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{197, 734}, {243, 243}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{656, 211}, {164, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {167, 43}} + 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 + + {{642, 251}, {238, 103}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {241, 103}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{784, 313}, {194, 73}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{525, 802}, {197, 73}} + {{608, 590}, {438, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + + {74, 862} + {{11, 977}, {478, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{475, 832}, {234, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{642, 181}, {220, 133}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {215, 63}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + {{668, 343}, {83, 43}} + 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 + 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 + {{786, 257}, {170, 63}} + 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 + {{855, 363}, {246, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{751, 183}, {204, 183}} + 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 + {{955, 103}, {164, 173}} + 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 + + {{437, 356}, {206, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{23, 794}, {245, 183}} + 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 + + {{712, 427}, {196, 163}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{155, 774}, {199, 203}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + + YES + + + + + YES + + + YES + + + + 531 + + + + YES + + AppDelegate + NSObject + + IBProjectSource + AppDelegate.h + + + + + YES + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSBrowser + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSBrowser.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSDocument + NSObject + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + id + id + id + id + id + id + + + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + + printDocument: + id + + + revertDocumentToSaved: + id + + + runPageLayout: + id + + + saveDocument: + id + + + saveDocumentAs: + id + + + saveDocumentTo: + id + + + + + IBFrameworkSource + AppKit.framework/Headers/NSDocument.h + + + + NSDocument + + IBFrameworkSource + AppKit.framework/Headers/NSDocumentScripting.h + + + + NSDocumentController + NSObject + + YES + + YES + clearRecentDocuments: + newDocument: + openDocument: + saveAllDocuments: + + + YES + id + id + id + id + + + + YES + + YES + clearRecentDocuments: + newDocument: + openDocument: + saveAllDocuments: + + + YES + + clearRecentDocuments: + id + + + newDocument: + id + + + openDocument: + id + + + saveAllDocuments: + id + + + + + IBFrameworkSource + AppKit.framework/Headers/NSDocumentController.h + + + + NSFontManager + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMatrix + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSMatrix.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMovieView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMovieView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSTableView + NSControl + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../MP4Dump.xcodeproj + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + + + diff --git a/Utilities/MP4Dump/English.lproj/MyDocument.xib b/Utilities/MP4Dump/English.lproj/MyDocument.xib new file mode 100755 index 0000000..7ca4509 --- /dev/null +++ b/Utilities/MP4Dump/English.lproj/MyDocument.xib @@ -0,0 +1,1303 @@ + + + + 1050 + 10J860 + 823 + 1038.35 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 823 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + MyDocument + + + FirstResponder + + + 15 + 2 + {{69, 418}, {637, 542}} + 1886912512 + Window + NSWindow + View + {1.79769e+308, 1.79769e+308} + {94, 86} + + + 256 + + YES + + + 274 + + YES + + + 2304 + + YES + + + 2322 + + YES + + YES + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + Apple URL pasteboard type + CorePasteboardFlavorType 0x6D6F6F76 + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + NeXT font pasteboard type + NeXT ruler pasteboard type + WebURLsWithTitlesPboardType + public.url + + + {622, 14} + + + + + + + + + + + YES + + + 134 + + + + 622 + 1 + + + 12263 + 0 + + + 3 + MQA + + + YES + + YES + NSBackgroundColor + NSColor + + + YES + + 6 + System + selectedTextBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + selectedTextColor + + 3 + MAA + + + + + + + YES + + YES + NSColor + NSCursor + NSUnderline + + + YES + + 1 + MCAwIDEAA + + + {8, -8} + 13 + + + + + + + 6 + {1261, 1e+07} + {223, 0} + + + + {{1, 1}, {622, 519}} + + + + + + {4, -5} + 1 + + 4 + + + + 256 + {{623, 1}, {15, 519}} + + + _doScroller: + 1 + 0.85256409645080566 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + 1 + + _doScroller: + 1 + 0.94565218687057495 + + + {{-1, 22}, {639, 521}} + + + 18 + + + + + + + 292 + {{-1, -2}, {100, 26}} + + YES + + -2076049856 + 134219776 + + LucidaGrande + 13 + 1044 + + + 1211650303 + 2 + + + 400 + 75 + + + Info + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + 3 + + + YES + + OtherViews + + YES + + + Error + + 1048576 + 2147483647 + + + _popUpItemAction: + 1 + + + + + Warning + + 1048576 + 2147483647 + + + _popUpItemAction: + 2 + + + + + + Verbose1 + + 1048576 + 2147483647 + + + _popUpItemAction: + 4 + + + + + Verbose2 + + 1048576 + 2147483647 + + + _popUpItemAction: + 5 + + + + + Verbose3 + + 1048576 + 2147483647 + + + _popUpItemAction: + 6 + + + + + Verbose4 + + 1048576 + 2147483647 + + + _popUpItemAction: + 7 + + + + + + 2 + 1 + YES + YES + 2 + + + + {637, 542} + + + {{0, 0}, {1680, 1028}} + {94, 108} + {1.79769e+308, 1.79769e+308} + + + NSApplication + + + + + YES + + + delegate + + + + 17 + + + + window + + + + 18 + + + + textView + + + + 100041 + + + + setLogLevel: + + + + 100049 + + + + setLogLevel: + + + + 100050 + + + + setLogLevel: + + + + 100051 + + + + setLogLevel: + + + + 100052 + + + + setLogLevel: + + + + 100053 + + + + setLogLevel: + + + + 100054 + + + + setLogLevel: + + + + 100055 + + + + logLevelButton + + + + 100056 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + 5 + + + YES + + + + Window + + + 6 + + + YES + + + + + + + -3 + + + Application + + + 100021 + + + YES + + + + + + + + 100022 + + + + + 100023 + + + + + 100024 + + + + + 100025 + + + YES + + + + + + 100026 + + + YES + + + + + + 100027 + + + YES + + + + + + + + + + + + 100029 + + + + + 100030 + + + + + 100042 + + + + + 100043 + + + + + 100044 + + + + + 100045 + + + + + 100046 + + + + + + + YES + + YES + -3.IBPluginDependency + 100021.IBPluginDependency + 100021.IBViewBoundsToFrameTransform + 100022.IBPluginDependency + 100023.IBPluginDependency + 100024.IBPluginDependency + 100025.IBPluginDependency + 100025.IBViewBoundsToFrameTransform + 100026.IBPluginDependency + 100027.IBEditorWindowLastContentRect + 100027.IBPluginDependency + 100029.IBPluginDependency + 100030.IBPluginDependency + 100042.IBPluginDependency + 100043.IBPluginDependency + 100044.IBPluginDependency + 100045.IBPluginDependency + 100046.IBPluginDependency + 5.IBEditorWindowLastContentRect + 5.IBPluginDependency + 5.IBWindowTemplateEditedContentRect + 5.ImportedFromIB2 + 5.editorWindowContentRectSynchronizationRect + 5.windowTemplate.hasMinSize + 5.windowTemplate.minSize + 6.IBPluginDependency + 6.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAAC/gAAAxBKAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABEBkAAwooAAA + + com.apple.InterfaceBuilder.CocoaPlugin + {{306, 109}, {130, 143}} + 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 + {{318, 228}, {637, 542}} + com.apple.InterfaceBuilder.CocoaPlugin + {{318, 228}, {637, 542}} + + {{201, 387}, {507, 413}} + + {94, 86} + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + + YES + + + + + YES + + + YES + + + + 100056 + + + + YES + + MyDocument + NSDocument + + setLogLevel: + id + + + setLogLevel: + + setLogLevel: + id + + + + YES + + YES + logLevelButton + textView + + + YES + NSPopUpButton + NSTextView + + + + YES + + YES + logLevelButton + textView + + + YES + + logLevelButton + NSPopUpButton + + + textView + NSTextView + + + + + IBProjectSource + MyDocument.h + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSDocument + NSObject + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + id + id + id + id + id + id + + + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + + printDocument: + id + + + revertDocumentToSaved: + id + + + runPageLayout: + id + + + saveDocument: + id + + + saveDocumentAs: + id + + + saveDocumentTo: + id + + + + + IBFrameworkSource + AppKit.framework/Headers/NSDocument.h + + + + NSDocument + + IBFrameworkSource + AppKit.framework/Headers/NSDocumentScripting.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMenuItemCell + NSButtonCell + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItemCell.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSPopUpButtonCell + NSMenuItemCell + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButtonCell.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../MP4Dump.xcodeproj + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + + + diff --git a/Utilities/MP4Dump/MP4Dump-Info.plist b/Utilities/MP4Dump/MP4Dump-Info.plist new file mode 100755 index 0000000..f09fb26 --- /dev/null +++ b/Utilities/MP4Dump/MP4Dump-Info.plist @@ -0,0 +1,111 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + m4v + + CFBundleTypeMIMETypes + + video/x-m4v + + CFBundleTypeName + Video-MPEG4 + CFBundleTypeOSTypes + + M4V + + CFBundleTypeRole + Viewer + LSTypeIsPackage + + NSDocumentClass + MyDocument + NSPersistentStoreTypeKey + Binary + + + CFBundleTypeExtensions + + mp4 + mpg4 + mqv + + CFBundleTypeMIMETypes + + audio/mp4 + video/mp4 + + CFBundleTypeName + Movie-MPEG4 + CFBundleTypeOSTypes + + mpg4 + + CFBundleTypeRole + Viewer + LSTypeIsPackage + + NSDocumentClass + MyDocument + NSPersistentStoreTypeKey + Binary + + + CFBundleTypeExtensions + + m4a + + CFBundleTypeMIMETypes + + audio/x-m4a + audio/x-m4v + + CFBundleTypeName + Audio-MPEG4 + CFBundleTypeOSTypes + + M4A + + CFBundleTypeRole + Viewer + LSTypeIsPackage + + NSDocumentClass + MyDocument + NSPersistentStoreTypeKey + Binary + + + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + org.galad.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.1 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/Utilities/MP4Dump/MP4Dump.xcodeproj/project.pbxproj b/Utilities/MP4Dump/MP4Dump.xcodeproj/project.pbxproj new file mode 100755 index 0000000..042b6de --- /dev/null +++ b/Utilities/MP4Dump/MP4Dump.xcodeproj/project.pbxproj @@ -0,0 +1,378 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + 1DDD582C0DA1D0D100B32029 /* MyDocument.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58280DA1D0D100B32029 /* MyDocument.xib */; }; + 1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */; }; + 8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */; }; + 8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165FFE840EACC02AAC07 /* InfoPlist.strings */; }; + 8D15AC310486D014006FF6A4 /* MyDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */; settings = {ATTRIBUTES = (); }; }; + 8D15AC320486D014006FF6A4 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4B0FDCFA73011CA2CEA /* main.mm */; settings = {ATTRIBUTES = (); }; }; + 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; }; + A9DAC2FD133204BD007CA155 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A9DAC2FC133204BD007CA155 /* AppDelegate.m */; }; + A9DC819C115DF59900FCD230 /* libmp4v2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9DC818C115DF59900FCD230 /* libmp4v2.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 089C1660FE840EACC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; + 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; + 1DDD58290DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MyDocument.xib; sourceTree = ""; }; + 1DDD582B0DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; + 2564AD2C0F5327BB00F57823 /* MP4Dump_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MP4Dump_Prefix.pch; sourceTree = ""; }; + 2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyDocument.m; sourceTree = ""; }; + 2A37F4AEFDCFA73011CA2CEA /* MyDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyDocument.h; sourceTree = ""; }; + 2A37F4B0FDCFA73011CA2CEA /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = ""; }; + 2A37F4BAFDCFA73011CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = ""; }; + 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 8D15AC360486D014006FF6A4 /* MP4Dump-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "MP4Dump-Info.plist"; sourceTree = ""; }; + 8D15AC370486D014006FF6A4 /* MP4Dump.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MP4Dump.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A9DAC2FB133204BD007CA155 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + A9DAC2FC133204BD007CA155 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + A9DC818C115DF59900FCD230 /* libmp4v2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libmp4v2.a; sourceTree = ""; }; + A9DC818E115DF59900FCD230 /* chapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chapter.h; sourceTree = ""; }; + A9DC818F115DF59900FCD230 /* file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = file.h; sourceTree = ""; }; + A9DC8190115DF59900FCD230 /* file_prop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = file_prop.h; sourceTree = ""; }; + A9DC8191115DF59900FCD230 /* general.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = general.h; sourceTree = ""; }; + A9DC8192115DF59900FCD230 /* isma.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = isma.h; sourceTree = ""; }; + A9DC8193115DF59900FCD230 /* itmf_generic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = itmf_generic.h; sourceTree = ""; }; + A9DC8194115DF59900FCD230 /* itmf_tags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = itmf_tags.h; sourceTree = ""; }; + A9DC8195115DF59900FCD230 /* platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = platform.h; sourceTree = ""; }; + A9DC8196115DF59900FCD230 /* project.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = project.h; sourceTree = ""; }; + A9DC8197115DF59900FCD230 /* sample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sample.h; sourceTree = ""; }; + A9DC8198115DF59900FCD230 /* streaming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = streaming.h; sourceTree = ""; }; + A9DC8199115DF59900FCD230 /* track.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = track.h; sourceTree = ""; }; + A9DC819A115DF59900FCD230 /* track_prop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = track_prop.h; sourceTree = ""; }; + A9DC819B115DF59900FCD230 /* mp4v2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mp4v2.h; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D15AC330486D014006FF6A4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */, + A9DC819C115DF59900FCD230 /* libmp4v2.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */ = { + isa = PBXGroup; + children = ( + A9DC818B115DF59900FCD230 /* mp4v2 */, + 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */, + ); + name = "Linked Frameworks"; + sourceTree = ""; + }; + 1058C7A8FEA54F5311CA2CBB /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */, + 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */, + 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 19C28FB0FE9D524F11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D15AC370486D014006FF6A4 /* MP4Dump.app */, + ); + name = Products; + sourceTree = ""; + }; + 2A37F4AAFDCFA73011CA2CEA /* MP4Dump */ = { + isa = PBXGroup; + children = ( + 2A37F4ABFDCFA73011CA2CEA /* Classes */, + 2A37F4AFFDCFA73011CA2CEA /* Other Sources */, + 2A37F4B8FDCFA73011CA2CEA /* Resources */, + 2A37F4C3FDCFA73011CA2CEA /* Frameworks */, + 19C28FB0FE9D524F11CA2CBB /* Products */, + ); + name = MP4Dump; + sourceTree = ""; + }; + 2A37F4ABFDCFA73011CA2CEA /* Classes */ = { + isa = PBXGroup; + children = ( + 2A37F4AEFDCFA73011CA2CEA /* MyDocument.h */, + 2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */, + ); + name = Classes; + sourceTree = ""; + }; + 2A37F4AFFDCFA73011CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + A9DAC2FB133204BD007CA155 /* AppDelegate.h */, + A9DAC2FC133204BD007CA155 /* AppDelegate.m */, + 2564AD2C0F5327BB00F57823 /* MP4Dump_Prefix.pch */, + 2A37F4B0FDCFA73011CA2CEA /* main.mm */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 2A37F4B8FDCFA73011CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */, + 8D15AC360486D014006FF6A4 /* MP4Dump-Info.plist */, + 089C165FFE840EACC02AAC07 /* InfoPlist.strings */, + 1DDD58280DA1D0D100B32029 /* MyDocument.xib */, + 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */, + ); + name = Resources; + sourceTree = ""; + }; + 2A37F4C3FDCFA73011CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */, + 1058C7A8FEA54F5311CA2CBB /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; + A9DC818B115DF59900FCD230 /* mp4v2 */ = { + isa = PBXGroup; + children = ( + A9DC818D115DF59900FCD230 /* mp4v2 */, + A9DC818C115DF59900FCD230 /* libmp4v2.a */, + A9DC819B115DF59900FCD230 /* mp4v2.h */, + ); + name = mp4v2; + path = ../../mp4v2; + sourceTree = SOURCE_ROOT; + }; + A9DC818D115DF59900FCD230 /* mp4v2 */ = { + isa = PBXGroup; + children = ( + A9DC818E115DF59900FCD230 /* chapter.h */, + A9DC818F115DF59900FCD230 /* file.h */, + A9DC8190115DF59900FCD230 /* file_prop.h */, + A9DC8191115DF59900FCD230 /* general.h */, + A9DC8192115DF59900FCD230 /* isma.h */, + A9DC8193115DF59900FCD230 /* itmf_generic.h */, + A9DC8194115DF59900FCD230 /* itmf_tags.h */, + A9DC8195115DF59900FCD230 /* platform.h */, + A9DC8196115DF59900FCD230 /* project.h */, + A9DC8197115DF59900FCD230 /* sample.h */, + A9DC8198115DF59900FCD230 /* streaming.h */, + A9DC8199115DF59900FCD230 /* track.h */, + A9DC819A115DF59900FCD230 /* track_prop.h */, + ); + path = mp4v2; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8D15AC270486D014006FF6A4 /* MP4Dump */ = { + isa = PBXNativeTarget; + buildConfigurationList = C05733C708A9546B00998B17 /* Build configuration list for PBXNativeTarget "MP4Dump" */; + buildPhases = ( + 8D15AC2B0486D014006FF6A4 /* Resources */, + 8D15AC300486D014006FF6A4 /* Sources */, + 8D15AC330486D014006FF6A4 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MP4Dump; + productInstallPath = "$(HOME)/Applications"; + productName = MP4Dump; + productReference = 8D15AC370486D014006FF6A4 /* MP4Dump.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 2A37F4A9FDCFA73011CA2CEA /* Project object */ = { + isa = PBXProject; + buildConfigurationList = C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "MP4Dump" */; + compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 2A37F4AAFDCFA73011CA2CEA /* MP4Dump */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8D15AC270486D014006FF6A4 /* MP4Dump */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D15AC2B0486D014006FF6A4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */, + 8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */, + 1DDD582C0DA1D0D100B32029 /* MyDocument.xib in Resources */, + 1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D15AC300486D014006FF6A4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D15AC310486D014006FF6A4 /* MyDocument.m in Sources */, + 8D15AC320486D014006FF6A4 /* main.mm in Sources */, + A9DAC2FD133204BD007CA155 /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 089C165FFE840EACC02AAC07 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 089C1660FE840EACC02AAC07 /* English */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 1DDD58280DA1D0D100B32029 /* MyDocument.xib */ = { + isa = PBXVariantGroup; + children = ( + 1DDD58290DA1D0D100B32029 /* English */, + ); + name = MyDocument.xib; + sourceTree = ""; + }; + 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 1DDD582B0DA1D0D100B32029 /* English */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; + 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */ = { + isa = PBXVariantGroup; + children = ( + 2A37F4BAFDCFA73011CA2CEA /* English */, + ); + name = Credits.rtf; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + C05733C808A9546B00998B17 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = MP4Dump_Prefix.pch; + INFOPLIST_FILE = "MP4Dump-Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../mp4v2\"", + ); + PRODUCT_NAME = MP4Dump; + }; + name = Debug; + }; + C05733C908A9546B00998B17 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = MP4Dump_Prefix.pch; + INFOPLIST_FILE = "MP4Dump-Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../mp4v2\"", + ); + PRODUCT_NAME = MP4Dump; + }; + name = Release; + }; + C05733CC08A9546B00998B17 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../mp4v2\"/**"; + ONLY_ACTIVE_ARCH = YES; + PREBINDING = NO; + SDKROOT = macosx10.8; + }; + name = Debug; + }; + C05733CD08A9546B00998B17 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../mp4v2\"/**"; + PREBINDING = NO; + SDKROOT = macosx10.8; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C05733C708A9546B00998B17 /* Build configuration list for PBXNativeTarget "MP4Dump" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C05733C808A9546B00998B17 /* Debug */, + C05733C908A9546B00998B17 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "MP4Dump" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C05733CC08A9546B00998B17 /* Debug */, + C05733CD08A9546B00998B17 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 2A37F4A9FDCFA73011CA2CEA /* Project object */; +} diff --git a/Utilities/MP4Dump/MP4Dump_Prefix.pch b/Utilities/MP4Dump/MP4Dump_Prefix.pch new file mode 100755 index 0000000..29ad787 --- /dev/null +++ b/Utilities/MP4Dump/MP4Dump_Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'MP4Dump' target in the 'MP4Dump' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/Utilities/MP4Dump/MyDocument.h b/Utilities/MP4Dump/MyDocument.h new file mode 100755 index 0000000..334e698 --- /dev/null +++ b/Utilities/MP4Dump/MyDocument.h @@ -0,0 +1,21 @@ +// +// MyDocument.h +// MP4Dump +// +// Created by Damiano Galassi on 27/03/10. +// Copyright 2010 __MyCompanyName__. All rights reserved. +// + + +#import + +@interface MyDocument : NSDocument +{ + IBOutlet NSTextView * textView; + IBOutlet NSPopUpButton *logLevelButton; + NSString * result; +} + +- (IBAction) setLogLevel: (id) sender; + +@end diff --git a/Utilities/MP4Dump/MyDocument.m b/Utilities/MP4Dump/MyDocument.m new file mode 100755 index 0000000..a95b198 --- /dev/null +++ b/Utilities/MP4Dump/MyDocument.m @@ -0,0 +1,95 @@ +// +// MyDocument.m +// MP4Dump +// +// Created by Damiano Galassi on 27/03/10. +// Copyright 2010 __MyCompanyName__. All rights reserved. +// + +#import "MyDocument.h" +#include "mp4v2.h" + +extern NSString *libraryPath; + +@implementation MyDocument + +- (id)init +{ + self = [super init]; + if (self) { + + // Add your subclass-specific initialization here. + // If an error occurs here, send a [self release] message and return nil. + + } + return self; +} + +- (NSString *)windowNibName +{ + // Override returning the nib file name of the document + // If you need to use a subclass of NSWindowController or if your document supports multiple NSWindowControllers, + // you should remove this method and override -makeWindowControllers instead. + return @"MyDocument"; +} + +- (void)windowControllerDidLoadNib:(NSWindowController *) aController +{ + if ([[NSUserDefaults standardUserDefaults] valueForKey:@"LogLevel"]) + [logLevelButton selectItemWithTag:[[NSUserDefaults standardUserDefaults] integerForKey:@"LogLevel"]]; + [super windowControllerDidLoadNib:aController]; + [textView setFont:[NSFont fontWithName:@"Monaco" size:10]]; + [textView setString:@""]; + [textView insertText:result]; + [textView setContinuousSpellCheckingEnabled:NO]; +} + +- (BOOL) loadFileDump:(NSURL *)absoluteURL error:(NSError **)outError +{ + MP4FileHandle fileHandle = MP4Read([[absoluteURL path] UTF8String]); + + MP4Dump(fileHandle, 0); + + MP4Close(fileHandle, 0); + result = [NSString stringWithContentsOfFile:libraryPath encoding:NSASCIIStringEncoding error:outError]; + + if([[NSFileManager defaultManager] isDeletableFileAtPath:libraryPath]) + [[NSFileManager defaultManager] removeItemAtPath:libraryPath error:nil]; + + if (result) + return YES; + else + return NO; +} + +- (BOOL)readFromURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError +{ + if ( outError != NULL && ![self loadFileDump:absoluteURL error:outError]) { + *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL]; + + return NO; + } + + if([[NSFileManager defaultManager] isDeletableFileAtPath:libraryPath]) + [[NSFileManager defaultManager] removeItemAtPath:libraryPath error:nil]; + + return YES; +} + +- (IBAction) setLogLevel: (id) sender +{ + NSInteger level = [sender tag]; + [[NSUserDefaults standardUserDefaults] setInteger:level forKey:@"LogLevel"]; + MP4LogSetLevel(level); + + if ([self loadFileDump:[self fileURL] error:nil]) { + [textView setString:@""]; + [textView insertText:result]; + } +} + +- (void)updateChangeCount:(NSDocumentChangeType)changeType +{ +} + +@end diff --git a/Utilities/MP4Dump/main.mm b/Utilities/MP4Dump/main.mm new file mode 100755 index 0000000..303aca0 --- /dev/null +++ b/Utilities/MP4Dump/main.mm @@ -0,0 +1,14 @@ +// +// main.m +// MP4Dump +// +// Created by Damiano Galassi on 27/03/10. +// Copyright 2010 __MyCompanyName__. All rights reserved. +// + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **) argv); +} diff --git a/Utilities/ParseFilename/ParseFilename.pl b/Utilities/ParseFilename/ParseFilename.pl new file mode 100755 index 0000000..04bc98e --- /dev/null +++ b/Utilities/ParseFilename/ParseFilename.pl @@ -0,0 +1,26 @@ +#!/usr/bin/perl + +use Video::Filename; + +my $filename = $ARGV[0]; + +my $file = Video::Filename::new($filename); + +if ($file->isTVshow()) { + print "tv" . "\n"; + print $file->{name} . "\n"; + print $file->{season} . "\n"; + print $file->{episode} . "\n"; +} elsif ($file->isEpisode()) { + print "tv" . "\n"; + print $file->{name} . "\n"; + print $file->{episode} . "\n"; + print $file->{part} . "\n"; +} elsif ($file->isMovie()) { + print "movie" . "\n"; + print $file->{movie} . "\n"; +} else { + print "unknown" . "\n"; +} + +exit; diff --git a/Utilities/ParseFilename/lib/Debug/Simple.pm b/Utilities/ParseFilename/lib/Debug/Simple.pm new file mode 100755 index 0000000..17fca1c --- /dev/null +++ b/Utilities/ParseFilename/lib/Debug/Simple.pm @@ -0,0 +1,227 @@ +# Copyright (c) 2008 Behan Webster. All rights reserved. This program is free +# software; you can redistribute it and/or modify it under the same terms +# as Perl itself. + +package Debug::Simple; + +use strict; +require Exporter; +use Data::Dumper; +use Term::ANSIColor qw(:constants); +$Term::ANSIColor::AUTORESET = 1; + +use vars qw(@EXPORT @ISA $VERSION); + +$VERSION = "0.10"; +@ISA = qw(Exporter); +@EXPORT = qw(debuglevels warning debug verbose test); + +my $opt; + +############################################################################### +sub debuglevels { + # Needs to have the keys: quiet, debug, verbose, test + ($opt) = @_; + &debug(5, "Command line options: ", OPTS => $opt); +} + +############################################################################### +sub _list { + return (ref($_[0]) eq 'ARRAY') ? @{$_[0]} : @_; +} + +############################################################################### +sub warning { + return if $opt->{quiet}; + #warn ("Warning: ", @_); + print YELLOW ("Warning: ", @_); + print ""; +} + +############################################################################### +sub debug { + return if $opt->{quiet}; + my @level = (&_list(shift), 0, 0, 0); + + return unless (defined $opt->{debug} && $level[0] <= $opt->{debug}) + || ($opt->{verbose} && $level[1] && $level[1] <= $opt->{verbose}) + || ($opt->{test} && $level[2]); + + #print "DEBUG\n" if defined $opt->{debug} && $level[0] <= $opt->{debug}; + #print "VERBOSE: $opt->{verbose} && $level[1]\n" if defined $opt->{verbose} && $level[1] <= $opt->{verbose}; + #print "TEST\n" if defined $opt->{test} && $level[3]; + + my $str = shift || ''; + my $name = shift; + + print BOLD "Debug: " unless $level[1] || $level[2]; + print BOLD "$str"; + if ($name && @_) { + my $save = $Data::Dumper::Varname; + $Data::Dumper::Varname = $name; + print BOLD Dumper(@_); + $Data::Dumper::Varname = $save; + } + print ""; +} + +############################################################################### +sub verbose { + return if $opt->{quiet}; + my @level = (&_list(shift), 0, 0); + + return unless ($opt->{verbose} && $level[0] && $level[0] <= $opt->{verbose}) + || ($opt->{test} && $level[1]); + + print @_; + print ""; +} + +############################################################################### +sub test { + my $code = shift; + my $str = shift || $code; + + if ($opt->{test}) { + print CYAN "$str\n"; + } else { + eval $code; + print MAGENTA "Eval failed: $@\n" if $@; + return $@; + } + print ""; +} + +1; +############################################################################### +__END__ + +=head1 NAME + +Debug::Simple - Very simple debugging statements + +=head1 SYNOPSIS + + use Debug::Simple; + + my %opt = (quiet => 0, debug => 4, verbose => 1, test => 0); + Debug::Simple::debuglevels(\%opt); + + warning("This is a warning\m"); + debug(1, "This is a level 3 debug message\n"); + debug(2, "This is a level 2 debug message with a Dump", NAME => \%opt); + verbose(1, "This is a verbose message\n"); + test('print "test code"'); + +=head1 DESCRIPTION + +This module provides a very simple way to provide debug/verbose/warning +messages. It is also trivially controlled via Getopt::Long. + +The idea is to be able to put a bunch of debugging print statements throughout +your code that you can enable or disable. + +=over 4 + +=item debuglevels(\%OPT) + +C registers the hashref C as the place to read values used +to control whether text is output to the screen or not. There are 4 values +read from this hash: quiet, debug, verbose, and test. + +=over + +=item quiet + +If non-zero, this will repress all output from Debug::Simple + +=item debug + +This indicates the level of debug messages desired. A debug +level of 4 prints all the debug messages from levels 1 to 4. + +=item verbose + +Like debug, this sets the level of verboseness. A verbose +level of 3 prints all verbose messages from 1 to 3. + +=item test + +If non-zero, the code passed to test() will be printed to the +screen instead of being executed. + +=back + +=item warning(STRING) + +C prints the C to stdout in YELLOW unless the "quiet" level is +non-zero (see C). C is prefaced with "Warning:". + +=item debug(LEVEL, STRING, [NAME => REF]) + +C prints a debugging message to stdout as long as C is at or below +the "debug" level. (see , +and then optionally uses Data::Dumper to dump a data structure referred to by +C. C is just a human readable name for C passed to Data::Dumper. + +=item verbose(LEVEL, STRING) + +C prints C to stdout as long as C is at or below the +"verbose" level. (see C). + +=item test(CODE) + +C executes C according to the "test" level. (see C). +If the "test" level is non-zero the code is printed to stdout instead of being +executed. + +=back + +=head1 LEVELS + +To make things marginally more useful, you can specify that a message can be +printed to stdout based on more than one level by specifying a list of levels. + +For instance, for C you can also specify the "verbose" and "test" levels +at which the debug message will be printed. In the following example, the debug +message will be output at debug levels 1-2, verbose levels 1-3 or test level 1. + + &debug([2,3,1], "This is a debug message\n"); + +In this case, the message will be printed to stdout if the verbose level is 1-2 +or test level 1. + + &verbose([2,1], "This is a verbose message\n"); + +=head1 EXAMPLE CODE + +This example shows how Debug::Simple code can be tied in with GetOpt::Long. + + use Debug::Simple; + use Getopt::Long; + use Pod::Usage; + + pod2usage(2) unless GetOptions( $opt = {}, + qw(help debug:i quiet test verbose|v+) ); + pod2usage(1) if $opt->{help}; + $opt->{debug} = 1 if defined $opt->{debug} && !$opt->{debug}; + Debug::Simple::debuglevels($opt); + + debug(2, "Command line options ", OPT=>$opt); + verbose(1, "Now on with the show\n"); + + ... + +=head1 AUTHOR + +Sbehanw@websterwood.com> + +=head1 COPYRIGHT + +Copyright (c) 2004-2008 Behan Webster. All rights reserved. This program is free +software; you can redistribute it and/or modify it under the same terms +as Perl itself. + +=cut diff --git a/Utilities/ParseFilename/lib/Text/Roman.pm b/Utilities/ParseFilename/lib/Text/Roman.pm new file mode 100755 index 0000000..816abc9 --- /dev/null +++ b/Utilities/ParseFilename/lib/Text/Roman.pm @@ -0,0 +1,259 @@ +#!/usr/bin/perl + +# ok, mar/98 +# +package Text::Roman; +require 5.000; +require Exporter; + + @ISA = (Exporter); + @EXPORT = qw(roman roman2int isroman mroman2int ismroman); + + $VERSION = 3.01; + + $ALGS = 'IVXLCDM'; + @alg = split '', $ALGS; + # for int2rom: + @alginf = (-1, 0, 0, 2, 2, 4, 4); + %parsub = (IV=>A, IX=>B, XL=>E, XC=>F, CD=>G, CM=>H); + %val = (I=>1, V=>5, X=>10, L=>50, C=>100, D=>500, M=>1000, + A=>4, B=>9, E=>40, F=>90, G=>400, H=>900); + %maxpos = (I=>2, V=>3, X=>29, L=>39, C=>299, D=>399, M=>2999, + A=>0, B=>0, E=>9, F=>9, G=>99, H=>99); + + for $i (0..$#alg) + { $valg[$i] = $val{$alg[$i]}; + } + + + +sub roman_stx +{ my $x = shift; +my $aux = $$x; + +$$x = uc $$x; +if ($$x eq $aux || lc $$x eq $aux) + { if ($$x =~ /^[IXCMVLD]+$/ && $$x !~ /([IXCM])\1{3,}|([VLD])\2+/) + { $$x =~ s/(IV|IX|XL|XC|CD|CM)/$parsub{$1}/g; + $$x !~ /[AB].*?I|[EF].*?X|[GH].*?C/; + } + else + { '';} + } +else + {''; + } +} + + + +sub roman2int + { my $x = shift; + my ($at, $flag, $i); + my $val=0; + my $ant=0; + my @U; + my $U=''; + + if (&roman_stx(\$x)) + { @U = split('', $x); + for ($i = $#U; $i >= 0; $i--) + { $at = $val{$U[$i]}; + return '' if ($at<$ant); + $val += $at; + $ant = $at; + } + $val; + } + else + { ''; + } + } + + +sub mroman2int +# allows '_' milhar syntax (LX_XXIII, L_X_XXIII) +# +{ my $x = shift; +my $s=0; +my ($sroman, $i, $aux); +my $y=''; +my @partes; + +@partes = split ('_',$x); +$sroman = pop @partes; +for $i (@partes) + { $y .= $i; + } +$aux = &roman2int($y); +return '' if ($y =~ /^(I{1,3})$/ || !$aux); +$s += $aux*1000; +$aux = &roman2int($sroman); +return '' if (!$aux); +$s+$aux; +} + + + +sub ismroman +# allows '_' milhar syntax (LX_XXIII, L_X_XXIII) +# +{ my $x = shift; +my ($i,$sroman); +my $y=''; +my @partes; + +if ($x =~ /^[_IXCMVLD]+$/) + { @partes = split ('_',$x); + $sroman = pop @partes; + for $i (@partes) + { $y .= $i; + } + return '' if ($y =~ /^(I{1,3})$/ || !&isroman($y)); + return &isroman($sroman); + } +} + + + +sub isroman +# same efect that (&roman2int($x)>0), but fasted +# +{ my $x = shift; +my $y=$x; +$x = uc $x; + +($x eq $y || lc $x eq $y) && $x =~ /^(M{1,3}(D(C{1,3}(L(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3}))?|XL(IX|(VI{0,3}|IV|I{1,3}))?|(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3})))?|C{0,3}XC(IX|(VI{0,3}|IV|I{1,3}))?|(L(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3}))?|XL(IX|(VI{0,3}|IV|I{1,3}))?|(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3}))))?|CD(XC(IX|(VI{0,3}|IV|I{1,3}))?|(L(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3}))?|XL(IX|(VI{0,3}|IV|I{1,3}))?|(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3}))))?|(C{1,3}(L(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3}))?|XL(IX|(VI{0,3}|IV|I{1,3}))?|(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3})))?|C{0,3}XC(IX|(VI{0,3}|IV|I{1,3}))?|(L(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3}))?|XL(IX|(VI{0,3}|IV|I{1,3}))?|(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3})))))?|M{0,3}CM(XC(IX|(VI{0,3}|IV|I{1,3}))?|(L(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3}))?|XL(IX|(VI{0,3}|IV|I{1,3}))?|(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3}))))?|(D(C{1,3}(L(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3}))?|XL(IX|(VI{0,3}|IV|I{1,3}))?|(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3})))?|C{0,3}XC(IX|(VI{0,3}|IV|I{1,3}))?|(L(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3}))?|XL(IX|(VI{0,3}|IV|I{1,3}))?|(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3}))))?|CD(XC(IX|(VI{0,3}|IV|I{1,3}))?|(L(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3}))?|XL(IX|(VI{0,3}|IV|I{1,3}))?|(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3}))))?|(C{1,3}(L(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3}))?|XL(IX|(VI{0,3}|IV|I{1,3}))?|(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3})))?|C{0,3}XC(IX|(VI{0,3}|IV|I{1,3}))?|(L(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3}))?|XL(IX|(VI{0,3}|IV|I{1,3}))?|(X{1,3}(VI{0,3}|IV|I{1,3})?|X{0,3}IX|(VI{0,3}|IV|I{1,3}))))))$/; +} + + + +sub roman_div +{ + my ($a, $b) = @_; + my $inf = $alginf[$b]; + + if ($b<0) + { (0,-1); } + elsif ( int($a/$valg[$b])>0 ) + { ($b,-1); } + elsif ( $a+$valg[$inf]>=$valg[$b] ) + { ($b, $inf); } + else + { &roman_div($a,$b-1); } + } + + +sub roman_do + { my ($x, $str_x) = @_; + my ($aux, $inf); + + ($aux, $inf) = &roman_div($x,$#alg); + if ($x>0 && $inf<0) + { &roman_do($x-$valg[$aux], $str_x.$alg[$aux]); } + elsif ($x>0 && $inf>=0) + { &roman_do( $x+$valg[$inf]-$valg[$aux], $str_x.$alg[$inf].$alg[$aux] ); } + else + { $str_x; } + } + + +sub roman + { my ($x) = @_; + if ($x <1 || $x > 3999) + {'';} + else + { roman_do($x,""); } + } + + +1; + + +__END__ + + + +=head1 NAME + +Text::Roman - Converts roman algarism in integer numbers and the contrary, recognize algarisms. + +=head1 SYNOPSIS + + use Text::Roman; + + print roman(123); + +=head1 DESCRIPTION + +Text::Roman::roman() is a very simple algarism converter. It converts a single integer +(in arabic algarisms) at a time to its roman correspondent. The conventional roman numbers +goes from 1 up to 3999. MROMANS (milhar romans) range is 1 up to 3999*1000+3999=4002999. + +Up to these number we will found symbols as:??????but they do not concern this specific +package. There is no concern for mix cases, like 'Xv', 'XiiI', as legal roman algarism +numbers. + +=over + +=item B: return string containing the roman corresponding to the given integer, or '' if the integer is out of domain... + +=item B: return '' if $str is not roman or return integer if it is. + +=item B: verify whether the given string is a conventional roman number, if it is return 1; if it is not return 0... + +=back + +Quite same follows for B and B, except that these functions +treat milhar romans. + +=head1 SPECIFICATION + +Roman number has origin in following BNF-like formula: + +a = I{1,3} + +b = V\a?|IV|\a + +e = X{1,3}\b?|X{0,3}IX|\b + +ee = IX|\b + +f = L\e?|XL\ee?|\e + +g = C{1,3}\f?|C{0,3}XC\ee?|\f + +gg = XC\ee?|\f + +h = D\g?|CD\gg?|\g + +j = M{1,3}\h?|M{0,3}CM\gg?|\h + +=head1 REFERENCES + +Especification supplied by redactor's manual of newspaper "O Estado de São Paulo". +URL: http://www.estado.com.br/redac/norn-nro.html + +=head1 EXAMPLE + + use Text::Roman; + + $roman = "XXXV"; + $mroman = 'L_X_XXIII'; + print roman(123), "\n"; + print roman2int($roman), "\n" if isroman($roman); + print mroman2int($mroman), "\n" if ismroman($mroman); + +=head1 BUGS + +No one known. + +=head1 AUTHOR + +Peter de Padua Krauss, krauss@ifqsc.sc.usp.br. + +=head1 COPYRIGHT + +1.2-krauss/set/97; 1.0-krauss/3/ago/97 + +=cut diff --git a/Utilities/ParseFilename/lib/Video/Filename.pm b/Utilities/ParseFilename/lib/Video/Filename.pm new file mode 100755 index 0000000..0c9c3a4 --- /dev/null +++ b/Utilities/ParseFilename/lib/Video/Filename.pm @@ -0,0 +1,609 @@ +# Copyright (c) 2008 Behan Webster. All rights reserved. This program is free +# software; you can redistribute it and/or modify it under the same terms +# as Perl itself. +# Modified 2010 by Douglas Stebila to support parentheses in movie years + +package Video::Filename; + +use strict; +require Exporter; + +use Debug::Simple; +use Data::Dumper; +use Term::ANSIColor qw(:constants); +use Text::Roman qw(roman2int); +$Term::ANSIColor::AUTORESET = 1; + +use vars qw($VERSION @filePatterns @testFuncs); + +$VERSION = "0.35.1"; + +@filePatterns = ( + { # DVD Episode Support - DddEee + # Perl > v5.10 + re => '^(?:(?.*?)[\/\s._-]+)?(?:d|dvd|disc|disk)[\s._]?(?\d{1,2})[x\/\s._-]*(?:e|ep|episode)[\s._]?(?\d{1,2}(?:\.\d{1,2})?)(?:-?(?:(?:e|ep)[\s._]*)?(?\d{1,2}))?(?:[\s._]?(?:p|part)[\s._]?(?\d+))?(?[a-z])?(?:[\/\s._-]*(?[^\/]+?))?$', + + # Perl < v5.10 + re_compat => '^(?:(.*?)[\/\s._-]+)?(?:d|dvd|disc|disk)[\s._]?(\d{1,2})[x\/\s._-]*(?:e|ep|episode)[\s._]?(\d{1,2})(?:-?(?:(?:e|ep)[\s._]*)?(\d{1,2}(?:\.\d{1,2})?))?(?:[\s._]?(?:p|part)[\s._]?(\d+))?([a-z])?(?:[\/\s._-]*([^\/]+?))?$', + keys_compat => [qw(name dvd episode endep part subep epname)], + + test_funcs => [1, 0, 1, 0], # DVD TV Episode Movie + test_keys => [qw(filename name dvd episode endep part subep epname ext)], + test_files => [ + ['D01E02.Episode_name.avi', undef, 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name.D01E02.Episode_name.avi', 'Series Name', 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/D01E02.Episode_name.avi', 'Series Name', 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/D01E02/Episode_name.avi', 'Series Name', 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name.D01E02a.Episode_name.avi', 'Series Name', 1, 2, undef, undef, 'a', 'Episode_name', 'avi'], + ['Series Name.D01E02p4.Episode_name.avi', 'Series Name', 1, 2, undef, 4, undef, 'Episode_name', 'avi'], + ['Series Name.D01E02-03.Episode_name.avi', 'Series Name', 1, 2, 3, undef, undef, 'Episode_name', 'avi'], + ['Series Name.D01E02-E03.Episode_name.avi', 'Series Name', 1, 2, 3, undef, undef, 'Episode_name', 'avi'], + ['Series Name.D01E02E.03.Episode_name.avi', 'Series Name', 1, 2, 3, undef, undef, 'Episode_name', 'avi'], + ['Series Name/D01E02E03/Episode_name.avi', 'Series Name', 1, 2, 3, undef, undef, 'Episode_name', 'avi'], + ['D01E02E03/Episode name.avi', undef, 1, 2, 3, undef, undef, 'Episode name', 'avi'], + ['Series Name.DVD_01.Episode_02.Episode_name.avi', 'Series Name', 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name.disk_V.Episode_XI.Episode_name.avi', 'Series Name', 5, 11, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name.disc_V.Episode_XI.Part.XXV.Episode_name.avi', 'Series Name', 5, 11, undef, 25, undef, 'Episode_name', 'avi'], + ['Series Name.DVD01.Ep02.Episode_name.avi', 'Series Name', 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/dvd_01.Episode_02.Episode_name.avi', 'Series Name', 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/disk_01/Episode_02.Episode_name.avi', 'Series Name', 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/D.I/Ep02.Episode_name.avi', 'Series Name', 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/D three/Ep five Episode_name.avi', 'Series Name', 3, 5, undef, undef, undef, 'Episode_name', 'avi'], + ], + }, + { # TV Show Support - SssEee or Season_ss_Episode_ss + # Perl > v5.10 + re => '^(?:(?.*?)[\/\s._-]+)?(?:s|se|season|series)[\s._-]?(?\d+)[x\/\s._-]*(?:e|ep|episode|[\/\s._-]+)[\s._-]?(?\d+)(?:-?(?:(?:e|ep)[\s._]*)?(?\d+))?(?:[\s._]?(?:p|part)[\s._]?(?\d+))?(?[a-z])?(?:[\/\s._-]*(?[^\/]+?))?$', + + # Perl < v5.10 + re_compat => '^(?:(.*?)[\/\s._-]+)?(?:s|se|season|series)[\s._-]?(\d+)[x\/\s._-]*(?:e|ep|episode|[\/\s._-]+)[\s._-]?(\d+)(?:-?(?:(?:e|ep)[\s._]*)?(\d+))?(?:[\s._]?(?:p|part)[\s._]?(\d+))?([a-z])?(?:[\/\s._-]*([^\/]+?))?$', + keys_compat => [qw(name season episode endep part subep epname)], + + test_funcs => [0, 1, 1, 0], # DVD TV Episode Movie + test_keys => [qw(filename name guess-name season episode endep part subep epname ext)], + test_files => [ + ['S01E02.Episode_name.avi', undef, undef, 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name.S01E02.Episode_name.avi', 'Series Name', undef, 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/S01E02.Episode_name.avi', 'Series Name', undef, 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/S01E02/Episode_name.avi', 'Series Name', undef, 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series/Name/S01E02/Episode_name.avi', 'Name', 'Series Name', 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series/Name/S01940E0237/Episode_name.avi', 'Name', 'Series Name', 1940, 237, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name.S01E02a.Episode_name.avi', 'Series Name', undef, 1, 2, undef, undef, 'a', 'Episode_name', 'avi'], + ['Series Name.S01E02p4.Episode_name.avi', 'Series Name', undef, 1, 2, undef, 4, undef, 'Episode_name', 'avi'], + ['Series Name.S01E02-03.Episode_name.avi', 'Series Name', undef, 1, 2, 3, undef, undef, 'Episode_name', 'avi'], + ['Series Name.S01E02-E03.Episode_name.avi', 'Series Name', undef, 1, 2, 3, undef, undef, 'Episode_name', 'avi'], + ['Series Name.S01E02E.03.Episode_name.avi', 'Series Name', undef, 1, 2, 3, undef, undef, 'Episode_name', 'avi'], + ['Series Name/S01E02E03/Episode_name.avi', 'Series Name', undef, 1, 2, 3, undef, undef, 'Episode_name', 'avi'], + ['S01E02E03/Episode name.avi', undef, undef, 1, 2, 3, undef, undef, 'Episode name', 'avi'], + ['Series Name.Season_01.Episode_02.Episode_name.avi', 'Series Name', undef, 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name.Season_V.Episode_XI.Episode_name.avi', 'Series Name', undef, 5, 11, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name.Season_V.Episode_XI.Part.XXV.Episode_name.avi', 'Series Name', undef, 5, 11, undef, 25, undef, 'Episode_name', 'avi'], + ['Series Name.Se01.Ep02.Episode_name.avi', 'Series Name', undef, 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/Season_01.Episode_02.Episode_name.avi', 'Series Name', undef, 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/Season_01/Episode_02.Episode_name.avi', 'Series Name', undef, 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/Season_01/02.Episode_name.avi', 'Series Name', undef, 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/S.I/Ep02.Episode_name.avi', 'Series Name', undef, 1, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/S.one/Ep twelve.Episode_name.avi', 'Series Name', undef, 1, 12, undef, undef, undef, 'Episode_name', 'avi'], + ], + }, + { # Movie IMDB Support + # Perl > v5.10 + re => '^(?.*?)?(?:[\/\s._-]*(?\[)?(?(?:19|20)\d{2})(?()\]))?(?:[\/\s._-]*(?\[)?(?:(?:imdb|tt)[\s._-]*)*(?\d{7})(?()\]))(?:[\s._-]*(?[^\/]+?))?$', + + # Perl < v5.10 + re_compat => '^(.*?)?(?:[\/\s._-]*\[?((?:19|20)\d{2})\]?)?(?:[\/\s._-]*\[?(?:(?:imdb|tt)[\s._-]*)*(\d{7})\]?)(?:[\s._-]*([^\/]+?))?$', + keys_compat => [qw(movie year imdb title)], + + test_funcs => [0, 0, 0, 1], # DVD TV Episode Movie + test_keys => [qw(filename movie guess-movie year imdb title ext)], + test_files => [ + ['Movie Name [1996] [imdb 1234567].mkv', 'Movie Name', undef, 1996, 1234567, undef, 'mkv'], + ['Movie Name [1996] [imdb tt1234567].mkv', 'Movie Name', undef, 1996, 1234567, undef, 'mkv'], + ['Movie Name [1996] [1234567].avi', 'Movie Name', undef, 1996, 1234567, undef, 'avi'], + ['Movie Name [1996] [tt1234567] foo.avi', 'Movie Name', undef, 1996, 1234567, 'foo', 'avi'], + ['Movie Name [1996]/tt1234567-foo.avi', 'Movie Name', undef, 1996, 1234567, 'foo', 'avi'], + ['Movie/Name/tt1234567_foo.avi', 'Name', 'Movie Name', undef, 1234567, 'foo', 'avi'], + ['Movie Name.[tt0096657] bar.avi', 'Movie Name', undef, undef, '0096657', 'bar', 'avi'], + ['Movie Name.tt0096657-foo.avi', 'Movie Name', undef, undef, '0096657', 'foo', 'avi'], + ['Movie.Name.tt0096657foo.avi', 'Movie.Name', undef, undef, '0096657', 'foo', 'avi'], + ['Movie Name.tt0096657_foo.avi', 'Movie Name', undef, undef, '0096657', 'foo', 'avi'], + ['Movie Name.tt0096657.avi', 'Movie Name', undef, undef, '0096657', undef, 'avi'], + ['Movie Name.[0096657].avi', 'Movie Name', undef, undef, '0096657', undef, 'avi'], + ['imdb-tt0096657.avi', undef, undef, undef, '0096657', undef, 'avi'], + ['tt0096657.mov', undef, undef, undef, '0096657', undef, 'mov'], + ['tt0096857', undef, undef, undef, '0096857', undef, undef], + ['1234576', undef, undef, undef, '1234576', undef, undef], + ], + #warning => 'Found year instead of season+episode', + }, + { # Movie + Year Support + # Perl > v5.10 + re => '^(?:(?<movie>.*?)[\/\s._-]*)?(?<openb>\[\(?)?(?<year>(?:19|20)\d{2})(?(<openb>)\)?\])(?:[\s._-]*(?<title>[^\/]+?))?$', + + # Perl < v5.10 + re_compat => '^(?:(.*?)[\/\s._-]*)?\[?\(?((?:19|20)\d{2})\)?\]?(?:[\s._-]*([^\/]+?))?$', + keys_compat => [qw(movie year title)], + + test_funcs => [0, 0, 0, 1], # DVD TV Episode Movie + test_keys => [qw(filename movie year title ext)], + test_files => [ + ['Movie (1988).avi', 'Movie', 1988, undef, 'avi'], + ['Movie.[1988].avi', 'Movie', 1988, undef, 'avi'], + ['Movie.2000.title.avi', 'Movie', 2000, 'title', 'avi'], + ['Movie/2009.title.avi', 'Movie', 2009, 'title', 'avi'], + ], + #warning => 'Found year instead of season+episode', + }, + { # TV Show Support - see + # Perl > v5.10 + re => '^(?:(?<name>.*?)[\/\s._-]*)?(?<season>\d{1,2}?)(?<episode>\d{2})(?:[^0-9][\s._-]*(?<epname>.+?))?$', + + # Perl < v5.10 + re_compat => '^(?:(.*?)[\/\s._-]*)?(\d{1,2}?)(\d{2})(?:[^0-9][\s._-]*(.+?))?$', + keys_compat => [qw(name season episode epname)], + + test_funcs => [0, 1, 1, 0], # DVD TV Episode Movie + test_keys => [qw(filename name season episode epname ext)], + test_files => [ + ['SN102.Episode_name.avi', 'SN', 1, 2, 'Episode_name', 'avi'], + ['Series Name.102.Episode_name.avi', 'Series Name', 1, 2, 'Episode_name', 'avi'], + ['Series Name/102.Episode_name.avi', 'Series Name', 1, 2, 'Episode_name', 'avi'], + ], + }, + { # TV Show Support - sxee + # Perl > v5.10 + re => '^(?:(?<name>.*?)[\/\s._-]*)?(?<openb>\[)?(?<season>\d{1,2})[x\/](?<episode>\d{1,2})(?:-(?:\k<season>x)?(?<endep>\d{1,2}))?(?(<openb>)\])(?:[\s._-]*(?<epname>[^\/]+?))?$', + + # Perl < v5.10 + re_compat => '^(?:(.*?)[\/\s._-]*)?\[?(\d{1,2})[x\/](\d{1,2})(?:-(?:\d{1,2}x)?(\d{1,2}))?\]?(?:[\s._-]*([^\/]+?))?$', + keys_compat => [qw(name season episode endep epname)], + + test_funcs => [0, 1, 1, 0], # DVD TV Episode Movie + test_keys => [qw(filename name season episode endep epname ext)], + test_files => [ + ['Series Name.1x02.Episode_name.avi', 'Series Name', 1, 2, undef, 'Episode_name', 'avi'], + ['Series Name/1x02.Episode_name.avi', 'Series Name', 1, 2, undef, 'Episode_name', 'avi'], + ['Series Name.[1x02].Episode_name.avi', 'Series Name', 1, 2, undef, 'Episode_name', 'avi'], + ['Series Name.1x02-03.Episode_name.avi', 'Series Name', 1, 2, 3, 'Episode_name', 'avi'], + ['Series Name.1x02-1x03.Episode_name.avi', 'Series Name', 1, 2, 3, 'Episode_name', 'avi'], + ], + }, + { # TV Show Support - season only + # Perl > v5.10 + re => '^(?:(?<name>.*?)[\/\s._-]+)?(?:s|se|season|series)[\s._]?(?<season>\d{1,2})(?:[\/\s._-]*(?<epname>[^\/]+?))?$', + + # Perl < v5.10 + re_compat => '^(?:(.*?)[\/\s._-]+)?(?:s|se|season|series)[\s._]?(\d{1,2})(?:[\/\s._-]*([^\/]+?))?$', + keys_compat => [qw(name season epname)], + + test_funcs => [0, 0, 0, 0], # DVD TV Episode Movie + test_keys => [qw(filename name season epname ext)], + test_files => [ + ['Series Name.s1.Episode_name.avi', 'Series Name', 1, 'Episode_name', 'avi'], + ['Series Name.s01.Episode_name.avi', 'Series Name', 1, 'Episode_name', 'avi'], + ['Series Name/se01.Episode_name.avi', 'Series Name', 1, 'Episode_name', 'avi'], + ['Series Name.season_1.Episode_name.avi', 'Series Name', 1, 'Episode_name', 'avi'], + ['Series Name/season_1/Episode_name.avi', 'Series Name', 1, 'Episode_name', 'avi'], + ['Series Name/season ten/Episode_name.avi', 'Series Name', 10, 'Episode_name', 'avi'], + ], + }, + { # TV Show Support - episode only + # Perl > v5.10 + re => '^(?:(?<name>.*?)[\/\s._-]*)?(?:(?:e|ep|episode)[\s._]?)?(?<episode>\d{1,2})(?:-(?:e|ep)?(?<endep>\d{1,2}))?(?:(?:p|part)(?<part>\d+))?(?<subep>[a-z])?(?:[\/\s._-]*(?<epname>[^\/]+?))?$', + + # Perl < v5.10 + re_compat => '^(?:(.*?)[\/\s._-]*)?(?:(?:e|ep|episode)[\s._]?)?(\d{1,2})(?:-(?:e|ep)?(\d{1,2}))?(?:(?:p|part)(\d+))?([a-z])?(?:[\/\s._-]*([^\/]+?))?$', + keys_compat => [qw(name episode endep part subep epname)], + + test_funcs => [0, 0, 1, 0], # DVD TV Episode Movie + test_keys => [qw(filename name episode endep part subep epname ext)], + test_files => [ + ['Series Name.Episode_02.Episode_name.avi', 'Series Name', 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/Episode_02.Episode_name.avi', 'Series Name', 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/Ep02.Episode_name.avi', 'Series Name', 2, undef, undef, undef, 'Episode_name', 'avi'], + ['E02.Episode_name.avi', undef, 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name.E02.Episode_name.avi', 'Series Name', 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name.02.Episode_name.avi', 'Series Nam', 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/E02.Episode_name.avi', 'Series Name', 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/02.Episode_name.avi', 'Series Name', 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/E02/Episode_name.avi', 'Series Name', 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name/02/Episode_name.avi', 'Series Name', 2, undef, undef, undef, 'Episode_name', 'avi'], + ['Series Name.E02a.Episode_name.avi', 'Series Name', 2, undef, undef, 'a', 'Episode_name', 'avi'], + ['Series Name.E02p3.Episode_name.avi', 'Series Name', 2, undef, 3, undef, 'Episode_name', 'avi'], + ['Series Name.E02-03.Episode_name.avi', 'Series Name', 2, 3, undef, undef, 'Episode_name', 'avi'], + ['Series Name.E02-E03.Episode_name.avi', 'Series Name', 2, 3, undef, undef, 'Episode_name', 'avi'], + ], + }, + { # Default Movie Support + # Perl > v5.10 + re => '^(?<movie>.*)$', + + # Perl < v5.10 + re_compat => '^(.*)$', + keys_compat => [qw(movie)], + + test_funcs => [0, 0, 0, 1], # DVD TV Episode Movie + test_keys => [qw(filename movie ext)], + test_files => [ + ['Movie.mov', 'Movie', 'mov'], + ], + #warning => 'Found year instead of season+episode', + }, +); + +############################################################################### +sub new { + my $self = bless {}; + # Read default values + for my $key (qw(file name season episode part options)) { + last unless defined $_[0]; + if (ref $_[0]) { + # Use a hashref for values + while (my ($key, $value) = each %{$_[0]}) { + $self->{$key} = $value; + } + } else { + $self->{$key} = shift; + } + } + # Seed endep/subep from passed in episode + if (defined $self->{episode}) { + $self->{endep} = $1 if $self->{episode} =~ s/-(\d+)//i; + $self->{subep} = $1 if $self->{episode} =~ s/([a-z])$//i; + } + &debug(5, "VideoFilename: $self->{file}\n"); + + # Start parsing file + my $file = $self->{file}; + $self->{dir} = $1 if $file =~ m|^(.*/)|; + $self->{filename} = $1 if $file; + $self->{ext} = lc $1 if $file =~ s/\.([0-9a-z]+)$//i; + + # Translate appropriate roman/english numbers to numerals + my $prefix = '(?:d|dvd|disc|disk|s|se|season|e|ep|episode)[\s._-]+'; + my $end = '(?:day|part)[\s._-]+'; + $file = &_allroman2int($file, $prefix, $end); + $file = &_allnum2int($file, $prefix, $end); + + # Strip out any irrelevant numbers which screw up parsing + $file =~ s/480p//; + $file =~ s/720p//; + $file =~ s/1080p//; + $file =~ s/x264//; + + # Run pre-processed filename through list of patterns + for my $pat (@filePatterns) { + if ($] >= 5.010000) { + if ($file =~ /$pat->{re}/i) { + &warning($pat->{warning}) if defined $pat->{warning}; + &debug(3, "PARSEINFO: $pat->{re}\n"); + $self->{regex} = $pat->{re}; + while (my ($key, $data) = each %-) { + $self->{$key} = $data->[0] if defined $data->[0] && !defined $self->{$key}; + } + last; + } + } else { # No named groups in regexes + my @matches; + if (@matches = ($file =~ /$pat->{re_compat}/i)) { + #print "MACTHES: ".join(',', @matches)."\n"; + &warning($pat->{warning}) if defined $pat->{warning}; + &debug(3, "PARSEINFO: $pat->{re_compat}\n"); + $self->{regex} = $pat->{re_compat}; + my $count = 0; + foreach my $key (@{$pat->{keys_compat}}) { + $self->{$key} = $matches[$count] unless defined $self->{$key}; + $count++; + } + last; + } + } + } + + # Perhaps a movie is really a name with default season or episode + if ((defined $self->{name} || defined $self->{season} || defined $self->{episode}) && defined $self->{movie}) { + $self->{name} = $self->{movie} unless defined $self->{name}; + delete $self->{movie}; + } + + # Process Series/Movie + for my $key (qw(name movie epname title)) { + if (defined $self->{$key}) { + if ($self->{$key} =~ /^.*\/(.*?)$/) { + # Get rid of any directory parts + $self->{"guess-$key"} = $self->{$key}; + # Keep the original name without '/' just in case the name contains a subdir + $self->{$key} = $1; + $self->{"guess-$key"} =~ s/[\/\s._-]+/ /; + } + $self->{$key} =~ s/[$self->{spaces}]+/ /g if defined $self->{spaces}; + $self->{$key} =~ s/^\s*(.+?)\s*$/$1/; # Remove leading/trailing separators + } + } + + # Guess part from epname + if (defined $self->{epname} && !defined $self->{part}) { + my $rmpart = 'Episode|Part|PT'; # Remove "Part #" from episode name + my $epname = &_allnum2int($self->{epname}); # Make letters into integers + if ($epname =~ /(?:$rmpart) (\d+)/i + || $epname =~ /(\d+)\s*(?:of|-)\s*\d+/i + || $epname =~ /^(\d+)/ + || $epname =~ /[\s._-](\d+)$/ + ) { + $self->{part} = $1; + } + } + + # Cosmetics + for my $key (qw(dvd season episode endep part)) { + $self->{$key} =~ s/^0+// if defined $self->{$key}; + } + $self->{endep} = undef if $self->{endep} == $self->{episode}; + + # Convenience for some developpers + if (defined $self->{season}) { + $self->{seasonepisode} = sprintf("S%02dE%02d", $self->{season}, $self->{episode}); + } elsif (defined $self->{dvd}) { + $self->{seasonepisode} = sprintf("D%02dE%02.1f", $self->{dvd}, $self->{episode}); + } + + &debug(2, '', VideoFilename=>$self); + return $self; +} + +############################################################################### +sub _num2int { + my $str = shift; + my ($n, $c, $sum) = (0, 0, 0); + while ($str) { + $str =~ s/^[\s,]+//; + debug(3, "STR=$str NUM=$n\n"); + + if ($str =~ s/^(zero|and|&)//i) { next; + } elsif ($str =~ s/^one//i) { $n += 1; + } elsif ($str =~ s/^tw(o|en)//i) { $n += 2; + } elsif ($str =~ s/^th(ree|ir)//i) { $n += 3; + } elsif ($str =~ s/^four//i) { $n += 4; + } elsif ($str =~ s/^fi(ve|f)//i) { $n += 5; + } elsif ($str =~ s/^six//i) { $n += 6; + } elsif ($str =~ s/^seven//i) { $n += 7; + } elsif ($str =~ s/^eight//i) { $n += 8; + } elsif ($str =~ s/^nine//i) { $n += 9; + } elsif ($str =~ s/^(t|te|e)en//i) { $n += 10; + } elsif ($str =~ s/^eleven//i) { $n += 11; + } elsif ($str =~ s/^twelve//i) { $n += 12; + } elsif ($str =~ s/^t?y//i) { $n *= 10; + } elsif ($str =~ s/^hundred//i) { $c += $n * 100; $n = 0; + } elsif ($str =~ s/^thousand//i) { $sum += ($c+$n) * 1000; ($c,$n) = (0,0); + } elsif ($str =~ s/^million//i) { $sum += ($c+$n) * 1000000; ($c,$n) = (0,0); + } elsif ($str =~ s/^billion//i) { $sum += ($c+$n) * 1000000000; ($c,$n) = (0,0); + } elsif ($str =~ s/^trillion//i) { $sum += ($c+$n) * 1000000000000; ($c,$n) = (0,0); + } + } + $sum += ($c+$n); + debug(2, "STR=$str SUM=$sum\n"); + return $sum; +} +sub _allnum2int { + my ($str, $prefix, $end) = @_; + + my $single = 'zero|one|two|three|five|(?:twen|thir|four|fif|six|seven|nine)(?:|teen|ty)|eight(?:|een|y)|ten|eleven|twelve'; + my $mult = 'hundred|thousand|(?:m|b|tr)illion'; + my $regex = "((?:(?:$single|$mult)(?:$single|$mult|\s|,|and|&)+)?(?:$single|$mult))"; + + if ($] >= 5.010000) { + $str =~ s/$prefix\K\b$regex\b/&_num2int($1)/egis; + $str =~ s/$end\K\b$regex$/&_num2int($1)/egis if defined $end; + } else { + $str =~ s/($prefix)\b$regex\b/"$1".&_num2int($2)/egis; + $str =~ s/($end)\b$regex$/"$1".&_num2int($2)/egis if defined $end; + } + + return $str; +} +sub _allroman2int { + my ($str, $prefix, $end) = @_; + + my $roman = '[MC]*[DC]*[CX]*[LX]*[XI]*[VI]*'; + if ($] >= 5.010000) { + $str =~ s/\b$prefix\K($roman)\b/roman2int($1)/egi; + $str =~ s/\b$end\K($roman)$/roman2int($1)/egi if defined $end; + } else { + $str =~ s/\b($prefix)($roman)\b/"$1".roman2int($2)/egi; + $str =~ s/\b($end)($roman)$/"$1".roman2int($2)/egi if defined $end; + } + return $str; +} + +############################################################################### +sub isDVDshow { + my ($self) = @_; + return defined $self->{dvd} && defined $self->{episode}; +} + +############################################################################### +sub isTVshow { + my ($self) = @_; + return defined $self->{season} && defined $self->{episode}; +} + +############################################################################### +sub isEpisode { + my ($self) = @_; + return defined $self->{episode}; +} + +############################################################################### +sub isMovie { + my ($self) = @_; + return defined $self->{movie} || defined $self->{imdb}; +} + +############################################################################### +sub testVideoFilename { + my @funcs = qw(isDVDshow isTVshow isEpisode isMovie); + for my $pat (@filePatterns) { + for my $test (@{$pat->{test_files}}) { + my $file = new($test->[0]); + # Make the correct rule fired + if ($file->{regex} ne $pat->{re}) { + print RED "PATT RE: $pat->{re}\nFILE RE: $file->{regex}\n"; + print RED "FAILED: $file->{file} (wrong rule)\n"; + print Dumper($file); exit; + } + # Make sure all the attributes were correctly parsed + my $keys = $pat->{test_keys}; + for my $i (1..8) { + my $attr = $file->{$keys->[$i]}; + my $value = $test->[$i]; + if ($attr ne $value) { + print RED "'$attr' ne '$value'\nFAILED: $file->{file}\n"; + print Dumper($file); exit; + } + &verbose(1, "'$attr' eq '$value'\n"); + } + # Make sure all the isXXXX() functions work properly + for my $i (0..$#funcs) { + unless (eval "\$file->$funcs[$i]()" == $pat->{test_funcs}->[$i]) { + print RED "\$file->$funcs[$i]() != $pat->{test_funcs}->[$i]\nFAILED: $file->{file}\n"; + print Dumper($file); exit; + } + } + print GREEN "PASSED: $file->{file}\n"; + } + } +} + +############################################################################### +__END__ + +=head1 NAME + +Video::Filename - Parse filenames for information about the video + +=head1 SYNOPSIS + + use Video::Filename; + + my $file = Video::Filename::new($filename, [$name, [$season, [$episode]]]); + my $file = Video::Filename::new($filename, { + name => 'series name', + season => 4, + episode => 5, + spaces => '\s._-', + } ); + # TV or DVD Episode + $file->{regex} + $file->{dir} + $file->{file} + $file->{name} + $file->{dvd} + $file->{season} + $file->{episode} + $file->{endep} + $file->{subep} + $file->{part} + $file->{epname} + $file->{ext} + + # Movie + $file->{movie} + $file->{year} + $file->{imdb} + $file->{title} + + $file->isDVDshow(); + $file->isTVshow(); + $file->isEpisode(); + $file->isMovie(); + + $file->testVideoFilename(); + +=head1 DESCRIPTION + +Video::Filename is used to parse information line name/season/episode and such +from a video filename. It also does a reasonable job at distinguishing a movie +from a tv episode. + +=over 4 + +=item $file = Video::Filename::new(FILENAME, [NAME, [SEASON, [EPISODE]]]); + +Parse C<FILENAME> and return a Video::Filename object containing the data. If +you specify C<NAME>, C<SEASON>, and/or C<EPISODE> it will override what is +parsed from C<FILENAME>. + +Alternatively, arguments can be passed in a hashref. This also allows the user +to specify the option of specifying characters which are replaced with spaces +in the parsed 'name', 'epname', 'movie', and 'title' fields. + + my $file = Video::Filename::new('This.is.a.name.s01e01.episode_title.avi', { + season => 4, + spaces => '\s._-', + } ); + print Dumper($file); + + $file = bless( { + 'epname' => 'episode title', + 'name' => 'This is a name', + 'file' => 'This.is.a.name.s01e01.episode_title.avi', + 'spaces' => '._', + 'seasonepisode' => 'S04E01', + 'episode' => 1, + 'ext' => 'avi', + 'season' => 4 + }, 'Video::Filename' ); + +Notice that that the season was overridden in the call to new(), so it's "4" +instead of the "1" parsed from the file name. + +=item isDVDshow(); + +Returns true if the object represents a DVD episode. + +=item isTVshow(); + +Returns true if the object represents a TV episode. + +=item isEpisode(); + +Returns true if the object represents an episode (TV or DVD). + +=item isMovie(); + +Returns true if the object represents a Movie. + +=item testVideoFilename(); + +Run a series of tests on the rules used to parse filenames. Basically a test +harness. + +=back + +=head1 COPYRIGHT + +Copyright (c) 2008 by Behan Webster. All rights reserved. + +=head1 LICENSE + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +=head1 AUTHOR + +S<Behan Webster E<lt>behanw@websterwood.comE<gt>> + +=cut + +# vim: sw=4 ts=4 diff --git a/dsa_pub.pem b/dsa_pub.pem new file mode 100755 index 0000000..548a1cb --- /dev/null +++ b/dsa_pub.pem @@ -0,0 +1,20 @@ +-----BEGIN PUBLIC KEY----- +MIIDOjCCAi0GByqGSM44BAEwggIgAoIBAQC2vgemrdI5/YleBONYcU0pzQ0OzRVj +qL4/9BhqjNTR8cP/s+llNzg8d5Dae0ZFCUK7c24Af2P4/6CqJlPpu373LTkx/O6S +rq9e4/4ayp8kNrtWkJwlZWGRTw7LAEmlNYEiMLjaZusrb90UFwr8REGVw0io2P19 +BFZNEppTCGdWFF2MybTGOxlyX+8wykZ4sHTvv7JBIFpTq1Cli3dFBsawX0UzEcic +kP6A6M1xR2f5w94OGgWqrDkxvNMpFOT2Ss33u5+LxVzLtySs6We+JZar+9XFxVDg +Zdh+ozGqZ/yGPKqIm8z5f0xnQ1m2Awj51cr9nIf421L683NYKlJ5dy6fAhUAyTrv +YaUxuYdEcDyEZlhlGS9Q1skCggEAUWBw5ekSq7e6uEvBoa5J6DUtng+cTHIim8O7 +aBQXk9r+yorezo04o1RUJh78d0i3riZiVNSOhSOpIFKS9zQfa5MxiPpBU5h1/KA/ +sQoAgXZESb7MFQyP8KQ6YytbmLL95dC/Mr312FDYPwj5lp9XyYQBvy5Zrd7MWKgL +D6bGH/i1uOcMJSLal11Fk22aLtfM+4AB3tE1npNicKnymPPgrEHqb2LKzAurZSpP +waGwq/hp8i2Fcf5Mz9wuZmgOpP/wjMqVA8rC3TrKops46EtopezSlCnnXkzd0xDN +qMbV12mGD2uo/060bdMDZ5jzNm9g2CporubRpUBEl8NYIlLGzAOCAQUAAoIBACLk +ZKeizCMfe2Zb+oAMni8PWIbx7rj8pYDyaO+QUvj+2eJo+p4z2xF6FYh5hNkNge9C +UaFHpFbldnJ2qMCp4SNEKoyN/LejsCnZU0wpd+QLwhZJghjmIs9SPa747hO9v7aS +1nOpyfuAbw44IXjwQ2GUXd4+Ea+UT8TqnuOrdwRIQxWyiBx5EkFvhj/ufdjxVhX8 +Kam5vQwNYxf1lflRIN3we8P0plZ9jVHFvhr4IgI02svDPH2xA8pIZZCHLuvnWekk +nj3umRwW1AteIw7FlIwBI4yWWK5MDIKh6kFT0BAx+GLsfriVcJ/iOAR5/0E4IUyj +H3BPUk2HAc34mOQiQOE= +-----END PUBLIC KEY----- diff --git a/iTunesStores.json b/iTunesStores.json new file mode 100755 index 0000000..b6caf31 --- /dev/null +++ b/iTunesStores.json @@ -0,0 +1,27 @@ +[ + {"storeCode": 143441, "country3": "USA", "country2": "US", "language2": "EN", "language": "English", "season": "season", "country": "USA"}, + {"storeCode": 143460, "country3": "AUS", "country2": "AU", "language2": "EN", "language": "English", "season": "season", "country": "Australia"}, + {"storeCode": 143446, "country3": "BEL", "country2": "BE", "language2": "NL", "language": "Nederlands", "season": "", "country": "België"}, + {"storeCode": 143446, "country3": "BEL", "country2": "BE", "language2": "FR", "language": "Français", "season": "saison", "country": "Belgique"}, + {"storeCode": 143503, "country3": "BRA", "country2": "BR", "language2": "PT", "language": "Português", "season": "", "country": "Brasil"}, + {"storeCode": 143455, "country3": "CAN", "country2": "CA", "language2": "EN", "language": "English", "season": "season", "country": "Canada"}, + {"storeCode": 143455, "country3": "CAN", "country2": "CA", "language2": "FR", "language": "Français", "season": "saison", "country": "Canada"}, + {"storeCode": 143458, "country3": "DNK", "country2": "DK", "language2": "DA", "language": "Dansk", "season": "", "country": "Danmark"}, + {"storeCode": 143443, "country3": "DEU", "country2": "DE", "language2": "DE", "language": "Deutsch", "season": "staffel", "country": "Deutschland"}, + {"storeCode": 143454, "country3": "ESP", "country2": "ES", "language2": "ES", "language": "Español", "season": "", "country": "España"}, + {"storeCode": 143442, "country3": "FRA", "country2": "FR", "language2": "FR", "language": "Français", "season": "saison", "country": "France"}, + {"storeCode": 143448, "country3": "GRC", "country2": "GR", "language2": "HE", "language": "ελληνικά", "season": "", "country": "Greece"}, + {"storeCode": 143449, "country3": "IRL", "country2": "IE", "language2": "EN", "language": "English", "season": "season", "country": "Ireland"}, + {"storeCode": 143450, "country3": "ITA", "country2": "IT", "language2": "IT", "language": "Italiano", "season": "", "country": "Italia"}, + {"storeCode": 143462, "country3": "JPN", "country2": "JP", "language2": "JA", "language": "日本語", "season": "", "country": "日本"}, + {"storeCode": 143451, "country3": "LUX", "country2": "LU", "language2": "FR", "language": "Français", "season": "saison", "country": "Luxembourg"}, + {"storeCode": 143452, "country3": "NLD", "country2": "NL", "language2": "NL", "language": "Nederlands", "season": "", "country": "Nederland"}, + {"storeCode": 143461, "country3": "NZL", "country2": "NZ", "language2": "EN", "language": "English", "season": "season", "country": "New Zealand"}, + {"storeCode": 143457, "country3": "NOR", "country2": "NO", "language2": "NO", "language": "Norsk", "season": "", "country": "Norge"}, + {"storeCode": 143453, "country3": "PRT", "country2": "PT", "language2": "PT", "language": "Português", "season": "", "country": "Portugal"}, + {"storeCode": 143459, "country3": "CHE", "country2": "CH", "language2": "DE", "language": "Deutsch", "season": "staffel", "country": "Schweiz"}, + {"storeCode": 143459, "country3": "CHE", "country2": "CH", "language2": "FR", "language": "Français", "season": "saison", "country": "Suisse"}, + {"storeCode": 143447, "country3": "FIN", "country2": "FI", "language2": "FI", "language": "Suomi", "season": "", "country": "Suomi"}, + {"storeCode": 143456, "country3": "SWE", "country2": "SE", "language2": "SV", "language": "Svenska", "season": "", "country": "Sverige"}, + {"storeCode": 143444, "country3": "GBR", "country2": "GB", "language2": "EN", "language": "English", "season": "season", "country": "UK"} +] \ No newline at end of file diff --git a/images/EncodeCanceled.png b/images/EncodeCanceled.png new file mode 100755 index 0000000..9e30bd5 Binary files /dev/null and b/images/EncodeCanceled.png differ diff --git a/images/EncodeCanceled@2x.png b/images/EncodeCanceled@2x.png new file mode 100755 index 0000000..8e0c394 Binary files /dev/null and b/images/EncodeCanceled@2x.png differ diff --git a/images/EncodeComplete.png b/images/EncodeComplete.png new file mode 100755 index 0000000..f4b8515 Binary files /dev/null and b/images/EncodeComplete.png differ diff --git a/images/EncodeComplete@2x.png b/images/EncodeComplete@2x.png new file mode 100755 index 0000000..e5ef554 Binary files /dev/null and b/images/EncodeComplete@2x.png differ diff --git a/images/EncodeWorking.png b/images/EncodeWorking.png new file mode 100755 index 0000000..200606b Binary files /dev/null and b/images/EncodeWorking.png differ diff --git a/images/Subler.icns b/images/Subler.icns new file mode 100755 index 0000000..b8b96de Binary files /dev/null and b/images/Subler.icns differ diff --git a/images/ToolbarActionTemplate.png b/images/ToolbarActionTemplate.png new file mode 100755 index 0000000..8cb20a1 Binary files /dev/null and b/images/ToolbarActionTemplate.png differ diff --git a/images/ToolbarRemoveTemplate.png b/images/ToolbarRemoveTemplate.png new file mode 100755 index 0000000..033e1f3 Binary files /dev/null and b/images/ToolbarRemoveTemplate.png differ diff --git a/images/ToolbarRemoveTemplate@2x.png b/images/ToolbarRemoveTemplate@2x.png new file mode 100755 index 0000000..5f7d1af Binary files /dev/null and b/images/ToolbarRemoveTemplate@2x.png differ diff --git a/images/close-over.pdf b/images/close-over.pdf new file mode 100755 index 0000000..07a47c6 Binary files /dev/null and b/images/close-over.pdf differ diff --git a/images/close-pressed.pdf b/images/close-pressed.pdf new file mode 100755 index 0000000..7ecaed7 Binary files /dev/null and b/images/close-pressed.pdf differ diff --git a/images/close.pdf b/images/close.pdf new file mode 100755 index 0000000..7108f98 Binary files /dev/null and b/images/close.pdf differ diff --git a/images/info-over.pdf b/images/info-over.pdf new file mode 100755 index 0000000..19ecb9f Binary files /dev/null and b/images/info-over.pdf differ diff --git a/images/info-pressed.pdf b/images/info-pressed.pdf new file mode 100755 index 0000000..8d7e328 Binary files /dev/null and b/images/info-pressed.pdf differ diff --git a/images/info.pdf b/images/info.pdf new file mode 100755 index 0000000..175c7a0 Binary files /dev/null and b/images/info.pdf differ diff --git a/images/tmdb-logo.png b/images/tmdb-logo.png new file mode 100755 index 0000000..c8f39f2 Binary files /dev/null and b/images/tmdb-logo.png differ diff --git a/images/tvdb-logo.png b/images/tvdb-logo.png new file mode 100755 index 0000000..0b13a83 Binary files /dev/null and b/images/tvdb-logo.png differ diff --git a/license.txt b/license.txt new file mode 100755 index 0000000..54ea686 --- /dev/null +++ b/license.txt @@ -0,0 +1,343 @@ +Subler is distributed under the GNU public license, found below. Please see the +bottom of this document for any other licenses applicable to code used within Subler. +-------------------------------------------------------------------- + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. \ No newline at end of file diff --git a/main.m b/main.m new file mode 100755 index 0000000..53a18b1 --- /dev/null +++ b/main.m @@ -0,0 +1,14 @@ +// +// main.m +// Subler +// +// Created by Damiano Galassi on 29/01/09. +// Copyright Damiano Galassi 2009 . All rights reserved. +// + +#import <Cocoa/Cocoa.h> + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **) argv); +}