-
Notifications
You must be signed in to change notification settings - Fork 4
/
LHDocument.h
134 lines (91 loc) · 3.25 KB
/
LHDocument.h
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
//
// LHDocument.h
// LastHistory
//
// Created by Frederik Seiffert on 04.10.09.
// Copyright Frederik Seiffert 2009 . All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "LHEvent.h"
extern NSString *LHDocumentWillOpenNotification;
extern NSString *LHDocumentDidOpenNotification;
extern NSString *LHDocumentDidCloseNotification;
@class LHHistoryView;
@class LHTrack;
@class LHHistoryEntry;
@class LHOperation;
@interface LHDocument : NSPersistentDocument
#ifdef MAC_OS_X_VERSION_10_6
<NSSoundDelegate>
#endif
{
IBOutlet LHHistoryView *historyView;
IBOutlet NSTokenField *searchField;
IBOutlet NSWindow *usernameSheet;
IBOutlet NSTextField *usernameField;
IBOutlet NSWindow *playlistNameSheet;
IBOutlet NSTextField *playlistNameField;
int _operationMode; // Analysis/Personal
BOOL _chartsMode;
NSArray *_playlist;
LHHistoryEntry *_firstHistoryEntry;
LHHistoryEntry *_lastHistoryEntry;
NSArray *_cachedHistoryEntries;
NSUInteger _hiddenHistoryEntriesCount;
NSUInteger _hiddenTracksCount;
LHHistoryEntry *_currentHistoryEntry;
id <LHEvent> _currentEvent;
NSSound *_currentSound;
BOOL _currentSoundIsPaused;
NSOperationQueue *_queue;
LHOperation *_currentOperation;
}
@property (readonly) LHHistoryView *historyView;
@property (assign) int operationMode;
@property (assign) BOOL chartsMode;
@property (retain) NSArray *playlist;
@property (retain) LHHistoryEntry *currentHistoryEntry;
@property (retain) id <LHEvent> currentEvent;
@property (retain) NSSound *currentSound;
@property (readonly) NSString *infoString;
@property (readonly) NSArray *tracks;
@property (readonly) NSUInteger tracksCount;
@property (readonly) NSArray *historyEntries;
@property (readonly) NSUInteger historyEntriesCount;
@property (readonly) LHHistoryEntry *firstHistoryEntry;
@property (readonly) LHHistoryEntry *lastHistoryEntry;
@property (retain) LHOperation *currentOperation;
- (void)setUsername:(NSString *)username;
- (void)updateOperation:(LHOperation *)op;
- (void)mergeChanges:(NSNotification *)notification;
- (NSArray *)objectsForEntity:(NSString *)entityName
withPredicate:(NSPredicate *)predicate
fetchLimit:(NSUInteger)fetchLimit
ascending:(BOOL)ascending
inContext:(NSManagedObjectContext *)context;
- (NSArray *)objectsForEntity:(NSString *)entityName;
- (NSUInteger)countForEntity:(NSString *)entityName
withPredicate:(NSPredicate *)predicate
inContext:(NSManagedObjectContext *)context;
- (NSUInteger)countForEntity:(NSString *)entityName;
// Actions
- (IBAction)updateFilter:(id)sender;
- (void)performFindPanelAction:(id)sender;
- (IBAction)toggleFullScreenMode:(id)sender;
- (IBAction)showTrackIniTunes:(id)sender;
- (IBAction)createPlaylistIniTunes:(id)sender;
- (IBAction)closePlaylistNameSheet:(id)sender;
- (IBAction)stop:(id)sender;
- (IBAction)pause:(id)sender;
- (IBAction)skipBackwards:(id)sender;
- (IBAction)skipForward:(id)sender;
- (BOOL)playHistoryEntry:(LHHistoryEntry *)historyEntry;
- (BOOL)playHistoryEntriesForEvent:(id <LHEvent>)event;
- (NSUInteger)numberOfHistoryEntriesForEvent:(id <LHEvent>)event;
// History Loading
- (IBAction)loadHistory:(id)sender;
- (IBAction)closeUsernameSheet:(id)sender;
// Last.fm Tag Loading
- (IBAction)retrieveTags:(id)sender;
- (IBAction)showTopTags:(id)sender;
@end