This repository has been archived by the owner on Jan 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
/
AppController.h
199 lines (166 loc) · 5.72 KB
/
AppController.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
//
// AppController.h
// Get_iPlayer GUI
//
// Created by Thomas Willson on 7/10/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "BBCDownload.h"
#import "Series.h"
#import "ITVDownload.h"
#import "Download.h"
#import <IOKit/pwr_mgt/IOPMLib.h>
#import "NilToStringTransformer.h"
#import "EmptyToStringTransformer.h"
#import "LogController.h"
#import "GiASearch.h"
#import "GetCurrentWebpage.h"
#import "GetiPlayerArguments.h"
#import "GetiPlayerProxy.h"
@interface AppController : NSObject {
//General
NSString *getiPlayerPath;
IBOutlet NSWindow *mainWindow;
IBOutlet NSApplication *application;
IBOutlet NSWindow *historyWindow;
IOPMAssertionID powerAssertionID;
//Update Components
NSTask *getiPlayerUpdateTask;
NSPipe *getiPlayerUpdatePipe;
NSArray *getiPlayerUpdateArgs;
NSMutableArray *typesToCache;
BOOL didUpdate;
BOOL runSinceChange;
BOOL quickUpdateFailed;
NSUInteger nextToCache;
NSDictionary *updateURLDic;
NSDate *lastUpdate;
//Main Window: Search
IBOutlet NSTextField *searchField;
IBOutlet NSProgressIndicator *searchIndicator;
IBOutlet NSArrayController *resultsController;
IBOutlet NSTableView *searchResultsTable;
NSMutableArray *searchResultsArray;
GiASearch *currentSearch;
//PVR
IBOutlet NSTextField *pvrSearchField;
IBOutlet NSProgressIndicator *pvrSearchIndicator;
IBOutlet NSArrayController *pvrResultsController;
IBOutlet NSArrayController *pvrQueueController;
IBOutlet NSPanel *pvrPanel;
NSMutableArray *pvrSearchResultsArray;
NSMutableArray *pvrQueueArray;
GiASearch *currentPVRSearch;
//Queue
IBOutlet NSButton *addToQueue;
IBOutlet NSArrayController *queueController;
IBOutlet NSButton *getNamesButton;
NSMutableArray *queueArray;
IBOutlet NSTableView *queueTableView;
IBOutlet NSToolbarItem *addSeriesLinkToQueueButton;
//Main Window: Status
IBOutlet NSProgressIndicator *overallIndicator;
IBOutlet NSProgressIndicator *currentIndicator;
IBOutlet NSTextField *overallProgress;
IBOutlet NSTextField *currentProgress;
//Download Controller
Download *currentDownload;
IBOutlet NSToolbarItem *stopButton;
IBOutlet NSToolbarItem *startButton;
//Preferences
NSMutableArray *tvFormatList;
NSMutableArray *radioFormatList;
NSMutableArray *itvFormatList;
IBOutlet NSArrayController *tvFormatController;
IBOutlet NSArrayController *radioFormatController;
IBOutlet NSArrayController *itvFormatController;
IBOutlet NSPanel *prefsPanel;
//Scheduling a Start
IBOutlet NSPanel *scheduleWindow;
IBOutlet NSDatePicker *datePicker;
NSTimer *interfaceTimer;
NSTimer *scheduleTimer;
BOOL runScheduled;
//Download Solutions
IBOutlet NSWindow *solutionsWindow;
IBOutlet NSArrayController *solutionsArrayController;
IBOutlet NSTableView *solutionsTableView;
NSDictionary *solutionsDictionary;
//PVR list editing
NilToStringTransformer *nilToEmptyStringTransformer;
NilToStringTransformer *nilToAsteriskTransformer;
// Format preferences
EmptyToStringTransformer *tvFormatTransformer;
EmptyToStringTransformer *radioFormatTransformer;
EmptyToStringTransformer *itvFormatTransformer;
//Verbose Logging
BOOL verbose;
IBOutlet LogController *logger;
//Proxy
GetiPlayerProxy *getiPlayerProxy;
HTTPProxy *proxy;
// Misc Menu Items / Buttons
IBOutlet NSToolbarItem *refreshCacheButton;
IBOutlet NSMenuItem *forceCacheUpdateMenuItem;
IBOutlet NSMenuItem *checkForCacheUpdateMenuItem;
//ITV Cache
BOOL updatingITVIndex;
BOOL updatingBBCIndex;
BOOL forceITVUpdateInProgress;
IBOutlet NSMenuItem *showNewProgrammesMenuItem;
IBOutlet NSTextField *itvProgressText;
IBOutlet NSMenuItem *forceITVUpdateMenuItem;
//New Programmes History
NSWindow *newProgrammesWindow;
}
@property IBOutlet NSProgressIndicator *itvProgressIndicator;
//Update
- (void)getiPlayerUpdateFinished;
- (IBAction)updateCache:(id)sender;
- (IBAction)forceUpdate:(id)sender;
- (void)updateCacheForType:(NSString *)type;
//Search
- (IBAction)pvrSearch:(id)sender;
- (IBAction)mainSearch:(id)sender;
//PVR
- (IBAction)addToAutoRecord:(id)sender;
//Misc.
- (void)addToiTunesThread:(Programme *)show;
- (void)cleanUpPath:(Programme *)show;
- (void)seasonEpisodeInfo:(Programme *)show;
- (IBAction)chooseDownloadPath:(id)sender;
- (IBAction)restoreDefaults:(id)sender;
- (IBAction)showFeedback:(id)sender;
- (IBAction)closeWindow:(id)sender;
+ (AppController*)sharedController;
//Queue
- (IBAction)addToQueue:(id)sender;
- (IBAction)getCurrentWebpage:(id)sender;
- (void)setQueueArray:(NSArray *)queue;
- (NSArray *)queueArray;
- (IBAction)removeFromQueue:(id)sender;
//Download Controller
- (IBAction)startDownloads:(id)sender;
- (IBAction)stopDownloads:(id)sender;
//PVR
- (IBAction)addSeriesLinkToQueue:(id)sender;
- (BOOL)processAutoRecordData:(NSString *)autoRecordData2 forSeries:(Series *)series2;
- (IBAction)hidePvrShow:(id)sender;
//Scheduling a Start
- (IBAction)showScheduleWindow:(id)sender;
- (IBAction)scheduleStart:(id)sender;
- (IBAction)cancelSchedule:(id)sender;
//Download Solutions
//- (IBAction)saveSolutionsAsText:(id)sender;
-(void)updateHistory;
-(void)updateHistoryForType:(NSString *)chanelType andProgFile:(NSString *)oldProgrammesFile andCacheFile:(NSString *)newCacheFile;
-(NSScanner *)skip:(NSScanner *)s andDelimiter:(NSString *)d andTimes:(int)times;
-(void)itvUpdateFinished;
-(void)forceITVUpdate1;
-(void)forceITVUpdateFinished;
-(int)findItemNumberFor:(NSString *)key inString:(NSString *)string;
-(NSString *)getItemNumber:(int)itemLocation fromString:(NSString *)string;
//Key-Value Coding
@property (readonly) NSString *getiPlayerPath;
@end