24
23
#include "services/mailbox.h"
28
26
#include "texteffects.h"
31
28
static const char *allVdrFonts[] = {
33
29
trNOOP("TrueType Font"),
35
trNOOP("No TTF support!"),
37
30
trNOOP("Default OSD Font"),
38
31
trNOOP("Default Fixed Size Font"),
39
trNOOP("Default Small Font"),
32
trNOOP("Default Small Font")
43
35
// cPluginSkinEnigmaSetup
67
59
void cPluginSkinEnigmaSetup::Setup(void)
69
61
// update setup display
70
int current = Current();
62
int currentItem = Current();
74
66
Add(new cOsdItem(tr("General")));
75
67
Add(new cOsdItem(tr("Logos & Symbols")));
76
#ifndef DISABLE_ANIMATED_TEXT
77
68
Add(new cOsdItem(tr("Animated Text")));
79
69
if (::Setup.UseSmallFont == 1) { // only if "Use small font" = "skin dependent"
80
70
Add(new cOsdItem(tr("Fonts")));
85
75
} //TODO? else display "EPGsearch plugin not found"
88
SetCurrent(Get(current));
78
SetCurrent(Get(currentItem));
90
80
SetHelp(NULL, NULL, NULL, trVDR("Button$Open"));
137
127
SetupStore("StatusLineMode", EnigmaConfig.statusLineMode);
138
128
SetupStore("ShowWssSymbols", EnigmaConfig.showWssSymbols);
139
129
SetupStore("ShowStatusSymbols", EnigmaConfig.showStatusSymbols);
130
SetupStore("ShowScrollbar", EnigmaConfig.showScrollbar);
131
SetupStore("ShowSignalInfo", EnigmaConfig.showSignalInfo);
132
SetupStore("ShowCaMode", EnigmaConfig.showCaMode);
141
134
char tmp[sizeof(EnigmaConfig.allFonts[0].Name) + 8];
142
135
for (int id = 0; id < FONT_NUMFONTS; id++) {
166
159
state = AddSubMenu(new cMenuSetupGeneral(&data));
167
160
else if (strcmp(ItemText, tr("Logos & Symbols")) == 0)
168
161
state = AddSubMenu(new cMenuSetupLogos(&data));
169
#ifndef DISABLE_ANIMATED_TEXT
170
162
else if (strcmp(ItemText, tr("Animated Text")) == 0)
171
163
state = AddSubMenu(new cMenuSetupAnimText(&data));
173
164
else if (strcmp(ItemText, tr("Fonts")) == 0)
174
165
state = AddSubMenu(new cMenuSetupFonts(&data));
175
166
#ifdef USE_PLUGIN_EPGSEARCH
219
210
statusLineModeTexts[1] = tr("Help buttons");
220
211
statusLineModeTexts[2] = tr("Free last line");
213
showScrollbarTexts[0] = trVDR("no");
214
showScrollbarTexts[1] = trVDR("yes");
215
showScrollbarTexts[2] = tr("if required");
239
233
Add(new cMenuEditBoolItem(tr("Full title width"), &data->fullTitleWidth));
240
234
Add(new cMenuEditStraItem(tr("Show remaining/elapsed time"), &data->showRemaining, 3, showRemainingTexts));
241
235
Add(new cMenuEditBoolItem(tr("Show VPS"), &data->showVps));
236
#ifndef DISABLE_SIGNALINFO
237
Add(new cMenuEditBoolItem(tr("Show signal info"), &data->showSignalInfo));
238
#endif //DISABLE_SIGNALINFO
239
Add(new cMenuEditBoolItem(tr("Show CA system as text"), &data->showCaMode));
242
240
Add(new cMenuEditBoolItem(tr("Show progressbar"), &data->showProgressbar));
243
#ifdef USE_PLUGIN_AVARDS
244
//TODO: USE_PLUGIN_AVARDS only if APIVERSNUM < 10504
245
cPlugin *pAvardsPlugin = cPluginManager::GetPlugin("avards");
246
if (pAvardsPlugin != NULL) {
247
#if APIVERSNUM < 10504
248
if (pAvardsPlugin->Service(AVARDS_MAXOSDSIZE_SERVICE_STRING_ID)) {
250
Add(new cMenuEditBoolItem(tr("Dynamic OSD size"), &data->dynOsd));
251
#if APIVERSNUM < 10504
253
Add(new cOsdItem(AVARDS_MAXOSDSIZE_SERVICE_STRING_ID " service not found!", osUnknown, false));
256
} //TODO? else display "Avards not found"
241
Add(new cMenuEditBoolItem(tr("Dynamic OSD size"), &data->dynOsd));
258
242
Add(new cMenuEditStraItem(tr("Show messages in menu on"), &data->statusLineMode, 3, statusLineModeTexts));
243
Add(new cMenuEditStraItem(tr("Show scrollbar in menu"), &data->showScrollbar, 3, showScrollbarTexts));
260
SetCurrent(Get(current));
245
SetCurrent(Get(currentItem));
262
247
SetHelp(NULL, NULL, NULL, NULL);
387
372
Add(new cMenuEditIntItem(tr("Channel logo cache size"), &data->cacheSize, 0, 1000));
390
SetCurrent(Get(current));
375
SetCurrent(Get(currentItem));
392
377
SetHelp(tr("Button$Flush cache"), NULL, NULL, NULL);
395
#ifndef DISABLE_ANIMATED_TEXT
396
380
// Setup: Animated Text
397
381
cMenuSetupAnimText::cMenuSetupAnimText(cEnigmaConfig* Data) : cMenuSetupSubMenu(tr("Animated Text"), Data)
425
409
Add(new cMenuEditBoolItem(tr(" Scroll info area"), &data->scrollInfo));
426
410
Add(new cMenuEditBoolItem(tr(" Scroll active list items"), &data->scrollListItem));
427
411
Add(new cMenuEditBoolItem(tr(" Scroll other items"), &data->scrollOther));
428
Add(new cMenuEditStraItem(tr(" Scoll behaviour"), &data->scrollMode, 2, scrollModeTexts));
429
Add(new cMenuEditIntItem(tr(" Scroll delay (ms)"), &data->scrollDelay, 50, 1000));
412
Add(new cMenuEditStraItem(tr(" Scroll behaviour"), &data->scrollMode, 2, scrollModeTexts));
413
Add(new cMenuEditIntItem(tr(" Scroll delay (ms)"), &data->scrollDelay, 3, 1000));
430
414
Add(new cMenuEditIntItem(tr(" Scroll pause (ms)"), &data->scrollPause, 500, 2000));
431
415
Add(new cMenuEditIntItem(tr(" Blink pause (ms)"), &data->blinkPause, 500, 2000));
434
SetCurrent(Get(current));
418
SetCurrent(Get(currentItem));
436
420
SetHelp(NULL, NULL, NULL, NULL);
442
#if VDRVERSNUM < 10504
443
cMenuSetupTTF::cMenuSetupTTF(FontInfo* Data) : cOsdMenu(tr("TrueType Font"), 10)
444
#else // VDRVERSNUM >= 10504
445
424
cMenuSetupTTF::cMenuSetupTTF(FontInfo* Data, cStringList* fonts) : cOsdMenu(tr("TrueType Font"), 10)
446
#endif // VDRVERSNUM < 10504
449
#if VDRVERSNUM < 10504
450
availTTFs = EnigmaTextEffects.GetAvailTTFs();
451
if (availTTFs && data) {
452
nMaxTTFs = EnigmaTextEffects.GetNumAvailTTFs();
454
for (int i = 0; i < nMaxTTFs; i++) {
456
if (strcmp(availTTFs[i], data->Name) == 0) {
462
nWidth = data->Width;
465
#else // VDRVERSNUM >= 10504
466
427
if (data && fonts) {
467
428
fontList = fonts;
468
429
nFont = std::max(0, fontList->Find(data->Name));
469
430
nWidth = data->Width;
470
431
nSize = data->Size;
472
#endif // VDRVERSNUM < 10504
474
434
SetHelp(NULL, NULL, NULL, NULL);
478
438
void cMenuSetupTTF::Set(void)
480
int current = Current();
440
int currentItem = Current();
483
#if VDRVERSNUM < 10504
485
Add(new cMenuEditStraItem(tr("Name"), &nFont, nMaxTTFs, availTTFs));
486
#else // VDRVERSNUM >= 10504
487
443
if (fontList->Size() > 0) {
488
444
Add(new cMenuEditStraItem(tr("Name"), &nFont, fontList->Size(), &(*fontList)[0]));
489
#endif // VDRVERSNUM < 10504
490
445
Add(new cMenuEditIntItem(tr("Size"), &nSize, 10, MAXFONTSIZE));
491
#if VDRVERSNUM < 10503 || VDRVERSNUM >= 10505
492
//VDR 1.5.2 - 1.5.4 can't set TTF width
493
446
Add(new cMenuEditIntItem(tr("Width"), &nWidth, 50, 150));
495
SetCurrent(Get(current));
447
SetCurrent(Get(currentItem));
497
449
cOsdItem *item = new cOsdItem(tr("No TrueType fonts installed!"));
526
478
void cMenuSetupTTF::Store(void)
528
#if VDRVERSNUM < 10504
529
if (data && availTTFs) {
530
strncpy(data->Name, availTTFs[nFont], sizeof(data->Name));
531
data->Width = nWidth;
534
#else // VDRVERSNUM >= 10504
536
481
Utf8Strn0Cpy(data->Name, (*fontList)[nFont], sizeof(data->Name));
537
482
data->Width = nWidth;
538
483
data->Size = nSize;
540
#endif // VDRVERSNUM < 10504
545
488
cMenuSetupFonts::cMenuSetupFonts(cEnigmaConfig* Data) : cMenuSetupSubMenu(tr("Fonts"), Data)
548
490
allVdrFonts[0] = tr("TrueType Font");
550
allVdrFonts[0] = tr("No TTF support!");
552
491
allVdrFonts[1] = tr("Default OSD Font");
553
492
allVdrFonts[2] = tr("Default Fixed Size Font");
554
493
allVdrFonts[3] = tr("Default Small Font");
557
#if VDRVERSNUM >= 10504
558
495
cFont::GetAvailableFontNames(&fontMonoNames, true);
559
496
cFont::GetAvailableFontNames(&fontNames);
572
507
eOSState state = cMenuSetupSubMenu::ProcessKey(Key);
575
509
if (state == osUnknown && Key == kBlue && data->allFonts[Current()].VdrId == FONT_TRUETYPE) {
576
#if VDRVERSNUM < 10504
577
state = AddSubMenu(new cMenuSetupTTF(&data->allFonts[Current()]));
578
#else // VDRVERSNUM >= 10504
579
510
state = AddSubMenu(new cMenuSetupTTF(&data->allFonts[Current()], strncmp(Get(Current())->Text(), tr("Fixed Font"), strlen(tr("Fixed Font"))) == 0 ? &fontMonoNames : &fontNames));
582
512
if (!HasSubMenu() && data->allFonts[Current()].VdrId == FONT_TRUETYPE)
583
513
SetHelp(NULL, NULL, NULL, tr("Button$Set"));
585
515
SetHelp(NULL, NULL, NULL, NULL);
592
521
void cMenuSetupFonts::Set(void)
594
int current = Current();
523
int currentItem = Current();
597
526
int numAvailFonts = sizeof(allVdrFonts)/sizeof(char*);
614
543
Add(new cMenuEditStraItem(tr("Replay: times"), &data->allFonts[FONT_REPLAYTIMES].VdrId, numAvailFonts, allVdrFonts));
615
544
Add(new cMenuEditStraItem(tr("Fixed Font"), &data->allFonts[FONT_FIXED].VdrId, numAvailFonts, allVdrFonts));
617
SetCurrent(Get(current));
546
SetCurrent(Get(currentItem));
620
548
if (data->allFonts[Current()].VdrId == FONT_TRUETYPE)
621
549
SetHelp(NULL, NULL, NULL, tr("Button$Set"));
624
551
SetHelp(NULL, NULL, NULL, NULL);