diff options
author | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2013-11-17 19:42:15 +0100 |
---|---|---|
committer | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2013-11-17 19:42:15 +0100 |
commit | 969add1f9c9c47ae6c17d1783e34417417281f40 (patch) | |
tree | dc0907667ac1bda0835910bc8589eb3182d00fac | |
parent | e96728cf26c71f8f76143057bb0594c101370303 (diff) | |
download | skin-flatplus-969add1f9c9c47ae6c17d1783e34417417281f40.tar.gz skin-flatplus-969add1f9c9c47ae6c17d1783e34417417281f40.tar.bz2 |
add option to show active recording in TopBar
-rw-r--r-- | HISTORY | 4 | ||||
-rw-r--r-- | baserender.c | 27 | ||||
-rw-r--r-- | baserender.h | 3 | ||||
-rw-r--r-- | config.c | 3 | ||||
-rw-r--r-- | config.h | 1 | ||||
-rw-r--r-- | displaychannel.c | 49 | ||||
-rw-r--r-- | displaychannel.h | 5 | ||||
-rw-r--r-- | flat.h | 4 | ||||
-rw-r--r-- | po/de_DE.po | 5 | ||||
-rw-r--r-- | setup.c | 2 |
10 files changed, 82 insertions, 21 deletions
@@ -15,6 +15,10 @@ VDR Plugin 'skinflatplus' Revision History - [add] option to display resolution & aspect - [add] default logo for channels without channel logo - [add] use icon from default theme if current theme does not have the icon +- [add] option to show additional info in epg menu. Lent code from skin elchi (thank you!) +- [add] option to show additional info in recording menu. Lent code from skin elchi (thank you!) +- [update] show recording in display channel for present and following +- [add] option to show active recording in TopBar 2013-23-09: Version 0.0.1 difference to skinflat diff --git a/baserender.c b/baserender.c index 72714aa1..ab98ef26 100644 --- a/baserender.c +++ b/baserender.c @@ -1,6 +1,9 @@ #include "baserender.h" #include "flat.h" +#include "symbols/1080/Crecording.xpm" +cBitmap cFlatBaseRender::bmCRecording(Crecording_xpm); + cFlatBaseRender::cFlatBaseRender(void) { font = cFont::CreateFont(Setup.FontOsd, Setup.FontOsdSize ); fontSml = cFont::CreateFont(Setup.FontSml, Setup.FontSmlSize); @@ -16,6 +19,7 @@ cFlatBaseRender::cFlatBaseRender(void) { topBarLastDate = ""; topBarUpdateTitle = false; topBarHeight = 0; + bmRecording = &bmCRecording; marginItem = 5; @@ -173,6 +177,29 @@ void cFlatBaseRender::TopBarUpdate(void) { topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth - fullWidth - marginItem*2, fontSmlTop + topBarFontSmlHeight), date, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, fullWidth, 0, taRight); DecorBorderDraw(Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight, Config.decorBorderTopBarSize, Config.decorBorderTopBarType, Config.decorBorderTopBarFg, Config.decorBorderTopBarBg); + + // look for timers + bool isRec = false, isRecPresent = false; + for(cTimer *ti = Timers.First(); ti; ti = Timers.Next(ti)) { + isRec = true; + if( ti->Matches(t) ) { + isRecPresent = true; + break; + } + } + + if( isRec && Config.TopBarRecordingShow ) { + int left = TopBarWidth - timeWidth - fullWidth - marginItem*3 - bmRecording->Width(); + int top = (topBarHeight - bmRecording->Height()) / 2; + if( isRecPresent ) { + topBarPixmap->DrawBitmap(cPoint(left, top), *bmRecording, + Theme.Color(clrTopBarRecordingPresent), Theme.Color(clrTopBarBg)); + } else { + topBarPixmap->DrawBitmap(cPoint(left, top), *bmRecording, + Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg)); + } + } + } } diff --git a/baserender.h b/baserender.h index 63ca3283..2fd89986 100644 --- a/baserender.h +++ b/baserender.h @@ -48,6 +48,9 @@ class cFlatBaseRender cString topBarLastDate; int topBarHeight; + cBitmap *bmRecording; + static cBitmap bmCRecording; + // Progressbar cPixmap *progressBarPixmap; cPixmap *progressBarPixmapBg; @@ -18,6 +18,8 @@ cFlatConfig::cFlatConfig(void) { RecordingAdditionalInfoShow = true; EpgAdditionalInfoShow = true; + TopBarRecordingShow = true; + MenuItemPadding = 5; marginOsdVer = 5; marginOsdHor = 5; @@ -150,6 +152,7 @@ bool cFlatConfig::SetupParse(const char *Name, const char *Value) { else if (strcmp(Name, "ResolutionAspectShow") == 0) ResolutionAspectShow = atoi(Value); else if (strcmp(Name, "RecordingAdditionalInfoShow") == 0) RecordingAdditionalInfoShow = atoi(Value); else if (strcmp(Name, "EpgAdditionalInfoShow") == 0) EpgAdditionalInfoShow = atoi(Value); + else if (strcmp(Name, "TopBarRecordingShow") == 0) TopBarRecordingShow = atoi(Value); else return false; return true; } @@ -158,4 +158,5 @@ class cFlatConfig int ResolutionAspectShow; int RecordingAdditionalInfoShow; int EpgAdditionalInfoShow; + int TopBarRecordingShow; }; diff --git a/displaychannel.c b/displaychannel.c index 559008cc..c103429a 100644 --- a/displaychannel.c +++ b/displaychannel.c @@ -1,5 +1,8 @@ #include "displaychannel.h" +#include "symbols/1080/Crecording.xpm" +cBitmap cFlatDisplayChannel::bmCRecording(Crecording_xpm); + cFlatDisplayChannel::cFlatDisplayChannel(bool WithInfo) { present = NULL; channelName = ""; @@ -11,6 +14,8 @@ cFlatDisplayChannel::cFlatDisplayChannel(bool WithInfo) { isGroup = false; isRecording = false, isRadioChannel = false; + + bmRecording = &bmCRecording; screenWidth = lastScreenWidth = -1; @@ -137,24 +142,6 @@ void cFlatDisplayChannel::ChannelIconsDraw(const cChannel *Channel, bool Resolut int left = channelWidth - width - marginItem; - // look for timers & records - time_t t = time(NULL); - for(cTimer *ti = Timers.First(); ti; ti = Timers.Next(ti)) { - if(ti->Matches(t) && (ti->Channel() == Channel)) { - if( ti->Recording() ) { - isRecording = true; - if( !Resolution ) { - if (imgLoader.LoadIcon("record", width)) { - int imageTop = top + (height - imgLoader.Height())/2; - chanIconsPixmap->DrawImage(cPoint(left, imageTop), imgLoader.GetImage()); - } - } - } - } - } - if( isRecording ) - left -= marginItem + width; - if( !Resolution && Channel ) { if (Channel->Ca()) { if (imgLoader.LoadIcon("crypted", width)) { @@ -222,6 +209,8 @@ void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Followi chanInfoBottomPixmap->Fill(Theme.Color(clrChannelBg)); chanIconsPixmap->Fill( clrTransparent ); + bool isRec = false; + /* chanLogoPixmap->Fill(clrTransparent); int imageHeight = heightImageLogo - marginItem*2; int imageLeft = marginItem; @@ -251,6 +240,11 @@ void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Followi int epgWidth = font->Width(Present->Title()); int epgShortWidth = fontSml->Width(Present->ShortText()); + + if( Present->HasTimer() ) { + isRec = true; + epgWidth -= marginItem + bmRecording->Width(); + } int s = (int)(time(NULL) - Present->StartTime()) / 60; int sleft = (Present->Duration() / 60) - s; @@ -263,6 +257,7 @@ void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Followi cTextWrapper epgInfoWrapper(Present->Title(), font, channelWidth - left - timeStringWidth - dotsWidth); epg = epgInfoWrapper.GetLine(0); epg = cString::sprintf("%s...", *epg); + epgWidth = font->Width(*epg); } else { epg = Present->Title(); } @@ -284,16 +279,27 @@ void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Followi chanInfoBottomPixmap->DrawText(cPoint(left, 0), *epg, Theme.Color(clrChannelFontEpg), Theme.Color(clrChannelBg), font); chanInfoBottomPixmap->DrawText(cPoint(left, fontHeight), *epgShort, Theme.Color(clrChannelFontEpg), Theme.Color(clrChannelBg), fontSml); + if( isRec ) { + chanInfoBottomPixmap->DrawBitmap(cPoint(left + epgWidth + marginItem + bmRecording->Width(), 0), *bmRecording, + Theme.Color(clrChannelRecordingPresent), Theme.Color(clrChannelBg)); + } } + if( Following ) { + isRec = false; cString startTime = Following->GetTimeString(); cString endTime = Following->GetEndTimeString(); cString timeString = cString::sprintf("%s - %s", *startTime, *endTime); int timeStringWidth = fontSml->Width(*timeString); - int epgWidth = fontSml->Width(Following->Title()); + int epgWidth = font->Width(Following->Title()); int epgShortWidth = fontSml->Width(Following->ShortText()); + + if( Following->HasTimer() ) { + epgWidth -= marginItem + bmRecording->Width(); + isRec = true; + } cString dur = cString::sprintf("%d min", Following->Duration() / 60); int durWidth = fontSml->Width(*dur); @@ -324,6 +330,11 @@ void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Followi Theme.Color(clrChannelFontEpgFollow), Theme.Color(clrChannelBg), font); chanInfoBottomPixmap->DrawText(cPoint(left, fontHeight*2 + fontSmlHeight), *epgShort, Theme.Color(clrChannelFontEpgFollow), Theme.Color(clrChannelBg), fontSml); + + if( isRec ) { + chanInfoBottomPixmap->DrawBitmap(cPoint(left + epgWidth + marginItem + bmRecording->Width(), fontHeight + fontSmlHeight), *bmRecording, + Theme.Color(clrChannelFontEpgFollow), Theme.Color(clrChannelBg)); + } } if( Config.ChannelIconsShow && CurChannel ) { ChannelIconsDraw(CurChannel, false); diff --git a/displaychannel.h b/displaychannel.h index 5071f96a..b77c349f 100644 --- a/displaychannel.h +++ b/displaychannel.h @@ -27,7 +27,10 @@ class cFlatDisplayChannel : public cFlatBaseRender, public cSkinDisplayChannel { void SignalQualityDraw(void); void ChannelIconsDraw(const cChannel *Channel, bool Resolution); - + + cBitmap *bmRecording; + static cBitmap bmCRecording; + public: cFlatDisplayChannel(bool WithInfo); virtual ~cFlatDisplayChannel(); @@ -31,6 +31,8 @@ THEME_CLR(Theme, clrTopBarBorderBg, 0xC0101010); THEME_CLR(Theme, clrTopBarBorderType, 0x00000000); THEME_CLR(Theme, clrTopBarBorderSize, 0x00000000); +THEME_CLR(Theme, clrTopBarRecordingPresent, 0xFFAA0000); + // Buttons THEME_CLR(Theme, clrButtonBg, 0xC0101010); THEME_CLR(Theme, clrButtonFont, 0xFFEEEEEE); @@ -81,6 +83,8 @@ THEME_CLR(Theme, clrChannelSignalProgressBg, 0xC0101010); THEME_CLR(Theme, clrChannelSignalProgressType, 0x00000002); THEME_CLR(Theme, clrChannelSignalProgressSize, 0x0000000A); +THEME_CLR(Theme, clrChannelRecordingPresent, 0xFFAA0000); + // Menu THEME_CLR(Theme, clrItemBg, 0xC0909090); THEME_CLR(Theme, clrItemFont, 0xFFEEEEEE); diff --git a/po/de_DE.po b/po/de_DE.po index 82c6c291..a425d6ed 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-skinflat 0.0.1\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-11-17 18:16+0100\n" +"POT-Creation-Date: 2013-11-17 19:36+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" @@ -144,6 +144,9 @@ msgstr "OSD horizontaler Rand" msgid "TopBar font size" msgstr "TopBar Font Größe" +msgid "TopBar show recording" +msgstr "TopBar zeige Aufnahme" + msgid "Message bottom offset" msgstr "Meldung unterer Abstand" @@ -137,6 +137,7 @@ void cFlatSetup::Store(void) { SetupStore("ResolutionAspectShow", Config.ResolutionAspectShow); SetupStore("RecordingAdditionalInfoShow", Config.RecordingAdditionalInfoShow); SetupStore("EpgAdditionalInfoShow", Config.EpgAdditionalInfoShow); + SetupStore("TopBarRecordingShow", Config.TopBarRecordingShow); Config.Init(); } @@ -168,6 +169,7 @@ void cFlatSetupGeneral::Setup(void) { Add(new cMenuEditIntItem(tr("OSD vertical margin"), &SetupConfig->marginOsdVer)); Add(new cMenuEditIntItem(tr("OSD horizontal margin"), &SetupConfig->marginOsdHor)); Add(new cMenuEditPrcItem(tr("TopBar font size"), &SetupConfig->TopBarFontSize, 0.01, 0.2, 1)); + Add(new cMenuEditBoolItem(tr("TopBar show recording"), &SetupConfig->TopBarRecordingShow)); Add(new cMenuEditIntItem(tr("Message bottom offset"), &SetupConfig->MessageOffset)); Add(new cMenuEditBoolItem(tr("TopBar border by theme?"), &SetupConfig->decorBorderTopBarByTheme)); |