summaryrefslogtreecommitdiff
path: root/logo.c
diff options
context:
space:
mode:
authorAndreas Mair <amair.sob@googlemail.com>2009-04-24 14:32:32 +0200
committerAndreas Mair <amair.sob@googlemail.com>2009-04-24 14:32:32 +0200
commit95977e11c0a5c1170351f2fafe400519d7b1086b (patch)
tree92259a6c6b8a7dc50ed9a0c3a2a172b204a4f54c /logo.c
parent7b34d920b0043281d7877d1e0ece8642d27f212d (diff)
downloadvdr-plugin-skinenigmang-0.1.0.tar.gz
vdr-plugin-skinenigmang-0.1.0.tar.bz2
2009-04-25: Version 0.1.0v0.1.0
- Fixed: Calculating width of events' start times in channel info OSD (Reported by tomglx @vdr-poprtal.de). - Changed: pause scrolling when text has scrolled all to the left in scroll behaviour "to the left" (Reported by Andreas Brugger). - Reworked: (simplified) font loading/caching. - Updated Italian translation (Provided by Diego Pierotto). - Removed: ENABLE_COPYFONT define. - Changed: Reduced number of font recreations (Reported by balta @vdr-portal.de). - Added: more CA systems to text mappings in channel info OSD (Submitted by free-x @vdr-portal.de). - Added: symbol in channel info OSD if current channel has subtitles. - Changed: background colors for the DarkBlue theme (Submitted by zulu @vdr-portal.de). - Added: New option "Show CA system as text". - Changed: Reduced number of locks while drawing to OSD which increases display speed especially in menu OSD. - Added: show signal strength and signal-to-noise ratio in channel info OSD (can be disabled by setting SKINENIGMA_DISABLE_SIGNALINFO to 1). - Fixed: compiler error with certain gcc versions (Reported by C-3PO @ vdr-portal.de). - Changed: smooth scrolling text (based on skinelchi by Christoph Haubrich <christoph.haubrich (AT) web.de>). - Removed: SKINENIGMA_DISABLE_ANIMATED_TEXT define. - Changed: Replace "/" by "~" in channel logo names. - Added: new setting "Show scrollbar in menu". - Added: Override VDR's SetTabs() to adopt column widths in menu OSD to selected font size. - Added: Support subtitle tracks in tracks OSD: logo will only be shown if icons/subtitle/subtitle.xpm exists. - Fixed: missing logo in tracks OSD while using single area. - Minor bugfixes and enhancements. - Requires at least VDR v1.6.0.
Diffstat (limited to 'logo.c')
-rw-r--r--logo.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/logo.c b/logo.c
index 1427f6d..8ff2b26 100644
--- a/logo.c
+++ b/logo.c
@@ -96,24 +96,36 @@ bool cEnigmaLogoCache::LoadChannelLogo(const cChannel *Channel)
return false;
bool fFoundLogo = false;
+ const char *logoname = NULL;
+ char *strLogo = NULL;
+ char *filename = NULL;
+
char *strChannelID = EnigmaConfig.useChannelId && !Channel->GroupSep() ? strdup(*Channel->GetChannelID().ToString()) : NULL;
- const char *logoname = EnigmaConfig.useChannelId && !Channel->GroupSep() ? strChannelID : Channel->Name();
- if (logoname) {
- char *filename = (char *)malloc(strlen(logoname) + 20 /* should be enough for folder */);
- if (filename == NULL) return false;
- strcpy(filename, "hqlogos/");
- strcat(filename, logoname);
+ logoname = EnigmaConfig.useChannelId && !Channel->GroupSep() ? strChannelID : Channel->Name();
+ if (logoname == NULL) goto leave;
+
+ strLogo = strreplace(strdup(logoname), '/', '~');
+ if (strLogo == NULL) goto leave;
+
+ filename = (char *)malloc(strlen(strLogo) + 20 /* should be enough for folder */);
+ if (filename == NULL) goto leave;
+
+ strcpy(filename, "hqlogos/");
+ strcat(filename, strLogo);
+ if (!(fFoundLogo = Load(filename, ChannelLogoWidth, ChannelLogoHeight, false))) {
+ strcpy(filename, "logos/");
+ strcat(filename, strLogo);
if (!(fFoundLogo = Load(filename, ChannelLogoWidth, ChannelLogoHeight, false))) {
- strcpy(filename, "logos/");
- strcat(filename, logoname);
- if (!(fFoundLogo = Load(filename, ChannelLogoWidth, ChannelLogoHeight, false))) {
- error("cPluginSkinEnigma::LoadChannelLogo: LOGO \"%s.xpm\" NOT FOUND in %s/[hq]logos", logoname, EnigmaConfig.GetLogoDir());
- fFoundLogo = Load("hqlogos/no_logo", ChannelLogoWidth, ChannelLogoHeight); //TODO? different default logo for channel/group?
- }
+ error("cPluginSkinEnigma::LoadChannelLogo: LOGO \"%s.xpm\" NOT FOUND in %s/[hq]logos", strLogo, EnigmaConfig.GetLogoDir());
+ fFoundLogo = Load("hqlogos/no_logo", ChannelLogoWidth, ChannelLogoHeight); //TODO? different default logo for channel/group?
}
- free(filename);
- free(strChannelID);
}
+
+leave:
+ free(filename);
+ free(strLogo);
+ free(strChannelID);
+
return fFoundLogo;
}