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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
|
#ifndef __TVGUIDE_RECMENUS_H
#define __TVGUIDE_RECMENUS_H
#define TEXTINPUTLENGTH 256
#include <vector>
#include <functional>
#include <vdr/epg.h>
#include "services/epgsearch.h"
#include "switchtimer.h"
#include "recmanager.h"
// --- cRecMenuMain ---------------------------------------------------------
class cRecMenuMain : public cRecMenu {
public:
cRecMenuMain(bool epgSearchAvailable, bool timerActive, bool switchTimerActive);
virtual ~cRecMenuMain(void) {};
};
/******************************************************************************************
* Instant Timer Menus
******************************************************************************************/
// --- cRecMenuAskFolder ---------------------------------------------------------
class cRecMenuAskFolder: public cRecMenu {
private:
std::vector<std::string> folders;
eRecMenuState NextAction;
public:
cRecMenuAskFolder(const cEvent *event, eRecMenuState nextAction);
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
virtual ~cRecMenuAskFolder(void) {};
std::string GetFolder(void);
};
// --- cRecMenuConfirmTimer ---------------------------------------------------------
class cRecMenuConfirmTimer: public cRecMenu {
public:
cRecMenuConfirmTimer(const cEvent *event);
virtual ~cRecMenuConfirmTimer(void) {};
};
// --- cRecMenuConfirmDeleteTimer ---------------------------------------------------------
class cRecMenuConfirmDeleteTimer: public cRecMenu {
public:
cRecMenuConfirmDeleteTimer(const cEvent *event);
virtual ~cRecMenuConfirmDeleteTimer(void) {};
};
// --- cRecMenuAskDeleteTimer ---------------------------------------------------------
class cRecMenuAskDeleteTimer: public cRecMenu {
public:
cRecMenuAskDeleteTimer(const cEvent *event);
virtual ~cRecMenuAskDeleteTimer(void) {};
};
// --- cRecMenuTimerConflicts ---------------------------------------------------------
class cRecMenuTimerConflicts: public cRecMenu {
public:
cRecMenuTimerConflicts(cTVGuideTimerConflicts *conflicts);
virtual ~cRecMenuTimerConflicts(void) {};
int GetTimerConflict(void);
};
// --- cRecMenuTimerConflict ---------------------------------------------------------
class cRecMenuTimerConflict: public cRecMenu {
private:
cTVGuideTimerConflict *conflict;
public:
cRecMenuTimerConflict(cTVGuideTimerConflict *conflict);
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
virtual ~cRecMenuTimerConflict(void) {};
int GetTimerConflictIndex(void);
};
// --- cRecMenuNoTimerConflict ---------------------------------------------------------
class cRecMenuNoTimerConflict: public cRecMenu {
public:
cRecMenuNoTimerConflict(void);
virtual ~cRecMenuNoTimerConflict(void) {};
};
// --- cRecMenuRerunResults ---------------------------------------------------------
class cRecMenuRerunResults: public cRecMenu {
private:
const cEvent **reruns;
int numReruns;
public:
cRecMenuRerunResults(const cEvent *original, const cEvent **reruns, int numReruns);
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
virtual ~cRecMenuRerunResults(void) {
delete[] reruns;
};
const cEvent *GetRerunEvent(void);
};
// --- cRecMenuNoRerunsFound ---------------------------------------------------------
class cRecMenuNoRerunsFound: public cRecMenu {
public:
cRecMenuNoRerunsFound(cString searchString);
virtual ~cRecMenuNoRerunsFound(void) {};
};
// --- cRecMenuConfirmRerunUsed ---------------------------------------------------------
class cRecMenuConfirmRerunUsed: public cRecMenu {
public:
cRecMenuConfirmRerunUsed(const cEvent *original, const cEvent *replace);
virtual ~cRecMenuConfirmRerunUsed(void) {};
};
// --- cRecMenuEditTimer ---------------------------------------------------------
class cRecMenuEditTimer: public cRecMenu {
private:
const cTimer *originalTimer;
bool timerActive;
time_t day;
int start;
int stop;
int prio;
int lifetime;
char folder[TEXTINPUTLENGTH];
public:
cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextState);
const cTimer *GetOriginalTimer(void);
virtual ~cRecMenuEditTimer(void) {};
cTimer GetTimer(void);
};
/******************************************************************************************
* Series Timer Menus
******************************************************************************************/
// --- cRecMenuSeriesTimer ---------------------------------------------------------
class cRecMenuSeriesTimer: public cRecMenu {
std::string folder;
bool timerActive;
int channel;
time_t tstart;
int start;
int stop;
int dayOfWeek;
int priority;
int lifetime;
void CalculateTimes(const cEvent *event);
public:
cRecMenuSeriesTimer(const cChannel *initialChannel, const cEvent *event, std::string folder);
virtual ~cRecMenuSeriesTimer(void) {};
cTimer *GetTimer(void);
};
// --- cRecMenuConfirmSeriesTimer ---------------------------------------------------------
class cRecMenuConfirmSeriesTimer: public cRecMenu {
public:
cRecMenuConfirmSeriesTimer(cTimer *seriesTimer);
virtual ~cRecMenuConfirmSeriesTimer(void) {};
};
/******************************************************************************************
* SearchTimer Menus
******************************************************************************************/
// --- cRecMenuSearchTimer ---------------------------------------------------------
class cRecMenuSearchTimer: public cRecMenu {
private:
char searchString[TEXTINPUTLENGTH];
public:
cRecMenuSearchTimer(const cEvent *event);
virtual ~cRecMenuSearchTimer(void) {};
std::string GetSearchString(void) { return searchString; };
};
// --- cRecMenuSearchTimerTemplates ---------------------------------------------------------
class cRecMenuSearchTimerTemplates: public cRecMenu {
private:
int numTemplates;
cTVGuideSearchTimer searchTimer;
std::vector<TVGuideEPGSearchTemplate> templates;
public:
cRecMenuSearchTimerTemplates(cTVGuideSearchTimer searchTimer, std::vector<TVGuideEPGSearchTemplate> templates);
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
virtual ~cRecMenuSearchTimerTemplates(void) {};
cTVGuideSearchTimer GetSearchTimer(void) { return searchTimer; };
TVGuideEPGSearchTemplate GetTemplate(void);
};
// --- cRecMenuSearchTimers ---------------------------------------------------------
class cRecMenuSearchTimers: public cRecMenu {
private:
int numSearchTimers;
std::vector<cTVGuideSearchTimer> searchTimers;
void SetMenuItems(void);
public:
cRecMenuSearchTimers(std::vector<cTVGuideSearchTimer> searchTimers);
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
cTVGuideSearchTimer GetSearchTimer(void);
virtual ~cRecMenuSearchTimers(void);
};
// --- cRecMenuSearchTimerEdit ---------------------------------------------------------
class cRecMenuSearchTimerEdit: public cRecMenu {
private:
cTVGuideSearchTimer searchTimer;
cTVGuideSearchTimer sT;
std::vector<std::string> searchModes;
std::vector<std::string> useChannelModes;
std::vector<std::string> channelGroups;
std::vector<std::string> compareDateModes;
std::vector<std::string> searchTimerModes;
std::vector<std::string> delModes;
std::vector<std::string> channelgroups;
std::vector<cRecMenuItem*> mainMenuItems;
bool init;
int numMenuItems;
int useChannelPos;
int useTimePos;
int useDayOfWeekPos;
int avoidRepeatsPos;
char searchString[TEXTINPUTLENGTH];
bool timerActive;
int startChannel;
int stopChannel;
int channelgroupIndex;
char directory[TEXTINPUTLENGTH];
int SplitChannelGroups(std::vector<std::string> *channelGroups, std::vector<std::string> *channelgroups);
public:
cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, std::vector<std::string> channelGroups);
void CreateMenuItems(void);
virtual ~cRecMenuSearchTimerEdit(void);
cTVGuideSearchTimer GetSearchTimer(void);
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
};
// --- cRecMenuSearchTimerDeleteConfirm ---------------------------------------------
class cRecMenuSearchTimerDeleteConfirm: public cRecMenu {
private:
cTVGuideSearchTimer searchTimer;
public:
cRecMenuSearchTimerDeleteConfirm(cTVGuideSearchTimer searchTimer);
virtual ~cRecMenuSearchTimerDeleteConfirm(void);
cTVGuideSearchTimer GetSearchTimer(void);
};
// --- cRecMenuSearchTimerCreateConfirm ---------------------------------------------------------
class cRecMenuSearchTimerCreateConfirm: public cRecMenu {
private:
public:
cRecMenuSearchTimerCreateConfirm(bool success);
virtual ~cRecMenuSearchTimerCreateConfirm(void) {};
};
// --- cRecMenuSearchTimerTemplatesCreate ---------------------------------------------------------
class cRecMenuSearchTimerTemplatesCreate: public cRecMenu {
private:
TVGuideEPGSearchTemplate templ;
cTVGuideSearchTimer searchTimer;
public:
cRecMenuSearchTimerTemplatesCreate(TVGuideEPGSearchTemplate templ, cTVGuideSearchTimer searchTimer);
virtual ~cRecMenuSearchTimerTemplatesCreate(void) {};
cTVGuideSearchTimer GetSearchTimer(void) { return searchTimer; };
TVGuideEPGSearchTemplate GetTemplate(void) { return templ; };
};
// --- cRecMenuSearchTimerResults ---------------------------------------------------------
class cRecMenuSearchTimerResults: public cRecMenu {
private:
const cEvent **searchResults;
int numResults;
eRecMenuState action2;
public:
cRecMenuSearchTimerResults(std::string searchString, const cEvent **searchResults, int numResults, std::string templateName = "", eRecMenuState action2 = rmsDisabled);
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
virtual ~cRecMenuSearchTimerResults(void) {
delete[] searchResults;
};
const cEvent *GetEvent(void);
};
// --- cRecMenuSearchTimerNothingFound ---------------------------------------------------------
class cRecMenuSearchTimerNothingFound: public cRecMenu {
public:
cRecMenuSearchTimerNothingFound(std::string searchString);
virtual ~cRecMenuSearchTimerNothingFound(void) {};
};
/******************************************************************************************
* SwitchTimer Menus
******************************************************************************************/
// --- cRecMenuSwitchTimer ---------------------------------------------------------
class cRecMenuSwitchTimer: public cRecMenu {
private:
int switchMinsBefore;
int switchMode;
public:
cRecMenuSwitchTimer(void);
virtual ~cRecMenuSwitchTimer(void) {};
cSwitchTimer GetSwitchTimer(void);
};
// --- cRecMenuSwitchTimerConfirm ---------------------------------------------------------
class cRecMenuSwitchTimerConfirm: public cRecMenu {
private:
public:
cRecMenuSwitchTimerConfirm(bool success);
virtual ~cRecMenuSwitchTimerConfirm(void) {};
};
// --- cRecMenuSwitchTimerDelete ---------------------------------------------------------
class cRecMenuSwitchTimerDelete: public cRecMenu {
private:
public:
cRecMenuSwitchTimerDelete(void);
virtual ~cRecMenuSwitchTimerDelete(void) {};
};
/******************************************************************************************
* Search Menus
******************************************************************************************/
// --- cRecMenuSearch ---------------------------------------------------------
class cRecMenuSearch: public cRecMenu {
private:
char searchString[TEXTINPUTLENGTH];
int mode;
int channelNr;
bool useTitle;
bool useSubTitle;
bool useDescription;
public:
cRecMenuSearch(std::string searchString, bool withOptions);
virtual ~cRecMenuSearch(void) {};
Epgsearch_searchresults_v1_0 GetEPGSearchStruct(void);
std::string GetSearchString(void) { return searchString; };
};
// --- cRecMenuSearchResults ---------------------------------------------------------
class cRecMenuSearchResults: public cRecMenu {
private:
std::string searchString;
const cEvent **searchResults;
int numResults;
public:
cRecMenuSearchResults(std::string searchString, const cEvent **searchResults, int numResults);
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
virtual ~cRecMenuSearchResults(void) {
delete[] searchResults;
};
const cEvent *GetEvent(void);
std::string GetSearchString(void) { return searchString; };
};
// --- cRecMenuSearchConfirmTimer ---------------------------------------------------------
class cRecMenuSearchConfirmTimer: public cRecMenu {
public:
cRecMenuSearchConfirmTimer(const cEvent *event, eRecMenuState nextAction);
virtual ~cRecMenuSearchConfirmTimer(void) {};
};
// --- cRecMenuSearchNothingFound ---------------------------------------------------------
class cRecMenuSearchNothingFound: public cRecMenu {
public:
cRecMenuSearchNothingFound(std::string searchString, bool tooShort = false);
virtual ~cRecMenuSearchNothingFound(void) {};
};
/******************************************************************************************
* Recording Search Menus
******************************************************************************************/
// --- cRecMenuRecordingSearch ---------------------------------------------------------
class cRecMenuRecordingSearch: public cRecMenu {
private:
char searchString[TEXTINPUTLENGTH];
public:
cRecMenuRecordingSearch(std::string search);
virtual ~cRecMenuRecordingSearch(void) {};
std::string GetSearchString(void) { return searchString; };
};
// --- cRecMenuRecordingSearchResults ---------------------------------------------------------
class cRecMenuRecordingSearchResults: public cRecMenu {
private:
std::string searchString;
const cRecording **searchResults;
int numResults;
public:
cRecMenuRecordingSearchResults(std::string searchString, const cRecording **searchResults, int numResults);
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
virtual ~cRecMenuRecordingSearchResults(void) {
delete[] searchResults;
};
std::string GetSearchString(void) { return searchString; };
};
// --- cRecMenuRecordingSearchNotFound ---------------------------------------------------------
class cRecMenuRecordingSearchNotFound: public cRecMenu {
public:
cRecMenuRecordingSearchNotFound(std::string searchString);
virtual ~cRecMenuRecordingSearchNotFound(void) {};
};
/******************************************************************************************
* Timeline
******************************************************************************************/
// --- cRecMenuTimeline ---------------------------------------------------------
class cRecMenuTimeline: public cRecMenu {
private:
std::vector<const cTimer*> timersToday;
int numTimersToday;
time_t today;
time_t timeStart;
time_t timeStop;
cTVGuideTimerConflicts *timerConflicts;
std::vector<cTVGuideTimerConflict*> conflictsToday;
cRecMenuItemTimelineHeader *header;
void SetStartStop(void);
void GetTimersForDay(void);
void SetTimers(void);
void PrevDay(void);
void NextDay(void);
void ClearMenu(void);
public:
cRecMenuTimeline(cTVGuideTimerConflicts *timerConflicts);
virtual ~cRecMenuTimeline(void) {};
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
eRecMenuState ProcessKey(eKeys Key);
const cTimer *GetTimer(void);
};
/******************************************************************************************
* Favorites
******************************************************************************************/
// --- cRecMenuFavorites ---------------------------------------------------------
class cRecMenuFavorites: public cRecMenu {
private:
std::vector<cTVGuideSearchTimer> favorites;
std::vector<cRecMenuItem*> myMenuItems;
int numFavorites;
void CreateFavoritesMenuItems(void);
std::string NiceTime(int favTime);
public:
cRecMenuFavorites(std::vector<cTVGuideSearchTimer> favorites);
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
cTVGuideSearchTimer GetFavorite(void);
virtual ~cRecMenuFavorites(void);
};
#endif //__TVGUIDE_RECMENUS_H
|