forked from sbooth/Tag
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeyValueTaggedFile.h
More file actions
110 lines (90 loc) · 3.24 KB
/
KeyValueTaggedFile.h
File metadata and controls
110 lines (90 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
* $Id$
*
* Copyright (C) 2005, 2006 Stephen F. Booth <me@sbooth.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#import <Cocoa/Cocoa.h>
@interface KeyValueTaggedFile : NSObject
{
NSMutableArray *_tags;
NSString *_filename;
NSString *_displayName;
int _changeCount;
}
+ (KeyValueTaggedFile *) parseFile:(NSString *)filename;
- (id) initWithFile:(NSString *)filename;
- (NSString *) filename;
- (NSURL *) fileURL;
- (NSString *) displayName;
- (void) save;
- (void) revert;
- (BOOL) dirty;
- (int) changeCount;
- (void) updateChangeCount:(NSDocumentChangeType)changeType;
- (NSString *) valueForTag:(NSString *)tag;
- (unsigned) countOfTags;
- (NSDictionary *) objectInTagsAtIndex:(unsigned)index;
- (void) willChangeValueForTag:(NSString *)tag;
- (void) didChangeValueForTag:(NSString *)tag;
- (void) setValue:(NSString *)value forTag:(NSString *)tag;
- (void) addValue:(NSString *)value forTag:(NSString *)tag;
- (void) updateTag:(NSString *)tag withValue:(NSString *)currentValue toValue:(NSString *)newValue;
- (void) renameTag:(NSString *)currentTag withValue:(NSString *)currentValue toTag:(NSString *)newTag;
- (void) guessTagsUsingPattern:(NSString *)pattern;
- (void) renameFileUsingPattern:(NSString *)pattern;
- (NSString *) customizeTag:(NSString *)tag;
- (NSDictionary *) tagMapping;
- (NSString *) tagForKey:(NSString *)key;
// Accessors
- (NSString *) title;
- (NSString *) artist;
- (NSString *) album;
- (NSNumber *) year;
- (NSString *) genre;
- (NSString *) composer;
- (NSString *) MCN;
- (NSString *) ISRC;
- (NSString *) encoder;
- (NSString *) comment;
- (NSNumber *) trackNumber;
- (NSNumber *) trackTotal;
- (NSNumber *) discNumber;
- (NSNumber *) discTotal;
- (NSNumber *) compilation;
- (NSString *) custom;
// Mutators
- (void) setArtist:(NSString *)value;
- (void) setTitle:(NSString *)value;
- (void) setAlbum:(NSString *)value;
- (void) setYear:(NSNumber *)value;
- (void) setGenre:(NSString *)value;
- (void) setComposer:(NSString *)value;
- (void) setMCN:(NSString *)value;
- (void) setISRC:(NSString *)value;
- (void) setEncoder:(NSString *)value;
- (void) setComment:(NSString *)value;
- (void) setTrackNumber:(NSNumber *)value;
- (void) setTrackTotal:(NSNumber *)value;
- (void) setDiscNumber:(NSNumber *)value;
- (void) setDiscTotal:(NSNumber *)value;
- (void) setCompilation:(NSNumber *)value;
- (void) setCustom:(NSString *)value;
@end
@interface KeyValueTaggedFile (ScriptingAdditions)
- (id) handleCloseScriptCommand:(NSCloseCommand *)command;
- (id) handleSaveScriptCommand:(NSScriptCommand *)command;
@end