diff options
author | louis <louis.braun@gmx.de> | 2013-09-13 16:38:04 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-09-13 16:38:04 +0200 |
commit | 24262eefa031a9d5ef243205719e8edc45d66ea4 (patch) | |
tree | 3164828d7afbfece68422afbfbe9205cc9051a83 | |
parent | dcfc3b7083fed403555e0d33907f86699026cd45 (diff) | |
download | skin-nopacity-24262eefa031a9d5ef243205719e8edc45d66ea4.tar.gz skin-nopacity-24262eefa031a9d5ef243205719e8edc45d66ea4.tar.bz2 |
changed channel logo handling and added logo converter script with some backgrounds
-rw-r--r-- | HISTORY | 8 | ||||
-rw-r--r-- | README | 10 | ||||
-rw-r--r-- | displaychannel.c | 2 | ||||
-rw-r--r-- | imageloader.c | 12 | ||||
-rw-r--r-- | logoconverter/backgrounds/bg1.png | bin | 0 -> 16135 bytes | |||
-rw-r--r-- | logoconverter/backgrounds/bg2.png | bin | 0 -> 16239 bytes | |||
-rw-r--r-- | logoconverter/backgrounds/bg3.png | bin | 0 -> 17074 bytes | |||
-rw-r--r-- | logoconverter/backgrounds/bg4.png | bin | 0 -> 14402 bytes | |||
-rw-r--r-- | logoconverter/backgrounds/fg1.png | bin | 0 -> 27916 bytes | |||
-rw-r--r-- | logoconverter/backgrounds/fg2.png | bin | 0 -> 25492 bytes | |||
-rw-r--r-- | logoconverter/backgrounds/fg3.png | bin | 0 -> 25123 bytes | |||
-rw-r--r-- | logoconverter/backgrounds/fg4.png | bin | 0 -> 17836 bytes | |||
-rw-r--r-- | logoconverter/make_background.sh | 33 | ||||
-rw-r--r-- | menudetailview.c | 2 | ||||
-rw-r--r-- | menuitem.c | 8 | ||||
-rw-r--r-- | timers.c | 2 |
16 files changed, 74 insertions, 3 deletions
@@ -249,3 +249,11 @@ Version 0.1.4 Feature 1403) - Display stereo symbol in displayChannel if at least one mpeg track is available (and not two, closes Feature 1404) +- Added script and background images to create fancy channel logos with + theme dependend background +- searching channel logos first in <logopath>/theme, then in + <defaltlogopath>/theme, then in <logopath> and finally in <defaultlogopath> + to allow theme dependend channel logos +- if no channel logo is found for channel name, the ChannelID is used to allow + logos for (feed) channels with changing names. Analog to the channel name + the ChannelID is also converted to lower case letters. @@ -107,10 +107,20 @@ immediately after placing the channel logos in the correct place. So if you have the name of a channel logo (may be by inserting a space or a hyphen) so that it fits to the channel name, only use lower case letters, and not the name of the channel with upper and lower letters as displayed inside VDR. +If no logo is found for the channel name, additionally a search for a logo named as the +ChannelID is performed. Analog to the channel name the ChannelID is also convertted to lower +case letters. This allows channel logos for channels with changing names (for instance +Sky Feed Channels). Additional hint: some channels have slashes in their name (in germany nick/comedy for instance). In this example, as a dirty hack just create a folder in your channel logo directory named "nick" and place an image named "comedy.png" inside this folder. +In the folder "logoconverter" a script and some backgrounds are provided to create logos +with fancy backgrounds from the transparent logos. Before running the script, just adapt the +config variables in the header of the script according to your needs. If you place the newly +created logos in a subfolder of your logo directory named exactly as the used Theme name, +nOpacity uses these logos only for the appropriate theme automatically. + RSS Feeds --------- diff --git a/displaychannel.c b/displaychannel.c index 082b43c..e8389fa 100644 --- a/displaychannel.c +++ b/displaychannel.c @@ -567,6 +567,8 @@ void cNopacityDisplayChannel::SetChannel(const cChannel *Channel, int Number) { cImageLoader imgLoader; if (imgLoader.LoadLogo(*ChannelName)) { pixmapLogo->DrawImage(cPoint(config.logoBorder, (height-config.logoHeight)/2), imgLoader.GetImage()); + } else if (imgLoader.LoadLogo(*(Channel->GetChannelID().ToString()))) { + pixmapLogo->DrawImage(cPoint(config.logoBorder, (height-config.logoHeight)/2), imgLoader.GetImage()); } } ShowSignalMeter(); diff --git a/imageloader.c b/imageloader.c index ba90353..cc1f329 100644 --- a/imageloader.c +++ b/imageloader.c @@ -20,10 +20,18 @@ bool cImageLoader::LoadLogo(const char *logo, int width = config.logoWidth, int toLowerCase(logoLower); bool success = false; if (config.logoPathSet) { - success = LoadImage(logoLower.c_str(), config.logoPath, config.logoExtension); + //theme dependend logo + cString logoPath = cString::sprintf("%s%s/", *config.logoPath, Setup.OSDTheme); + success = LoadImage(logoLower.c_str(), logoPath, config.logoExtension); + if (!success) + success = LoadImage(logoLower.c_str(), config.logoPath, config.logoExtension); } if (!success) { - success = LoadImage(logoLower.c_str(), config.logoPathDefault, config.logoExtension); + //theme dependend logo + cString logoPath = cString::sprintf("%s%s/", *config.logoPathDefault, Setup.OSDTheme); + success = LoadImage(logoLower.c_str(), logoPath, config.logoExtension); + if (!success) + success = LoadImage(logoLower.c_str(), config.logoPathDefault, config.logoExtension); } if (!success) return false; diff --git a/logoconverter/backgrounds/bg1.png b/logoconverter/backgrounds/bg1.png Binary files differnew file mode 100644 index 0000000..3260391 --- /dev/null +++ b/logoconverter/backgrounds/bg1.png diff --git a/logoconverter/backgrounds/bg2.png b/logoconverter/backgrounds/bg2.png Binary files differnew file mode 100644 index 0000000..9cf789d --- /dev/null +++ b/logoconverter/backgrounds/bg2.png diff --git a/logoconverter/backgrounds/bg3.png b/logoconverter/backgrounds/bg3.png Binary files differnew file mode 100644 index 0000000..87d1f1c --- /dev/null +++ b/logoconverter/backgrounds/bg3.png diff --git a/logoconverter/backgrounds/bg4.png b/logoconverter/backgrounds/bg4.png Binary files differnew file mode 100644 index 0000000..fd1e222 --- /dev/null +++ b/logoconverter/backgrounds/bg4.png diff --git a/logoconverter/backgrounds/fg1.png b/logoconverter/backgrounds/fg1.png Binary files differnew file mode 100644 index 0000000..b87e1d1 --- /dev/null +++ b/logoconverter/backgrounds/fg1.png diff --git a/logoconverter/backgrounds/fg2.png b/logoconverter/backgrounds/fg2.png Binary files differnew file mode 100644 index 0000000..f970b0b --- /dev/null +++ b/logoconverter/backgrounds/fg2.png diff --git a/logoconverter/backgrounds/fg3.png b/logoconverter/backgrounds/fg3.png Binary files differnew file mode 100644 index 0000000..96932ca --- /dev/null +++ b/logoconverter/backgrounds/fg3.png diff --git a/logoconverter/backgrounds/fg4.png b/logoconverter/backgrounds/fg4.png Binary files differnew file mode 100644 index 0000000..1b58ebf --- /dev/null +++ b/logoconverter/backgrounds/fg4.png diff --git a/logoconverter/make_background.sh b/logoconverter/make_background.sh new file mode 100644 index 0000000..a2acbcb --- /dev/null +++ b/logoconverter/make_background.sh @@ -0,0 +1,33 @@ +#!/bin/bash -e +#set -x + +#CONFIG + +SOURCEDIR=/etc/vdr/plugins/skinnopacity/logos +OUTPUTDIR=/etc/vdr/plugins/skinnopacity/logos_darkred +FOREGROUND=/usr/local/src/VDR/PLUGINS/src/skinnopacity/logoconverter/backgrounds/fg4.png +BACKGROUND=/usr/local/src/VDR/PLUGINS/src/skinnopacity/logoconverter/backgrounds/bg2.png + +#MAIN +IFS=$'\n' +FILES=$(find $SOURCEDIR -name *.png | sort) +sedstring="s!$SOURCEDIR!$OUTPUTDIR!g" + +[ ! -d $SOURCEDIR ] && (echo "ERR: $SOURCEDIR1 not found"; exit 1); +[ ! -f $FOREGROUND ] && (echo "ERR: $FOREGROUND not found"; exit 1); +[ ! -f $BACKGROUND ] && (echo "ERR: $BACKGROUND not found"; exit 1); + +echo "Convert new logos to format $(basename $OUTPUTDIR)" +for file in $FILES; do + targetdir=`dirname $file | sed -e $sedstring` + targetfile="$targetdir/$(basename $file)" + if [ ! -f $targetfile ] ; then + echo $targetfile + [ ! -d $targetdir ] && mkdir -p $targetdir + convert +dither -background 'transparent' -resize '220x164' -extent '268x200' -gravity 'center' "$file" png:- 2> /dev/null | \ + composite - $BACKGROUND png:- 2> /dev/null | \ + composite -compose screen -blend 50x100 $FOREGROUND - "$targetfile" 2> /dev/null + fi +done + +exit 0 diff --git a/menudetailview.c b/menudetailview.c index 66a1428..160e6c3 100644 --- a/menudetailview.c +++ b/menudetailview.c @@ -445,6 +445,8 @@ void cNopacityMenuDetailEventView::DrawHeader(void) { cChannel *channel = Channels.GetByChannelID(event->ChannelID(), true); if (channel && channel->Name() && imgLoader.LoadLogo(channel->Name(), logoWidth, config.detailViewLogoHeight)) { pixmapLogo->DrawImage(cPoint(0, max((headerHeight - config.detailViewLogoHeight - border)/2, 0)), imgLoader.GetImage()); + } else if (channel && imgLoader.LoadLogo(*(channel->GetChannelID().ToString()), logoWidth, config.detailViewLogoHeight)) { + pixmapLogo->DrawImage(cPoint(0, max((headerHeight - config.detailViewLogoHeight - border)/2, 0)), imgLoader.GetImage()); } int widthTextHeader = width - 4 * border - logoWidth; if (imgLoader.LoadEPGImage(event->EventID())) { @@ -524,6 +524,8 @@ void cNopacityScheduleMenuItem::DrawLogo(int logoWidth, int logoHeight) { cImageLoader imgLoader; if (imgLoader.LoadLogo(Channel->Name(), logoWidth, logoHeight)) { pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage()); + } else if (imgLoader.LoadLogo(*(Channel->GetChannelID().ToString()), logoWidth, logoHeight)) { + pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage()); } else { cTextWrapper channel; channel.Set(Channel->Name(), font, logoWidth); @@ -764,7 +766,9 @@ void cNopacityChannelMenuItem::Render() { cImageLoader imgLoader; if (imgLoader.LoadLogo(Channel->Name(), logoWidth, logoHeight)) { pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage()); - } + } else if (imgLoader.LoadLogo(*(Channel->GetChannelID().ToString()), logoWidth, logoHeight)) { + pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage()); + } drawn = true; } SetTextShort(); @@ -934,6 +938,8 @@ void cNopacityTimerMenuItem::DrawLogo(int logoWidth, int logoHeight) { cImageLoader imgLoader; if (imgLoader.LoadLogo(Timer->Channel()->Name(), logoWidth, logoHeight)) { pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage()); + } else if (imgLoader.LoadLogo(*(Timer->Channel()->GetChannelID().ToString()), logoWidth, logoHeight)) { + pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage()); } else { cTextWrapper channel; channel.Set(Timer->Channel()->Name(), font, logoWidth); @@ -172,6 +172,8 @@ void cNopacityTimer::DrawLogo(void) { cImageLoader imgLoader;
if (imgLoader.LoadLogo(Channel->Name(), logoWidth, logoHeight)) {
pixmapLogo->DrawImage(cPoint((width - logoWidth)/2, 1), imgLoader.GetImage());
+ } else if (imgLoader.LoadLogo(*(Channel->GetChannelID().ToString()), logoWidth, logoHeight)) {
+ pixmapLogo->DrawImage(cPoint((width - logoWidth)/2, 1), imgLoader.GetImage());
} else {
cTextWrapper channel;
channel.Set(Channel->Name(), fontLarge, width - 10);
|