summaryrefslogtreecommitdiff
path: root/flat.h
blob: 27fbd25aa364c11a04c76029e9e3d7b0b39043b2 (plain)
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
#pragma once

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <stdint.h>
#include <string.h>

#include <vdr/skins.h>
#include <vdr/videodir.h>

#include "config.h"
#include "imagecache.h"

extern class cFlatConfig Config;
extern class cImageCache imgCache;
extern bool firstDisplay;

class cFlatDisplayMenu;
extern cTheme Theme;

// BUTTONS
#define CLR_BUTTONRED                       0xFFBB0000
#define CLR_BUTTONGREEN                     0xFF00BB00
#define CLR_BUTTONYELLOW                    0xFFBBBB00
#define CLR_BUTTONBLUE                      0xFF0000BB

// MESSAGES
#define CLR_MESSAGESTATUS                   0xFF0000FF
#define CLR_MESSAGEINFO                     0xFF009900
#define CLR_MESSAGEWARNING                  0xFFBBBB00
#define CLR_MESSAGEERROR                    0xFFBB0000

// TopBar
THEME_CLR(Theme, clrTopBarBg,               0xF0202020);
THEME_CLR(Theme, clrTopBarFont,             0xFFEEEEEE);
THEME_CLR(Theme, clrTopBarTimeFont,         0xFFEEEEEE);
THEME_CLR(Theme, clrTopBarDateFont,         0xFF909090);
THEME_CLR(Theme, clrTopBarBorderFg,         0xF0202020);
THEME_CLR(Theme, clrTopBarBorderBg,         0xF0202020);

THEME_CLR(Theme, clrTopBarRecordingActiveFg,  0xFF880000);
THEME_CLR(Theme, clrTopBarRecordingActiveBg,  0xF0202020);

THEME_CLR(Theme, clrTopBarConflictLowFg,      0xFFBBBB00);
THEME_CLR(Theme, clrTopBarConflictLowBg,      0xF0202020);
THEME_CLR(Theme, clrTopBarConflictHighFg,     0xFF880000);
THEME_CLR(Theme, clrTopBarConflictHighBg,    0xF0202020);

// Buttons
THEME_CLR(Theme, clrButtonBg,               0xF0202020);
THEME_CLR(Theme, clrButtonFont,             0xFFEEEEEE);
THEME_CLR(Theme, clrButtonRed,              CLR_BUTTONRED);
THEME_CLR(Theme, clrButtonGreen,            CLR_BUTTONGREEN);
THEME_CLR(Theme, clrButtonYellow,           CLR_BUTTONYELLOW);
THEME_CLR(Theme, clrButtonBlue,             CLR_BUTTONBLUE);

THEME_CLR(Theme, clrButtonBorderFg,        0xF0202020);
THEME_CLR(Theme, clrButtonBorderBg,        0xF0202020);

// Messages
THEME_CLR(Theme, clrMessageBg,              0xF0202020);
THEME_CLR(Theme, clrMessageFont,            0xFFEEEEEE);

THEME_CLR(Theme, clrMessageStatus,          CLR_MESSAGESTATUS);
THEME_CLR(Theme, clrMessageInfo,            CLR_MESSAGEINFO);
THEME_CLR(Theme, clrMessageWarning,         CLR_MESSAGEWARNING);
THEME_CLR(Theme, clrMessageError,           CLR_MESSAGEERROR);

THEME_CLR(Theme, clrMessageBorderFg,        0xF0202020);
THEME_CLR(Theme, clrMessageBorderBg,        0xF0202020);

// Channel
THEME_CLR(Theme, clrChannelBg,              0xF0202020);
THEME_CLR(Theme, clrChannelFontTitle,       0xFF03A9F4);
THEME_CLR(Theme, clrChannelFontEpg,         0xFFEEEEEE);
THEME_CLR(Theme, clrChannelFontEpgFollow,   0xFF909090);
THEME_CLR(Theme, clrChannelProgressFg,      0xFF03A9F4);
THEME_CLR(Theme, clrChannelProgressBarFg,   0xFF03A9F4);
THEME_CLR(Theme, clrChannelProgressBg,      0xF0202020);

THEME_CLR(Theme, clrChannelBorderFg,        0xF003A9F4);
THEME_CLR(Theme, clrChannelBorderBg,        0xF003A9F4);

