diff options
-rw-r--r-- | HISTORY | 4 | ||||
-rw-r--r-- | config.c | 5 | ||||
-rw-r--r-- | config.h | 3 | ||||
-rw-r--r-- | displaymenu.c | 1 | ||||
-rw-r--r-- | displayreplay.c | 73 | ||||
-rw-r--r-- | displayreplay.h | 2 | ||||
-rw-r--r-- | po/de_DE.po | 8 | ||||
-rw-r--r-- | setup.c | 8 | ||||
-rwxr-xr-x | widgets/system_information/system_information.ubuntu | 61 |
9 files changed, 143 insertions, 22 deletions
@@ -14,7 +14,9 @@ VDR Plugin 'skinflatplus' Revision History - Widget temperatures - Widget custom command - Please see the example scripts and README-files -- [add] Weather Widget in channelinfo and replayinfo +- [add] Weather widget in channelinfo and replayinfo +- [add] option Weather widget font size +- [add] poster/banner image in replay info - [update] default themes - background transparency slightly reduced - use color palette of android material design @@ -122,6 +122,9 @@ cFlatConfig::cFlatConfig(void) { TVScraperChanInfoShowPoster = 1; TVScraperChanInfoPosterSize = 0.01; + TVScraperReplayInfoShowPoster = 1; + TVScraperReplayInfoPosterSize = 0.01; + TVScraperEPGInfoShowPoster = 1; TVScraperRecInfoShowPoster = 1; @@ -343,6 +346,8 @@ bool cFlatConfig::SetupParse(const char *Name, const char *Value) { else if (strcmp(Name, "ChannelWeatherShow") == 0) ChannelWeatherShow = atoi(Value); else if (strcmp(Name, "PlaybackWeatherShow") == 0) PlaybackWeatherShow = atoi(Value); else if (strcmp(Name, "WeatherFontSize") == 0) WeatherFontSize = atod(Value); + else if (strcmp(Name, "TVScraperReplayInfoShowPoster") == 0) TVScraperReplayInfoShowPoster = atoi(Value); + else if (strcmp(Name, "TVScraperReplayInfoPosterSize") == 0) TVScraperReplayInfoPosterSize = atod(Value); else return false; @@ -294,6 +294,9 @@ class cFlatConfig int TVScraperChanInfoShowPoster; double TVScraperChanInfoPosterSize; + int TVScraperReplayInfoShowPoster; + double TVScraperReplayInfoPosterSize; + int TVScraperEPGInfoShowPoster; int TVScraperRecInfoShowPoster; diff --git a/displaymenu.c b/displaymenu.c index 2935d2e0..88994831 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -213,6 +213,7 @@ void cFlatDisplayMenu::Clear(void) { contentHeadIconsPixmap->Fill(clrTransparent); DecorBorderClearByFrom(BorderMenuItem); DecorBorderClearByFrom(BorderContent); + DecorBorderClearByFrom(BorderMMWidget); DecorBorderClearAll(); isScrolling = false; diff --git a/displayreplay.c b/displayreplay.c index c1dd97a9..8dc3af7f 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -13,6 +13,14 @@ cFlatDisplayReplay::cFlatDisplayReplay(bool ModeOnly) { screenWidth = lastScreenWidth = -1; + int TVSLeft = 20 + Config.decorBorderChannelEPGSize; + int TVSTop = topBarHeight + Config.decorBorderTopBarSize*2 + 20 + Config.decorBorderChannelEPGSize; + int TVSWidth = osdWidth - 40 - Config.decorBorderChannelEPGSize*2; + int TVSHeight = osdHeight - topBarHeight - labelHeight - 40 - Config.decorBorderChannelEPGSize*2; + + chanEpgImagesPixmap = osd->CreatePixmap(2, cRect(TVSLeft, TVSTop, TVSWidth, TVSHeight)); + chanEpgImagesPixmap->Fill( clrTransparent ); + labelPixmap = osd->CreatePixmap(1, cRect(Config.decorBorderReplaySize, osdHeight - labelHeight - Config.decorBorderReplaySize, osdWidth - Config.decorBorderReplaySize*2, labelHeight)); iconsPixmap = osd->CreatePixmap(2, cRect(Config.decorBorderReplaySize, osdHeight - labelHeight - Config.decorBorderReplaySize, @@ -40,9 +48,14 @@ cFlatDisplayReplay::~cFlatDisplayReplay() { if( fontSecs != NULL ) delete fontSecs; - osd->DestroyPixmap(labelPixmap); - osd->DestroyPixmap(labelJump); - osd->DestroyPixmap(iconsPixmap); + if( labelPixmap ) + osd->DestroyPixmap(labelPixmap); + if( labelJump ) + osd->DestroyPixmap(labelJump); + if( iconsPixmap ) + osd->DestroyPixmap(iconsPixmap); + if( chanEpgImagesPixmap ) + osd->DestroyPixmap(chanEpgImagesPixmap); } void cFlatDisplayReplay::SetRecording(const cRecording *Recording) { @@ -240,6 +253,60 @@ void cFlatDisplayReplay::UpdateInfo(void) { } } delete index; + + std::string mediaPath; + int mediaWidth = 0; + int mediaHeight = 0; + // TVScraper + // first try scraper2vdr + static cPlugin *pScraper = cPluginManager::GetPlugin("scraper2vdr"); + if( !pScraper ) // if it doesn't exit, try tvscraper + pScraper = cPluginManager::GetPlugin("tvscraper"); + if( Config.TVScraperReplayInfoShowPoster && pScraper ) { + ScraperGetEventType call; + call.recording = recording; + int seriesId = 0; + int episodeId = 0; + int movieId = 0; + + if (pScraper->Service("GetEventType", &call)) { + seriesId = call.seriesId; + episodeId = call.episodeId; + movieId = call.movieId; + } + if( seriesId > 0 ) { + cSeries series; + series.seriesId = seriesId; + series.episodeId = episodeId; + if (pScraper->Service("GetSeries", &series)) { + if( series.banners.size() > 0 ) + mediaPath = series.banners[0].path; + mediaWidth = series.banners[0].width * Config.TVScraperReplayInfoPosterSize*100; + mediaHeight = series.banners[0].height * Config.TVScraperReplayInfoPosterSize*100; + } + } else if (movieId > 0) { + cMovie movie; + movie.movieId = movieId; + if (pScraper->Service("GetMovie", &movie)) { + mediaPath = movie.poster.path; + mediaWidth = movie.poster.width * 0.5 * Config.TVScraperReplayInfoPosterSize*100; + mediaHeight = movie.poster.height * 0.5 * Config.TVScraperReplayInfoPosterSize*100; + } + } + } + + chanEpgImagesPixmap->Fill(clrTransparent); + DecorBorderClearByFrom(BorderTVSPoster); + if( mediaPath.length() > 0 ) { + cImage *img = imgLoader.LoadFile(mediaPath.c_str(), mediaWidth, mediaHeight); + if( img ) { + chanEpgImagesPixmap->DrawImage(cPoint(0, 0), *img); + + DecorBorderDraw(20 + Config.decorBorderChannelEPGSize, topBarHeight + Config.decorBorderTopBarSize*2 + 20 + Config.decorBorderChannelEPGSize, img->Width(), img->Height(), + Config.decorBorderChannelEPGSize, Config.decorBorderChannelEPGType, Config.decorBorderChannelEPGFg, Config.decorBorderChannelEPGBg, BorderTVSPoster); + } + } + } if( iscutted ) { diff --git a/displayreplay.h b/displayreplay.h index e9901809..5e7999ce 100644 --- a/displayreplay.h +++ b/displayreplay.h @@ -1,6 +1,7 @@ #pragma once #include "baserender.h" +#include "services/scraper2vdr.h" class cFlatDisplayReplay : public cFlatBaseRender, public cSkinDisplayReplay { private: @@ -10,6 +11,7 @@ class cFlatDisplayReplay : public cFlatBaseRender, public cSkinDisplayReplay { cPixmap *labelPixmap; cPixmap *labelJump; cPixmap *iconsPixmap; + cPixmap *chanEpgImagesPixmap; cFont *fontSecs; const cRecording *recording; diff --git a/po/de_DE.po b/po/de_DE.po index dec8557d..88533c35 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-skinflat 0.4.3\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2014-11-17 19:12+0100\n" +"POT-Creation-Date: 2014-11-17 20:05+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -744,6 +744,12 @@ msgstr "Kanalinfo zeige Poster?" msgid "Channelinfo poster size" msgstr "Kanalinfo Poster Größe" +msgid "Replayinfo show poster?" +msgstr "" + +msgid "Replayinfo poster size" +msgstr "" + msgid "EPG info show poster?" msgstr "EPG-Info zeige Poster?" @@ -311,6 +311,8 @@ void cFlatSetup::Store(void) { SetupStore("ChannelWeatherShow", Config.ChannelWeatherShow); SetupStore("PlaybackWeatherShow", Config.PlaybackWeatherShow); SetupStore("WeatherFontSize", dtoa(Config.WeatherFontSize)); + SetupStore("TVScraperReplayInfoShowPoster", Config.TVScraperReplayInfoShowPoster); + SetupStore("TVScraperReplayInfoPosterSize", dtoa(Config.TVScraperReplayInfoPosterSize)); Config.Init(); } @@ -487,6 +489,8 @@ bool cFlatSetupGeneral::SetupParse(const char *Name, const char *Value) { else if (strcmp(Name, "ChannelWeatherShow") == 0) SetupConfig->ChannelWeatherShow = atoi(Value); else if (strcmp(Name, "PlaybackWeatherShow") == 0) SetupConfig->PlaybackWeatherShow = atoi(Value); else if (strcmp(Name, "WeatherFontSize") == 0) SetupConfig->WeatherFontSize = atod(Value); + else if (strcmp(Name, "TVScraperReplayInfoShowPoster") == 0) SetupConfig->TVScraperReplayInfoShowPoster = atoi(Value); + else if (strcmp(Name, "TVScraperReplayInfoPosterSize") == 0) SetupConfig->TVScraperReplayInfoPosterSize = atod(Value); else return false; return true; @@ -645,6 +649,8 @@ void cFlatSetupGeneral::SaveCurrentSettings(void) { Config.Store("ChannelWeatherShow", SetupConfig->ChannelWeatherShow, *Filename); Config.Store("PlaybackWeatherShow", SetupConfig->PlaybackWeatherShow, *Filename); Config.Store("WeatherFontSize", dtoa(Config.WeatherFontSize), *Filename); + Config.Store("TVScraperReplayInfoShowPoster", SetupConfig->TVScraperReplayInfoShowPoster, *Filename); + Config.Store("TVScraperReplayInfoPosterSize", dtoa(Config.TVScraperReplayInfoPosterSize), *Filename); cString msg = cString::sprintf("%s %s", tr("saved settings in file:"), *File); Skins.Message(mtInfo, msg); @@ -1195,6 +1201,8 @@ void cFlatSetupTvsraper::Setup(void) { Add(new cMenuEditBoolItem(tr("Channelinfo show poster?"), &SetupConfig->TVScraperChanInfoShowPoster)); Add(new cMenuEditPrcItem(tr("Channelinfo poster size"), &SetupConfig->TVScraperChanInfoPosterSize, 0.004, 0.015, 2)); + Add(new cMenuEditBoolItem(tr("Replayinfo show poster?"), &SetupConfig->TVScraperReplayInfoShowPoster)); + Add(new cMenuEditPrcItem(tr("Replayinfo poster size"), &SetupConfig->TVScraperReplayInfoPosterSize, 0.004, 0.015, 2)); Add(new cMenuEditBoolItem(tr("EPG info show poster?"), &SetupConfig->TVScraperEPGInfoShowPoster)); Add(new cMenuEditBoolItem(tr("recording info show poster?"), &SetupConfig->TVScraperRecInfoShowPoster)); Add(new cMenuEditBoolItem(tr("EPG info show actors?"), &SetupConfig->TVScraperEPGInfoShowActors)); diff --git a/widgets/system_information/system_information.ubuntu b/widgets/system_information/system_information.ubuntu index 4222b602..5d4c98a2 100755 --- a/widgets/system_information/system_information.ubuntu +++ b/widgets/system_information/system_information.ubuntu @@ -65,26 +65,51 @@ if [ $SHOW_KERNEL_VERSION = 1 ]; then fi if [ $SHOW_UPTIME = 1 ]; then - uptime | grep -ohe 'up .*' | sed 's/,//g' | awk '{ printf $2" "$3 }' > ./${UPTIME_POS}_uptime + UPTIME=($(cat /proc/uptime)) # UpTime in Array + UPTIME[0]=${UPTIME[0]%.*} # .* entfernen (UpTime in Sekunden) + TAGE=$((UPTIME[0] / 86400)) ; STD=$((UPTIME[0] % 86400 / 3600)) + MIN=$((UPTIME[0] % 3600 / 60)) ; SEK=$((UPTIME[0] % 60)) + if [ $TAGE -ge 1 ] ; then + echo "${TAGE}T ${STD}S ${MIN}M" > ./${UPTIME_POS}_uptime + else + [ $STD -ge 1 ] && echo -n "${STD} Std. " > ./${UPTIME_POS}_uptime + echo "${MIN} Min." >> ./${UPTIME_POS}_uptime + fi fi if [ $SHOW_LOAD = 1 ]; then - cat /proc/loadavg | awk '{print $1}' > ./${LOAD_POS}_load + LOADAVG=($(cat /proc/loadavg)) # Zeile in Array + echo "${LOADAVG[0]//./,}" > ./${LOAD_POS}_load fi if [ $SHOW_PROCESSES = 1 ]; then - ps aux | wc -l > ./${PROCESSES_POS}_processes + PROCS=($(ls -d /proc/[0-9]*/)) + echo "${#PROCS[@]}" > ./${PROCESSES_POS}_processes fi if [ $SHOW_MEM_USAGE = 1 ]; then - free -m | awk '/Mem:/ { total=$2 } /buffers\/cache/ { used=$3 } END { printf("%3.1f%%", used/total*100)}' > ./${MEM_USAGE_POS}_mem_usage + mapfile -t < <(free -m) # Ausgabe von free in Array (Vier Zeilen) + MEM=(${MAPFILE[1]}) # 2. Zeile + BUF=(${MAPFILE[2]}) # 3. Zeile + MEM_USAGE=$((${BUF[2]} * 1000 / ${MEM[1]})) + [ $MEM_USAGE -lt 10 ] && MEM_USAGE="0${MEM_USAGE}" + MEM_DEC=${MEM_USAGE: -1} + echo "${MEM_USAGE:0: -1},${MEM_DEC}%" > ./${MEM_USAGE_POS}_mem_usage fi if [ $SHOW_SWAP_USAGE = 1 ]; then - SWAP=`free -m | awk '/Swap/ {print($2)}'` - if [ $SWAP -gt 0 ]; then - free -m | awk '/Swap/ { printf("%3.1f%%", $3/$2*100) }' > ./${SWAP_USAGE_POS}_swap_usage + mapfile -t < <(free -m) # Ausgabe von free in Array (Vier Zeilen) + SWAP=(${MAPFILE[3]}) # 4. Zeile + if [ ${SWAP[1]} -gt 0 ]; then # Swap Total + if [ ${SWAP[2]} -gt 0 ]; then # Swap Used + SWP=$((${SWAP[2]} * 1000 / ${SWAP[1]})) + [ $SWP -lt 10 ] && SWP="0${SWP}" + SWP_DEC=${SWP: -1} ; SWP=${SWP:0: -1},${SWP_DEC} + echo "${SWP}%" > ./${SWAP_USAGE_POS}_swap_usage + else + echo "0,0%" > ./${SWAP_USAGE_POS}_swap_usage fi + fi fi if [ $SHOW_ROOT_USAGE = 1 ]; then @@ -96,19 +121,21 @@ if [ $SHOW_VIDEO_USAGE = 1 ] && [ -d ${VIDEO_MOUNT} ]; then fi if [ $SHOW_VDR_CPU_USAGE = 1 ]; then - vdr_pid=`pidof vdr` - if [ $? = 0 ]; then - VALUE=`ps -p ${vdr_pid} -o %cpu | awk 'NR==2{print $0}' | tr -d ' '` - echo "${VALUE}%" > ./${VDR_CPU_USAGE_POS}_vdr_cpu_usage - fi + vdr_pid=$(pidof vdr) + if [ $? = 0 ]; then + mapfile -t < <(ps -p ${vdr_pid} -o %cpu) # Ausgabe von ps in Array (Zwei Zeilen) + CPU_USAGE=${MAPFILE[1]/./,} # 24.2 -> 24,2 + echo "${CPU_USAGE}%" > ./${VDR_CPU_USAGE_POS}_vdr_cpu_usage + fi fi if [ $SHOW_VDR_MEM_USAGE = 1 ]; then - vdr_pid=`pidof vdr` - if [ $? = 0 ]; then - VALUE=`ps -p ${vdr_pid} -o %mem | awk 'NR==2{print $0}' | tr -d ' '` - echo "${VALUE}%" > ./${VDR_MEM_USAGE_POS}_vdr_mem_usage - fi + vdr_pid=$(pidof vdr) + if [ $? = 0 ]; then + mapfile -t < <(ps -p ${vdr_pid} -o %mem) # Ausgabe von ps in Array (Zwei Zeilen) + VDR_MEM_USAGE=${MAPFILE[1]/./,} # 24.2 -> 24,2 + echo "${VDR_MEM_USAGE}%" > ./${VDR_MEM_USAGE_POS}_vdr_mem_usage + fi fi if [ $SHOW_TEMPERATURES = 1 ]; then |