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
|
/*
* GraphLCD plugin for the Video Disk Recorder
*
* display.h - display class
*
* This file is released under the GNU General Public License. Refer
* to the COPYING file distributed with this package.
*
* (c) 2001-2004 Carsten Siebholz <c.siebholz AT t-online.de>
* (c) 2004 Andreas Regel <andreas.regel AT powarman.de>
*/
#ifndef GRAPHLCD_DISPLAY_H
#define GRAPHLCD_DISPLAY_H
#include <stdint.h>
#include <string>
#include <vector>
#include <glcdgraphics/bitmap.h>
#include <glcdgraphics/font.h>
#include "global.h"
#include "layout.h"
#include "logolist.h"
#include "setup.h"
#include "state.h"
#include "widgets.h"
#include <vdr/thread.h>
#include <vdr/player.h>
#define LCDMAXCARDS 4
static const int kMaxTabCount = 10;
enum ThreadState
{
Normal,
Replay,
Menu
};
// Display update Thread
class cGraphLCDDisplay : public cThread
{
public:
cGraphLCDDisplay(void);
~cGraphLCDDisplay(void);
int Init(GLCD::cDriver * Lcd, const char * CfgDir);
void Tick(void);
void SetChannel(int ChannelNumber);
void SetClear();
void SetOsdTitle();
void SetOsdItem(const char * Text);
void SetOsdCurrentItem();
void Recording(const cDevice * Device , const char * Name);
void Replaying(bool starting, eReplayMode replayMode);
//void SetStatusMessage(const char * Msg);
void SetOsdTextItem(const char * Text, bool Scroll);
//void SetColorButtons(const char * Red, const char * Green, const char * Yellow, const char * Blue);
void SetVolume(int Volume, bool Absolute);
void Update();
protected:
virtual void Action();
private:
bool update;
bool active;
GLCD::cDriver * mLcd;
cFontList fontList;
GLCD::cBitmap * bitmap;
const GLCD::cFont * largeFont;
const GLCD::cFont * normalFont;
const GLCD::cFont * smallFont;
const GLCD::cFont * symbols;
std::string cfgDir;
std::string fontDir;
std::string logoDir;
ThreadState State;
ThreadState LastState;
cMutex mutex;
cGraphLCDState * GraphLCDState;
int menuTop;
int menuCount;
int tabCount;
int tab[kMaxTabCount];
int tabMax[kMaxTabCount];
std::vector <std::string> textItemLines;
int textItemTop;
int textItemVisibleLines;
bool showVolume;
time_t CurrTime;
time_t LastTime;
time_t LastTimeCheckSym;
time_t LastTimeModSym;
struct timeval CurrTimeval;
struct timeval UpdateAt;
std::vector<cScroller> scroller;
cGraphLCDLogoList * logoList;
cGraphLCDLogo * logo;
char szETSymbols[32];
void DisplayChannel();
void DisplayTime();
void DisplayLogo();
void DisplaySymbols();
void DisplayProgramme();
void DisplayReplay(tReplayState & replay);
void DisplayMenu();
void DisplayMessage();
void DisplayTextItem();
void DisplayColorButtons();
void DisplayVolume();
void UpdateIn(long usec);
bool CheckAndUpdateSymbols();
/** Check if replay index bigger as one hour */
bool IndexIsGreaterAsOneHour(int Index, double framesPerSecond) const;
/** Translate replay index to string with minute and second MM:SS */
const char *IndexToMS(int Index, double framesPerSecond) const;
/** Compare Scroller with new Textbuffer*/
bool IsScrollerTextChanged(const std::vector<cScroller> & scroller, const std::vector <std::string> & lines) const;
/** Returns true if Logo loaded and active*/
bool IsLogoActive() const;
/** Returns true if Symbols loaded and active*/
bool IsSymbolsActive() const;
/** Set Brightness depends user activity */
void SetBrightness();
uint64_t LastTimeBrightness;
int nCurrentBrightness;
bool bBrightnessActive;
cCharSetConv *conv;
const char * Convert(const char *s);
};
#endif
|