Changeset 91

Show
Ignore:
Timestamp:
06/30/07 17:04:56 (2 years ago)
Author:
pmerrill
Message:

--File Name added to import screen

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/SapphireMetaData.m

    r90 r91  
    2020 
    2121//File Specific Keys 
    22 #define MODIFIED_KEY                    @"Modified" 
    23 #define WATCHED_KEY                             @"Watched" 
    24 #define FAVORITE_KEY                    @"Favorite" 
    25 #define RESUME_KEY                              @"Resume Time" 
    26 #define SIZE_KEY                                @"Size" 
    27 #define DURATION_KEY                    @"Duration" 
    28 #define AUDIO_DESC_KEY                  @"Audio Description" 
    29 #define SAMPLE_RATE_KEY                 @"Sample Rate" 
    30 #define VIDEO_DESC_KEY                  @"Video Description" 
     22#define MODIFIED_KEY                                   @"Modified" 
     23#define WATCHED_KEY                                    @"Watched" 
     24#define FAVORITE_KEY                                   @"Favorite" 
     25#define RESUME_KEY                                     @"Resume Time" 
     26#define SIZE_KEY                                               @"Size" 
     27#define DURATION_KEY                                   @"Duration" 
     28#define AUDIO_DESC_KEY                         @"Audio Description" 
     29#define SAMPLE_RATE_KEY                        @"Sample Rate" 
     30#define VIDEO_DESC_KEY                         @"Video Description" 
    3131 
    3232//TV Show Specific Keys 
    33 #define EPISODE_NUMBER_KEY              @"Episode Number" 
    34 #define EPISODE_TITLE_KEY               @"Episode Title" 
    35 #define SEASON_NUMBER_KEY               @"Season" 
    36 #define SHOW_NAME_KEY                   @"Show Name" 
    37 #define SHOW_DESCRIPTION_KEY    @"Show Description" 
    38 #define SHOW_AIR_DATE                   @"Air Date" 
     33#define EPISODE_NUMBER_KEY                      @"Episode Number" 
     34#define EPISODE_TITLE_KEY                               @"Episode Title" 
     35#define SEASON_NUMBER_KEY                       @"Season" 
     36#define SHOW_NAME_KEY                           @"Show Name" 
     37#define SHOW_DESCRIPTION_KEY            @"Show Description" 
     38#define SHOW_AIR_DATE                           @"Air Date" 
     39 
     40//ATV Extra Info 
     41#define SHOW_BROADCASTER_KEY            @"Broadcast Company" 
     42#define SHOW_PUBLISHED_DATE_KEY @"Published Date" 
     43#define SHOW_AQUIRED_DATE                       @"Date Aquired" 
     44#define SHOW_RATING_KEY                         @"Rating" 
     45#define SHOW_FAVORITE_RATING            @"User Rating" 
     46 
     47//IMDB Type Info 
    3948 
    4049 
     
    273282        } 
    274283        return NO; 
     284} 
     285 
     286- (BOOL)hasXMLMetaData:(NSString *)file 
     287{ 
     288//      NSString *extension = [file pathExtension] ; 
     289 
     290        return FALSE ; 
    275291} 
    276292 
  • trunk/SapphirePopulateDataMenu.h

    r81 r91  
    2121        BRTextControl                                   *text; 
    2222        BRTextControl                                   *fileProgress; 
     23        BRTextControl                                   *currentFile; 
    2324        BRProgressBarWidget                     *bar; 
    2425 
  • trunk/SapphirePopulateDataMenu.m

    r84 r91  
    4343        text = [[BRTextControl alloc] initWithScene: scene]; 
    4444        fileProgress = [[BRTextControl alloc] initWithScene: scene]; 
     45        currentFile = [[BRTextControl alloc] initWithScene: scene]; 
    4546         
    4647        bar = [[BRProgressBarWidget alloc] initWithScene: scene]; 
     
    5960        [self addControl: text]; 
    6061        [self addControl: fileProgress] ; 
     62        [self addControl: currentFile] ; 
    6163        [[self masterLayer] addSublayer:bar]; 
    6264        [self addControl: button]; 
     
    9193         
    9294        NSRect frame; 
    93 //      frame.origin.x =  (master.size.width - progressSize.width) * 0.2f; 
    94         frame.origin.x =  (master.size.width) * 0.2f; 
    95         frame.origin.y = (master.size.height * 0.00f - progressSize.height) + master.size.height * 0.25f/0.8f; 
     95        frame.origin.x =  (master.size.width) * 0.05f; 
     96        frame.origin.y = (master.size.height * 0.1f - progressSize.height) ; 
    9697        frame.size = progressSize; 
    9798        [fileProgress setFrame:frame]; 
     99} 
     100 
     101- (void)setCurrentFile:(NSString *)theCurrentFile 
     102{ 
     103        [currentFile setTextAttributes:[[BRThemeInfo sharedTheme] paragraphTextAttributes]]; 
     104        [currentFile setText:theCurrentFile]; 
     105         
     106        NSRect master = [[self masterLayer] frame]; 
     107        [currentFile setMaximumSize:NSMakeSize(master.size.width * 9.0f/10.0f, master.size.height * 0.3f)]; 
     108        NSSize currentFileSize = [currentFile renderedSize]; 
     109         
     110        NSRect frame; 
     111        frame.origin.x =  (master.size.width) * 0.05f; 
     112        frame.origin.y = (master.size.height * 0.07f - currentFileSize.height) ; 
     113        frame.size = currentFileSize; 
     114        [currentFile setFrame:frame]; 
    98115} 
    99116 
     
    119136        updated = 0 ; 
    120137        current = 0; 
    121 //      [self setFileProgress:@"File Progress:  <Checking> "]; 
    122 //      [[self scene] renderScene]; 
    123138        max = [importItems count]; 
    124139        importTimer = [NSTimer scheduledTimerWithTimeInterval:0.0f target:self selector:@selector(importNextItem:) userInfo:nil repeats:YES]; 
     
    128143{ 
    129144        SapphireFileMetaData *fileMeta = [importItems objectAtIndex:0]; 
     145        NSString * fileName=[[fileMeta path] lastPathComponent] ; 
     146        current++ ; 
     147        [self setCurrentFile:[NSString stringWithFormat:@"Current File: %@",fileName]]; 
     148        [self setFileProgress:[NSString stringWithFormat:@"File Progress: %0.0f / %0.0f", current, max,updated]]; 
    130149        if([fileMeta updateMetaData])updated++; 
     150         
    131151        [importItems removeObjectAtIndex:0]; 
    132         current++ ; 
    133         [self setFileProgress:[NSString stringWithFormat:@"File Progress: %0.0f / %0.0f", current, max,updated]]; 
    134152        [bar setPercentage:current/max * 100.0f]; 
    135153         
     
    143161                [title setTitle: @"Import Complete"]; 
    144162                [self setFileProgress:[NSString stringWithFormat:@"Updated %0.0f Entries.", updated]]; 
     163                [self setCurrentFile:@""]; 
    145164                [self setText:@"Sapphire will continue to import new files as it encounters them.  You may initiate this import again at any time, and any new or changed files will be imported"]; 
    146165                [[self scene] renderScene]; 
     
    161180        [self setText:@"This will populate Sapphire's Meta data.  This proceedure may take a while, but you may cancel at any time"]; 
    162181        [self setFileProgress:@" "]; 
     182        [self setCurrentFile:@" "] ; 
    163183        [bar setPercentage:0.0f]; 
    164184        [button setTitle: @"Import Meta Data"];