Changeset 470
- Timestamp:
- 01/29/08 17:00:49 (1 year ago)
- Files:
-
- trunk/SapphireFrappliance/SapphireMediaPreview.h (modified) (1 diff)
- trunk/SapphireFrappliance/SapphireMediaPreview.m (modified) (4 diffs)
- trunk/SapphireFrappliance/SapphireMetaData.h (modified) (1 diff)
- trunk/SapphireFrappliance/SapphireSettings.h (modified) (1 diff)
- trunk/SapphireFrappliance/SapphireSettings.m (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/SapphireFrappliance/SapphireMediaPreview.h
r461 r470 42 42 */ 43 43 - (void)setMetaData:(SapphireMetaData *)newMeta inMetaData:(SapphireDirectoryMetaData *)dir; 44 - (void)setUtilityData:(NSMutableDictionary *)newMeta; 44 45 45 46 @end trunk/SapphireFrappliance/SapphireMediaPreview.m
r469 r470 97 97 } 98 98 99 - (void)setUtilityData:(NSMutableDictionary *)newMeta 100 { 101 [meta release]; 102 meta=[newMeta retain]; 103 SapphireMedia *asset =[SapphireMedia alloc]; 104 [asset setImagePath:[[NSBundle bundleForClass:[self class]] pathForResource:@"DefaultPreview" ofType:@"png"]]; 105 [self setAsset:asset]; 106 107 } 108 99 109 - (void)setMetaData:(SapphireMetaData *)newMeta inMetaData:(SapphireDirectoryMetaData *)dir 100 110 { … … 327 337 328 338 /*! 339 * @brief populate utility data 340 */ 341 - (void)populateUtilityDataWith:(NSMutableDictionary *)allMeta 342 { 343 BRMetadataLayer *metaLayer = [self gimmieMetadataLayer]; 344 /* Get the setting name */ 345 NSString *value = [allMeta objectForKey:META_TITLE_KEY]; 346 if(value != nil) 347 [metaLayer setTitle:value]; 348 /*Get the setting description*/ 349 value = [allMeta objectForKey:META_DESCRIPTION_KEY]; 350 if(value != nil) 351 [metaLayer setSummary:value]; 352 } 353 354 /*! 329 355 * @brief populate generic file data 330 356 */ … … 451 477 /*Get our data then*/ 452 478 NSArray *order = nil; 453 NSMutableDictionary *allMeta = [meta getDisplayedMetaDataInOrder:&order]; 454 479 NSMutableDictionary *allMeta = nil; 455 480 FileClass fileClass=FILE_CLASS_UNKNOWN ; 456 if([meta isKindOfClass:[SapphireDirectoryMetaData class]]) 457 fileClass=FILE_CLASS_NOT_FILE; 458 else 459 fileClass=(FileClass)[(SapphireFileMetaData *) meta fileClass]; 481 if([meta respondsToSelector:@selector(getDisplayedMetaDataInOrder:)]) 482 { 483 allMeta=[meta getDisplayedMetaDataInOrder:&order]; 484 if([meta isKindOfClass:[SapphireDirectoryMetaData class]]) 485 fileClass=FILE_CLASS_NOT_FILE; 486 else 487 fileClass=(FileClass)[(SapphireFileMetaData *) meta fileClass]; 488 } 489 if(!allMeta) 490 fileClass=FILE_CLASS_UTILITY; 460 491 461 462 492 BRMetadataLayer *metaLayer = [self gimmieMetadataLayer]; 463 493 /* TV Show Preview Handeling */ … … 470 500 { 471 501 [self populateMovieMetadataWith:allMeta]; 502 } 503 /* Utility Preview Handeling */ 504 else if(fileClass == FILE_CLASS_UTILITY) 505 { 506 [self populateUtilityDataWith:(NSMutableDictionary *)meta]; 472 507 } 473 508 else if(fileClass != FILE_CLASS_NOT_FILE) trunk/SapphireFrappliance/SapphireMetaData.h
r461 r470 88 88 #define FILE_CONTAINER_TYPE_KEY @"File Container Type" 89 89 typedef enum { 90 FILE_CLASS_UTILITY= -2, 90 91 FILE_CLASS_NOT_FILE= -1, 91 92 FILE_CLASS_UNKNOWN = 0, trunk/SapphireFrappliance/SapphireSettings.h
r461 r470 30 30 @interface SapphireSettings : SapphireMediaMenuController 31 31 { 32 NSArray *names; /*!< @brief The menu names in order*/ 33 NSArray *keys; /*!< @brief The setting keys, in order*/ 34 NSArray *gems; /*!< @brief The left icons, in order*/ 35 NSMutableDictionary *options; /*!< @brief The settings, in order*/ 36 NSString *path; /*!< @brief The persistent store path*/ 37 NSDictionary *defaults; /*!< @brief The default settings, in order*/ 38 SapphireMetaDataCollection *metaCollection; /*!< @brief The collection*/ 32 NSArray *names; /*!< @brief The menu names in order*/ 33 NSArray *settingDescriptions; /*!< @brief The menu names in order*/ 34 NSArray *keys; /*!< @brief The setting keys, in order*/ 35 NSArray *gems; /*!< @brief The left icons, in order*/ 36 NSMutableDictionary *options; /*!< @brief The settings, in order*/ 37 NSString *path; /*!< @brief The persistent store path*/ 38 NSDictionary *defaults; /*!< @brief The default settings, in order*/ 39 SapphireMetaDataCollection *metaCollection; /*!< @brief The collection*/ 39 40 } 40 41 trunk/SapphireFrappliance/SapphireSettings.m
r461 r470 24 24 #import "SapphireSettings.h" 25 25 #import "SapphireTheme.h" 26 #import "SapphireMediaPreview.h" 26 27 #import "SapphireAllFileDataImporter.h" 27 28 #import "SapphireTVShowImporter.h" … … 91 92 BRLocalizedString(@" Disable Anonymous Reporting", @"Disable the anonymous reporting for aid in future features"), nil]; 92 93 94 settingDescriptions=[[NSArray alloc] initWithObjects: 95 BRLocalizedString(@"tells Sapphire to examine all files, and remember the file size, length and other information that can be gathered from the file itself.", @"Populate File Data description"), 96 BRLocalizedString(@"tells Sapphire that for every TV episode, gather more information about this episode from the internet.", @"Fetch TV Show Data description"), 97 BRLocalizedString(@"tells Sapphire that for every Movie, gather more information from the internet.", @"Fetch Movie Data description"), 98 /* BRLocalizedString(@"Choose Movie Posters", @"Start Poster Chooser description"),*/ 99 BRLocalizedString(@"allows the user to specify which collections should be hidden from Sapphire's main menu.", @"Hide Collections description"), 100 BRLocalizedString(@"allows to user to specify which collections should be skipped when importing meta data.", @"Don't Import Collections description"), 101 BRLocalizedString(@"tells Sapphire that when changing filter settings, skip over the favorite shows filter.", @"Skip Favorite shows description"), 102 /* BRLocalizedString(@"Skip \"Top Shows\" filter", @"Skip Top shows description"),*/ 103 BRLocalizedString(@"tells Sapphire that when changing filter settings, skip over the unwatched shows filter.", @"Skip Unwatched shows description"), 104 BRLocalizedString(@"tells Sapphire to disable the display of the show's synopsis.", @"Hide show summarys description"), 105 BRLocalizedString(@"tells Sapphire to disable the display of audio codec and sample rate information.", @"Hide perian audio info description"), 106 BRLocalizedString(@"tells Sapphire to disable the display of video codec, resolution, and color depth information.", @"Hide perian video info description"), 107 BRLocalizedString(@"tells Sapphire to automatically choose posters for movies instead of asking the user to choose one.", @"Hide poster chooser description"), 108 BRLocalizedString(@"tells Sapphire to hide the main menu element forcing frontrow to quit.", @"Hide the ui quitter description"), 109 BRLocalizedString(@"tells Sapphire that when using a filter, use the cached data to setup directories rather than scanning the directories themselves for new files.", @"Fast Directory Switching description"), 110 BRLocalizedString(@"tells Sapphire that you have an AC3 decoder and to enable passthrough of the full audio information to the decoder. This is how you get 5.1 output.", @"Enable AC3 Passthrough description"), 111 BRLocalizedString(@"tells Sapphire to not report any anonymous information on how you use Sapphire. Anonymous reporting enables us to improve the plugin for future use.", @"Disable the anonymous reporting description"), nil]; 112 93 113 keys = [[NSArray alloc] initWithObjects: @"", 94 114 @"", … … 479 499 // If subclassing BRMediaMenuController, this function is called when the selection cursor 480 500 // passes over an item. 501 if(item >= [names count]) 502 return nil; 503 else 504 { 505 /* Get setting name & kill the gem cushion */ 506 NSString *settingName = [[names objectAtIndex:item]substringFromIndex:2]; 507 NSString *settingDescription=[settingDescriptions objectAtIndex:item]; 508 /* Construct a gerneric metadata asset for display */ 509 NSMutableDictionary *settingMeta=[[NSMutableDictionary alloc] init]; 510 [settingMeta setObject:settingName forKey:META_TITLE_KEY]; 511 [settingMeta setObject:[NSNumber numberWithInt:FILE_CLASS_UTILITY] forKey:FILE_CLASS_KEY]; 512 [settingMeta setObject:settingDescription forKey:META_DESCRIPTION_KEY]; 513 SapphireMediaPreview *preview = [[SapphireMediaPreview alloc] initWithScene:[self scene]]; 514 [preview setUtilityData:settingMeta]; 515 [preview setShowsMetadataImmediately:YES]; 516 /*And go*/ 517 return [preview autorelease]; 518 } 519 481 520 return ( nil ); 482 521 }
