source: trunk/SapphireMetaData.h @ 78

Revision 78, 2.5 KB checked in by gbooker, 7 years ago (diff)

Some more optimizations and respect the fast directory setting.

Line 
1//
2//  SapphireMetaData.h
3//  Sapphire
4//
5//  Created by Graham Booker on 6/22/07.
6//  Copyright 2007 __MyCompanyName__. All rights reserved.
7//
8
9#import <Cocoa/Cocoa.h>
10#import "SapphirePredicates.h"
11
12@class SapphireMetaData, SapphireFileMetaData, SapphireDirectoryMetaData;
13
14@protocol SapphireMetaDataDelegate <NSObject>
15- (void)updateCompleteForFile:(NSString *)file;
16@end
17
18@interface SapphireMetaData : NSObject {
19        NSMutableDictionary                             *metaData;
20        SapphireMetaData                                *parent;
21        /* These two are not retained */
22        NSString                                                *path;
23        id <SapphireMetaDataDelegate>   delegate;
24}
25
26- (NSString *)path;
27
28- (void)setDelegate:(id <SapphireMetaDataDelegate>)newDelegate;
29- (void)writeMetaData;
30
31@end
32
33@interface SapphireMetaDataCollection : SapphireMetaData {
34        SapphireDirectoryMetaData       *mainDirectory;
35        NSString                                        *dictionaryPath;
36}
37- (id)initWithFile:(NSString *)dictionary path:(NSString *)myPath;
38- (SapphireDirectoryMetaData *)rootDirectory;
39
40@end
41
42@interface SapphireDirectoryMetaData : SapphireMetaData {
43        /*These two are not retained*/
44        NSMutableDictionary     *metaFiles;
45        NSMutableDictionary     *metaDirs;
46       
47        NSMutableDictionary     *cachedMetaFiles;
48        NSMutableDictionary     *cachedMetaDirs;
49
50        NSMutableArray          *files;
51        NSMutableArray          *directories;
52       
53        NSTimer                         *importTimer;
54        NSMutableArray          *importArray;
55        BOOL                            scannedDirectory;
56}
57
58- (void)reloadDirectoryContents;
59- (NSArray *)files;
60- (NSArray *)directories;
61- (NSArray *)predicatedFiles:(SapphirePredicate *)predicate;
62- (NSArray *)predicatedDirectories:(SapphirePredicate *)predicate;
63
64- (SapphireFileMetaData *)metaDataForFile:(NSString *)file;
65- (SapphireDirectoryMetaData *)metaDataForDirectory:(NSString *)file;
66
67- (BOOL)pruneMetaData;
68- (BOOL)updateMetaData;
69
70- (void)cancelImport;
71- (void)resumeImport;
72- (void)resumeDelayedImport;
73
74- (SapphireMetaData *)metaDataForSubPath:(NSString *)path;
75- (NSArray *)subFileMetas;
76- (void)scanForNewFiles;
77
78- (BOOL)watchedForPredicate:(SapphirePredicate *)predicate;
79- (void)setWatched:(BOOL)watched predicate:(SapphirePredicate *)predicate;
80- (BOOL)favoriteForPredicate:(SapphirePredicate *)predicate;
81- (void)setFavorite:(BOOL)favorite predicate:(SapphirePredicate *)predicate;
82
83@end
84
85@interface SapphireFileMetaData : SapphireMetaData {
86}
87
88- (void) updateMetaData;
89
90- (int)modified;
91- (BOOL)watched;
92- (void)setWatched:(BOOL)watched;
93- (BOOL)favorite;
94- (void)setFavorite:(BOOL)favorite;
95- (unsigned int)resumeTime;
96- (void)setResumeTime:(unsigned int)resumeTime;
97
98- (long long)size;
99- (float)duration;
100- (int)sampleRate;
101
102- (NSString *)sizeString;
103- (NSString *)metaDataDescription;
104
105@end
Note: See TracBrowser for help on using the repository browser.