source: trunk/SapphireMetaData.h @ 88

Revision 88, 2.7 KB checked in by gbooker, 7 years ago (diff)

Cover flow for directories and the like.

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