diff options
author | louis <louis.braun@gmx.de> | 2013-04-14 12:00:27 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-04-14 12:00:27 +0200 |
commit | 9f70bbf3cd68c12c913dbc84ed28f7d2f7430487 (patch) | |
tree | 4e39ab87c18f90ea5865cc3b78f89a424c91166f | |
parent | 47e4d8da9edc889886edf683390d36bb4a515490 (diff) | |
download | skin-nopacity-9f70bbf3cd68c12c913dbc84ed28f7d2f7430487.tar.gz skin-nopacity-9f70bbf3cd68c12c913dbc84ed28f7d2f7430487.tar.bz2 |
Added display of next Schedules in Channel Menu
-rw-r--r-- | HISTORY | 4 | ||||
-rw-r--r-- | config.c | 2 | ||||
-rw-r--r-- | config.h | 1 | ||||
-rw-r--r-- | displaymenu.c | 4 | ||||
-rw-r--r-- | displaymenuview.c | 5 | ||||
-rw-r--r-- | displaymenuview.h | 1 | ||||
-rw-r--r-- | menuitem.c | 49 | ||||
-rw-r--r-- | menuitem.h | 4 | ||||
-rw-r--r-- | po/de_DE.po | 8 | ||||
-rw-r--r-- | po/it_IT.po | 8 | ||||
-rw-r--r-- | po/sk_SK.po | 8 | ||||
-rw-r--r-- | setup.c | 2 | ||||
-rw-r--r-- | textwindow.c | 14 | ||||
-rw-r--r-- | textwindow.h | 4 |
14 files changed, 98 insertions, 16 deletions
@@ -200,3 +200,7 @@ Version 0.1.2 - added option "auto" for video scaling: with this option the video window is resized when the detailed EPG Window is displayed in Schedules and Recordings menu to be completely visible. +- Added Channel Number in narrow Timer menu +- Added display of next Schedules in Channel Menu in separate Info Window. + The Number of displayed Schedules can be configured in Plugin Channels + Menu Setup. @@ -77,6 +77,7 @@ cNopacityConfig::cNopacityConfig() { numAdditionalEPGPictures = 9; displayAdditionalRecEPGPictures = 1; numAdditionalRecEPGPictures = 9; + numEPGEntriesChannelsMenu = 15; menuFadeTime = 0; menuEPGWindowFadeTime = 300; menuWidthMain = 30; @@ -353,6 +354,7 @@ bool cNopacityConfig::SetupParse(const char *Name, const char *Value) { else if (strcmp(Name, "numAdditionalEPGPictures") == 0) numAdditionalEPGPictures = atoi(Value); else if (strcmp(Name, "displayAdditionalRecEPGPictures") == 0) displayAdditionalRecEPGPictures = atoi(Value); else if (strcmp(Name, "numAdditionalRecEPGPictures") == 0) numAdditionalRecEPGPictures = atoi(Value); + else if (strcmp(Name, "numEPGEntriesChannelsMenu") == 0) numEPGEntriesChannelsMenu = atoi(Value); else if (strcmp(Name, "menuWidthMain") == 0) menuWidthMain = atoi(Value); else if (strcmp(Name, "menuWidthSchedules") == 0) menuWidthSchedules = atoi(Value); else if (strcmp(Name, "menuWidthChannels") == 0) menuWidthChannels = atoi(Value); @@ -104,6 +104,7 @@ class cNopacityConfig { int numAdditionalEPGPictures;
int displayAdditionalRecEPGPictures;
int numAdditionalRecEPGPictures;
+ int numEPGEntriesChannelsMenu;
int menuFadeTime;
int menuEPGWindowFadeTime;
int menuFrameTime;
diff --git a/displaymenu.c b/displaymenu.c index 26382f0..e99da16 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -469,13 +469,15 @@ bool cNopacityDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bo if (!config.narrowChannelMenu) return false; if ((initMenu)&&(Index > menuItemIndexLast)) { - cNopacityMenuItem *item = new cNopacityChannelMenuItem(osd, Channel, Selectable); + cNopacityMenuItem *item = new cNopacityChannelMenuItem(osd, Channel, Selectable, &videoWindowRect); cPoint itemSize; menuView->GetMenuItemSize(MenuCategory(), &itemSize); item->SetFont(menuView->GetMenuItemFont(mcChannel)); item->SetFontSmall(menuView->GetMenuItemFontSmall(mcChannel)); + item->SetFontEPGWindow(menuView->GetEPGWindowFont()); int spaceTop = menuView->GetMenuTop(currentNumItems, itemSize.Y()); item->SetGeometry(Index, spaceTop, menuView->GetMenuItemLeft(itemSize.X()), itemSize.X(), itemSize.Y(), menuView->spaceMenu); + item->SetTextWindow(menuView->GetDescriptionTextWindowSize(mcChannel)); item->SetCurrent(Current); item->SetBackgrounds(handleBackgrounds); item->CreateText(); diff --git a/displaymenuview.c b/displaymenuview.c index c43ebaf..d5979ce 100644 --- a/displaymenuview.c +++ b/displaymenuview.c @@ -101,12 +101,15 @@ void cNopacityDisplayMenuView::SetGeometry(void) { void cNopacityDisplayMenuView::SetDescriptionTextWindowSize(void) { int xSchedules = (config.menuAdjustLeft) ? (2 * spaceMenu + contentWidthSchedules + widthScrollbar) : (spaceMenu); int xRecordings = (config.menuAdjustLeft) ? (2 * spaceMenu + contentWidthRecordings + widthScrollbar) : (spaceMenu); + int xChannels = (config.menuAdjustLeft) ? (2 * spaceMenu + contentWidthChannels + widthScrollbar) : (spaceMenu); int height = config.menuHeightInfoWindow * (contentHeight - 2*spaceMenu) / 100; int y = headerHeight + (contentHeight - height - spaceMenu); int widthSchedules = (config.menuAdjustLeft) ? (osdWidth - xSchedules - spaceMenu) : (osdWidth - contentWidthSchedules - widthScrollbar - 2 * spaceMenu); int widthRecordings = (config.menuAdjustLeft) ? (osdWidth - xRecordings - spaceMenu) : (osdWidth - contentWidthRecordings - widthScrollbar - 2 * spaceMenu); + int widthChannels = (config.menuAdjustLeft) ? (osdWidth - xChannels - spaceMenu) : (osdWidth - contentWidthChannels - widthScrollbar - 2 * spaceMenu); textWindowSizeSchedules = cRect(xSchedules,y,widthSchedules,height); textWindowSizeRecordings = cRect(xRecordings,y,widthRecordings,height); + textWindowSizeChannels = cRect(xChannels,y,widthChannels,height); } cRect *cNopacityDisplayMenuView::GetDescriptionTextWindowSize(eMenuCategory menuCat) { @@ -115,6 +118,8 @@ cRect *cNopacityDisplayMenuView::GetDescriptionTextWindowSize(eMenuCategory menu return &textWindowSizeSchedules; case mcRecording: return &textWindowSizeRecordings; + case mcChannel: + return &textWindowSizeChannels; default: return NULL; } diff --git a/displaymenuview.h b/displaymenuview.h index 9ba3bf3..51eb053 100644 --- a/displaymenuview.h +++ b/displaymenuview.h @@ -71,6 +71,7 @@ class cNopacityDisplayMenuView { int avrgFontWidth; cRect textWindowSizeSchedules; cRect textWindowSizeRecordings; + cRect textWindowSizeChannels; void SetDescriptionTextWindowSize(void); int GetContentWidth(eMenuCategory menuCat); public: @@ -563,8 +563,9 @@ void cNopacityScheduleMenuItem::DrawRemaining(int x, int y, int width) { // cNopacityChannelMenuItem ------------- -cNopacityChannelMenuItem::cNopacityChannelMenuItem(cOsd *osd, const cChannel *Channel, bool sel) : cNopacityMenuItem (osd, "", sel) { +cNopacityChannelMenuItem::cNopacityChannelMenuItem(cOsd *osd, const cChannel *Channel, bool sel, cRect *vidWin) : cNopacityMenuItem (osd, "", sel) { this->Channel = Channel; + this->vidWin = vidWin; } cNopacityChannelMenuItem::~cNopacityChannelMenuItem(void) { @@ -585,7 +586,7 @@ void cNopacityChannelMenuItem::CreateText() { strChannelSource = cString::sprintf("%s - %s", *cSource::ToString(source->Code()), source->Description()); else strChannelSource = ""; - strChannelInfo = cString::sprintf("%s %d, %d MHz", tr("Transp."), Channel->Transponder(), Channel->Frequency()); + strChannelInfo = cString::sprintf("%s %d, %d MHz", tr("Transp."), Channel->Transponder(), Channel->Frequency()/1000); } int cNopacityChannelMenuItem::CheckScrollable(bool hasIcon) { @@ -634,6 +635,39 @@ void cNopacityChannelMenuItem::DrawBackground(int handleBackground) { pixmap->DrawText(cPoint(sourceX, height/2 + (height/4 - fontSmall->Height())/2), *strChannelSource, Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall); } +std::string cNopacityChannelMenuItem::readEPG(void) { + std::stringstream sstrText; + cSchedulesLock schedulesLock; + const cSchedules *schedules = cSchedules::Schedules(schedulesLock); + const cSchedule *Schedule = NULL; + Schedule = schedules->GetSchedule(Channel); + if (!Schedule) { + sstrText << tr("No EPG Information found"); + } else { + const cEvent *PresentEvent = Schedule->GetPresentEvent(); + int i=0; + if (!PresentEvent) { + sstrText << tr("No EPG Information found"); + } else { + for (const cEvent *event = PresentEvent; event; event = Schedule->Events()->Next(event)) { + if (event) { + sstrText << *event->GetTimeString(); + sstrText << " "; + sstrText << event->Title(); + if (event->ShortText() && (strlen(event->ShortText()) > 1)) + sstrText << " ~ " << event->ShortText(); + i++; + if (i < config.numEPGEntriesChannelsMenu) + sstrText << "\n"; + else + break; + } + } + } + } + return sstrText.str(); +} + void cNopacityChannelMenuItem::Render() { int handleBgrd = (current)?handleBackgrounds[7]:handleBackgrounds[6]; @@ -658,6 +692,17 @@ void cNopacityChannelMenuItem::Render() { SetTextShort(); Cancel(-1); } + if (wasCurrent) + if (infoTextWindow) { + delete infoTextWindow; + infoTextWindow = NULL; + } + if (current && Channel) { + infoTextWindow = new cNopacityTextWindow(osd, fontEPGWindow, vidWin); + infoTextWindow->SetGeometry(textWindow); + infoTextWindow->SetText(readEPG().c_str()); + infoTextWindow->Start(); + } } else { //Channelseparators DrawDelimiter(Channel->Name(), "skinIcons/Channelseparator", handleBgrd); } @@ -112,11 +112,13 @@ private: std::string strEntryFull; cString strChannelSource; cString strChannelInfo; + cRect *vidWin; void SetTextFull(void); void SetTextShort(void); void DrawBackground(int handleBackground); + std::string readEPG(void); public: - cNopacityChannelMenuItem(cOsd *osd, const cChannel *Channel, bool sel); + cNopacityChannelMenuItem(cOsd *osd, const cChannel *Channel, bool sel, cRect *vidWin); ~cNopacityChannelMenuItem(void); void CreatePixmapTextScroller(int totalWidth); void CreateText(void); diff --git a/po/de_DE.po b/po/de_DE.po index b8b387c..9137c50 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: skinnopacity 0.0.1\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-04-13 10:26+0200\n" +"POT-Creation-Date: 2013-04-14 11:28+0200\n" "PO-Revision-Date: 2012-11-11 17:49+0200\n" "Last-Translator: louis\n" "Language-Team: \n" @@ -44,6 +44,9 @@ msgstr "Geschätzte Bitrate" msgid "Transp." msgstr "Transp." +msgid "No EPG Information found" +msgstr "Keine EPG Informationen verfügbar" + msgid "Duration" msgstr "Dauer" @@ -317,6 +320,9 @@ msgstr "Schriftgröße anpassen - Menüelement klein" msgid "Adjust Font Size - EPG Info Window" msgstr "Schriftgröße anpassen - EPG Infofenster" +msgid "Number of EPG Entries in Schedules Info Window" +msgstr "Anzahl der EPG Einträge im Programm Info Fenster" + msgid "Display additional EPG Pictures in detailed recording View" msgstr "Weitere EPG Bilder in der detaillierten Aufnahmeansicht anzeigen" diff --git a/po/it_IT.po b/po/it_IT.po index 190e958..cdf3366 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: skinnopacity 0.0.1\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-04-13 10:26+0200\n" +"POT-Creation-Date: 2013-04-14 11:28+0200\n" "PO-Revision-Date: 2013-03-19 22:56+0100\n" "Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" "Language-Team: \n" @@ -47,6 +47,9 @@ msgstr "Bitrate estimato" msgid "Transp." msgstr "Transponder" +msgid "No EPG Information found" +msgstr "" + msgid "Duration" msgstr "Durata" @@ -320,6 +323,9 @@ msgstr "Adatta dim. caratteri - Voce menu piccolo" msgid "Adjust Font Size - EPG Info Window" msgstr "Adatta dim. caratteri - Finestra info EPG" +msgid "Number of EPG Entries in Schedules Info Window" +msgstr "" + msgid "Display additional EPG Pictures in detailed recording View" msgstr "Mostra immagini EPG aggiuntivo nella vista dettagli registrazione" diff --git a/po/sk_SK.po b/po/sk_SK.po index c9152a0..22c39a4 100644 --- a/po/sk_SK.po +++ b/po/sk_SK.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-skinnopacity 0.0.6\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-04-13 10:26+0200\n" +"POT-Creation-Date: 2013-04-14 11:28+0200\n" "PO-Revision-Date: 2013-03-12 15:59+0100\n" "Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n" "Language-Team: \n" @@ -47,6 +47,9 @@ msgstr "Odhadovaná prenosová rýchlos»" msgid "Transp." msgstr "Transp." +msgid "No EPG Information found" +msgstr "" + msgid "Duration" msgstr "Då¾ka" @@ -320,6 +323,9 @@ msgstr "Nastavenie veµkos»i písma - Malé polo¾ky ponuky" msgid "Adjust Font Size - EPG Info Window" msgstr "Nastavenie veµkos»i písma - EPG informaèné okno" +msgid "Number of EPG Entries in Schedules Info Window" +msgstr "" + msgid "Display additional EPG Pictures in detailed recording View" msgstr "Zobrazi» ïal¹ie EPG obrázky v podrobnom zobrazení nahrávky" @@ -132,6 +132,7 @@ void cNopacitySetup::Store(void) { SetupStore("numAdditionalEPGPictures", config.numAdditionalEPGPictures); SetupStore("displayAdditionalRecEPGPictures", config.displayAdditionalRecEPGPictures); SetupStore("numAdditionalRecEPGPictures", config.numAdditionalRecEPGPictures); + SetupStore("numEPGEntriesChannelsMenu", config.numEPGEntriesChannelsMenu); SetupStore("menuFadeTime", config.menuFadeTime); SetupStore("menuScrollDelay", config.menuScrollDelay); SetupStore("menuScrollSpeed", config.menuScrollSpeed); @@ -388,6 +389,7 @@ void cNopacitySetupMenuDisplayChannels::Set(void) { Add(new cMenuEditBoolItem(tr("Use narrow menu"), &tmpNopacityConfig->narrowChannelMenu)); if (tmpNopacityConfig->narrowChannelMenu) Add(new cMenuEditIntItem(cString::sprintf("%s%s", *spacer, tr("Width (Percent of OSD Width)")), &tmpNopacityConfig->menuWidthChannels, 10, 97)); + Add(new cMenuEditIntItem(tr("Number of EPG Entries in Schedules Info Window"), &tmpNopacityConfig->numEPGEntriesChannelsMenu, 1, 100)); Add(new cMenuEditIntItem(tr("Adjust Font Size - Menu Item"), &tmpNopacityConfig->fontMenuitemChannel, -20, 20)); Add(new cMenuEditIntItem(tr("Adjust Font Size - Menu Item Small"), &tmpNopacityConfig->fontMenuitemChannelSmall, -20, 20)); diff --git a/textwindow.c b/textwindow.c index 71e020e..342f578 100644 --- a/textwindow.c +++ b/textwindow.c @@ -35,7 +35,7 @@ cNopacityTextWindow::~cNopacityTextWindow(void) { bool cNopacityTextWindow::CreatePixmap(int border) { int lineHeight = font->Height(); bool scrolling = false; - twText.Set(text, font, geometry->Width() - 2*border); + twText.Set(*text, font, geometry->Width() - 2*border); int pixmapTotalHeight = lineHeight * (twText.Lines()+1); int drawportHeight = geometry->Height(); if ((pixmapTotalHeight - (lineHeight/2)) > drawportHeight) { @@ -43,14 +43,14 @@ bool cNopacityTextWindow::CreatePixmap(int border) { scrolling = true; } cPixmap::Lock(); - pixmapBackground = osd->CreatePixmap(4, cRect(geometry->X(), geometry->Y(), geometry->Width(), geometry->Height())); + pixmapBackground = osd->CreatePixmap(4, cRect(geometry->X()-1, geometry->Y()-1, geometry->Width()+2, geometry->Height()+2)); pixmap = osd->CreatePixmap(5, cRect(geometry->X(), geometry->Y(), geometry->Width(), geometry->Height()), cRect(0, 0, geometry->Width(), drawportHeight)); pixmapBackground->SetAlpha(0); - pixmapBackground->Fill(clrBlack); + pixmapBackground->Fill(Theme.Color(clrMenuBorder)); + pixmapBackground->DrawRectangle(cRect(1, 1, geometry->Width(), geometry->Height()), clrBlack); pixmap->SetAlpha(0); - pixmap->Fill(Theme.Color(clrMenuBorder)); - pixmap->DrawRectangle(cRect(1, 1, geometry->Width()-2, drawportHeight-2), Theme.Color(clrMenuBack)); + pixmap->Fill(Theme.Color(clrMenuBack)); cPixmap::Unlock(); return scrolling; } @@ -60,7 +60,7 @@ void cNopacityTextWindow::DrawText(int border) { int currentLineHeight = lineHeight/2; cPixmap::Lock(); for (int i=0; (i < twText.Lines()) && Running(); i++) { - pixmap->DrawText(cPoint(border, currentLineHeight), twText.GetLine(i), Theme.Color(clrMenuFontButton), clrTransparent, font); + pixmap->DrawText(cPoint(border, currentLineHeight), twText.GetLine(i), Theme.Color(clrMenuFontDetailViewText), clrTransparent, font); currentLineHeight += lineHeight; } cPixmap::Unlock(); @@ -71,7 +71,7 @@ void cNopacityTextWindow::DoSleep(int duration) { for (int i = 0; Running() && (i*sleepSlice < duration); i++) cCondWait::SleepMs(sleepSlice); } - + void cNopacityTextWindow::Action(void) { DoSleep(config.menuInfoTextDelay*1000); diff --git a/textwindow.h b/textwindow.h index 5475da7..321a0fe 100644 --- a/textwindow.h +++ b/textwindow.h @@ -10,7 +10,7 @@ private: cRect *vidWin; cRect oldVidWin; bool scaledWindow; - const char *text; + cString text; cTextWrapper twText; bool CreatePixmap(int border); void DrawText(int border); @@ -20,7 +20,7 @@ public: cNopacityTextWindow(cOsd *osd, cFont *font, cRect *vidWin); virtual ~cNopacityTextWindow(void); void SetGeometry(cRect *geo) {geometry = geo;}; - void SetText(const char *Text) {text = Text;}; + void SetText(cString Text) {text = Text;}; }; #endif //__NOPACITY_TEXTWINDOW_H
\ No newline at end of file |