File: setup.h

package info (click to toggle)
vdr-plugin-osdteletext 2.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 860 kB
  • sloc: ansic: 12,465; makefile: 83; sh: 14
file content (169 lines) | stat: -rw-r--r-- 5,010 bytes parent folder | download | duplicates (2)
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
/*************************************************************** -*- c++ -*-
 *       Copyright (c) < 2021    by TODO                                   *
 *       Copyright (c) 2021      by Peter Bieringer (extenions)            *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/


#ifndef __SETUP_H
#define __SETUP_H

#include <vdr/config.h>

// max for setup
#define HOTKEY_LEVEL_MAX_LIMIT         9  // maximum supported by SetupStore parser: 9, required minimum: 1
#define HOTKEY_LEVEL_MAX_LIMIT_STRING "9" // as string to be displayed in online help

#define OSD_PRESET_MAX_LIMIT         9  // maximum supported by SetupStore parser: 9, required minimum: 1
#define OSD_PRESET_MAX_LIMIT_STRING "9" // as string to be displayed in online help

// min/max for setup
#define OSDleftPctMin      0
#define OSDleftPctMax     90
#define OSDtopPctMin       0
#define OSDtopPctMax      90
#define OSDwidthPctMin    10
#define OSDwidthPctMax   100
#define OSDheightPctMin   10
#define OSDheightPctMax  100
#define OSDframePixMin     0
#define OSDframePixMax   100
#define txtVoffsetMin    -10
#define txtVoffsetMax    +10
#define BackTransMin       0
#define BackTransMax     255

// There are two places to be kept in sync with these enums:
//  TeletextBrowser::TranslateKey and 
// 1:1 relation between st_modes[] in osdteletext.c + eTeletextAction in setup.h + st_modesHotkey in setup.c
enum eTeletextAction {
   Zoom,
   HalfPage,
   SwitchChannel,
   DarkScreen,
   Config,
   LineMode24,
   ToggleConceal,
   TogglePause,
   HotkeyLevelPlus,
   HotkeyLevelMinus,
   OsdPresetPlus,
   OsdPresetMinus,
   LastAction // has to stay always as the last one (special flag for 'jump to pages')
}; //and 100-899 => jump to page

enum eTeletextActionConfig {
   Left,
   Top,
   Width,
   Height,
   Frame,
   Font,
   Voffset,
   BackTrans,
   LastActionConfig, // has to stay always the last one
};

enum eTeletextActionValueType {
   Pct,
   Pix,
   Int,
   Str,
   None,
};


// values stored in setup.c:
extern const char *st_modesHotkey[];
extern const char *config_modes[];

enum ActionKeys {
   // keep in sync: static const ActionKeyName st_actionKeyNames in osdteletext.c
   ActionKeyFastRew,
   ActionKeyFastFwd,
   ActionKeyStop,
   ActionKeyOk,
   ActionKeyPlay,

   LastActionKey
};

enum ActionHotkeys {
   // keep in sync: static const ActionKeyName st_actionHotkeyNames in osdteletext.c
   ActionHotkeyRed,
   ActionHotkeyGreen,
   ActionHotkeyYellow,
   ActionHotkeyBlue,

   LastActionHotkey
};

enum HotkeyFlag {
   HotkeyNormal,
   HotkeyYellowValue,
   HotkeyGreenYellowValue
};

enum InfoLineFlag {
   InfoLine1,
   InfoLine2
};

enum HintLinesMode {
   HintLinesHotkeys = 0,
   HintLinesNone = 1,
   HintLinesHotkeysAndStdkeys = 2
};

//Default values are set in menu.c, setup menu, parsing and storing can be found in osdteletext.c
class TeletextSetup {
public:
   TeletextSetup();
   bool migrationFlag_2_2;
   int osdConfig[(int) eTeletextActionConfig::LastActionConfig][OSD_PRESET_MAX_LIMIT];
   int mapKeyToAction[(int) ActionKeys::LastActionKey]; // see enum ActionKeys
   int mapHotkeyToAction[(int) ActionHotkeys::LastActionHotkey][HOTKEY_LEVEL_MAX_LIMIT]; // see enum ActionHotkeys and HotkeyLevelMax
   int configuredClrBackground; // legacy TODO remove >= 2.3.0
   int showClock;
   int autoUpdatePage;
   int osdPresetMax;
   int hotkeyLevelMax;
   int HideMainMenu;
   cStringList txtFontNames;
   int txtG0Block;
   int txtG2Block;
   const char *txtBlock[11]; // see osdteletext.c
   int colorMode4bpp;
   int lineMode24;
   const char *lineMode[3]; // see osdteletext.c

   // current value of osdPreset
   int osdPreset;
};

// shortcut to OSD config value of current preset
#define TTSETUPPRESET(type) ttSetup.osdConfig[type][ttSetup.osdPreset]

// shortcut to OSD config value of current preset converted to TCOLOR value incl. negate
#define TTSETUPPRESET_TCOLOR(type) ((tColor) (((uint32_t) (255 - (ttSetup.osdConfig[type][ttSetup.osdPreset] & 0xff))) << 24))

// shortcut to OSD config value of current preset converted to font name
#define TTSETUPPRESET_FONTNAME(type) ttSetup.txtFontNames[TTSETUPPRESET(type)]

// Teletext display lines
//  ttSetup.lineMode24 == HintLinesHotkeys     : 25
//  ttSetup.lineMode24 == HintLinesNone        : 24
//  ttSetup.lineMode24 == (others)             : 27
#define TT_DISPLAY_LINES  ((ttSetup.lineMode24 == HintLinesNone) ? 24 : ((ttSetup.lineMode24 == HintLinesHotkeys) ? 25 : 27))


extern TeletextSetup ttSetup;

#endif

// vim: ts=3 sw=3 et