source: trunk/SapphireMetaData.h @ 201

Revision 201, 5.2 KB checked in by gbooker, 7 years ago (diff)

Changed all www.nanopi.net to www.nanopi.net

Line 
1//
2//  SapphireMetaData.h
3//  Sapphire
4//
5//  Created by Graham Booker on 6/22/07.
6//  Copyright 2007 www.nanopi.net. All rights reserved.
7//
8
9#import <Cocoa/Cocoa.h>
10#import "SapphirePredicates.h"
11
12#define META_TVRAGE_IMPORT_KEY                  @"TVRage Source"
13#define META_XML_IMPORT_KEY                             @"XML Source"
14
15//TV Show Specific Keys
16#define META_TITLE_KEY                                  @"Title"
17#define META_SEASON_NUMBER_KEY                  @"Season"
18#define META_EPISODE_NUMBER_KEY                 @"Episode"
19#define META_SHOW_NAME_KEY                              @"Show Name"
20#define META_DESCRIPTION_KEY                    @"Show Description"
21#define META_SHOW_AIR_DATE                              @"Air Date"
22#define META_RATING_KEY                                 @"Rating"
23#define META_SUMMARY_KEY                                @"Summary"
24#define META_ABSOLUTE_EP_NUMBER_KEY             @"Episode Number"
25#define META_SHOW_IDENTIFIER_KEY                @"Show ID"
26
27//ATV Extra Info
28#define META_SHOW_BROADCASTER_KEY               @"Broadcast Company"
29#define META_SHOW_PUBLISHED_DATE_KEY    @"Published Date"
30#define META_SHOW_AQUIRED_DATE                  @"Date Aquired"
31#define META_SHOW_RATING_KEY                    @"Rating"
32#define META_SHOW_FAVORITE_RATING_KEY   @"User Rating"
33#define META_COPYRIGHT_KEY                              @"Copyright"
34
35//IMDB Type Info
36
37//Special Display Only Info
38#define META_EPISODE_AND_SEASON_KEY             @"S/E"
39
40typedef enum {
41        FILE_CLASS_UNKNOWN = 0,
42        FILE_CLASS_TV_SHOW = 1,
43        FILE_CLASS_MOVIE = 2,
44} FileClass;
45
46@class SapphireMetaData, SapphireMetaDataCollection, SapphireFileMetaData, SapphireDirectoryMetaData;
47
48@protocol SapphireMetaDataDelegate <NSObject>
49- (void)updateCompleteForFile:(NSString *)file;
50@end
51
52@protocol SapphireMetaDataScannerDelegate <NSObject>
53- (void)gotSubFiles:(NSArray *)subs;
54- (void)scanningDir:(NSString *)dir;
55- (BOOL)getSubFilesCanceled;
56@end
57
58@interface SapphireMetaData : NSObject {
59        NSMutableDictionary                             *metaData;
60        SapphireMetaData                                *parent;
61        /* These two are not retained */
62        NSString                                                *path;
63        id <SapphireMetaDataDelegate>   delegate;
64}
65
66+ (NSSet *)videoExtensions;
67+ (NSSet *)audioExtensions;
68- (NSString *)path;
69
70- (void)setDelegate:(id <SapphireMetaDataDelegate>)newDelegate;
71- (void)writeMetaData;
72- (SapphireMetaDataCollection *)collection;
73- (NSMutableDictionary *)getDisplayedMetaDataInOrder:(NSArray * *)order;
74
75@end
76
77@interface SapphireMetaDataCollection : SapphireMetaData {
78        NSMutableDictionary                     *directories;
79        NSMutableDictionary                     *skipCollection;
80        NSMutableDictionary                     *hideCollection;
81        NSString                                        *dictionaryPath;
82        BOOL                                            importing;
83}
84- (id)initWithFile:(NSString *)dictionary;
85- (SapphireDirectoryMetaData *)directoryForPath:(NSString *)path;
86- (NSArray *)collectionDirectories;
87- (void)setImporting:(BOOL)isImporting;
88- (BOOL)hideCollection:(NSString *)collection;
89- (void)setHide:(BOOL)hide forCollection:(NSString *)collection;
90- (BOOL)skipCollection:(NSString *)collection;
91- (void)setSkip:(BOOL)skip forCollection:(NSString *)collection;
92
93@end
94
95@interface SapphireDirectoryMetaData : SapphireMetaData {
96        /*These two are not retained*/
97        NSMutableDictionary                     *metaFiles;
98        NSMutableDictionary                     *metaDirs;
99       
100        NSMutableDictionary                     *cachedMetaFiles;
101        NSMutableDictionary                     *cachedMetaDirs;
102
103        NSMutableArray                          *files;
104        NSMutableArray                          *directories;
105       
106        NSTimer                                         *importTimer;
107        NSMutableArray                          *importArray;
108        BOOL                                            scannedDirectory;
109       
110        /*This is not retained*/
111        SapphireMetaDataCollection      *collection;
112}
113
114- (void)reloadDirectoryContents;
115- (NSArray *)files;
116- (NSArray *)directories;
117- (NSArray *)predicatedFiles:(SapphirePredicate *)predicate;
118- (NSArray *)predicatedDirectories:(SapphirePredicate *)predicate;
119
120- (SapphireFileMetaData *)metaDataForFile:(NSString *)file;
121- (SapphireDirectoryMetaData *)metaDataForDirectory:(NSString *)dir;
122
123- (BOOL)pruneMetaData;
124- (BOOL)updateMetaData;
125
126- (void)cancelImport;
127- (void)resumeImport;
128- (void)resumeDelayedImport;
129
130- (SapphireMetaData *)metaDataForSubPath:(NSString *)path;
131- (void)getSubFileMetasWithDelegate:(id <SapphireMetaDataScannerDelegate>)subDelegate skipDirectories:(NSMutableSet *)skip;
132- (void)scanForNewFilesWithDelegate:(id <SapphireMetaDataScannerDelegate>)subDelegate skipDirectories:(NSMutableSet *)skip;
133
134- (BOOL)watchedForPredicate:(SapphirePredicate *)predicate;
135- (void)setWatched:(BOOL)watched forPredicate:(SapphirePredicate *)predicate;
136- (BOOL)favoriteForPredicate:(SapphirePredicate *)predicate;
137- (void)setFavorite:(BOOL)favorite forPredicate:(SapphirePredicate *)predicate;
138- (void)setToImportFromSource:(NSString *)source forPredicate:(SapphirePredicate *)predicate;
139- (void)setFileClass:(FileClass)fileClass forPredicate:(SapphirePredicate *)predicate;
140
141@end
142
143@interface SapphireFileMetaData : SapphireMetaData {
144        NSDictionary            *combinedInfo;
145}
146
147- (BOOL) updateMetaData;
148
149- (int)modified;
150- (BOOL)watched;
151- (void)setWatched:(BOOL)watched;
152- (BOOL)favorite;
153- (void)setFavorite:(BOOL)favorite;
154- (long)importedTimeFromSource:(NSString *)source;
155- (void)setToImportFromSource:(NSString *)source;
156- (void)importInfo:(NSMutableDictionary *)newMeta fromSource:(NSString *)source withTime:(long)modTime;
157- (unsigned int)resumeTime;
158- (void)setResumeTime:(unsigned int)resumeTime;
159- (FileClass)fileClass;
160- (void)setFileClass:(FileClass)fileClass;
161
162- (long long)size;
163- (float)duration;
164- (Float64)sampleRate;
165- (UInt32)audioFormatID;
166- (BOOL)hasVideo;
167- (int)episodeNumber;
168- (int)seasonNumber;
169- (NSString *)episodeTitle;
170- (NSString *)showID;
171- (NSString *)showName;
172- (NSString *)sizeString;
173
174@end
Note: See TracBrowser for help on using the repository browser.