source: trunk/SapphireMetaData.h @ 168

Revision 168, 4.6 KB checked in by gbooker, 7 years ago (diff)

Corrected sample rate information.

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- (NSString *)path;
67
68- (void)setDelegate:(id <SapphireMetaDataDelegate>)newDelegate;
69- (void)writeMetaData;
70- (SapphireMetaDataCollection *)collection;
71- (NSMutableDictionary *)getDisplayedMetaDataInOrder:(NSArray * *)order;
72
73@end
74
75@interface SapphireMetaDataCollection : SapphireMetaData {
76        NSMutableDictionary                     *directories;
77        NSString                                        *dictionaryPath;
78        BOOL                                            importing;
79}
80- (id)initWithFile:(NSString *)dictionary;
81- (SapphireDirectoryMetaData *)directoryForPath:(NSString *)path;
82- (void)setImporting:(BOOL)isImporting;
83
84@end
85
86@interface SapphireDirectoryMetaData : SapphireMetaData {
87        /*These two are not retained*/
88        NSMutableDictionary                     *metaFiles;
89        NSMutableDictionary                     *metaDirs;
90       
91        NSMutableDictionary                     *cachedMetaFiles;
92        NSMutableDictionary                     *cachedMetaDirs;
93
94        NSMutableArray                          *files;
95        NSMutableArray                          *directories;
96       
97        NSTimer                                         *importTimer;
98        NSMutableArray                          *importArray;
99        BOOL                                            scannedDirectory;
100       
101        /*This is not retained*/
102        SapphireMetaDataCollection      *collection;
103}
104
105- (void)reloadDirectoryContents;
106- (NSArray *)files;
107- (NSArray *)directories;
108- (NSArray *)predicatedFiles:(SapphirePredicate *)predicate;
109- (NSArray *)predicatedDirectories:(SapphirePredicate *)predicate;
110
111- (SapphireFileMetaData *)metaDataForFile:(NSString *)file;
112- (SapphireDirectoryMetaData *)metaDataForDirectory:(NSString *)dir;
113
114- (BOOL)pruneMetaData;
115- (BOOL)updateMetaData;
116
117- (void)cancelImport;
118- (void)resumeImport;
119- (void)resumeDelayedImport;
120
121- (SapphireMetaData *)metaDataForSubPath:(NSString *)path;
122- (void)getSubFileMetasWithDelegate:(id <SapphireMetaDataScannerDelegate>)subDelegate skipDirectories:(NSMutableSet *)skip;
123- (void)scanForNewFilesWithDelegate:(id <SapphireMetaDataScannerDelegate>)subDelegate skipDirectories:(NSMutableSet *)skip;
124
125- (BOOL)watchedForPredicate:(SapphirePredicate *)predicate;
126- (void)setWatched:(BOOL)watched forPredicate:(SapphirePredicate *)predicate;
127- (BOOL)favoriteForPredicate:(SapphirePredicate *)predicate;
128- (void)setFavorite:(BOOL)favorite forPredicate:(SapphirePredicate *)predicate;
129- (void)setToImportFromSource:(NSString *)source forPredicate:(SapphirePredicate *)predicate;
130
131@end
132
133@interface SapphireFileMetaData : SapphireMetaData {
134        NSDictionary            *combinedInfo;
135}
136
137- (BOOL) updateMetaData;
138
139- (int)modified;
140- (BOOL)watched;
141- (void)setWatched:(BOOL)watched;
142- (BOOL)favorite;
143- (void)setFavorite:(BOOL)favorite;
144- (long)importedTimeFromSource:(NSString *)source;
145- (void)setToImportFromSource:(NSString *)source;
146- (void)importInfo:(NSMutableDictionary *)newMeta fromSource:(NSString *)source withTime:(long)modTime;
147- (unsigned int)resumeTime;
148- (void)setResumeTime:(unsigned int)resumeTime;
149
150- (long long)size;
151- (float)duration;
152- (Float64)sampleRate;
153- (UInt32)audioFormatID;
154- (int)episodeNumber;
155- (int)seasonNumber;
156- (NSString *)episodeTitle;
157- (NSString *)showID;
158
159- (NSString *)sizeString;
160
161@end
Note: See TracBrowser for help on using the repository browser.