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
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
|
#ifndef __TVGUIDE_RECMENUITEM_H
#define __TVGUIDE_RECMENUITEM_H
#define AUTO_ADVANCE_TIMEOUT 1500
#include <string>
#include <vdr/tools.h>
#include "styledpixmap.h"
#include "timerconflict.h"
#include "searchtimer.h"
enum eRecMenuState {
rmsConsumed,
rmsNotConsumed,
rmsRefresh,
rmsContinue,
rmsClose,
rmsDisabled,
//INSTANT TIMER
rmsInstantRecord,
rmsInstantRecordFolder,
rmsIgnoreTimerConflict,
rmsDeleteTimerConflictMenu,
rmsEditTimerConflictMenu,
rmsSearchRerunsTimerConflictMenu,
rmsSaveTimerConflictMenu,
rmsTimerConflictShowInfo,
rmsDeleteTimer,
rmsDeleteTimerConfirmation,
rmsEditTimer,
rmsSaveTimer,
//SEARCH
rmsSearch,
rmsSearchWithOptions,
rmsSearchPerform,
rmsSearchShowInfo,
rmsSearchRecord,
rmsSearchRecordConfirm,
rmsSearchNothingFoundConfirm,
//SERIES TIMER
rmsSeriesTimer,
rmsSeriesTimerFolder,
rmsSeriesTimerCreate,
//SEARCHTIMER
rmsSearchTimer,
rmsSearchTimerOptions,
rmsSearchTimers,
rmsSearchTimerEdit,
rmsSearchTimerTest,
rmsSearchTimerSave,
rmsSearchTimerCreateWithTemplate,
rmsSearchTimerDeleteConfirm,
rmsSearchTimerDelete,
rmsSearchTimerDeleteWithTimers,
rmsSearchTimerRecord,
//SWITCHTIMER
rmsSwitchTimer,
rmsSwitchTimerCreate,
rmsSwitchTimerDelete,
//RECORDINGS SEARCH
rmsRecordingSearch,
rmsRecordingSearchResult,
//TIMER CONFLICTS
rmsTimerConflict,
rmsTimerConflicts,
rmsTimerConflictIgnoreReruns,
rmsTimerConflictRecordRerun,
//TIMELINE
rmsTimeline,
rmsTimelineTimerEdit,
rmsTimelineTimerSave,
rmsTimelineTimerDelete,
//FAVORITES
rmsFavoritesRecord,
rmsFavoritesRecordConfirm,
rmsFavoritesNow,
rmsFavoritesNext,
rmsFavoritesUser1,
rmsFavoritesUser2,
rmsFavoritesUser3,
rmsFavoritesUser4,
};
enum eDependend {
eGreater,
eLower,
};
// --- cRecMenuItem -------------------------------------------------------------
class cRecMenuItem : public cListObject, public cStyledPixmap {
protected:
int x, y;
int width, height;
bool selectable;
bool active;
bool defaultBackground;
bool drawn;
eRecMenuState action;
tColor colorText;
tColor colorTextBack;
const cFont *font;
const cFont *fontSmall;
const cFont *fontLarge;
public:
cRecMenuItem(void);
virtual ~cRecMenuItem(void);
void SetGeometry(int x, int y, int width);
virtual void SetPixmaps(void);
virtual int GetHeight(void) { return height; };
virtual int GetWidth(void) { return 0; };
virtual void CalculateHeight(int textWidth) {};
virtual void setActive(void) { this->active = true; }
virtual void setInactive(void) { this->active = false; }
bool isSelectable(void) { return selectable; }
bool isActive(void) { return active; }
virtual void setBackground(void);
virtual void Draw(void) {};
virtual void Hide(void) { if (pixmap) pixmap->SetLayer(-1);};
virtual void Show(void) { if (pixmap) pixmap->SetLayer(4);};
virtual int GetIntValue(void) { return -1; };
virtual time_t GetTimeValue(void) { return 0; };
virtual bool GetBoolValue(void) { return false; };
virtual cString GetStringValue(void) { return cString(""); };
virtual const cEvent *GetEventValue(void) { return NULL; };
virtual const cTimer *GetTimerValue(void) { return NULL; };
virtual eRecMenuState ProcessKey(eKeys Key) { return rmsNotConsumed; };
};
// --- cRecMenuItemButton -------------------------------------------------------
class cRecMenuItemButton : public cRecMenuItem {
private:
cString text;
bool halfWidth;
bool alignLeft;
const cFont *fontButtons;
cPixmap *pixmapText;
public:
cRecMenuItemButton(const char *text, eRecMenuState action, bool active, bool halfWidth = false, bool alignLeft = false, bool largeFont = false);
virtual ~cRecMenuItemButton(void);
int GetWidth(void);
void SetPixmaps(void);
void Draw(void);
void Hide(void);
void Show(void);
cString GetStringValue(void) { return text; };
eRecMenuState ProcessKey(eKeys Key);
};
// --- cRecMenuItemButtonYesNo -------------------------------------------------------
class cRecMenuItemButtonYesNo : public cRecMenuItem {
private:
cString textYes;
cString textNo;
eRecMenuState actionNo;
bool yesActive;
cStyledPixmap *pixmapNo;
tColor colorTextNo;
tColor colorTextNoBack;
public:
cRecMenuItemButtonYesNo(cString textYes,
cString textNo,
eRecMenuState actionYes,
eRecMenuState actionNo,
bool active);
virtual ~cRecMenuItemButtonYesNo(void);
void SetPixmaps(void);
void setBackground(void);
void Hide(void);
void Show(void);
eRecMenuState ProcessKey(eKeys Key);
void Draw(void);
};
// --- cRecMenuItemInfo -------------------------------------------------------
class cRecMenuItemInfo : public cRecMenuItem {
private:
cString text;
cTextWrapper wrapper;
int border;
const cFont *fontInfo;
public:
cRecMenuItemInfo(const char *text, bool largeFont = false);
virtual ~cRecMenuItemInfo(void);
void setBackground(void);
void CalculateHeight(int textWidth);
void Draw(void);
};
// --- cRecMenuItemInt -------------------------------------------------------
class cRecMenuItemInt : public cRecMenuItem {
private:
cString text;
int currentVal;
int *callback;
int minVal;
int maxVal;
cPixmap *pixmapVal;
bool fresh;
void DrawValue(void);
public:
cRecMenuItemInt(cString text,
int minVal,
int maxVal,
bool active = false,
int *callback = NULL,
eRecMenuState action = rmsNotConsumed);
virtual ~cRecMenuItemInt(void);
void SetPixmaps(void);
void Hide(void);
void Show(void);
void setBackground(void);
eRecMenuState ProcessKey(eKeys Key);
void Draw(void);
int GetIntValue(void) { return currentVal; };
};
// --- cRecMenuItemBool -------------------------------------------------------
class cRecMenuItemBool : public cRecMenuItem {
private:
cString text;
bool yes;
bool *callback;
cPixmap *pixmapVal;
bool refresh;
void DrawValue(void);
public:
cRecMenuItemBool(cString text,
bool active = false,
bool *callback = NULL,
eRecMenuState action = rmsNotConsumed,
bool refresh = false);
cRecMenuItemBool(cString text,
bool active = false,
int *callback = NULL,
eRecMenuState action = rmsNotConsumed,
bool refresh = false);
virtual ~cRecMenuItemBool(void);
void SetPixmaps(void);
void Hide(void);
void Show(void);
eRecMenuState ProcessKey(eKeys Key);
void Draw(void);
bool GetBoolValue(void) { return yes; };
};
// --- cRecMenuItemSelect -------------------------------------------------------
class cRecMenuItemSelect : public cRecMenuItem {
private:
cString text;
int currentVal;
int *callback;
bool refresh;
std::vector<std::string> strings;
int numValues;
cPixmap *pixmapVal;
void DrawValue(void);
public:
cRecMenuItemSelect(cString text,
std::vector<std::string> Strings,
bool active = false,
int *callback = NULL,
eRecMenuState action = rmsNotConsumed,
bool refresh = false);
virtual ~cRecMenuItemSelect(void);
void SetPixmaps(void);
void Hide(void);
void Show(void);
eRecMenuState ProcessKey(eKeys Key);
void Draw(void);
int GetIntValue(void) { return currentVal; };
cString GetStringValue(void) { return strings[currentVal].c_str(); };
};
// --- cRecMenuItemSelectDirectory -------------------------------------------------------
class cRecMenuItemSelectDirectory : public cRecMenuItem {
private:
cString text;
std::string originalFolder;
std::vector<std::string> folders;
int currentVal;
char *callback;
int numValues;
cPixmap *pixmapVal;
void DrawValue(void);
int GetInitial(void);
void SetCallback(void);
public:
cRecMenuItemSelectDirectory(cString text,
std::string originalFolder,
bool active = false,
char *callback = NULL,
eRecMenuState action = rmsNotConsumed,
bool isSearchTimer = false);
virtual ~cRecMenuItemSelectDirectory(void);
void SetPixmaps(void);
void Hide(void);
void Show(void);
eRecMenuState ProcessKey(eKeys Key);
void Draw(void);
};
// --- cRecMenuItemText -------------------------------------------------------
class cRecMenuItemText : public cRecMenuItem {
private:
cString title;
char *value;
char *callback;
int length;
const char *allowed;
int pos, offset;
bool insert, newchar, uppercase;
int lengthUtf8;
uint *valueUtf8;
uint *allowedUtf8;
uint *charMapUtf8;
uint *currentCharUtf8;
eKeys lastKey;
cTimeMs autoAdvanceTimeout;
cPixmap *pixmapVal;
cStyledPixmap *pixmapKeyboard;
cPixmap *pixmapKeyboardHighlight;
cPixmap *pixmapKeyboardIcons;
int keyboardWidth;
int gridWidth;
int gridHeight;
int keyboardHeight;
bool keyboardDrawn;
uint *IsAllowed(uint c);
void AdvancePos(void);
uint Inc(uint c, bool Up);
void Type(uint c);
void Insert(void);
void Delete(void);
void EnterEditMode(void);
void LeaveEditMode(bool SaveValue = false);
bool InEditMode(void) { return valueUtf8 != NULL; };
void SetText(void);
void ActivateKeyboard(void);
void DeactivateKeyboard(void);
void HighlightSMSKey(int num);
void ClearSMSKey(void);
char *GetSMSKeys(int num);
void DrawValue(char *newValue);
public:
cRecMenuItemText(cString title,
int length,
bool active = false,
char *callback = NULL);
virtual ~cRecMenuItemText(void);
void SetPixmaps(void);
void Hide(void);
void Show(void);
void setBackground(void);
eRecMenuState ProcessKey(eKeys Key);
void Draw(void);
cString GetStringValue(void) { return value; };
};
// --- cRecMenuItemTime -------------------------------------------------------
class cRecMenuItemTime : public cRecMenuItem {
private:
cString text;
int value;
int *callback;
int mm;
int hh;
int pos;
bool fresh;
cPixmap *pixmapVal;
void DrawValue(void);
public:
cRecMenuItemTime(cString text,
bool active = false,
int *callback = NULL,
eRecMenuState action = rmsNotConsumed);
virtual ~cRecMenuItemTime(void);
void SetPixmaps(void);
void Hide(void);
void Show(void);
eRecMenuState ProcessKey(eKeys Key);
void Draw(void);
int GetIntValue(void) { return value; };
};
// --- cRecMenuItemDay -------------------------------------------------------
class cRecMenuItemDay : public cRecMenuItem {
private:
cString text;
time_t currentVal;
time_t *callback;
cPixmap *pixmapVal;
void DrawValue(void);
public:
cRecMenuItemDay(cString text,
bool active = false,
time_t *callback = NULL,
eRecMenuState action = rmsNotConsumed);
virtual ~cRecMenuItemDay(void);
void SetPixmaps(void);
void Hide(void);
void Show(void);
eRecMenuState ProcessKey(eKeys Key);
void Draw(void);
time_t GetTimeValue(void) { return currentVal; };
};
// --- cRecMenuItemTimer -------------------------------------------------------
class cRecMenuItemTimer : public cRecMenuItem {
private:
const cTimer *timer;
eRecMenuState action2;
eRecMenuState action3;
eRecMenuState action4;
int iconActive;
cPixmap *pixmapIcons;
cPixmap *pixmapStatus;
time_t conflictStart;
time_t conflictStop;
time_t overlapStart;
time_t overlapStop;
int DrawIcons(void);
void DrawTimerConflict(void);
public:
cRecMenuItemTimer(const cTimer *timer,
eRecMenuState action1,
eRecMenuState action2,
eRecMenuState action3,
eRecMenuState action4,
time_t conflictStart,
time_t conflictStop,
time_t overlapStart,
time_t overlapStop,
bool active);
virtual ~cRecMenuItemTimer(void);
void SetPixmaps(void);
void Hide(void);
void Show(void);
eRecMenuState ProcessKey(eKeys Key);
void Draw(void);
};
// --- cRecMenuItemTimerConflictHeader -------------------------------------------------------
class cRecMenuItemTimerConflictHeader: public cRecMenuItem {
private:
cPixmap *pixmapStatus;
time_t conflictStart;
time_t conflictStop;
time_t overlapStart;
time_t overlapStop;
public:
cRecMenuItemTimerConflictHeader(time_t conflictStart,
time_t conflictStop,
time_t overlapStart,
time_t overlapStop);
virtual ~cRecMenuItemTimerConflictHeader(void);
void SetPixmaps(void);
void Hide(void);
void Show(void);
void setBackground(void);
void Draw(void);
};
// --- cRecMenuItemEvent -------------------------------------------------------
class cRecMenuItemEvent : public cRecMenuItem {
private:
const cEvent *event;
eRecMenuState action2;
int iconActive;
cPixmap *pixmapText;
cPixmap *pixmapIcons;
int DrawIcons(void);
public:
cRecMenuItemEvent(const cEvent *event,
eRecMenuState action1,
eRecMenuState action2,
bool active);
virtual ~cRecMenuItemEvent(void);
void SetPixmaps(void);
void Hide(void);
void Show(void);
const cEvent *GetEventValue(void) { return event; };
eRecMenuState ProcessKey(eKeys Key);
void Draw(void);
};
// --- cRecMenuItemChannelChooser -------------------------------------------------------
class cRecMenuItemChannelChooser : public cRecMenuItem {
private:
cString text;
#if VDRVERSNUM >= 20301
const cChannels *channels;
const cChannel *chanNew;
#else
cChannels *channels;
cChannel *chanNew;
#endif
const cChannel *channel;
int channelNumber;
int *callback;
bool initialChannelSet;
bool fresh;
cPixmap *pixmapChannel;
void DrawValue(void);
public:
cRecMenuItemChannelChooser (cString text,
bool active = false,
int *callback = NULL,
eRecMenuState action = rmsNotConsumed);
virtual ~cRecMenuItemChannelChooser(void);
void SetPixmaps(void);
void Hide(void);
void Show(void);
eRecMenuState ProcessKey(eKeys Key);
void Draw(void);
int GetIntValue(void);
};
// --- cRecMenuItemDayChooser -------------------------------------------------------
class cRecMenuItemDayChooser : public cRecMenuItem {
private:
cString text;
int weekdays;
int *callback;
bool epgsearchMode;
std::string days;
int daysX;
int daysY;
int daysSize;
int selectedDay;
cPixmap *pixmapWeekdays;
cPixmap *pixmapWeekdaysSelect;
void SetSizes(void);
void DrawDays(void);
void DrawHighlight(int day);
void ToggleDay(void);
bool WeekDaySet(unsigned day);
public:
cRecMenuItemDayChooser (cString text,
bool active = false,
int *callback = NULL);
virtual ~cRecMenuItemDayChooser(void);
void SetPixmaps(void);
void Hide(void);
void Show(void);
void setBackground(void);
eRecMenuState ProcessKey(eKeys Key);
void Draw(void);
int GetIntValue(void) { return weekdays;} ;
};
// --- cRecMenuItemRecording -------------------------------------------------------
class cRecMenuItemRecording : public cRecMenuItem {
private:
const cRecording *recording;
cPixmap *pixmapText;
public:
cRecMenuItemRecording(const cRecording *recording, bool active);
virtual ~cRecMenuItemRecording(void);
void SetPixmaps(void);
void Hide(void);
void Show(void);
void Draw(void);
};
// --- cRecMenuItemTimelineHeader -------------------------------------------------------
class cRecMenuItemTimelineHeader : public cRecMenuItem {
private:
time_t day;
const cTimer *timer;
std::vector<cTVGuideTimerConflict*> conflicts;
cPixmap *pixmapTimeline;
cPixmap *pixmapTimerInfo;
cPixmap *pixmapTimerConflicts;
int width5Mins;
int x0;
bool timelineDrawn;
void DrawTimeline(void);
void DrawTimerConflicts(void);
void DrawCurrentTimer(void);
public:
cRecMenuItemTimelineHeader(time_t day, std::vector<cTVGuideTimerConflict*> conflictsToday);
virtual ~cRecMenuItemTimelineHeader(void);
void SetDay(time_t day) { this->day = day; };
void SetPixmaps(void);
void SetCurrentTimer(const cTimer *timer) { this->timer = timer; };
void UnsetCurrentTimer(void) { timer = NULL; };
void RefreshTimerDisplay(void);
void Hide(void);
void Show(void);
void Draw(void);
};
// --- cRecMenuItemTimelineTimer -------------------------------------------------------
class cRecMenuItemTimelineTimer : public cRecMenuItem {
private:
const cTimer *timer;
std::vector<cTVGuideTimerConflict*> conflicts;
cPixmap *pixmapBack;
cPixmap *pixmapTimerConflicts;
cRecMenuItemTimelineHeader *header;
int x0;
int width5Mins;
time_t start;
time_t stop;
void DrawBackground(void);
void DrawTimerBar(void);
void DrawTimeScale(void);
void DrawTimerConflicts(void);
void DrawNoTimerInfo(void);
public:
cRecMenuItemTimelineTimer(const cTimer *timer, time_t start, time_t stop, std::vector<cTVGuideTimerConflict*> conflictsToday, cRecMenuItemTimelineHeader *header, bool active);
virtual ~cRecMenuItemTimelineTimer(void);
void setActive(void);
void setInactive(void);
void SetPixmaps(void);
void Hide(void);
void Show(void);
void Draw(void);
const cTimer *GetTimerValue(void);
eRecMenuState ProcessKey(eKeys Key);
};
// --- cRecMenuItemSearchTimer -------------------------------------------------------
class cRecMenuItemSearchTimer : public cRecMenuItem {
private:
cTVGuideSearchTimer timer;
eRecMenuState action1;
eRecMenuState action2;
eRecMenuState action3;
int iconActive;
cPixmap *pixmapText;
cPixmap *pixmapIcons;
int DrawIcons(void);
public:
cRecMenuItemSearchTimer(cTVGuideSearchTimer timer,
eRecMenuState action1,
eRecMenuState action2,
eRecMenuState action3,
bool active);
virtual ~cRecMenuItemSearchTimer(void);
void SetPixmaps(void);
void Hide(void);
void Show(void);
void Draw(void);
cTVGuideSearchTimer GetTimer(void) { return timer; };
eRecMenuState ProcessKey(eKeys Key);
};
// --- cRecMenuItemFavorite -------------------------------------------------------
class cRecMenuItemFavorite : public cRecMenuItem {
private:
cTVGuideSearchTimer favorite;
eRecMenuState action1;
cPixmap *pixmapText;
cPixmap *pixmapIcons;
int DrawIcons(void);
public:
cRecMenuItemFavorite(cTVGuideSearchTimer favorite,
eRecMenuState action1,
bool active);
virtual ~cRecMenuItemFavorite(void);
void SetPixmaps(void);
void Hide(void);
void Show(void);
void Draw(void);
cTVGuideSearchTimer GetFavorite(void) { return favorite; };
eRecMenuState ProcessKey(eKeys Key);
};
// --- cRecMenuItemFavoriteStatic -------------------------------------------------------
class cRecMenuItemFavoriteStatic : public cRecMenuItem {
private:
std::string text;
cPixmap *pixmapText;
cPixmap *pixmapIcons;
int DrawIcons(void);
public:
cRecMenuItemFavoriteStatic(std::string text, eRecMenuState action, bool active);
virtual ~cRecMenuItemFavoriteStatic(void);
void SetPixmaps(void);
void Hide(void);
void Show(void);
void Draw(void);
eRecMenuState ProcessKey(eKeys Key);
};
#endif //__TVGUIDE_RECMENUITEM_H
|