diff options
author | Andreas Mair <amair.sob@googlemail.com> | 2008-03-09 09:39:06 +0100 |
---|---|---|
committer | Andreas Mair <amair.sob@googlemail.com> | 2008-03-09 09:39:06 +0100 |
commit | 7b34d920b0043281d7877d1e0ece8642d27f212d (patch) | |
tree | c3fb775627f5889beca307e407fcb95b4e6b7342 /config.c | |
parent | 40650ddcf7b4142790b786e50f315dade90e8678 (diff) | |
download | vdr-plugin-skinenigmang-0.0.6.tar.gz vdr-plugin-skinenigmang-0.0.6.tar.bz2 |
2008-03-09: Version 0.0.6v0.0.6
- Added scrollbar in menu lists when compiled with VDR >= v1.5.15.
- Fixed: VDR didn't responde anymore if the font used for lists was too small (<11px) and the marker in front of the active list item has been turned on.
- Added workaround to fix chrashes (hopefully) for VDR 1.4.x and patched fonts.
- Updated French translation (Submitted by Patrice Staudt).
- Updated Dutch translation (Submitted by Johan Schuring).
- Updated Spanish translation (Submitted by Bittor Corl).
- Updated Finnish translation (Submitted by Rolf Ahrenberg).
- Fixed crash in EPG details when using epgsearch if channel isn't found.
- Updated Italian translation (Provided by Gringo).
- Fix TrueTypeFonts support when compiled with VDR >= v1.5.4.
- Use WeekDayNameFull() in VDR >= v1.5.5.
- Use "Full Title Width" setting also for Tracks and Replay OSD.
- Optionally scroll current event's title and subtitle in channel info.
- New setup option "Show status symbols" (Suggested by chrisz @vdr-portal.de).
- Moved to the new i18n system introduced in VDR 1.5.7; fully backwards compatible due to Udo Richter's po2i18n.pl.
- Optionally show current WSS mode as symbol (if Avards is running).
- Draw "Dolby Digital" and "MONO" indicator in language flags.
- Hide inactive status symbols.
- Removed date from OSDs: tracks, volume
- Added status symbols in replay OSD.
- Draw line right to logos in Tracks and Replay OSD as it's done in other OSDs too.
- Added channel info OSD for "Info on channel switch = no" VDR option (Reported by Pat @vdr-portal.de).
- Removed compile time dependencies to plugin services.
- Renamed SKINENIGMA_HAVE_EPGSEARCH define to SKINENIGMA_USE_PLUGIN_EPGSEARCH.
- Disable i18n support for VDR >= v1.5.7.
- Added Turkish to translation array (for VDR >= v1.5.2).
- Use group name for logos even if channel logos are searched for by channel id.
- Fixed problems when compiling with VDR v1.5.7+ (Reported by Matthias Fechner).
- Fixed problems with certain images (Submitted by pinky666 @vdr-portal.de).
- Fixed crash if using display of repeatings in EPG details and reelchannelscan plugin is loaded.
- New setup option for location of messages in menu OSD.
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 113 |
1 files changed, 103 insertions, 10 deletions
@@ -10,7 +10,7 @@ #include "tools.h" #ifdef USE_PLUGIN_AVARDS -#include "../avards/avards_services.h" +#include "services/avards.h" #endif #include <stdlib.h> @@ -29,6 +29,10 @@ cGraphtftFont FontCache; # endif #endif +#ifndef DISABLE_ANIMATED_TEXT +const cFont *vdrFonts[eDvbFontSize]; +#endif + FontConfig allFontConfig[FONT_NUMFONTS] = { { FONT_OSDTITLE, "FontOsdTitle", "FontOsdTitleName" }, @@ -61,7 +65,7 @@ cEnigmaConfig::cEnigmaConfig() : showAuxInfo(1), showLogo(1), showVps(1), showSy imageWidth(120), imageHeight(80), imageExtension(0), fullTitleWidth(0), useTextEffects(0), scrollDelay(50), scrollPause(1500), scrollMode(0), blinkPause(1000), scrollInfo(1), scrollListItem(1), scrollOther(1), scrollTitle(1), - dynOsd(0) + dynOsd(0), statusLineMode(0), showWssSymbols(0), showStatusSymbols(1) { memset(logoDir, 0, sizeof(logoDir)); memset(strImagesDir, 0, sizeof(strImagesDir)); @@ -89,10 +93,16 @@ cEnigmaConfig::cEnigmaConfig() : showAuxInfo(1), showLogo(1), showVps(1), showSy allFonts[id].Width = 100; allFonts[id].Size = 26; } + +#ifndef DISABLE_ANIMATED_TEXT + for (int id = 0; id < eDvbFontSize; id++) + vdrFonts[id] = NULL; +#endif } cEnigmaConfig::~cEnigmaConfig() { + INIT_FONTS; // free allocated fonts } void cEnigmaConfig::SetLogoDir(const char *logodirP) @@ -130,18 +140,33 @@ void cEnigmaConfig::SetFontsDir(const char *dir) } #endif -const cFont *cEnigmaConfig::GetFont(int id, const cFont *pFontCur) +#ifndef DISABLE_ANIMATED_TEXT +void cEnigmaConfig::InitFonts(void) +{ + for (int id = 0; id < eDvbFontSize; id++) { + if (vdrFonts[id]) { + delete vdrFonts[id]; + vdrFonts[id] = NULL; + } + } +} +#endif + +const cFont *cEnigmaConfig::GetFont(int id) { const cFont *res = NULL; if (::Setup.UseSmallFont == 1) { // if "Use small font" == "skin dependent" if (allFonts[id].VdrId == FONT_TRUETYPE) { - if (pFontCur) // TTFs can't get patched, so it's always save to return the previous pointer - return pFontCur; if (!isempty(allFonts[id].Name)) { #ifdef HAVE_FREETYPE char *cachename; +#if VDRVERSNUM < 10503 asprintf(&cachename, "%s_%d_%d_%d", allFonts[id].Name, allFonts[id].Size, allFonts[id].Width, Setup.OSDLanguage); if (FontCache.Load(string(strFontsDir) + "/" + string(allFonts[id].Name), cachename, allFonts[id].Size, Setup.OSDLanguage, allFonts[id].Width)) { +#else + asprintf(&cachename, "%s_%d_%d_%s", allFonts[id].Name, allFonts[id].Size, allFonts[id].Width, Setup.OSDLanguage); + if (FontCache.Load(string(allFonts[id].Name), cachename, allFonts[id].Size, allFonts[id].Width)) { +#endif res = FontCache.GetFont(cachename); } else { error("ERROR: EnigmaNG: Couldn't load font %s:%d", allFonts[id].Name, allFonts[id].Size); @@ -152,20 +177,88 @@ const cFont *cEnigmaConfig::GetFont(int id, const cFont *pFontCur) #endif } } else if (allFonts[id].VdrId > FONT_TRUETYPE) { +#ifdef DISABLE_ANIMATED_TEXT res = cFont::GetFont((eDvbFont)(allFonts[id].VdrId - 1)); +#else + res = CopyFont((eDvbFont)(allFonts[id].VdrId - 1)); +#endif } else { +#ifdef DISABLE_ANIMATED_TEXT res = cFont::GetFont((eDvbFont)allFonts[id].VdrId); +#else + res = CopyFont((eDvbFont)allFonts[id].VdrId); +#endif } - } - if (res == NULL) - res = cFont::GetFont((eDvbFont)allFonts[id].Default); + if (res == NULL) { +#ifdef DISABLE_ANIMATED_TEXT + res = cFont::GetFont((eDvbFont)allFonts[id].Default); +#else + res = CopyFont((eDvbFont)allFonts[id].Default); +#endif + } + } if (res) return res; - else - return cFont::GetFont(fontOsd); + else { +#ifdef DISABLE_ANIMATED_TEXT + return cFont::GetFont(::Setup.UseSmallFont == 2 ? fontSml : fontOsd); +#else + return CopyFont(::Setup.UseSmallFont == 2 ? fontSml : fontOsd); +#endif + } +} + +#ifndef DISABLE_ANIMATED_TEXT +const cFont *cEnigmaConfig::CopyFont(eDvbFont vdrId) +{ +# ifdef ENABLE_COPYFONT + if (vdrFonts[vdrId]) { + return vdrFonts[vdrId]; + } + + const cFont *res = NULL; +# if VDRVERSNUM < 10503 + const cFont *src = cFont::GetFont(vdrId); + + int num_rows_global = src->Height(); + int num_rows = num_rows_global + 2; + cFont::tPixelData* font_data = new cFont::tPixelData[225 * num_rows]; + + for (int i = 0; i < 225; i++) { + for (int j = 0; j < num_rows; j++) { + font_data[i * num_rows + j] = 0x0000000000000000; + } + } + font_data[0 + 0] = src->CharData(0)->width; + font_data[0 + 1] = num_rows_global; + + for (int num_char = 33, i = 1; num_char < cFont::NUMCHARS; i++, num_char++) { + const cFont::tCharData *char_data = src->CharData(num_char); + font_data[i * num_rows + 0] = char_data->width; + font_data[i * num_rows + 1] = char_data->height; + for(int j = 0; j < (int)char_data->height; j++) { + cFont::tPixelData Data = (cFont::tPixelData)char_data->lines[j]; + font_data[i * num_rows + 2 + j] = Data; + } + } + + res = new cFont(font_data); +# else + switch (vdrId) { + case fontSml: res = cFont::CreateFont(Setup.FontSml, Setup.FontSmlSize); break; + case fontFix: res = cFont::CreateFont(Setup.FontFix, Setup.FontFixSize); break; + default: res = cFont::CreateFont(Setup.FontOsd, Setup.FontOsdSize); break; + } +# endif + vdrFonts[vdrId] = res; + return res; +# else + return cFont::GetFont(vdrId); +# endif } +#endif void cEnigmaConfig::SetFont(int id, const char *font) { |