THEME_CLR(Theme, clrChannelEPGBorderFg,        0xF003A9F4);
THEME_CLR(Theme, clrChannelEPGBorderBg,        0xF003A9F4);

THEME_CLR(Theme, clrChannelSignalFont,            0xFF909090);
THEME_CLR(Theme, clrChannelSignalProgressFg,      0xFF909090);
THEME_CLR(Theme, clrChannelSignalProgressBarFg,   0xFF909090);
THEME_CLR(Theme, clrChannelSignalProgressBg,      0xF0202020);

THEME_CLR(Theme, clrChannelRecordingPresentFg,    0xFFAA0000);
THEME_CLR(Theme, clrChannelRecordingPresentBg,    0xF0202020);
THEME_CLR(Theme, clrChannelRecordingFollowFg,     0xFF909090);
THEME_CLR(Theme, clrChannelRecordingFollowBg,     0xF0202020);

// Menu
THEME_CLR(Theme, clrItemBg,                 0xF0909090);
THEME_CLR(Theme, clrItemFont,               0xFFEEEEEE);
THEME_CLR(Theme, clrItemCurrentBg,          0xF003A9F4);
THEME_CLR(Theme, clrItemCurrentFont,        0xFFEEEEEE);
THEME_CLR(Theme, clrItemSelableBg,          0xF0202020);
THEME_CLR(Theme, clrItemSelableFont,        0xFFEEEEEE);
THEME_CLR(Theme, clrScrollbarFg,            0xFF03A9F4);
THEME_CLR(Theme, clrScrollbarBarFg,         0xFF03A9F4);
THEME_CLR(Theme, clrScrollbarBg,            0xF0202020);
// Menu Event
THEME_CLR(Theme, clrMenuEventBg,            0xF0202020);
THEME_CLR(Theme, clrMenuEventFontTitle,     0xFF03A9F4);
THEME_CLR(Theme, clrMenuEventTitleLine,     0xFF03A9F4);
THEME_CLR(Theme, clrMenuEventFontInfo,      0xFFEEEEEE);
// Menu Recording
THEME_CLR(Theme, clrMenuRecBg,              0xF0202020);
THEME_CLR(Theme, clrMenuRecFontTitle,       0xFF03A9F4);
THEME_CLR(Theme, clrMenuRecTitleLine,       0xFF03A9F4);
THEME_CLR(Theme, clrMenuRecFontInfo,        0xFFEEEEEE);
// Menu Text (Multiline)
THEME_CLR(Theme, clrMenuTextBg,             0xF0202020);
THEME_CLR(Theme, clrMenuTextFont,           0xFFEEEEEE);
THEME_CLR(Theme, clrMenuTextFixedFont,      0xFFEEEEEE);

THEME_CLR(Theme, clrMenuContentHeadBorderFg,        0xF003A9F4);
THEME_CLR(Theme, clrMenuContentHeadBorderBg,        0xF003A9F4);

THEME_CLR(Theme, clrMenuContentBorderFg,        0xF003A9F4);
THEME_CLR(Theme, clrMenuContentBorderBg,        0xF003A9F4);

// Menu Items
THEME_CLR(Theme, clrMenuItemProgressFg,      0xFFEEEEEE);
THEME_CLR(Theme, clrMenuItemProgressBarFg,   0xFFEEEEEE);
THEME_CLR(Theme, clrMenuItemProgressBg,      0xF0202020);
THEME_CLR(Theme, clrMenuItemCurProgressFg,      0xFFEEEEEE);
THEME_CLR(Theme, clrMenuItemCurProgressBarFg,   0xFFEEEEEE);
THEME_CLR(Theme, clrMenuItemCurProgressBg,      0xF003A9F4);

THEME_CLR(Theme, clrMenuItemBorderFg,      0xF0909090);
THEME_CLR(Theme, clrMenuItemBorderBg,      0xF0909090);
THEME_CLR(Theme, clrMenuItemSelableBorderFg,      0xF0202020);
THEME_CLR(Theme, clrMenuItemSelableBorderBg,      0xF0202020);
THEME_CLR(Theme, clrMenuItemCurrentBorderFg,      0xF003A9F4);
THEME_CLR(Theme, clrMenuItemCurrentBorderBg,      0xF003A9F4);

