diff options
author | Andreas Mair <amair.sob@googlemail.com> | 2007-03-06 09:26:11 +0100 |
---|---|---|
committer | Andreas Mair <amair.sob@googlemail.com> | 2007-03-06 09:26:11 +0100 |
commit | de39678a54ab87364a3c8c5e3b058d313451db5b (patch) | |
tree | 46ea3b911b6fb0982d910e5bcd398d373f86a887 | |
parent | b1fa489fdbd06712add00390966defbe9a96232a (diff) | |
download | vdr-plugin-skinenigmang-de39678a54ab87364a3c8c5e3b058d313451db5b.tar.gz vdr-plugin-skinenigmang-de39678a54ab87364a3c8c5e3b058d313451db5b.tar.bz2 |
2007-03-06: Version 0.0.3v0.0.3
- New command line option "-l" to set the logo path.
- Added support for epgsearch's timer check auxiliary info in a recording's info.
- Reorganized setup menu.
- Don't use small font in a recording's replay info.
- Show channel name and number in recording's info.
- Don't use small font for description in event and recording info.
- Added setup options for epgsearch features.
- Use location set at "Channel info position" to display channel info.
- Fixed transparent group titles in menus. (Reported by several users)
- New (temporary) compile time option SKINENIGMA_FULL_CHANNELINFO_TITLE.
- Fixed duration and elapsed/remaining time displaying in channel info.
- Enhanced setup option "Show remaining/elapsed time".
- Enhanced setup option "Show Symbols".
- Changed alignment in bottom line of channel info.
- New setup option to hide language flags; shows language name in channel info. (Suggested by balta @vdr-portal.de)
- Redraw date in main menu and channel info only if time changed. (Based on suggestion by Hanspeter)
- Changed detection for main menu; it now must start with "VDR - ". (Based on patch by triple955 @vdr-portal.de)
- Fixed problems with floating text. (Patch by triple955 @vdr-portal.de)
- Localized full weekday name.
- Added new setup option for 8bpp or 4bpp single area.
- Added Russian translation (Submitted by SergArb @vdr-portal.de).
- Log "LOGO NOT FOUND" errors to syslog (Requested by Der_Pit).
- Changed a false 4bpp area to 2bpp.
- Corrected brackets (Reported by Sebastian Werner).
- Many other fixes and graphical changes.
-rw-r--r-- | HISTORY | 27 | ||||
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | README | 96 | ||||
-rw-r--r-- | config.c | 3 | ||||
-rw-r--r-- | config.h | 5 | ||||
-rw-r--r-- | enigma.c | 678 | ||||
-rw-r--r-- | i18n.c | 424 | ||||
-rw-r--r-- | logo.c | 3 | ||||
-rw-r--r-- | skinenigmang.c | 120 | ||||
-rw-r--r-- | themes/EnigmaNG-YellowSun.theme | 54 | ||||
-rw-r--r-- | tools.c | 70 |
11 files changed, 1167 insertions, 323 deletions
@@ -1,6 +1,33 @@ VDR Skin 'EnigmaNG' Revision History ------------------------------------------ +2007-03-06: Version 0.0.3 +- New command line option "-l" to set the logo path. +- Added support for epgsearch's timer check auxiliary info in a recording's info. +- Reorganized setup menu. +- Don't use small font in a recording's replay info. +- Show channel name and number in recording's info. +- Don't use small font for description in event and recording info. +- Added setup options for epgsearch features. +- Use location set at "Channel info position" to display channel info. +- Fixed transparent group titles in menus. (Reported by several users) +- New (temporary) compile time option SKINENIGMA_FULL_CHANNELINFO_TITLE. +- Fixed duration and elapsed/remaining time displaying in channel info. +- Enhanced setup option "Show remaining/elapsed time". +- Enhanced setup option "Show Symbols". +- Changed alignment in bottom line of channel info. +- New setup option to hide language flags; shows language name in channel info. (Suggested by balta @vdr-portal.de) +- Redraw date in main menu and channel info only if time changed. (Based on suggestion by Hanspeter) +- Changed detection for main menu; it now must start with "VDR - ". (Based on patch by triple955 @vdr-portal.de) +- Fixed problems with floating text. (Patch by triple955 @vdr-portal.de) +- Localized full weekday name. +- Added new setup option for 8bpp or 4bpp single area. +- Added Russian translation (Submitted by SergArb @vdr-portal.de). +- Log "LOGO NOT FOUND" errors to syslog (Requested by Der_Pit). +- Changed a false 4bpp area to 2bpp. +- Corrected brackets (Reported by Sebastian Werner). +- Many other fixes and graphical changes. + 2007-02-19: Version 0.0.2 - Fixed problems in replay OSD when not using small font (Reported by several people). - Only display reruns of current event in EPG info if there are more than two reruns. @@ -1,7 +1,7 @@ # # Makefile for a Video Disk Recorder plugin # -# $Id: Makefile,v 1.2 2007/02/15 13:37:17 amair Exp $ +# $Id: Makefile,v 1.4 2007/03/06 07:02:27 amair Exp $ # If you are using the epgsearch plugin and want to see the number of # timer conflicts in the main menu's info area. @@ -14,6 +14,10 @@ # Debugging on/off #SKINENIGMA_DEBUG = 1 +# If set the top and bottom borders are drawn around the channel logo +# in the channel info. TEMPORARY OPTION?!? +#SKINENIGMA_FULL_CHANNELINFO_TITLE = 1 + # Strip debug symbols? Set eg. to /bin/true if not #STRIP = strip STRIP = /bin/true @@ -70,6 +74,10 @@ ifdef SKINENIGMA_NO_MENULOGO DEFINES += -DSKINENIGMA_NO_MENULOGO endif +ifdef SKINENIGMA_FULL_CHANNELINFO_TITLE +DEFINES += -DSKINENIGMA_FULL_CHANNELINFO_TITLE +endif + ### The object files (add further files here): OBJS = $(PLUGIN).o enigma.o config.o logo.o i18n.o tools.o status.o @@ -37,6 +37,10 @@ SKINENIGMA_NO_MENULOGO = 1 This turns usage of logos in the main menu complete. This might also improve the performance of the menus. EXPERIMENTAL!!! +SKINENIGMA_FULL_CHANNELINFO_TITLE = 1 +If set the top and bottom borders are drawn around the channel logo +in the channel info. TEMPORARY OPTION?!? + Patches ------- @@ -78,6 +82,14 @@ some things before: > cd /path/to/vdrconf/themes/ > rm -f EnigmaNG-*.theme + +Options +------- + + -l path, --logodir=path + Path to the logos. + + Usage ----- @@ -87,45 +99,75 @@ In VDR go to the OSD settings menu and select the skin "EnigmaNG" Setup Options ------------- -- Show auxiliary information top/bottom +- One area (if possible) + If you don't want to use a single 8bpp area for the OSD you can disable + it here. If this option is enabled this will not ensure that a single + area is used, but EnigmaNG will try to use it. If your output deviice + can handle that area (e.g. softdevice) it will be used. Otherwise multiple + areas are used. + This option might be useful for 4MB modded DVB cards because they say they + can handle the 8bpp single area but the OSD will be slower. If you own such + a card you may want to play with that option and see if you can increase + OSD speed. + NOTE: after commit the settings you have to fully close and re-open the OSD + to make the change affect. + +- Bpp in single area (4/8) + The number of bpp (bit per pixel) to use for the single area. + 4bpp means upto 16 colors, 8bpp means upto 256 colors. + NOTE: if this is set to 4bpp you should also disable "Show symbols" because + otherwise a palette overflow is very likely. + +- Show info area in main menu + This info area is shown in the main menu and it will show the current/next + timers and the number of timer conflicts (if SKINENIGMA_HAVE_EPGSEARCH has been defined). + +- Show auxiliary information (top/bottom) Here you can set where you want to have the auxiliary information when you open an event's or recording's info screen. This information includes for a recording its channel, size, priority, lifetime, audio languages and some values that selected plugins (epgsearch, VDRAdmin-AM, pin) have set. For an event the audio languages are shown. -- Show remaining/elapsed time +- Show remaining/elapsed time (elapsed/remaining/percent) Here you can set if you want to read the number of minutes an event is already running (preceded by "+") or the number of minutes an event will - run (preceded by "-") in the channel info. - -- Show symbols in lists - This replaces "T", "t", "V"... in the EPG views symbols. + run (preceded by "-") or the percent the event has been running in the + channel info. +- Show VPS + Hide or show VPS information in channel info and event info. + - Show progressbar This replaces progressbars shown with pipes (e.g. [|| ]) by a graphical progressbar. -- Show symbols +* Logos & Symbols + +- Show symbols (never/always/not in menu/only in menu) Here you can enable or disable the large symbols shown in top right corner of the main menu, the recordings info and the event info and the "background" symbol of the mode symbol when replaying recordings. + Possible options: + never - don't show them anywhere + always - show them everywhere + not in menu - don't show them in the main menu or recording/even info + only in menu - only show them in the main menu or recording/even info -- Show info area in main menu - This info area is shown in the main menu and it will show the current/next - timers and the number of timer conflicts (if SKINENIGMA_HAVE_EPGSEARCH has been defined). +- Show symbols in lists + This replaces "T", "t", "V"... in the EPG views symbols. - Show marker in lists If enabled a small circle is drawn in front of the selected item in lists. -- Show VPS - Hide or show VPS information in channel info and event info. +- Show flags + If enabled graphical flags are drawn for the audio channel languages if the + requested flag file exists. Else language's abbreviation is drawn. - - Show channel logos Hide or show channel logos in channel info. -- Identify channel by name/data +- Identify channel by (name/data) Here you can choose if the channel logo should be searched by the channel's name (e.g. "YLETV2" -> "YLETV2.xpm") or by the channel's unique id (e.g. "T-8438-4097-33.xpm"). @@ -134,6 +176,30 @@ Setup Options - Channel logo cache size The number of logos/symbols to keep in the cache. +* EPGSearch + +- Number of Reruns (0 - 10) + The number of reruns to show in an event's info. + +- Use Subtitle for reruns (never/if exists/always) + If set to "never" all events will match that _contain_ the current event's + title in their title, e.g. if title is "Brisant" it will also find + "Brisant Classix". + If set to "if exists" it will use the subtitle to find reruns if the + current event contains a subtitle. This will also require a full title match, + e.g. if title is "Brisant" and subtitle is "Boulevard Magazin" it will find + only events with title and subtitle beeing exactly "Brisant" and "Boulevard + Magazin". It won't find events named "Brisant Classix" or "Brisant" without + subtitle. + If set to "always" it will always use the subtitle even if it's empty. As a + sideeffect also the event titles must match exactly, e.g. if title is + "Tagesschau" it will only find events named "Tagesschau" and not "Tagesschau + vor 30 Jahren". + +- Show timer conflicts + Enable or disable showing the number of timer conflicts in the main menu's + info area. + Notes ----- @@ -174,6 +240,8 @@ Credits WomensLike: http://www.vdr-portal.de/board/thread.php?threadid=59651 WineRed: http://www.vdr-portal.de/board/thread.php?threadid=59416 AppleGreen: http://www.vdr-portal.de/board/thread.php?threadid=59427 + YellowSun: http://www.vdr-portal.de/board/thread.php?postid=581117 - skiller2k1 @vdr-portal.de for Comedy Central logo. http://www.vdr-portal.de/board/thread.php?postid=567887#post567887 + @@ -14,7 +14,8 @@ cEnigmaConfig EnigmaConfig; cEnigmaConfig::cEnigmaConfig() : showAuxInfo(1), showLogo(1), showVps(1), showSymbols(1), showListSymbols(1), showProgressbar(1), cacheSize(50), useChannelId(0), showInfo(1), showRemaining(0), showMarker(1), - singleArea(1) + singleArea(1), singleArea8Bpp(1), showFlags(1), numReruns(5), + useSubtitleRerun(1), showTimerConflicts(1) { memset(logoDir, 0, sizeof(logoDir)); } @@ -29,6 +29,11 @@ public: int showRemaining; int showMarker; int singleArea; + int singleArea8Bpp; + int showFlags; + int numReruns; + int useSubtitleRerun; + int showTimerConflicts; }; extern cEnigmaConfig EnigmaConfig; @@ -209,12 +209,8 @@ THEME_CLR(Theme, clrReplayProgressCurrent, 0xFFFF0000); #define LogoDecoWidth SmallGap #define MarkerGap 6 -/* LogoHeight must be maximum of - * - the height needed for titlebar, event title & subtitle (see cSkinEnigmaDisplayMenu::SetEvent() & cSkinEnigmaDisplayMenu::SetRecording()) - * - the height of the message OSD - */ -#define LogoHeight max(cFont::GetFont(fontOsd)->Height() * 3 + TitleDeco + SmallGap, cFont::GetFont(fontOsd)->Height() * 2 + TitleDeco + SmallGap * 2 + MessageHeight) -#define LogoWidth LogoHeight +#define SymbolHeight 18 +#define LogoHeight 80 // --- cSkinEnigmaDisplayChannel -------------------------------------------- @@ -222,6 +218,7 @@ class cSkinEnigmaDisplayChannel:public cSkinDisplayChannel { private: cOsd *osd; bool fShowLogo; + time_t lastTime; int xLogoLeft, xLogoRight, yLogoTop, yLogoBottom, xLogoDecoLeft, xLogoDecoRight, xLogoPos, yLogoPos; int xTitleLeft, xTitleRight, yTitleTop, yTitleBottom, yTitleDecoTop, yTitleDecoBottom; @@ -229,6 +226,7 @@ private: int xEventNextLeft, xEventNextRight, yEventNextTop, yEventNextBottom; int xBottomLeft, xBottomRight, yBottomTop, yBottomBottom; int xMessageLeft, xMessageRight, yMessageTop, yMessageBottom; + int xFirstSymbol; int lineHeightSml; int lineHeightOsd; @@ -251,17 +249,24 @@ public: cSkinEnigmaDisplayChannel::cSkinEnigmaDisplayChannel(bool WithInfo) { fShowLogo = EnigmaConfig.showLogo; + xFirstSymbol = 0; + lastTime = 0; lineHeightSml = cFont::GetFont(fontSml)->Height(); lineHeightOsd = cFont::GetFont(fontOsd)->Height(); int LogoSize = max(lineHeightSml * 2 + lineHeightOsd * 2 + SmallGap, LogoHeight); + LogoSize += (LogoSize % 2 ? 1 : 0); // title bar & logo area xLogoLeft = 0; xLogoRight = xLogoLeft + LogoSize; xLogoDecoLeft = xLogoRight + LogoDecoGap; xLogoDecoRight = xLogoDecoLeft + LogoDecoWidth; +#ifdef SKINENIGMA_FULL_CHANNELINFO_TITLE + xTitleLeft = xLogoLeft; +#else xTitleLeft = (fShowLogo ? xLogoDecoRight + LogoDecoGap2 : 0); +#endif xTitleRight = xTitleLeft + ((Setup.OSDWidth - xTitleLeft) & ~0x07); // width must be multiple of 8 yTitleTop = 0; yTitleBottom = yTitleTop + lineHeightOsd; @@ -272,7 +277,11 @@ cSkinEnigmaDisplayChannel::cSkinEnigmaDisplayChannel(bool WithInfo) xLogoPos = xLogoLeft + (LogoSize - LogoHeight) / 2; yLogoPos = yLogoTop + (LogoSize - LogoHeight) / 2; // current event area +#ifdef SKINENIGMA_FULL_CHANNELINFO_TITLE + xEventNowLeft = (fShowLogo ? xLogoDecoRight + LogoDecoGap2 : 0); +#else xEventNowLeft = xTitleLeft; +#endif xEventNowRight = xTitleRight; yEventNowTop = yLogoTop; yEventNowBottom = yEventNowTop + lineHeightOsd + lineHeightSml; @@ -287,15 +296,15 @@ cSkinEnigmaDisplayChannel::cSkinEnigmaDisplayChannel(bool WithInfo) yBottomTop = yEventNextBottom + SmallGap; yBottomBottom = yBottomTop + lineHeightOsd; // message area - xMessageLeft = xTitleLeft; + xMessageLeft = xEventNowLeft; xMessageRight = xTitleRight; yMessageTop = yLogoTop + (LogoSize - 2 * SmallGap - lineHeightSml - 2 * SmallGap) / 2; yMessageBottom = yMessageTop + MessageHeight; // create osd - osd = cOsdProvider::NewOsd(Setup.OSDLeft, Setup.OSDTop + Setup.OSDHeight - yBottomBottom); + osd = cOsdProvider::NewOsd(Setup.OSDLeft, Setup.OSDTop + (Setup.ChannelInfoPos ? 0 : (Setup.OSDHeight - yBottomBottom)) ); tArea Areas[] = { {0, 0, xBottomRight - 1, yBottomBottom - 1, fShowLogo ? 8 : 4} }; - if (EnigmaConfig.singleArea && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea) == oeOk)) { + if (EnigmaConfig.singleArea && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) { osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); // clear all osd->DrawRectangle(0, 0, osd->Width(), osd->Height(), clrTransparent); @@ -379,6 +388,10 @@ void cSkinEnigmaDisplayChannel::DrawGroupInfo(const cChannel *Channel, int Numbe const cFont *font = cFont::GetFont(fontOsd); int xName = xTitleLeft + Roundness + font->Width("0000-") + Gap; +#ifdef SKINENIGMA_FULL_CHANNELINFO_TITLE + if (fShowLogo) + xName = xEventNowLeft; +#endif // draw channel group name osd->DrawText(xName + 3, yTitleTop + 3, GetChannelName(Channel), Theme.Color(clrTitleShadow), clrTransparent, font, @@ -395,14 +408,20 @@ void cSkinEnigmaDisplayChannel::DrawChannelInfo(const cChannel *Channel, int Num const cFont *font = cFont::GetFont(fontOsd); int xNumber = xTitleLeft + Roundness; int xName = xNumber + font->Width("0000-") + Gap; +#ifdef SKINENIGMA_FULL_CHANNELINFO_TITLE + if (fShowLogo) { + xNumber = xTitleLeft + Roundness; + xName = xEventNowLeft; + } +#endif // draw channel number osd->DrawText(xNumber + 3, yTitleTop + 3, GetChannelNumber(Channel, Number), Theme.Color(clrTitleShadow), clrTransparent, font, - xName - xNumber - Gap - 3, yTitleBottom - yTitleTop - 3); + xName - xNumber - Gap - 3, yTitleBottom - yTitleTop - 3, taRight); osd->DrawText(xNumber, yTitleTop, GetChannelNumber(Channel, Number), Theme.Color(clrTitleFg), clrTransparent, font, - xName - xNumber - Gap, yTitleBottom - yTitleTop); + xName - xNumber - Gap, yTitleBottom - yTitleTop, taRight); // draw channel name osd->DrawText(xName + 3, yTitleTop + 3, GetChannelName(Channel), Theme.Color(clrTitleShadow), clrTransparent, font, @@ -415,7 +434,7 @@ void cSkinEnigmaDisplayChannel::DrawChannelInfo(const cChannel *Channel, int Num // right edge of logo int xs = xBottomRight - Roundness; // bottom edge of logo - int ys = yBottomBottom - SmallGap; + int ys = yBottomTop + (yBottomBottom - yBottomTop - SymbolHeight) / 2; bool isvps = false; if (EnigmaConfig.showVps) { // check if vps @@ -434,53 +453,66 @@ void cSkinEnigmaDisplayChannel::DrawChannelInfo(const cChannel *Channel, int Num } } } - char *strFile = NULL; - asprintf(&strFile, "flags/%s", Channel->Alang(0)); - if (EnigmaLogoCache.Load(strFile)) { - xs -= (EnigmaLogoCache.Get().Width() + SmallGap); - osd->DrawBitmap(xs, ys - EnigmaLogoCache.Get().Height(), EnigmaLogoCache.Get()); + + bool fFlagFound = false; + if (EnigmaConfig.showFlags) { + char *strFile = NULL; + asprintf(&strFile, "flags/%s", Channel->Alang(0)); + if (EnigmaLogoCache.Load(strFile)) { + xs -= (EnigmaLogoCache.Get().Width() + SmallGap); + osd->DrawBitmap(xs, ys, EnigmaLogoCache.Get()); + fFlagFound = true; + } + free(strFile); + } + if (!fFlagFound) { + const cFont *fontSmall = cFont::GetFont(fontSml); + xs -= fontSmall->Width(Channel->Alang(0)); + osd->DrawText(xs, yBottomTop + SmallGap , Channel->Alang(0), + Theme.Color(clrSymbolActive), Theme.Color(clrBottomBg), fontSmall, + fontSmall->Width(Channel->Alang(0)), yBottomBottom - SmallGap); } - free(strFile); // draw audio symbol according to current audio channel int AudioMode = cDevice::PrimaryDevice()->GetAudioChannel(); if (!(AudioMode >= 0 && AudioMode < MAX_AUDIO_BITMAPS)) AudioMode = 0; xs -= (bmAudio[AudioMode].Width() + SmallGap); - osd->DrawBitmap(xs, ys - bmAudio[AudioMode].Height(), bmAudio[AudioMode], + osd->DrawBitmap(xs, ys, bmAudio[AudioMode], Theme.Color(clrBottomBg), Theme.Color(Channel->Apid(1) ? clrSymbolActive : clrSymbolInactive)); // draw dolby digital symbol xs -= (bmDolbyDigital.Width() + SmallGap); - osd->DrawBitmap(xs, ys - bmDolbyDigital.Height(), bmDolbyDigital, + osd->DrawBitmap(xs, ys, bmDolbyDigital, Theme.Color(clrBottomBg), Theme.Color(Channel->Dpid(0) ? clrSymbolActive : clrSymbolInactive)); if (EnigmaConfig.showVps) { // draw vps symbol xs -= (bmVPS.Width() + SmallGap); - osd->DrawBitmap(xs, ys - bmVPS.Height(), bmVPS, + osd->DrawBitmap(xs, ys, bmVPS, Theme.Color(clrBottomBg), Theme.Color(isvps ? clrSymbolActive : clrSymbolInactive)); } // draw radio symbol if no video PID; otherwise draw teletext symbol if (Channel->Vpid()) { xs -= (bmTeletext.Width() + SmallGap); - osd->DrawBitmap(xs, ys - bmTeletext.Height(), bmTeletext, + osd->DrawBitmap(xs, ys, bmTeletext, Theme.Color(clrBottomBg), Theme.Color(Channel->Tpid() ? clrSymbolActive : clrSymbolInactive)); } else { xs -= (bmRadio.Width() + SmallGap); - osd->DrawBitmap(xs, ys - bmRadio.Height(), bmRadio, + osd->DrawBitmap(xs, ys, bmRadio, Theme.Color(clrBottomBg), Theme.Color(Channel->Apid(0) ? clrSymbolActive : clrSymbolInactive)); } // draw encryption symbol xs -= (bmEncrypted.Width() + SmallGap); - osd->DrawBitmap(xs, ys - bmEncrypted.Height(), bmEncrypted, + osd->DrawBitmap(xs, ys, bmEncrypted, Theme.Color(clrBottomBg), Theme.Color(Channel->Ca() ? clrSymbolActive : clrSymbolInactive)); // draw recording symbol xs -= (bmRecording.Width() + SmallGap); if (cRecordControls::Active()) - osd->DrawBitmap(xs, ys - bmRecording.Height(), bmRecording, + osd->DrawBitmap(xs, ys, bmRecording, Theme.Color(clrBottomBg), Theme.Color(HasChannelTimerRecording(Channel) ? clrSymbolRecord : clrSymbolActive)); else - osd->DrawBitmap(xs, ys - bmRecording.Height(), bmRecording, + osd->DrawBitmap(xs, ys, bmRecording, Theme.Color(clrBottomBg), Theme.Color(clrSymbolInactive)); + xFirstSymbol = xs - Gap; } cString cSkinEnigmaDisplayChannel::GetChannelName(const cChannel *Channel) @@ -513,6 +545,8 @@ cString cSkinEnigmaDisplayChannel::GetChannelNumber(const cChannel *Channel, int void cSkinEnigmaDisplayChannel::SetChannel(const cChannel *Channel, int Number) { + xFirstSymbol = 0; + if (Channel) { // clear all osd->DrawRectangle(0, 0, osd->Width(), osd->Height(), clrTransparent); @@ -563,17 +597,37 @@ void cSkinEnigmaDisplayChannel::SetEvents(const cEvent *Present, int xTimeLeft = xEventNowLeft + Gap; int xTimeWidth = lFontOsd->Width("00:00"); - int xDurationLeft = xEventNowRight - Gap - lFontOsd->Width("000'"); - int xDurationWidth = xEventNowRight - Gap - xDurationLeft; - int xTextLeft = xTimeLeft + xTimeWidth + BigGap; - int xTextWidth = xDurationLeft - xTextLeft - BigGap; // check epg datas const cEvent *e = Present; // Current event if (e) { - char sLen[4]; + char sLen[6]; + char sNow[6]; int total = e->Duration(); snprintf(sLen, sizeof(sLen), "%d'", total / 60); + + int now = (time(NULL) - e->StartTime()); + if ((now < total) && ((now / 60) > 0)) { + switch (EnigmaConfig.showRemaining) { + case 0: + snprintf(sNow, sizeof(sNow), "+%d'", now / 60); + break; + case 1: + snprintf(sNow, sizeof(sNow), "-%d'", (int)ceil((total - now) / 60.0)); + break; + case 2: + snprintf(sNow, sizeof(sNow), "%ld%%", lrint((ceil((float)now) / total * 100.0))); + break; + default: + error("Invalid value for ShowRemaining: %d", EnigmaConfig.showRemaining); + } + } + + int xDurationLeft = xEventNowRight - Gap - max(lFontOsd->Width(sLen), lFontOsd->Width(sNow)); + int xDurationWidth = xEventNowRight - Gap - xDurationLeft; + int xTextLeft = xTimeLeft + xTimeWidth + BigGap; + int xTextWidth = xDurationLeft - xTextLeft - BigGap; + // draw start time osd->DrawText(xTimeLeft, yEventNowTop, e->GetTimeString(), Theme.Color(clrMenuEventTitle), Theme.Color(clrBackground), @@ -602,38 +656,43 @@ void cSkinEnigmaDisplayChannel::SetEvents(const cEvent *Present, osd->DrawText(xTextLeft, yEventNowTop + lineHeightOsd, e->ShortText(), Theme.Color(clrMenuEventShortText), Theme.Color(clrBackground), lFontSml, xTextWidth, lineHeightSml); - int now = (time(NULL) - e->StartTime()); + + // draw duration if ((now < total) && ((now / 60) > 0)) { - char sNow[5]; - if (EnigmaConfig.showRemaining) { - snprintf(sNow, sizeof(sNow), "-%d'", (total - now) / 60); - } else { - snprintf(sNow, sizeof(sNow), "+%d'", now / 60); - } osd->DrawText(xDurationLeft, yEventNowTop + lineHeightOsd, sNow, Theme.Color(clrMenuEventShortText), Theme.Color(clrBackground), lFontSml, xDurationWidth, lineHeightSml, taRight); } // draw timebar - int xBarWidth = 124; int xBarLeft = xBottomLeft + Roundness; - int x = xBarLeft + SmallGap + (int)(roundf((float)(now) / (float)(total) * (float)(xBarWidth - Gap - SmallGap))); - x = min(x, xBottomLeft + Gap + xBarWidth - SmallGap - 1); +/*TODO? #ifdef SKINENIGMA_FULL_CHANNELINFO_TITLE + if (fShowLogo) + xBarLeft = xEventNowLeft; +#endif*/ + int xBarWidth = (xFirstSymbol > xBarLeft ? (xFirstSymbol - Gap - xBarLeft) : 124); + int x = xBarLeft + SmallGap + (int)(ceil((float)(now) / (float)(total) * (float)(xBarWidth - Gap - SmallGap))); + x = min(x, xBarLeft + Gap + xBarWidth - SmallGap - 1); osd->DrawRectangle(xBarLeft, yBottomTop + SmallGap + SmallGap, - xBottomLeft + Gap + xBarWidth - 1, - yBottomBottom - SmallGap - 1, + xBarLeft + Gap + xBarWidth - 1, + yBottomBottom - SmallGap - SmallGap - 1, Theme.Color(clrBotProgBarBg)); osd->DrawRectangle(xBarLeft + SmallGap, yBottomTop + SmallGap + SmallGap + SmallGap, x, - yBottomBottom - SmallGap - SmallGap - 1, + yBottomBottom - SmallGap - SmallGap - SmallGap - 1, Theme.Color(clrBotProgBarFg)); } e = Following; // Next event if (e) { - char sLen[5]; - snprintf(sLen, 5, "%d'", e->Duration() / 60); + char sLen[6]; + snprintf(sLen, sizeof(sLen), "%d'", e->Duration() / 60); + + int xDurationLeft = xEventNowRight - Gap - lFontOsd->Width(sLen); + int xDurationWidth = xEventNowRight - Gap - xDurationLeft; + int xTextLeft = xTimeLeft + xTimeWidth + BigGap; + int xTextWidth = xDurationLeft - xTextLeft - BigGap; + // draw start time osd->DrawText(xTimeLeft, yEventNextTop, e->GetTimeString(), Theme.Color(clrMenuEventTitle), Theme.Color(clrAltBackground), @@ -684,13 +743,17 @@ void cSkinEnigmaDisplayChannel::SetMessage(eMessageType Type, const char *Text) void cSkinEnigmaDisplayChannel::Flush(void) { - // update date string - cString date = DayDateTime(); - const cFont *font = cFont::GetFont(fontOsd); - int w = font->Width(date); - osd->DrawText(xTitleRight - Roundness - w, yTitleTop, date, - Theme.Color(clrTitleFg), Theme.Color(clrTitleBg), - font, w, yTitleBottom - yTitleTop, taCenter); + time_t now = time(NULL); + if (now != lastTime) { + lastTime = now; + // update date string + cString date = DayDateTime(); + const cFont *font = cFont::GetFont(fontOsd); + int w = font->Width(date); + osd->DrawText(xTitleRight - Roundness - w, yTitleTop, date, + Theme.Color(clrTitleFg), Theme.Color(clrTitleBg), + font, w, yTitleBottom - yTitleTop, taCenter); + } osd->Flush(); } @@ -701,6 +764,7 @@ private: cOsd *osd; char *strTitle; + char *strLastDate; bool isMainMenu; bool fShowLogo; bool fShowInfo; @@ -741,20 +805,25 @@ public: cSkinEnigmaDisplayMenu::cSkinEnigmaDisplayMenu(void) { + setlocale(LC_TIME, tr("en_US")); osd = NULL; strTitle = NULL; + strLastDate = NULL; isMainMenu = true; #ifdef SKINENIGMA_NO_MENULOGO fShowLogo = false; #else - fShowLogo = EnigmaConfig.showSymbols; + fShowLogo = (EnigmaConfig.showSymbols == 1 || EnigmaConfig.showSymbols == 3); #endif fShowInfo = EnigmaConfig.showInfo; lineHeightSml = cFont::GetFont(fontSml)->Height(); lineHeightOsd = cFont::GetFont(fontOsd)->Height(); - int RightColWidth = (144 + LogoWidth) & ~0x07; // must be multiple of 8 + int LogoSize = max(lineHeightOsd + TitleDeco + lineHeightOsd + lineHeightSml, + max(3 * lineHeightOsd, LogoHeight) + ); + int RightColWidth = (144 + LogoSize) & ~0x07; // must be multiple of 8 // title bar xTitleLeft = 0; @@ -779,10 +848,10 @@ cSkinEnigmaDisplayMenu::cSkinEnigmaDisplayMenu(void) yMessageBottom = yButtonsTop - SmallGap; yMessageTop = yMessageBottom - MessageHeight + SmallGap; // No extra SmallGap at bottom as there's already the Gap above the buttons // logo box - xLogoLeft = Setup.OSDWidth - LogoWidth; + xLogoLeft = Setup.OSDWidth - LogoSize; xLogoRight = Setup.OSDWidth; yLogoTop = yTitleTop; - yLogoBottom = yLogoTop + LogoHeight + SmallGap; + yLogoBottom = yLogoTop + LogoSize + SmallGap; // info box xInfoLeft = Setup.OSDWidth - RightColWidth; xInfoRight = Setup.OSDWidth; @@ -797,11 +866,13 @@ cSkinEnigmaDisplayMenu::cSkinEnigmaDisplayMenu(void) // create osd osd = cOsdProvider::NewOsd(Setup.OSDLeft, Setup.OSDTop); - tArea Areas[] = { {xTitleLeft, yTitleTop, xMessageRight - 1, yButtonsBottom - 1, 8} }; + tArea Areas[] = { {xTitleLeft, yTitleTop, xMessageRight - 1, yButtonsBottom - 1, EnigmaConfig.singleArea8Bpp ? 8 : 4} }; if (EnigmaConfig.singleArea && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) { osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); - } else { //TODO? single body area (-> no symbols in event/recording info) - tArea Areas[] = { {xTitleLeft, yTitleTop, xTitleRight - 1, yTitleDecoBottom - 1, 4}, //title area + // clear all + osd->DrawRectangle(0, 0, osd->Width(), osd->Height(), clrTransparent); + } else { + tArea Areas[] = { {xTitleLeft, yTitleTop, xTitleRight - 1, yTitleDecoBottom - 1, 2}, //title area {xBodyLeft, yBodyTop, xBodyRight - 1, yLogoBottom - 1, 2}, //body area (beside date/logo area) #ifdef SKINENIGMA_NO_MENULOGO {xDateLeft, yDateTop, xDateRight - 1, yBodyTop - 1, 2}, //date @@ -822,16 +893,20 @@ cSkinEnigmaDisplayMenu::cSkinEnigmaDisplayMenu(void) return; } -#ifndef SKINENIGMA_NO_MENULOGO - // set colors for info area + // clear all + osd->DrawRectangle(0, 0, osd->Width(), osd->Height(), clrTransparent); + + // reset colors for list areas + osd->GetBitmap(1)->Reset(); +#ifdef SKINENIGMA_NO_MENULOGO + osd->GetBitmap(3)->Reset(); + osd->GetBitmap(4)->Reset(); + osd->GetBitmap(5)->Reset(); +#else + osd->GetBitmap(3)->Reset(); osd->GetBitmap(4)->Reset(); - osd->GetBitmap(4)->SetColor(0, Theme.Color(clrTransparent)); - osd->GetBitmap(4)->SetColor(1, Theme.Color(clrBackground)); - osd->GetBitmap(4)->SetColor(2, Theme.Color(clrAltBackground)); #endif } - // clear all - osd->DrawRectangle(0, 0, osd->Width(), osd->Height(), clrTransparent); SetupAreas(); } @@ -858,30 +933,32 @@ void cSkinEnigmaDisplayMenu::SetupAreas(void) int yMaxHeight = yInfoBottom; #ifdef SKINENIGMA_HAVE_EPGSEARCH - cPlugin *p = cPluginManager::GetPlugin("epgsearch"); - if (p) { - Epgsearch_lastconflictinfo_v1_0 *serviceData = new Epgsearch_lastconflictinfo_v1_0; - if (serviceData) { - serviceData->nextConflict = 0; - serviceData->relevantConflicts = 0; - serviceData->totalConflicts = 0; - - p->Service("Epgsearch-lastconflictinfo-v1.0", serviceData); - if (serviceData->relevantConflicts > 0) { - int yWarning = yMaxHeight - 3 * h; // Needed space for warning - yMaxHeight = yWarning; - osd->DrawRectangle(xInfoLeft, yWarning, xInfoRight - 1, yWarning + SmallGap + 1, Theme.Color(clrBackground)); - yWarning += 1 + h / 2; - osd->DrawText(xInfoLeft, yWarning, tr("WARNING"), Theme.Color(clrMenuItemSelectableFg), Theme.Color(clrAltBackground), font, w, h, taCenter); - yWarning += h + SmallGap; - - char *info; - asprintf(&info, "%d %s", serviceData->relevantConflicts, (serviceData->relevantConflicts == 1 ? tr("Timer conflict") : tr("Timer conflicts"))); - osd->DrawText(x, yWarning, info, Theme.Color(clrMenuItemSelectableFg), Theme.Color(clrAltBackground), font, w, h, taCenter); - yWarning += h; - free(info); + if (EnigmaConfig.showTimerConflicts) { + cPlugin *p = cPluginManager::GetPlugin("epgsearch"); + if (p) { + Epgsearch_lastconflictinfo_v1_0 *serviceData = new Epgsearch_lastconflictinfo_v1_0; + if (serviceData) { + serviceData->nextConflict = 0; + serviceData->relevantConflicts = 0; + serviceData->totalConflicts = 0; + + p->Service("Epgsearch-lastconflictinfo-v1.0", serviceData); + if (serviceData->relevantConflicts > 0) { + int yWarning = yMaxHeight - 3 * h; // Needed space for warning + yMaxHeight = yWarning; + osd->DrawRectangle(xInfoLeft, yWarning, xInfoRight - 1, yWarning + SmallGap + 1, Theme.Color(clrBackground)); + yWarning += 1 + h / 2; + osd->DrawText(xInfoLeft, yWarning, tr("WARNING"), Theme.Color(clrMenuItemSelectableFg), Theme.Color(clrAltBackground), font, w, h, taCenter); + yWarning += h + SmallGap; + + char *info; + asprintf(&info, "%d %s", serviceData->relevantConflicts, (serviceData->relevantConflicts == 1 ? tr("Timer conflict") : tr("Timer conflicts"))); + osd->DrawText(x, yWarning, info, Theme.Color(clrMenuItemSelectableFg), Theme.Color(clrAltBackground), font, w, h, taCenter); + yWarning += h; + free(info); + } + delete serviceData; } - delete serviceData; } } #endif //SKINENIGMA_HAVE_EPGSEARCH @@ -920,6 +997,7 @@ void cSkinEnigmaDisplayMenu::SetupAreas(void) cSkinEnigmaDisplayMenu::~cSkinEnigmaDisplayMenu() { free(strTitle); + free(strLastDate); delete osd; } @@ -990,17 +1068,20 @@ void cSkinEnigmaDisplayMenu::SetTitle(const char *Title) strTitle = NULL; } - if (!(isMainMenu && Title && strncmp(tr("VDR"), Title, strlen(tr("VDR"))) == 0)) { + char *strTitlePrefix = NULL; + asprintf(&strTitlePrefix, "%s - ", tr("VDR")); + + if (!(isMainMenu && Title && strncmp(strTitlePrefix, Title, strlen(strTitlePrefix)) == 0)) { bool old_isMainMenu = isMainMenu; bool old_fShowLogo = fShowLogo; bool old_fShowInfo = fShowInfo; - if (strTitle == NULL || strncmp(tr("VDR"), strTitle, strlen(tr("VDR"))) == 0) { + if (strTitle == NULL || strncmp(strTitlePrefix, strTitle, strlen(strTitlePrefix)) == 0) { isMainMenu = true; #ifdef SKINENIGMA_NO_MENULOGO fShowLogo = false; #else - fShowLogo = EnigmaConfig.showSymbols; + fShowLogo = (EnigmaConfig.showSymbols == 1 || EnigmaConfig.showSymbols == 3); #endif fShowInfo = EnigmaConfig.showInfo; } else { @@ -1019,6 +1100,11 @@ void cSkinEnigmaDisplayMenu::SetTitle(const char *Title) } else { DrawTitle(Title); } + + free (strTitlePrefix); + + free(strLastDate); + strLastDate = NULL; } void cSkinEnigmaDisplayMenu::DrawTitle(const char *Title) @@ -1161,6 +1247,10 @@ void cSkinEnigmaDisplayMenu::SetItem(const char *Text, int Index, bool Current, && strchr(" V", s[1]) && strchr(" *", s[2])) { // update status iseventinfo = true; + } else if (strlen(s) == 4 && s[0] == ' ' && strchr(" tTR", s[1]) + && strchr(" V", s[2]) && strchr(" *", s[3])) { + // update status + iseventinfo = true; } // check if new recording: "01.01.06*", "10:10*" @@ -1448,7 +1538,7 @@ void cSkinEnigmaDisplayMenu::SetEvent(const cEvent *Event) #ifdef SKINENIGMA_NO_MENULOGO fShowLogo = false; #else - fShowLogo = EnigmaConfig.showSymbols; + fShowLogo = (EnigmaConfig.showSymbols == 1 || EnigmaConfig.showSymbols == 3); #endif const cFont *font = cFont::GetFont(fontOsd); @@ -1565,14 +1655,23 @@ void cSkinEnigmaDisplayMenu::SetEvent(const cEvent *Event) string stringReruns; #ifdef SKINENIGMA_HAVE_EPGSEARCH // try to find a rerun of the show using epgsearch-service - if (!isempty(Event->Title())) { + if (EnigmaConfig.numReruns > 0 && !isempty(Event->Title())) { stringstream sstrReruns; Epgsearch_searchresults_v1_0 data; - data.query = (char *)Event->Title(); + string strQuery = Event->Title(); + if (EnigmaConfig.useSubtitleRerun > 0) { + if (EnigmaConfig.useSubtitleRerun == 2 || !isempty(Event->ShortText())) + strQuery += "~"; + if (!isempty(Event->ShortText())) + strQuery += Event->ShortText(); + data.useSubTitle = true; + } else { + data.useSubTitle = false; + } + data.query = (char *)strQuery.c_str(); data.mode = 0; data.channelNr = 0; data.useTitle = true; - data.useSubTitle = false; data.useDescription = false; if (cPluginManager::CallFirstService("Epgsearch-searchresults-v1.0", &data)) { cList<Epgsearch_searchresults_v1_0::cServiceSearchResult>* list = data.pResultList; @@ -1580,7 +1679,7 @@ void cSkinEnigmaDisplayMenu::SetEvent(const cEvent *Event) //TODO: current event is shown as rerun sstrReruns << tr("RERUNS OF THIS SHOW") << ':' << endl; int i = 0; - for (Epgsearch_searchresults_v1_0::cServiceSearchResult *r = list->First(); r && i < 5; r = list->Next(r)) { + for (Epgsearch_searchresults_v1_0::cServiceSearchResult *r = list->First(); r && i < EnigmaConfig.numReruns; r = list->Next(r)) { i++; sstrReruns << "- " << *DayDateTime(r->event->StartTime()) @@ -1615,7 +1714,7 @@ void cSkinEnigmaDisplayMenu::SetEvent(const cEvent *Event) (strFirst || strSecond) && strThird ? "\n\n" : "", strThird ? strThird : ""); textScroller.Set(osd, xBodyLeft + Gap, y, xInfoRight - xBodyLeft - wsb - Gap, yBodyBottom - Gap - y, - mytext, smlfont, Theme.Color(clrMenuTxtFg), + mytext, font, Theme.Color(clrMenuTxtFg), Theme.Color(clrBackground)); SetScrollbar(); free(mytext); @@ -1647,7 +1746,7 @@ void cSkinEnigmaDisplayMenu::SetRecording(const cRecording *Recording) #ifdef SKINENIGMA_NO_MENULOGO fShowLogo = false; #else - fShowLogo = EnigmaConfig.showSymbols; + fShowLogo = (EnigmaConfig.showSymbols == 1 || EnigmaConfig.showSymbols == 3); #endif const cRecordingInfo *Info = Recording->Info(); @@ -1664,8 +1763,9 @@ void cSkinEnigmaDisplayMenu::SetRecording(const cRecording *Recording) stringstream sstrInfo; int dirSize = DirSizeMB(Recording->FileName()); cChannel *channel = Channels.GetByChannelID(((cRecordingInfo *)Info)->ChannelID()); - sstrInfo << tr("Channel") << ": " << (channel ? channel->Name() : "???") << endl - << tr("Size") << ": " << setprecision(3) << (dirSize > 1023 ? dirSize / 1024.0 : dirSize) << (dirSize > 1023 ? "GB\n" : "MB\n") + if (channel) + sstrInfo << tr("Channel") << ": " << channel->Number() << " - " << channel->Name() << endl; + sstrInfo << tr("Size") << ": " << setprecision(3) << (dirSize > 1023 ? dirSize / 1024.0 : dirSize) << (dirSize > 1023 ? "GB\n" : "MB\n") << tr("Priority") << ": " << Recording->priority << endl << tr("Lifetime") << ": " << Recording->lifetime << endl; if (Info->Aux()) { @@ -1742,7 +1842,7 @@ void cSkinEnigmaDisplayMenu::SetRecording(const cRecording *Recording) asprintf(&mytext, "%s%s%s", strInfo ? strInfo : "", strInfo && strDescr ? "\n\n" : "", strDescr ? strDescr : ""); textScroller.Set(osd, xBodyLeft + Gap, y, xInfoRight - xBodyLeft - Gap - wsb, - yBodyBottom - Gap - y, mytext, smlfont, + yBodyBottom - Gap - y, mytext, font, Theme.Color(clrMenuTxtFg), Theme.Color(clrBackground)); SetScrollbar(); @@ -1766,10 +1866,9 @@ void cSkinEnigmaDisplayMenu::SetRecording(const cRecording *Recording) void cSkinEnigmaDisplayMenu::SetText(const char *Text, bool FixedFont) { - int wsb = lineHeightOsd + 2 * SmallGap; //scrollbar width // draw text textScroller.Set(osd, xBodyLeft + Gap, yBodyTop + Gap, - (fShowLogo || fShowInfo ? xBodyRight : xInfoRight) - 2 * Gap - wsb, + GetTextAreaWidth(), yBodyBottom - yBodyTop - 2 * Gap, Text, GetTextAreaFont(FixedFont), Theme.Color(clrMenuTxtFg), Theme.Color(clrBackground)); @@ -1778,8 +1877,10 @@ void cSkinEnigmaDisplayMenu::SetText(const char *Text, bool FixedFont) int cSkinEnigmaDisplayMenu::GetTextAreaWidth(void) const { + int wsb = lineHeightOsd + 2 * SmallGap; //scrollbar width + // max text area width - return (fShowLogo || fShowInfo ? xBodyRight : xInfoRight) - xBodyLeft; + return (fShowLogo || fShowInfo ? xBodyRight : xInfoRight) - 2 * Gap - wsb; } const cFont *cSkinEnigmaDisplayMenu::GetTextAreaFont(bool FixedFont) const @@ -1792,44 +1893,53 @@ void cSkinEnigmaDisplayMenu::Flush(void) { //debug("cSkinEnigmaDisplayMenu::Flush\n"); if (fShowLogo) { - int x = xDateLeft + SmallGap; - int w = xLogoLeft - x; - const cFont *font = cFont::GetFont(fontOsd); - int ys = yDateTop + (yDateBottom - yDateTop - 3 * lineHeightOsd) / 2; - - char temp[32]; - struct tm tm_r; time_t t = time(NULL); - tm *tm = localtime_r(&t, &tm_r); - - strftime(temp, sizeof(temp), "%A", tm); - osd->DrawText(x, ys, temp, Theme.Color(clrMenuTxtFg), - Theme.Color(clrLogoBg), font, w, - lineHeightOsd, taCenter); - ys += lineHeightOsd; + cString time = TimeString(t); + if ((strLastDate == NULL) || strcmp(strLastDate, (const char*)time) != 0) { + free(strLastDate); + strLastDate = strdup((const char*)time); - strftime(temp, sizeof(temp), "%d.%m.%Y", tm); - osd->DrawText(x, ys, temp, Theme.Color(clrMenuTxtFg), - Theme.Color(clrLogoBg), font, w, - lineHeightOsd, taCenter); - ys += lineHeightOsd; + int x = xDateLeft + SmallGap; + int w = xLogoLeft - x; + const cFont *font = cFont::GetFont(fontOsd); + int ys = yDateTop + (yDateBottom - yDateTop - 3 * lineHeightOsd) / 2; - cString time = TimeString(t); - osd->DrawText(x, ys, time, Theme.Color(clrMenuTxtFg), - Theme.Color(clrLogoBg), font, w, - lineHeightOsd, taCenter); - //draw borders - osd->DrawRectangle(xDateLeft, yDateTop, xDateLeft + SmallGap - 1, yLogoBottom - SmallGap - 1, clrTransparent); - osd->DrawRectangle(xDateLeft, yLogoBottom - SmallGap, xDateRight, yLogoBottom - 1, clrTransparent); + char temp[32]; + struct tm tm_r; + tm *tm = localtime_r(&t, &tm_r); + + strftime(temp, sizeof(temp), "%A", tm); + osd->DrawText(x, ys, temp, Theme.Color(clrMenuTxtFg), + Theme.Color(clrLogoBg), font, w, + lineHeightOsd, taCenter); + ys += lineHeightOsd; + + strftime(temp, sizeof(temp), "%d.%m.%Y", tm); + osd->DrawText(x, ys, temp, Theme.Color(clrMenuTxtFg), + Theme.Color(clrLogoBg), font, w, + lineHeightOsd, taCenter); + ys += lineHeightOsd; + + osd->DrawText(x, ys, time, Theme.Color(clrMenuTxtFg), + Theme.Color(clrLogoBg), font, w, + lineHeightOsd, taCenter); + //draw borders + osd->DrawRectangle(xDateLeft, yDateTop, xDateLeft + SmallGap - 1, yLogoBottom - SmallGap - 1, clrTransparent); + osd->DrawRectangle(xDateLeft, yLogoBottom - SmallGap, xDateRight, yLogoBottom - 1, clrTransparent); + } } else { cString date = DayDateTime(); - const cFont *font = cFont::GetFont(fontOsd); - osd->DrawText(xDateLeft + SmallGap, yDateTop, date, Theme.Color(clrMenuTxtFg), - Theme.Color(clrLogoBg), font, xDateRight - xDateLeft - SmallGap, - yTitleDecoBottom - yDateTop, taCenter); - //draw borders - osd->DrawRectangle(xDateLeft, yDateTop, xDateLeft + SmallGap - 1, yTitleDecoBottom - 1, clrTransparent); - osd->DrawRectangle(xDateLeft, yTitleDecoBottom, xDateRight, yBodyTop - 1, clrTransparent); + if ((strLastDate == NULL) || strcmp(strLastDate, (const char*)date) != 0) { + free(strLastDate); + strLastDate = strdup((const char*)date); + const cFont *font = cFont::GetFont(fontOsd); + osd->DrawText(xDateLeft + SmallGap, yDateTop, date, Theme.Color(clrMenuTxtFg), + Theme.Color(clrLogoBg), font, xDateRight - xDateLeft - SmallGap, + yTitleDecoBottom - yDateTop, taCenter); + //draw borders + osd->DrawRectangle(xDateLeft, yDateTop, xDateLeft + SmallGap - 1, yTitleDecoBottom - 1, clrTransparent); + osd->DrawRectangle(xDateLeft, yTitleDecoBottom, xDateRight, yBodyTop - 1, clrTransparent); + } } osd->Flush(); } @@ -1869,8 +1979,8 @@ cSkinEnigmaDisplayReplay::cSkinEnigmaDisplayReplay(bool ModeOnly) nJumpWidth = 0; lineHeight = cFont::GetFont(fontOsd)->Height(); - int logoWidth = LogoWidth; - logoWidth += (logoWidth % 2 ? 1 : 0); + int LogoSize = LogoHeight; + LogoSize += (LogoSize % 2 ? 1 : 0); xTitleLeft = 0; xTitleRight = Setup.OSDWidth; yTitleTop = 0; @@ -1878,9 +1988,9 @@ cSkinEnigmaDisplayReplay::cSkinEnigmaDisplayReplay(bool ModeOnly) yTitleDecoTop = yTitleBottom + TitleDecoGap; yTitleDecoBottom = yTitleDecoTop + TitleDecoHeight; xLogoLeft = xTitleLeft; - xLogoRight = xLogoLeft + logoWidth; + xLogoRight = xLogoLeft + LogoSize; yLogoTop = yTitleDecoBottom + TitleDecoGap2; - yLogoBottom = yLogoTop + LogoHeight; + yLogoBottom = yLogoTop + LogoSize; xTimeLeft = xLogoRight + LogoDecoGap2; xTimeRight = xTitleRight; xTimeLeft += (xTimeRight - xTimeLeft) - ((xTimeRight - xTimeLeft) & ~0x07); @@ -1896,17 +2006,17 @@ cSkinEnigmaDisplayReplay::cSkinEnigmaDisplayReplay(bool ModeOnly) yBottomBottom = yBottomTop + lineHeight; xMessageLeft = xProgressLeft; xMessageRight = xProgressRight; - yMessageTop = yLogoTop + (LogoHeight - MessageHeight) / 2; + yMessageTop = yLogoTop + (LogoSize - MessageHeight) / 2; yMessageBottom = yMessageTop + MessageHeight; // create osd osd = cOsdProvider::NewOsd(Setup.OSDLeft, Setup.OSDTop + Setup.OSDHeight - yBottomBottom); - tArea Areas[] = { {xTitleLeft, yTitleTop, xBottomRight - 1, yBottomBottom - 1, 8} }; + tArea Areas[] = { {xTitleLeft, yTitleTop, xBottomRight - 1, yBottomBottom - 1, EnigmaConfig.singleArea8Bpp ? 8 : 4} }; if (EnigmaConfig.singleArea && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) { osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); } else { tArea Areas[] = { {xTitleLeft, yTitleTop, xTitleRight - 1, yTitleDecoBottom - 1, 2}, - {xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, 4}, + {xLogoLeft, yLogoTop, xLogoRight + 1, yLogoBottom - 1, 4}, //TODO? "+1" because of wrong colors with "-1" {xProgressLeft, yProgressTop, xTimeRight - 1, yTimeBottom - 1, 4}, {xBottomLeft, yBottomTop, xBottomRight - 1, yBottomBottom - 1, 2} }; @@ -1922,7 +2032,7 @@ cSkinEnigmaDisplayReplay::cSkinEnigmaDisplayReplay(bool ModeOnly) osd->DrawRectangle(0, 0, osd->Width(), osd->Height(), clrTransparent); if (modeonly) { // draw logo area - osd->DrawRectangle(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, EnigmaConfig.showSymbols ? Theme.Color(clrLogoBg) : clrTransparent); + osd->DrawRectangle(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, (EnigmaConfig.showSymbols == 1 || EnigmaConfig.showSymbols == 2) ? Theme.Color(clrLogoBg) : clrTransparent); } else { // draw title area osd->DrawRectangle(xTitleLeft, yTitleTop, xTitleRight - 1, @@ -1990,7 +2100,7 @@ void cSkinEnigmaDisplayReplay::SetMode(bool Play, bool Forward, int Speed) if (Speed < -1) Speed = -1; - if (EnigmaConfig.showSymbols) { + if (EnigmaConfig.showSymbols == 1 || EnigmaConfig.showSymbols == 2) { osd->DrawRectangle(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg)); char *logo = NULL; @@ -2003,7 +2113,7 @@ void cSkinEnigmaDisplayReplay::SetMode(bool Play, bool Forward, int Speed) } free(logo); } else { - osd->DrawRectangle(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, modeonly ? clrTransparent : Theme.Color(clrLogoBg)); + osd->DrawRectangle(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg)); } if (Speed == -1) @@ -2048,7 +2158,7 @@ void cSkinEnigmaDisplayReplay::SetCurrent(const char *Current) return; // draw current time - const cFont *font = cFont::GetFont(fontSml); + const cFont *font = cFont::GetFont(fontOsd); int w = font->Width(Current); osd->DrawText(xTimeLeft + BigGap, yTimeTop, Current, Theme.Color(clrReplayCurrent), Theme.Color(clrAltBackground), font, @@ -2061,7 +2171,7 @@ void cSkinEnigmaDisplayReplay::SetTotal(const char *Total) return; // draw total time - const cFont *font = cFont::GetFont(fontSml); + const cFont *font = cFont::GetFont(fontOsd); int w = font->Width(Total); osd->DrawText(xTimeRight - BigGap - w, yTimeTop, Total, Theme.Color(clrReplayTotal), Theme.Color(clrAltBackground), font, w, @@ -2072,7 +2182,7 @@ void cSkinEnigmaDisplayReplay::SetJump(const char *Jump) { if (Jump) { // draw jump prompt - const cFont *font = cFont::GetFont(fontSml); + const cFont *font = cFont::GetFont(fontOsd); nJumpWidth = font->Width(Jump); osd->DrawText(xTimeLeft + (xTimeRight - xTimeLeft - nJumpWidth) / 2, yTimeTop, Jump, Theme.Color(clrReplayModeJump), @@ -2137,6 +2247,8 @@ private: int xBottomLeft, xBottomRight, yBottomTop, yBottomBottom; int lineHeight; + bool fShowSymbol; + public: cSkinEnigmaDisplayVolume(); virtual ~ cSkinEnigmaDisplayVolume(); @@ -2146,15 +2258,18 @@ public: cSkinEnigmaDisplayVolume::cSkinEnigmaDisplayVolume() { + fShowSymbol = (EnigmaConfig.showSymbols == 1 || EnigmaConfig.showSymbols == 2); lineHeight = cFont::GetFont(fontOsd)->Height(); + int LogoSize = max(3 * lineHeight + TitleDeco + SmallGap, LogoHeight); + LogoSize += (LogoSize % 2 ? 1 : 0); xLogoLeft = 0; - xLogoRight = LogoWidth; + xLogoRight = LogoSize; xLogoDecoLeft = xLogoRight + LogoDecoGap; xLogoDecoRight = xLogoDecoLeft + LogoDecoWidth; yLogoTop = 0; - yLogoBottom = yLogoTop + LogoHeight; - xTitleLeft = xLogoDecoRight + LogoDecoGap2; + yLogoBottom = yLogoTop + LogoSize; + xTitleLeft = fShowSymbol ? (xLogoDecoRight + LogoDecoGap2) : 0; xTitleRight = Setup.OSDWidth; yTitleTop = yLogoTop; yTitleBottom = yTitleTop + lineHeight; @@ -2171,36 +2286,55 @@ cSkinEnigmaDisplayVolume::cSkinEnigmaDisplayVolume() // create osd osd = cOsdProvider::NewOsd(Setup.OSDLeft, Setup.OSDTop + Setup.OSDHeight - yBottomBottom); - tArea Areas[] = { {xLogoLeft, yLogoTop, xTitleRight - 1, yBottomBottom - 1, 8} }; + tArea Areas[] = { {xLogoLeft, yLogoTop, xTitleRight - 1, yBottomBottom - 1, EnigmaConfig.singleArea8Bpp ? 8 : 4} }; if (EnigmaConfig.singleArea && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) { osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); } else { - tArea Areas[] = { {xLogoLeft, yLogoTop, xLogoRight + LogoDecoGap + LogoDecoWidth - 1, yLogoBottom - 1, 4}, - {xTitleLeft, yTitleTop, xTitleRight - 1, yBottomBottom - 1, 4} - }; - int rc = osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)); - if (rc == oeOk) - osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); - else { - error("cSkinEnigmaDisplayVolume: CanHandleAreas() returned %d (%d, %d)\n", rc, oeWrongAlignment, oeOutOfMemory); - return; + cBitmap *bitmap = NULL; + if (fShowSymbol) { + tArea Areas[] = { {xLogoLeft, yLogoTop, xLogoRight + LogoDecoGap + LogoDecoWidth - 1, yLogoBottom - 1, 4}, + {xTitleLeft, yTitleTop, xTitleRight - 1, yBottomBottom - 1, 4} + }; + int rc = osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)); + if (rc == oeOk) + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + else { + error("cSkinEnigmaDisplayVolume: CanHandleAreas() returned %d\n", rc); + return; + } + bitmap = osd->GetBitmap(1); + } else { + tArea Areas[] = { {xTitleLeft, yTitleTop, xTitleRight - 1, yBottomBottom - 1, 4} + }; + int rc = osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)); + if (rc == oeOk) + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + else { + error("cSkinEnigmaDisplayVolume: CanHandleAreas() returned %d\n", rc); + return; + } + bitmap = osd->GetBitmap(0); + } + if (bitmap) { + // set colors + bitmap->Reset(); + bitmap->SetColor(0, Theme.Color(clrTransparent)); + bitmap->SetColor(1, Theme.Color(clrBackground)); + bitmap->SetColor(2, Theme.Color(clrTitleBg)); + bitmap->SetColor(3, Theme.Color(clrBottomBg)); + bitmap->SetColor(4, Theme.Color(clrVolumeBar)); + bitmap->SetColor(5, Theme.Color(clrVolumeBarMute)); + bitmap->SetColor(6, Theme.Color(clrTitleFg)); + bitmap->SetColor(7, Theme.Color(clrTitleShadow)); } - // set colors - osd->GetBitmap(1)->Reset(); - osd->GetBitmap(1)->SetColor(0, Theme.Color(clrTransparent)); - osd->GetBitmap(1)->SetColor(1, Theme.Color(clrBackground)); - osd->GetBitmap(1)->SetColor(2, Theme.Color(clrTitleBg)); - osd->GetBitmap(1)->SetColor(3, Theme.Color(clrBottomBg)); - osd->GetBitmap(1)->SetColor(4, Theme.Color(clrVolumeBar)); - osd->GetBitmap(1)->SetColor(5, Theme.Color(clrVolumeBarMute)); - osd->GetBitmap(1)->SetColor(6, Theme.Color(clrTitleFg)); - osd->GetBitmap(1)->SetColor(7, Theme.Color(clrTitleShadow)); } // clear all osd->DrawRectangle(0, 0, osd->Width(), osd->Height(), clrTransparent); - // draw logo area - osd->DrawRectangle(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg)); - osd->DrawRectangle(xLogoDecoLeft, yLogoTop, xLogoDecoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg)); + if (fShowSymbol) { + // draw logo area + osd->DrawRectangle(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg)); + osd->DrawRectangle(xLogoDecoLeft, yLogoTop, xLogoDecoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg)); + } // draw title osd->DrawRectangle(xTitleLeft, yTitleTop, xTitleRight - 1, yTitleBottom - 1, Theme.Color(clrTitleBg)); osd->DrawRectangle(xTitleLeft, yTitleDecoTop, xTitleRight - 1, yTitleDecoBottom - 1, Theme.Color(clrTitleBg)); @@ -2210,6 +2344,11 @@ cSkinEnigmaDisplayVolume::cSkinEnigmaDisplayVolume() // draw bottom area osd->DrawRectangle(xBottomLeft, yBottomTop, xBottomRight - 1, yBottomBottom - 1, Theme.Color(clrBottomBg)); osd->DrawEllipse(xBottomRight - Roundness, yBottomBottom - Roundness, xBottomRight - 1, yBottomBottom - 1, clrTransparent, -4); + + if (!fShowSymbol) { + osd->DrawEllipse(xTitleLeft, yTitleTop, xTitleLeft + Roundness - 1, yTitleTop + Roundness - 1, clrTransparent, -2); + osd->DrawEllipse(xBottomLeft, yBottomBottom - Roundness, xBottomLeft + Roundness, yBottomBottom - 1, clrTransparent, -3); + } } cSkinEnigmaDisplayVolume::~cSkinEnigmaDisplayVolume() @@ -2228,14 +2367,16 @@ void cSkinEnigmaDisplayVolume::SetVolume(int Current, int Total, bool Mute) if (Mute) { ColorBar = Theme.Color(clrVolumeBarMute); Prompt = tr("Mute"); - fFoundLogo = EnigmaLogoCache.Load("icons/volume/muteOn"); + if (fShowSymbol) + fFoundLogo = EnigmaLogoCache.Load("icons/volume/muteOn"); } else { ColorBar = Theme.Color(clrVolumeBar); Prompt = tr("Volume"); - fFoundLogo = EnigmaLogoCache.Load("icons/volume/muteOff"); + if (fShowSymbol) + fFoundLogo = EnigmaLogoCache.Load("icons/volume/muteOff"); } // logo - if (fFoundLogo) + if (fShowSymbol && fFoundLogo) osd->DrawBitmap(xLogoLeft + (xLogoRight - xLogoLeft - EnigmaLogoCache.Get().Width()) / 2, yLogoTop + (yLogoBottom - yLogoTop - EnigmaLogoCache.Get().Height()) / 2, EnigmaLogoCache.Get(),EnigmaLogoCache.Get().Color(1), @@ -2243,14 +2384,14 @@ void cSkinEnigmaDisplayVolume::SetVolume(int Current, int Total, bool Mute) // current volume int vol = xBodyLeft + Gap + (xBodyRight - Gap - xBodyLeft - Gap) * Current / Total; // draw titlebar - osd->DrawRectangle(xTitleLeft + Gap, yTitleTop, xTitleRight - Roundness - 1, + osd->DrawRectangle(xTitleLeft + (fShowSymbol ? Gap : Roundness), yTitleTop, xTitleRight - Roundness - 1, yTitleBottom - 1, Theme.Color(clrTitleBg)); - osd->DrawText(xTitleLeft + Gap + 3, yTitleTop + 3, Prompt, + osd->DrawText(xTitleLeft + (fShowSymbol ? Gap : Roundness) + 3, yTitleTop + 3, Prompt, Theme.Color(clrTitleShadow), clrTransparent, font, - xTitleRight - xTitleLeft, lineHeight, taCenter); - osd->DrawText(xTitleLeft + Gap, yTitleTop, Prompt, + xTitleRight - Roundness - xTitleLeft, lineHeight, taCenter); + osd->DrawText(xTitleLeft + (fShowSymbol ? Gap : Roundness), yTitleTop, Prompt, Theme.Color(clrTitleFg), clrTransparent, font, - xTitleRight - xTitleLeft, lineHeight, taCenter); + xTitleRight - Roundness - xTitleLeft, lineHeight, taCenter); // draw volumebar osd->DrawRectangle(xBodyLeft + Gap, yBodyTop + Gap, xBodyRight - Gap - 1, yBodyBottom - Gap - 1, Theme.Color(clrBackground)); @@ -2261,9 +2402,9 @@ void cSkinEnigmaDisplayVolume::SetVolume(int Current, int Total, bool Mute) void cSkinEnigmaDisplayVolume::Flush(void) { cString date = DayDateTime(); - osd->DrawText(xBottomLeft, yBottomTop, date, Theme.Color(clrTitleFg), + osd->DrawText(xBottomLeft + (fShowSymbol ? 0 : Roundness), yBottomTop, date, Theme.Color(clrTitleFg), Theme.Color(clrBottomBg), cFont::GetFont(fontOsd), - xBottomRight - Gap - xBottomLeft - 1, + xBottomRight - (fShowSymbol ? Gap : (2 * Roundness)) - xBottomLeft - 1, yBottomBottom - yBottomTop - 1, taRight); osd->Flush(); } @@ -2281,6 +2422,7 @@ private: int lineHeight; int currentIndex; + bool fShowSymbol; void SetItem(const char *Text, int Index, bool Current); public: @@ -2293,18 +2435,24 @@ public: }; cSkinEnigmaDisplayTracks::cSkinEnigmaDisplayTracks(const char *Title, int NumTracks, const char *const *Tracks) -{ //TODO: honour enable/disable option "show symbols" +{ + fShowSymbol = (EnigmaConfig.showSymbols == 1 || EnigmaConfig.showSymbols == 2); + const cFont *font = cFont::GetFont(fontOsd); lineHeight = font->Height(); + int LogoSize = LogoHeight; + LogoSize += (LogoSize % 2 ? 1 : 0); currentIndex = -1; int ItemsWidth = 0; for (int i = 0; i < NumTracks; i++) ItemsWidth = max(ItemsWidth, font->Width(Tracks[i])); - ItemsWidth += (EnigmaConfig.showMarker ? lineHeight : SmallGap); - ItemsWidth = max(ItemsWidth, LogoWidth); - int width = LogoWidth + LogoDecoGap2 + ItemsWidth; + ItemsWidth += (EnigmaConfig.showMarker ? lineHeight : SmallGap) + SmallGap; + ItemsWidth = max(ItemsWidth, LogoSize); + int width = ItemsWidth; + if (fShowSymbol) + width += LogoSize + LogoDecoGap2; width = max(width, font->Width(DayDateTime()) + 2 * Roundness); - width = max(width, font->Width(Title) + 2 * Roundness); + width = max(width, font->Width(Title) + 2 * Roundness + (fShowSymbol ? 0 : (bmAudio[0].Width() + SmallGap))); xTitleLeft = 0; xTitleRight = Setup.OSDWidth; @@ -2319,10 +2467,10 @@ cSkinEnigmaDisplayTracks::cSkinEnigmaDisplayTracks(const char *Title, int NumTra yTitleDecoTop = yTitleBottom + TitleDecoGap; yTitleDecoBottom = yTitleDecoTop + TitleDecoHeight; xLogoLeft = xTitleLeft; - xLogoRight = xLogoLeft + LogoWidth; + xLogoRight = xLogoLeft + LogoSize; yLogoTop = yTitleDecoBottom + TitleDecoGap2; - yLogoBottom = yLogoTop + LogoHeight; - xListLeft = xLogoRight + LogoDecoGap2; + yLogoBottom = yLogoTop + LogoSize; + xListLeft = fShowSymbol ? (xLogoRight + LogoDecoGap2) : 0; xListRight = xTitleRight; yListTop = yLogoTop; yListBottom = yLogoBottom; @@ -2333,21 +2481,35 @@ cSkinEnigmaDisplayTracks::cSkinEnigmaDisplayTracks(const char *Title, int NumTra // create osd osd = cOsdProvider::NewOsd(Setup.OSDLeft, Setup.OSDTop + Setup.OSDHeight - yBottomBottom); - tArea Areas[] = { {xTitleLeft, yTitleTop, xBottomRight - 1, yBottomBottom - 1, 8} }; + tArea Areas[] = { {xTitleLeft, yTitleTop, xBottomRight - 1, yBottomBottom - 1, EnigmaConfig.singleArea8Bpp ? 8 : 4} }; if (EnigmaConfig.singleArea && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) { osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); } else { - tArea Areas[] = { {xTitleLeft, yTitleTop, xTitleRight - 1, yTitleDecoBottom- 1, 2}, - {xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, 4}, - {xListLeft, yListTop, xListRight - 1, yListBottom - 1, 4}, - {xBottomLeft, yBottomTop, xBottomRight - 1, yBottomBottom - 1, 2} - }; - int rc = osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)); - if (rc == oeOk) - osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); - else { - error("cSkinEnigmaDisplayTracks: CanHandleAreas() returned %d\n", rc); - return; + if (fShowSymbol) { + tArea Areas[] = { {xTitleLeft, yTitleTop, xTitleRight - 1, yTitleDecoBottom- 1, 2}, + {xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, 4}, + {xListLeft, yListTop, xListRight - 1, yListBottom - 1, 4}, + {xBottomLeft, yBottomTop, xBottomRight - 1, yBottomBottom - 1, 2} + }; + int rc = osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)); + if (rc == oeOk) + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + else { + error("cSkinEnigmaDisplayTracks: CanHandleAreas() returned %d\n", rc); + return; + } + } else { + tArea Areas[] = { {xTitleLeft, yTitleTop, xTitleRight - 1, yTitleDecoBottom- 1, 2}, + {xListLeft, yListTop, xListRight - 1, yListBottom - 1, 4}, + {xBottomLeft, yBottomTop, xBottomRight - 1, yBottomBottom - 1, 2} + }; + int rc = osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)); + if (rc == oeOk) + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + else { + error("cSkinEnigmaDisplayTracks: CanHandleAreas() returned %d\n", rc); + return; + } } } // clear all @@ -2358,19 +2520,21 @@ cSkinEnigmaDisplayTracks::cSkinEnigmaDisplayTracks(const char *Title, int NumTra osd->DrawText(xTitleLeft + Roundness + 3, yTitleTop + 3, Title, Theme.Color(clrTitleShadow), clrTransparent, font, xTitleRight - Roundness - xTitleLeft - Roundness, - lineHeight - 3, taCenter); + lineHeight - 3, fShowSymbol ? taCenter : taLeft); osd->DrawText(xTitleLeft + Roundness, yTitleTop, Title, Theme.Color(clrTitleFg), clrTransparent, font, xTitleRight - Roundness - xTitleLeft - Roundness, lineHeight, - taCenter); + fShowSymbol ? taCenter : taLeft); // draw rounded left corner of titlebar osd->DrawEllipse(xTitleLeft, yTitleTop, xTitleLeft + Roundness - 1, yTitleTop + Roundness - 1, clrTransparent, -2); // draw rounded right corner of titlebar osd->DrawEllipse(xTitleRight - Roundness, yTitleTop, xTitleRight - 1, yTitleTop + Roundness - 1, clrTransparent, -1); - // draw logo area - osd->DrawRectangle(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg)); + if (fShowSymbol) { + // draw logo area + osd->DrawRectangle(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg)); + } // draw list area osd->DrawRectangle(xListLeft, yListTop, xListRight - 1, yListBottom - 1, Theme.Color(clrBackground)); // draw bottom @@ -2417,15 +2581,24 @@ void cSkinEnigmaDisplayTracks::SetItem(const char *Text, int Index, bool Current void cSkinEnigmaDisplayTracks::SetAudioChannel(int AudioChannel) { - // draw logo area - osd->DrawRectangle(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg)); - if (!(AudioChannel >= 0 && AudioChannel < MAX_AUDIO_BITMAPS)) - AudioChannel = 0; - if (EnigmaLogoCache.Load(strAudio_large[AudioChannel])) - osd->DrawBitmap(xLogoLeft + (xLogoRight - xLogoLeft - EnigmaLogoCache.Get().Width()) / 2, - yLogoTop + (yLogoBottom - yLogoTop - EnigmaLogoCache.Get().Height()) / 2, - EnigmaLogoCache.Get(),EnigmaLogoCache.Get().Color(1), - Theme.Color(clrLogoBg)); + if (fShowSymbol) { + // draw logo area + osd->DrawRectangle(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg)); + if (!(AudioChannel >= 0 && AudioChannel < MAX_AUDIO_BITMAPS)) + AudioChannel = 0; + if (EnigmaLogoCache.Load(strAudio_large[AudioChannel])) + osd->DrawBitmap(xLogoLeft + (xLogoRight - xLogoLeft - EnigmaLogoCache.Get().Width()) / 2, + yLogoTop + (yLogoBottom - yLogoTop - EnigmaLogoCache.Get().Height()) / 2, + EnigmaLogoCache.Get(),EnigmaLogoCache.Get().Color(1), + Theme.Color(clrLogoBg)); + } else { + if (!(AudioChannel >= 0 && AudioChannel < MAX_AUDIO_BITMAPS)) + AudioChannel = 0; + osd->DrawBitmap(xTitleRight - Roundness - bmAudio[AudioChannel].Width(), + yTitleTop + (yTitleBottom - yTitleTop - bmAudio[AudioChannel].Height()) / 2, + bmAudio[AudioChannel], Theme.Color(clrTitleFg), + Theme.Color(clrTitleBg)); + } } void cSkinEnigmaDisplayTracks::SetTrack(int Index, const char *const *Tracks) @@ -2458,6 +2631,7 @@ private: int xBottomLeft, xBottomRight, yBottomTop, yBottomBottom; int lineHeight; + bool fShowSymbol; public: cSkinEnigmaDisplayMessage(); virtual ~ cSkinEnigmaDisplayMessage(); @@ -2468,14 +2642,18 @@ public: cSkinEnigmaDisplayMessage::cSkinEnigmaDisplayMessage() { lineHeight = cFont::GetFont(fontOsd)->Height(); + fShowSymbol = (EnigmaConfig.showSymbols == 1 || EnigmaConfig.showSymbols == 2); + + int LogoSize = max(3 * lineHeight + TitleDeco + 5 * SmallGap, LogoHeight); + LogoSize += (LogoSize % 2 ? 1 : 0); xLogoLeft = 0; - xLogoRight = xLogoLeft + LogoWidth; + xLogoRight = xLogoLeft + LogoSize; xLogoDecoLeft = xLogoRight + LogoDecoGap; xLogoDecoRight = xLogoDecoLeft + LogoDecoWidth; yLogoTop = 0; - yLogoBottom = yLogoTop + LogoHeight; - xTitleLeft = xLogoDecoRight + LogoDecoGap2; + yLogoBottom = yLogoTop + LogoSize; + xTitleLeft = fShowSymbol ? xLogoDecoRight + LogoDecoGap2 : 0; xTitleRight = Setup.OSDWidth; yTitleTop = yLogoTop; yTitleBottom = yTitleTop + lineHeight; @@ -2492,18 +2670,29 @@ cSkinEnigmaDisplayMessage::cSkinEnigmaDisplayMessage() // create osd osd = cOsdProvider::NewOsd(Setup.OSDLeft, Setup.OSDTop + Setup.OSDHeight - yBottomBottom); - tArea Areas[] = { {xLogoLeft, yLogoTop, xBottomRight - 1, yBottomBottom - 1, 8} }; + tArea Areas[] = { {xLogoLeft, yLogoTop, xBottomRight - 1, yBottomBottom - 1, EnigmaConfig.singleArea8Bpp ? 8 : 4} }; if (EnigmaConfig.singleArea && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) { osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); } else { - tArea Areas[] = { {xLogoLeft, yLogoTop, xLogoRight + LogoDecoGap + LogoDecoWidth - 1, yLogoBottom - 1, 4}, - {xTitleLeft, yTitleTop, xBottomRight - 1, yBottomBottom - 1, 4} }; - int rc = osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)); - if (rc == oeOk) - osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); - else { - error("cSkinEnigmaDisplayMessage: CanHandleAreas() returned %d\n", rc); - return; + if (fShowSymbol) { + tArea Areas[] = { {xLogoLeft, yLogoTop, xLogoRight + LogoDecoGap + LogoDecoWidth - 1, yLogoBottom - 1, 4}, + {xTitleLeft, yTitleTop, xBottomRight - 1, yBottomBottom - 1, 4} }; + int rc = osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)); + if (rc == oeOk) + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + else { + error("cSkinEnigmaDisplayMessage: CanHandleAreas() returned %d\n", rc); + return; + } + } else { + tArea Areas[] = { {xTitleLeft, yTitleTop, xBottomRight - 1, yBottomBottom - 1, 4} }; + int rc = osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)); + if (rc == oeOk) + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + else { + error("cSkinEnigmaDisplayMessage: CanHandleAreas() returned %d\n", rc); + return; + } } } // clear all @@ -2517,13 +2706,15 @@ cSkinEnigmaDisplayMessage::~cSkinEnigmaDisplayMessage() void cSkinEnigmaDisplayMessage::SetMessage(eMessageType Type, const char *Text) { - // draw logo - osd->DrawRectangle(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg)); - osd->DrawRectangle(xLogoDecoLeft, yLogoTop, xLogoDecoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg)); - if (EnigmaLogoCache.Load("icons/message/info")) - osd->DrawBitmap(xLogoLeft + (xLogoRight - xLogoLeft - EnigmaLogoCache.Get().Width()) / 2, - yLogoTop + (yLogoBottom - yLogoTop - EnigmaLogoCache.Get().Height()) / 2, EnigmaLogoCache.Get(), - EnigmaLogoCache.Get().Color(1), Theme.Color(clrLogoBg)); + if (EnigmaConfig.showSymbols == 1 || EnigmaConfig.showSymbols == 2) { + // draw logo + osd->DrawRectangle(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg)); + osd->DrawRectangle(xLogoDecoLeft, yLogoTop, xLogoDecoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg)); + if (EnigmaLogoCache.Load("icons/message/info")) + osd->DrawBitmap(xLogoLeft + (xLogoRight - xLogoLeft - EnigmaLogoCache.Get().Width()) / 2, + yLogoTop + (yLogoBottom - yLogoTop - EnigmaLogoCache.Get().Height()) / 2, EnigmaLogoCache.Get(), + EnigmaLogoCache.Get().Color(1), Theme.Color(clrLogoBg)); + } // draw title osd->DrawRectangle(xTitleLeft, yTitleTop, xTitleRight - 1, yTitleBottom - 1, Theme.Color(clrTitleBg)); osd->DrawRectangle(xTitleLeft, yTitleDecoTop, xTitleRight - 1, yTitleDecoBottom - 1, Theme.Color(clrTitleBg)); @@ -2542,6 +2733,13 @@ void cSkinEnigmaDisplayMessage::SetMessage(eMessageType Type, const char *Text) osd->DrawRectangle(xBottomLeft, yBottomTop, xBottomRight - 1, yBottomBottom - 1, Theme.Color(clrBottomBg)); osd->DrawEllipse(xBottomRight - Roundness, yBottomBottom - Roundness, xBottomRight - 1, yBottomBottom - 1, clrTransparent, -4); + + if (!(EnigmaConfig.showSymbols == 1 || EnigmaConfig.showSymbols == 2)) { + // draw ellipse if not showing logo + osd->DrawEllipse(xTitleLeft, yTitleTop, xTitleLeft + Roundness - 1, yTitleTop + Roundness - 1, clrTransparent, -2); + osd->DrawEllipse(xBottomLeft, yBottomBottom - Roundness, + xBottomLeft + Roundness - 1, yBottomBottom - 1, clrTransparent, -3); + } } void cSkinEnigmaDisplayMessage::Flush(void) @@ -8,6 +8,28 @@ #include "i18n.h" const tI18nPhrase Phrases[] = { + {"en_US", // English + "de_DE", // Deutsch + "sl_SI", // Slovenski + "it_IT", // Italiano + "nl_NL", // Nederlands + "pt_PT", // Português + "fr_FR", // Français + "no_NO", // Norsk + "fi_FI", // suomi (Finnish) + "pl_PL", // Polski + "es_ES", // Español + "el_GR", // ÅëëçíéêÜ (Greek) + "sv_SE", // Svenska + "ro_RO", // Românã + "hu_HU", // Magyar + "ca_AD", // Català + "ru_RU", // ÀãááÚØÙ (Russian) + "hr_HR", // Hrvatski + "et_EE", // Eesti + "da_DK", // Dansk + "cs_CZ", // Èesky (Czech) + }, {"EnigmaNG skin", // English "EnigmaNG Oberfläche", // Deutsch "", // Slovenski @@ -24,7 +46,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "EnigmaNG áÚØÝ", // ÀãááÚØÙ (Russian) "", // Hrvatski "EnigmaNG kest", // Eesti "", // Dansk @@ -46,7 +68,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "EnigmaNG", // ÀãááÚØÙ (Russian) "", // Hrvatski "EnigmaNG", // Eesti "", // Dansk @@ -68,7 +90,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "ÜØÝ", // ÀãááÚØÙ (Russian) "", // Hrvatski "min", // Eesti "", // Dansk @@ -90,7 +112,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "ÁâÕàÕÞ", // ÀãááÚØÙ (Russian) "", // Hrvatski "Stereo", // Eesti "", // Dansk @@ -112,7 +134,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "»ÕÒëÙ", // ÀãááÚØÙ (Russian) "", // Hrvatski "Vasak", // Eesti "", // Danske @@ -134,7 +156,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "¿àÐÒëÙ", // ÀãááÚØÙ (Russian) "", // Hrvatski "Parem", // Eesti "", // Dansk @@ -156,7 +178,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "²ëÚÛ.·ÒãÚ", // ÀãááÚØÙ (Russian) "", // Hrvatski "Hääletu", // Eesti "", // Dansk @@ -178,7 +200,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "³àÞÜÚÞáâì", // ÀãááÚØÙ (Russian) "", // Hrvatski "Helitugevus", // Eesti "", // Dansk @@ -200,7 +222,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "¿ÞÚÐ×ëÒÐâì ÛÞÓÞ ÚÐÝÐÛÞÒ", // ÀãááÚØÙ (Russian) "", // Hrvatski "Kanalilogo näitamine", // Eesti "", // Dansk @@ -222,7 +244,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "¾ßàÕÔÕÛïâì ÚÐÝÐÛ ßÞ", // ÀãááÚØÙ (Russian) "", // Hrvatski "Kanali tuvastamise meetod", // Eesti "", // Dansk @@ -244,7 +266,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "¸Üï", // ÀãááÚØÙ (Russian) "", // Hrvatski "nimi", // Eesti "", // Dansk @@ -266,7 +288,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "´ÐÝÝëÕ", // ÀãááÚØÙ (Russian) "", // Hrvatski "andmed", // Eesti "", // Dansk @@ -288,7 +310,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "ÀÐ×ÜÕà ÚÕèÐ ÛÞÓÐâØßÞÒ ÚÐÝÐÛÞÒ", // ÀãááÚØÙ (Russian) "", // Hrvatski "Kanalilogo vahemälu suurus", // Eesti "", // Dansk @@ -310,7 +332,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "¾çØáâØâì ÚÕè", // ÀãááÚØÙ (Russian) "", // Hrvatski "Tühjenda", // Eesti "", // Dansk @@ -332,7 +354,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "¾çØéÐî ÚÕè...", // ÀãááÚØÙ (Russian) "", // Hrvatski "Kanalilogo vahemälu tühjendamine...", // Eesti "", // Dansk @@ -354,14 +376,14 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "Ï×ëÚØ", // ÀãááÚØÙ (Russian) "", // Hrvatski "Keeled", // Eesti "", // Dansk "", // Èesky (Czech) }, {"Auxiliary information", // English - "Zusatzinfo", // Deutsch + "Zusatzinformation", // Deutsch "", // Slovenski "", // Italiano "", // Nederlands @@ -376,7 +398,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "ÀÐáè. ØÝäÞàÜÐæØï", // ÀãááÚØÙ (Russian) "", // Hrvatski "Lisainfo", // Eesti "", // Dansk @@ -398,7 +420,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "¿ÞÚÐ×ëÒÐâì àÐáè. ØÝäÞàÜÐæØî", // ÀãááÚØÙ (Russian) "", // Hrvatski "Lisainfo näitamine", // Eesti "", // Dansk @@ -420,7 +442,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "¿ÞÚÐ×ëÒÐâì ÞáâÐÒ/ßàÞèÕÔ ÒàÕÜï", // ÀãááÚØÙ (Russian) "", // Hrvatski "", // Eesti "", // Dansk @@ -442,7 +464,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "¾áâÐÛÞáì", // ÀãááÚØÙ (Russian) "", // Hrvatski "", // Eesti "", // Dansk @@ -464,7 +486,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "¿àÞèÛÞ", // ÀãááÚØÙ (Russian) "", // Hrvatski "", // Eesti "", // Dansk @@ -486,7 +508,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "¿ÞÚÐ×ëÒÐâì ØÝä. ÞÑÛÐáâ Ò ÓÛ. ÜÕÝî", // ÀãááÚØÙ (Russian) "", // Hrvatski "", // Eesti "", // Dansk @@ -508,7 +530,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "¿ÞÚÐ×ëÒÐâì ÜÕâÚã Ò áßØáÚÐå", // ÀãááÚØÙ (Russian) "", // Hrvatski "", // Eesti "", // Dansk @@ -530,7 +552,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "¿ÞÚÐ×ëÒÐâì ßÞÛÞáã ßàÞÚàãâÚØ", // ÀãááÚØÙ (Russian) "", // Hrvatski "Edenemisriba näitamine", // Eesti "", // Dansk @@ -552,7 +574,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "¿ÞÚÐ×ëÒÐâì áØÜÒÞÛë", // ÀãááÚØÙ (Russian) "", // Hrvatski "Sümbolite näitamine", // Eesti "", // Dansk @@ -574,7 +596,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "¿ÞÚÐ×ëÒÐâì VPS", // ÀãááÚØÙ (Russian) "", // Hrvatski "", // Eesti "", // Dansk @@ -596,7 +618,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "¿Àµ´Ã¿Àµ¶´µ½¸µ", // ÀãááÚØÙ (Russian) "", // Hrvatski "", // Eesti "", // Dansk @@ -618,7 +640,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "ºÞÝäÛØÚâ âÐÙÜÕàÐ", // ÀãááÚØÙ (Russian) "", // Hrvatski "", // Eesti "", // Dansk @@ -640,7 +662,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "ÂÐÙÜÕàë ÚÞÝäÛØÚâãîâ", // ÀãááÚØÙ (Russian) "", // Hrvatski "", // Eesti "", // Dansk @@ -662,7 +684,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "ÂÐÙÜÕàë", // ÀãááÚØÙ (Russian) "", // Hrvatski "", // Eesti "", // Dansk @@ -706,7 +728,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "½ÕßàÐÒØÛìÝëÙ ÚÐÝÐÛ", // ÀãááÚØÙ (Russian) "", // Hrvatski "", // Eesti "", // Dansk @@ -728,7 +750,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "ÀÐ×ÜÕà", // ÀãááÚØÙ (Russian) "", // Hrvatski "", // Eesti "", // Dansk @@ -750,7 +772,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "²ëÚÛ.·ÒãÚ", // ÀãááÚØÙ (Russian) "", // Hrvatski "", // Eesti "", // Dansk @@ -772,7 +794,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "³àÞÜÚÞáâì", // ÀãááÚØÙ (Russian) "", // Hrvatski "", // Eesti "", // Dansk @@ -794,7 +816,7 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català - "", // ÀãááÚØÙ (Russian) + "¿ÞÚÐ×ëÒÐâì áØÜÒÞÛë Ò áßØáÚÐå", // ÀãááÚØÙ (Russian) "", // Hrvatski "", // Eesti "", // Dansk @@ -816,6 +838,336 @@ const tI18nPhrase Phrases[] = { "", // Românã "", // Magyar "", // Català + "¾ÔÝÐ ÞÑÛÐáâì(ÕáÛØ ÒÞ×ÜÞÖÝÞ)", // ÀãááÚØÙ (Russian) + "", // Hrvatski + "", // Eesti + "", // Dansk + "", // Èesky (Czech) + }, + {"Bpp in single area", // English + "Tiefe des Bildbereichs", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "Kuva-alueen värisyvyys", // suomi (Finnish) + "", // Polski + "", // Español + "", // ÅëëçíéêÜ (Greek) + "", // Svenska + "", // Românã + "", // Magyar + "", // Català + "", // ÀãááÚØÙ (Russian) + "", // Hrvatski + "", // Eesti + "", // Dansk + "", // Èesky (Czech) + }, + {"Show flags", // English + "Fahnen anzeigen", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "", // suomi (Finnish) + "", // Polski + "", // Español + "", // ÅëëçíéêÜ (Greek) + "", // Svenska + "", // Românã + "", // Magyar + "", // Català + "", // ÀãááÚØÙ (Russian) + "", // Hrvatski + "", // Eesti + "", // Dansk + "", // Èesky (Czech) + }, + {"Show symbols in menu", // English + "Symbole im Menü", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "", // suomi (Finnish) + "", // Polski + "", // Español + "", // ÅëëçíéêÜ (Greek) + "", // Svenska + "", // Românã + "", // Magyar + "", // Català + "", // ÀãááÚØÙ (Russian) + "", // Hrvatski + "", // Eesti + "", // Dansk + "", // Èesky (Czech) + }, + {"never", // English + "nie", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "", // suomi (Finnish) + "", // Polski + "", // Español + "", // ÅëëçíéêÜ (Greek) + "", // Svenska + "", // Românã + "", // Magyar + "", // Català + "", // ÀãááÚØÙ (Russian) + "", // Hrvatski + "", // Eesti + "", // Dansk + "", // Èesky (Czech) + }, + {"always", // English + "immer", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "", // suomi (Finnish) + "", // Polski + "", // Español + "", // ÅëëçíéêÜ (Greek) + "", // Svenska + "", // Românã + "", // Magyar + "", // Català + "", // ÀãááÚØÙ (Russian) + "", // Hrvatski + "", // Eesti + "", // Dansk + "", // Èesky (Czech) + }, + {"not in menu", // English + "nicht im Menü", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "", // suomi (Finnish) + "", // Polski + "", // Español + "", // ÅëëçíéêÜ (Greek) + "", // Svenska + "", // Românã + "", // Magyar + "", // Català + "", // ÀãááÚØÙ (Russian) + "", // Hrvatski + "", // Eesti + "", // Dansk + "", // Èesky (Czech) + }, + {"only in menu", // English + "nur im Menü", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "", // suomi (Finnish) + "", // Polski + "", // Español + "", // ÅëëçíéêÜ (Greek) + "", // Svenska + "", // Românã + "", // Magyar + "", // Català + "", // ÀãááÚØÙ (Russian) + "", // Hrvatski + "", // Eesti + "", // Dansk + "", // Èesky (Czech) + }, + {"percent", // English + "Prozent", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "", // suomi (Finnish) + "", // Polski + "", // Español + "", // ÅëëçíéêÜ (Greek) + "", // Svenska + "", // Românã + "", // Magyar + "", // Català + "", // ÀãááÚØÙ (Russian) + "", // Hrvatski + "", // Eesti + "", // Dansk + "", // Èesky (Czech) + }, + {"if exists", // English + "wenn vorhanden", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "", // suomi (Finnish) + "", // Polski + "", // Español + "", // ÅëëçíéêÜ (Greek) + "", // Svenska + "", // Românã + "", // Magyar + "", // Català + "", // ÀãááÚØÙ (Russian) + "", // Hrvatski + "", // Eesti + "", // Dansk + "", // Èesky (Czech) + }, + {"Number of Reruns", // English + "Anzahl Wiederholungen", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "", // suomi (Finnish) + "", // Polski + "", // Español + "", // ÅëëçíéêÜ (Greek) + "", // Svenska + "", // Românã + "", // Magyar + "", // Català + "", // ÀãááÚØÙ (Russian) + "", // Hrvatski + "", // Eesti + "", // Dansk + "", // Èesky (Czech) + }, + {"Use Subtitle for reruns", // English + "Verw. Untertitel für Wdh.", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "", // suomi (Finnish) + "", // Polski + "", // Español + "", // ÅëëçíéêÜ (Greek) + "", // Svenska + "", // Românã + "", // Magyar + "", // Català + "", // ÀãááÚØÙ (Russian) + "", // Hrvatski + "", // Eesti + "", // Dansk + "", // Èesky (Czech) + }, + {"Show timer conflicts", // English + "Timerkonflikte anzeigen", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "", // suomi (Finnish) + "", // Polski + "", // Español + "", // ÅëëçíéêÜ (Greek) + "", // Svenska + "", // Românã + "", // Magyar + "", // Català + "", // ÀãááÚØÙ (Russian) + "", // Hrvatski + "", // Eesti + "", // Dansk + "", // Èesky (Czech) + }, + {"Timer check", // English + "Überwachung", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "", // suomi (Finnish) + "", // Polski + "", // Español + "", // ÅëëçíéêÜ (Greek) + "", // Svenska + "", // Românã + "", // Magyar + "", // Català + "", // ÀãááÚØÙ (Russian) + "", // Hrvatski + "", // Eesti + "", // Dansk + "", // Èesky (Czech) + }, + {"EPGSearch", // English + "EPGSearch", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "", // suomi (Finnish) + "", // Polski + "", // Español + "", // ÅëëçíéêÜ (Greek) + "", // Svenska + "", // Românã + "", // Magyar + "", // Català + "", // ÀãááÚØÙ (Russian) + "", // Hrvatski + "", // Eesti + "", // Dansk + "", // Èesky (Czech) + }, + {"Logos & Symbols", // English + "Logos & Symbole", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "", // suomi (Finnish) + "", // Polski + "", // Español + "", // ÅëëçíéêÜ (Greek) + "", // Svenska + "", // Românã + "", // Magyar + "", // Català "", // ÀãááÚØÙ (Russian) "", // Hrvatski "", // Eesti @@ -110,8 +110,7 @@ bool cEnigmaLogoCache::LoadXpm(const char *fileNameP) return true; } // no xpm logo found - delete bitmap - printf("NOT FOUND: %s\n", filename); - debug("cPluginSkinEnigma::LoadXpm() LOGO NOT FOUND\n"); + error("cPluginSkinEnigma::LoadXpm(%s) LOGO NOT FOUND\n", filename); delete bmp; bitmapM = NULL; free(filename); diff --git a/skinenigmang.c b/skinenigmang.c index f4a1a25..323cffb 100644 --- a/skinenigmang.c +++ b/skinenigmang.c @@ -18,10 +18,13 @@ #error "VDR-1.4.0 API version or greater is required!" #endif -static const char VERSION[] = "0.0.2"; +static const char VERSION[] = "0.0.3"; static const char DESCRIPTION[] = "EnigmaNG skin"; class cPluginSkinEnigma : public cPlugin { +private: + bool fLogodirSet; + public: cPluginSkinEnigma(void); virtual ~cPluginSkinEnigma(); @@ -55,7 +58,12 @@ public: class cPluginSkinEnigmaSetup : public cMenuSetupPage { private: cEnigmaConfig data; + const char *showSymbolsTexts[4]; + const char *showRemainingTexts[3]; + const char *useSubtitleRerunTexts[3]; + virtual void Setup(void); + void AddCategory(const char *Title); protected: virtual eOSState ProcessKey(eKeys Key); virtual void Store(void); @@ -68,7 +76,7 @@ cPluginSkinEnigma::cPluginSkinEnigma(void) // initialize any member variables here. // DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT! - debug("cPluginSkinEnigma()\n"); + fLogodirSet = false; } cPluginSkinEnigma::~cPluginSkinEnigma() @@ -79,12 +87,28 @@ cPluginSkinEnigma::~cPluginSkinEnigma() const char *cPluginSkinEnigma::CommandLineHelp(void) { // return a string that describes all known command line options. - return NULL; + return " -l <LOGODIR>, --logodir=<LOGODIR> Define a directory for channel logos.\n"; } bool cPluginSkinEnigma::ProcessArgs(int argc, char *argv[]) { // implement command line argument processing here if applicable. + static const struct option long_options[] = { + { "logodir", required_argument, NULL, 'l' }, + { NULL } + }; + + int c; + while ((c = getopt_long(argc, argv, "l:", long_options, NULL)) != -1) { + switch (c) { + case 'l': + EnigmaConfig.SetLogoDir(optarg); + fLogodirSet = true; + break; + default: + return false; + } + } return true; } @@ -100,12 +124,13 @@ bool cPluginSkinEnigma::Start(void) // start any background activities the plugin shall perform. debug("cPluginSkinEnigma::Start()\n"); RegisterI18n(Phrases); - // set logo directory - EnigmaConfig.SetLogoDir(cPlugin::ConfigDirectory(PLUGIN_NAME_I18N)); + if (!fLogodirSet) { + // set logo directory + EnigmaConfig.SetLogoDir(cPlugin::ConfigDirectory(PLUGIN_NAME_I18N)); + fLogodirSet = true; + } // resize logo cache EnigmaLogoCache.Resize(EnigmaConfig.cacheSize); - // create status catcher - //new cEnigmaStatus; // create skin new cSkinEnigma; return true; @@ -141,7 +166,9 @@ bool cPluginSkinEnigma::SetupParse(const char *Name, const char *Value) debug("cPluginSkinEnigma::SetupParse()\n"); if (!strcasecmp(Name, "TrySingleArea")) EnigmaConfig.singleArea = atoi(Value); - if (!strcasecmp(Name, "ShowAuxInfo")) + else if (!strcasecmp(Name, "SingleArea8Bpp")) { + EnigmaConfig.singleArea8Bpp = atoi(Value); + } else if (!strcasecmp(Name, "ShowAuxInfo")) EnigmaConfig.showAuxInfo = atoi(Value); else if (!strcasecmp(Name, "ShowProgressBar")) EnigmaConfig.showProgressbar = atoi(Value); @@ -159,10 +186,18 @@ bool cPluginSkinEnigma::SetupParse(const char *Name, const char *Value) EnigmaConfig.showMarker = atoi(Value); else if (!strcasecmp(Name, "ShowVPS")) EnigmaConfig.showVps = atoi(Value); + else if (!strcasecmp(Name, "ShowFlags")) + EnigmaConfig.showFlags = atoi(Value); else if (!strcasecmp(Name, "CacheSize")) EnigmaConfig.cacheSize = atoi(Value); else if (!strcasecmp(Name, "UseChannelId")) EnigmaConfig.useChannelId = atoi(Value); + else if (!strcasecmp(Name, "NumReruns")) + EnigmaConfig.numReruns = atoi(Value); + else if (!strcasecmp(Name, "UseSubtitleRerun")) + EnigmaConfig.useSubtitleRerun = atoi(Value); + else if (!strcasecmp(Name, "ShowTimerConflicts")) + EnigmaConfig.showTimerConflicts = atoi(Value); else return false; @@ -196,6 +231,18 @@ cPluginSkinEnigmaSetup::cPluginSkinEnigmaSetup(void) SetHelp(tr("Button$Flush cache"), NULL, NULL, NULL); } +void cPluginSkinEnigmaSetup::AddCategory(const char *Title) { + char *buffer = NULL; + + asprintf(&buffer, "--- %s ----------------------------------------------------------------", Title ); + + cOsdItem *item = new cOsdItem(buffer); + free(buffer); + + item->SetSelectable(false); + Add(item); +} + void cPluginSkinEnigmaSetup::Setup(void) { // update setup display @@ -203,26 +250,48 @@ void cPluginSkinEnigmaSetup::Setup(void) Clear(); + showSymbolsTexts[0] = tr("never"); + showSymbolsTexts[1] = tr("always"); + showSymbolsTexts[2] = tr("not in menu"); + showSymbolsTexts[3] = tr("only in menu"); + + showRemainingTexts[0] = tr("elapsed"); + showRemainingTexts[1] = tr("remaining"); + showRemainingTexts[2] = tr("percent"); + + useSubtitleRerunTexts[0] = tr("never"); + useSubtitleRerunTexts[1] = tr("if exists"); + useSubtitleRerunTexts[2] = tr("always"); + Add(new cMenuEditBoolItem(tr("One area (if possible)"), &data.singleArea, tr("no"), tr("yes"))); + if (data.singleArea) { + Add(new cMenuEditBoolItem(tr("Bpp in single area"), &data.singleArea8Bpp, + "4", "8")); + } + Add(new cMenuEditBoolItem(tr("Show info area in main menu"), &data.showInfo, + tr("no"), tr("yes"))); Add(new cMenuEditBoolItem(tr("Show auxiliary information"), &data.showAuxInfo, tr("top"), tr("bottom"))); - Add(new cMenuEditBoolItem(tr("Show remaining/elapsed time"), &data.showRemaining, - tr("elapsed"), tr("remaining"))); - Add(new cMenuEditBoolItem(tr("Show symbols in lists"), &data.showListSymbols, + Add(new cMenuEditStraItem(tr("Show remaining/elapsed time"), &data.showRemaining, + 3, showRemainingTexts)); + Add(new cMenuEditBoolItem(tr("Show VPS"), &data.showVps, tr("no"), tr("yes"))); Add(new cMenuEditBoolItem(tr("Show progressbar"), &data.showProgressbar, tr("no"), tr("yes"))); - Add(new cMenuEditBoolItem(tr("Show symbols"), &data.showSymbols, - tr("no"), tr("yes"))); - Add(new cMenuEditBoolItem(tr("Show info area in main menu"), &data.showInfo, + + AddCategory(tr("Logos & Symbols")); + Add(new cMenuEditStraItem(tr("Show symbols"), &data.showSymbols, + 4, showSymbolsTexts)); + Add(new cMenuEditBoolItem(tr("Show symbols in lists"), &data.showListSymbols, tr("no"), tr("yes"))); Add(new cMenuEditBoolItem(tr("Show marker in lists"), &data.showMarker, tr("no"), tr("yes"))); - Add(new cMenuEditBoolItem(tr("Show VPS"), &data.showVps, + Add(new cMenuEditBoolItem(tr("Show flags"), &data.showFlags, tr("no"), tr("yes"))); Add(new cMenuEditBoolItem(tr("Show channel logos"), &data.showLogo, tr("no"), tr("yes"))); + if (data.showLogo) { Add(new cMenuEditBoolItem(tr("Identify channel by"), &data.useChannelId, tr("name"), tr("data"))); @@ -232,6 +301,18 @@ void cPluginSkinEnigmaSetup::Setup(void) 0, 1000)); } +#ifdef SKINENIGMA_HAVE_EPGSEARCH + AddCategory(tr("EPGSearch")); + Add(new cMenuEditIntItem(tr("Number of Reruns"), &data.numReruns, + 0, 10)); + Add(new cMenuEditStraItem(tr("Use Subtitle for reruns"), &data.useSubtitleRerun, + 3, useSubtitleRerunTexts)); + if (data.showInfo) { + Add(new cMenuEditBoolItem(tr("Show timer conflicts"), &data.showTimerConflicts, + tr("no"), tr("yes"))); + } +#endif + SetCurrent(Get(current)); Display(); } @@ -242,6 +323,7 @@ void cPluginSkinEnigmaSetup::Store(void) debug("cPluginSkinEnigmaSetup::Store()\n"); EnigmaConfig = data; SetupStore("TrySingleArea", EnigmaConfig.singleArea); + SetupStore("SingleArea8Bpp", EnigmaConfig.singleArea8Bpp); SetupStore("ShowAuxInfo", EnigmaConfig.showAuxInfo); SetupStore("ShowRemaining", EnigmaConfig.showRemaining); SetupStore("ShowProgressBar", EnigmaConfig.showProgressbar); @@ -250,9 +332,13 @@ void cPluginSkinEnigmaSetup::Store(void) SetupStore("ShowLogo", EnigmaConfig.showLogo); SetupStore("ShowInfo", EnigmaConfig.showInfo); SetupStore("ShowVPS", EnigmaConfig.showVps); + SetupStore("ShowFlags", EnigmaConfig.showFlags); SetupStore("ShowMarker", EnigmaConfig.showMarker); SetupStore("CacheSize", EnigmaConfig.cacheSize); SetupStore("UseChannelId", EnigmaConfig.useChannelId); + SetupStore("NumReruns", EnigmaConfig.numReruns); + SetupStore("UseSubtitleRerun", EnigmaConfig.useSubtitleRerun); + SetupStore("ShowTimerConflicts", EnigmaConfig.showTimerConflicts); // resize logo cache EnigmaLogoCache.Resize(EnigmaConfig.cacheSize); } @@ -262,6 +348,8 @@ eOSState cPluginSkinEnigmaSetup::ProcessKey(eKeys Key) // process key presses int oldShowLogo = data.showLogo; int oldShowSymbols = data.showSymbols; + int oldSingleArea = data.singleArea; + int oldShowInfo = data.showInfo; eOSState state = cMenuSetupPage::ProcessKey(Key); if ((state == osUnknown) && (Key == kRed)) { @@ -270,7 +358,7 @@ eOSState cPluginSkinEnigmaSetup::ProcessKey(eKeys Key) Skins.Message(mtInfo, NULL); state = osContinue; } - if (Key != kNone && ((data.showLogo != oldShowLogo) || (data.showSymbols != oldShowSymbols))) { + if (Key != kNone && ((data.singleArea != oldSingleArea) || (data.showLogo != oldShowLogo) || (data.showSymbols != oldShowSymbols) || (oldShowInfo != data.showInfo))) { Setup(); } diff --git a/themes/EnigmaNG-YellowSun.theme b/themes/EnigmaNG-YellowSun.theme new file mode 100644 index 0000000..fe8c0ff --- /dev/null +++ b/themes/EnigmaNG-YellowSun.theme @@ -0,0 +1,54 @@ +Description = YellowSun +clrBackground = E5fae9bc +clrAltBackground = E5f3e396 +clrTitleBg = E5ffd927 +clrLogoBg = E5e7dd41 +clrBottomBg = E5e8c523 +clrBotProgBarBg = FF808080 +clrBotProgBarFg = FFFFFFFF +clrMenuTxtFg = FF000000 +clrTitleFg = FF000000 +clrTitleShadow = FF9f9f9f +clrSymbolActive = FFb12e2e +clrSymbolInactive = FF808080 +clrSymbolRecord = FFC40000 +clrSymbolTimerActive = FFe98400 +clrSymbolVpsActive = FF002ec4 +clrSymbolRecActive = FFC40000 +clrSymbolRunActive = FF00C400 +clrButtonRedFg = FFFFFFFF +clrButtonRedBg = E5C40000 +clrButtonGreenFg = FFFFFFFF +clrButtonGreenBg = E500C400 +clrButtonYellowFg = FF000000 +clrButtonYellowBg = E5f4f115 +clrButtonBlueFg = FFFFFFFF +clrButtonBlueBg = E50000C4 +clrMessageBorder = E5FF0000 +clrMessageStatusFg = FF000000 +clrMessageStatusBg = E5ffe29b +clrMessageInfoFg = FF000000 +clrMessageInfoBg = E5ffdf89 +clrMessageWarningFg = FF000000 +clrMessageWarningBg = E5ffe08d +clrMessageErrorFg = FF000000 +clrMessageErrorBg = E5FFD1D1 +clrVolumeBar = FFffaa33 +clrVolumeBarMute = FFFF0000 +clrMenuItemCurrentFg = FF000000 +clrMenuHighlight = E5f3e396 +clrMenuItemSelectableFg = FF000000 +clrMenuItemNotSelectableFg = E54158BC +clrMenuEventTitle = FF000000 +clrMenuEventShortText = FF1D2F7D +clrMenuScrollbarTotal = E5B2BBD6 +clrMenuScrollbarShown = FF000000 +clrReplayCurrent = FFd4870e +clrReplayTotal = FFd4870e +clrReplayModeJump = FFd4870e +clrReplayBarAreaBg = E5fae086 +clrReplayProgressSeen = FFe3be57 +clrReplayProgressRest = E5fada8c +clrReplayProgressSelected = FFfb7141 +clrReplayProgressMark = FFfb7141 +clrReplayProgressCurrent = FFfb7141 @@ -14,17 +14,22 @@ #include <stdlib.h> #include <string.h> #include "common.h" +#include "i18n.h" #include "tools.h" using namespace std; -#define AUX_HEADER_EPGSEARCH "EPGSearch: " -#define AUX_TAGS_EPGSEARCH_START "<epgsearch>" -#define AUX_TAGS_EPGSEARCH_ITEM1_START "<Channel>" -#define AUX_TAGS_EPGSEARCH_ITEM1_END "</Channel>" -#define AUX_TAGS_EPGSEARCH_ITEM2_START "<Search timer>" -#define AUX_TAGS_EPGSEARCH_ITEM2_END "</Search timer>" -#define AUX_TAGS_EPGSEARCH_END "</epgsearch>" +#define AUX_HEADER_EPGSEARCH "EPGSearch: " +#define AUX_TAGS_EPGSEARCH_START "<epgsearch>" +#define AUX_TAGS_EPGSEARCH_ITEM_1A_START "<Channel>" +#define AUX_TAGS_EPGSEARCH_ITEM_1A_END "</Channel>" +#define AUX_TAGS_EPGSEARCH_ITEM_2A_START "<Search timer>" +#define AUX_TAGS_EPGSEARCH_ITEM_2A_END "</Search timer>" +#define AUX_TAGS_EPGSEARCH_ITEM_1B_START "<update>" +#define AUX_TAGS_EPGSEARCH_ITEM_1B_END "</update>" +#define AUX_TAGS_EPGSEARCH_ITEM_2B_START "<eventid>" +#define AUX_TAGS_EPGSEARCH_ITEM_2B_END "</eventid>" +#define AUX_TAGS_EPGSEARCH_END "</epgsearch>" #define AUX_HEADER_VDRADMIN "VDRAdmin-AM: " #define AUX_TAGS_VDRADMIN_START "<vdradmin-am>" @@ -51,11 +56,11 @@ const char *parseaux(const char *aux) sstrReturn << AUX_HEADER_EPGSEARCH; // parse first item char *tmp; - if ((tmp = strcasestr(start, AUX_TAGS_EPGSEARCH_ITEM1_START)) != NULL) { + if ((tmp = strcasestr(start, AUX_TAGS_EPGSEARCH_ITEM_1A_START)) != NULL) { if (tmp < end) { - tmp += strlen(AUX_TAGS_EPGSEARCH_ITEM1_START); + tmp += strlen(AUX_TAGS_EPGSEARCH_ITEM_1A_START); char *tmp2; - if ((tmp2 = strcasestr(tmp, AUX_TAGS_EPGSEARCH_ITEM1_END)) != NULL) { + if ((tmp2 = strcasestr(tmp, AUX_TAGS_EPGSEARCH_ITEM_1A_END)) != NULL) { // add channel sstrReturn << string(tmp, tmp2 - tmp); founditem = true; @@ -65,11 +70,11 @@ const char *parseaux(const char *aux) } } // parse second item - if ((tmp = strcasestr(start, "<Search timer>")) != NULL) { + if ((tmp = strcasestr(start, AUX_TAGS_EPGSEARCH_ITEM_2A_START)) != NULL) { if (tmp < end) { - tmp += strlen(AUX_TAGS_EPGSEARCH_ITEM2_START); + tmp += strlen(AUX_TAGS_EPGSEARCH_ITEM_2A_START); char *tmp2; - if ((tmp2 = strcasestr(tmp, AUX_TAGS_EPGSEARCH_ITEM2_END)) != NULL) { + if ((tmp2 = strcasestr(tmp, AUX_TAGS_EPGSEARCH_ITEM_2A_END)) != NULL) { // add separator if (founditem) { sstrReturn << ", "; @@ -82,6 +87,45 @@ const char *parseaux(const char *aux) } } } + // timer check? + if ((tmp = strcasestr(start, AUX_TAGS_EPGSEARCH_ITEM_1B_START)) != NULL) { + if (tmp < end) { + tmp += strlen(AUX_TAGS_EPGSEARCH_ITEM_1B_START); + char *tmp2; + if ((tmp2 = strcasestr(tmp, AUX_TAGS_EPGSEARCH_ITEM_1B_END)) != NULL) { + if (string(tmp, tmp2 - tmp) != "0") { + // add separator + if (founditem) { + sstrReturn << ", "; + } + founditem = true; + // add search item + sstrReturn << tr("Timer check"); + + // parse second item + if ((tmp = strcasestr(start, AUX_TAGS_EPGSEARCH_ITEM_2B_START)) != NULL) { + if (tmp < end) { + tmp += strlen(AUX_TAGS_EPGSEARCH_ITEM_2B_START); + char *tmp2; + if ((tmp2 = strcasestr(tmp, AUX_TAGS_EPGSEARCH_ITEM_2B_END)) != NULL) { + // add separator + if (founditem) { + sstrReturn << ", "; + } + // add search item + sstrReturn << "eventid=" << string(tmp, tmp2 - tmp); + } + } + } + } else { + founditem = false; + } + } else { + founditem = false; + } + } + } + // use old syntax if (!founditem) { start += strlen(AUX_HEADER_EPGSEARCH); |