// Menu Timer Item
THEME_CLR(Theme, clrMenuTimerItemDisabledFont,       0xFF909090);
THEME_CLR(Theme, clrMenuTimerItemRecordingFont,      0xFFEEEEEE);

// For Tilde, Timer Extra, Program Short Text
THEME_CLR(Theme, clrMenuItemExtraTextFont,    0xFF909090);
THEME_CLR(Theme, clrMenuItemExtraTextCurrentFont,    0xFF909090);

// Replay
THEME_CLR(Theme, clrReplayBg,               0xF0202020);
THEME_CLR(Theme, clrReplayFont,             0xFFEEEEEE);
THEME_CLR(Theme, clrReplayFontSpeed,        0xFF03A9F4);
THEME_CLR(Theme, clrReplayProgressFg,       0xFFEEEEEE);
THEME_CLR(Theme, clrReplayProgressBarFg,    0xFFEEEEEE);
THEME_CLR(Theme, clrReplayProgressBarCurFg, 0xFF03A9F4);
THEME_CLR(Theme, clrReplayProgressBg,       0xF0202020);
THEME_CLR(Theme, clrReplayMarkFg,           0xFFEEEEEE);
THEME_CLR(Theme, clrReplayMarkCurrentFg,    0xFF03A9F4);

THEME_CLR(Theme, clrReplayBorderFg,         0xF0202020);
THEME_CLR(Theme, clrReplayBorderBg,         0xF0202020);

// Tracks
THEME_CLR(Theme, clrTrackItemBg,            0xF0909090);
THEME_CLR(Theme, clrTrackItemFont,          0xFFEEEEEE);
THEME_CLR(Theme, clrTrackItemSelableBg,     0xF0202020);
THEME_CLR(Theme, clrTrackItemSelableFont,   0xFFEEEEEE);
THEME_CLR(Theme, clrTrackItemCurrentBg,     0xF003A9F4);
THEME_CLR(Theme, clrTrackItemCurrentFont,   0xFFEEEEEE);

THEME_CLR(Theme, clrTrackItemBorderFg,      0xF0909090);
THEME_CLR(Theme, clrTrackItemBorderBg,      0xF0909090);
THEME_CLR(Theme, clrTrackItemSelableBorderFg,      0xF0202020);
THEME_CLR(Theme, clrTrackItemSelableBorderBg,      0xF0202020);
THEME_CLR(Theme, clrTrackItemCurrentBorderFg,      0xF003A9F4);
THEME_CLR(Theme, clrTrackItemCurrentBorderBg,      0xF003A9F4);

// Volume
THEME_CLR(Theme, clrVolumeBg,               0xF0202020);
THEME_CLR(Theme, clrVolumeFont,             0xFFEEEEEE);
THEME_CLR(Theme, clrVolumeProgressFg,       0xFF03A9F4);
THEME_CLR(Theme, clrVolumeProgressBarFg,    0xFF03A9F4);
THEME_CLR(Theme, clrVolumeProgressBg,       0xF0202020);

THEME_CLR(Theme, clrVolumeBorderFg,         0xF0202020);
THEME_CLR(Theme, clrVolumeBorderBg,         0xF0202020);

class cFlat : public cSkin {
    private:
        cFlatDisplayMenu *displayMenu;
    public:
        cFlat(void);
        virtual const char *Description(void);
        virtual cSkinDisplayChannel *DisplayChannel(bool WithInfo);
        virtual cSkinDisplayMenu *DisplayMenu(void);
        virtual cSkinDisplayReplay *DisplayReplay(bool ModeOnly);
        virtual cSkinDisplayVolume *DisplayVolume(void);
        virtual cSkinDisplayTracks *DisplayTracks(const char *Title, int NumTracks, const char * const *Tracks);
        virtual cSkinDisplayMessage *DisplayMessage(void);
};

char * substr(char * string, int start, int end);
char *GetFilenameWithoutext(char * fullfilename);

static inline uint32_t GetMsTicks(void)
{
#ifdef CLOCK_MONOTONIC
    struct timespec tspec;

    clock_gettime(CLOCK_MONOTONIC, &tspec);
    return (tspec.tv_sec * 1000) + (tspec.tv_nsec / (1000 * 1000));
#else
    struct timeval tval;

    if (gettimeofday(&tval, NULL) < 0)
        eturn 0;
    return (tval.tv_sec * 1000) + (tval.tv_usec / 1000);
#endif
}