diff options
-rw-r--r-- | HISTORY | 4 | ||||
-rw-r--r-- | config.c | 8 | ||||
-rw-r--r-- | config.h | 4 | ||||
-rw-r--r-- | displaymenu.c | 47 | ||||
-rw-r--r-- | displaymenu.h | 2 | ||||
-rw-r--r-- | displaymenuview.c | 28 | ||||
-rw-r--r-- | displaymenuview.h | 5 | ||||
-rw-r--r-- | icons/newrecording.png | bin | 0 -> 3071 bytes | |||
-rw-r--r-- | icons/radio.png | bin | 0 -> 6506 bytes | |||
-rw-r--r-- | icons/recordingcutted.png | bin | 0 -> 4976 bytes | |||
-rw-r--r-- | icons/recordingdatetime.png | bin | 0 -> 9137 bytes | |||
-rw-r--r-- | icons/recordingfolder.png | bin | 0 -> 23322 bytes | |||
-rw-r--r-- | imageloader.c | 2 | ||||
-rw-r--r-- | menuitem.c | 264 | ||||
-rw-r--r-- | menuitem.h | 29 | ||||
-rw-r--r-- | po/de_DE.po | 32 | ||||
-rw-r--r-- | setup.c | 8 |
17 files changed, 421 insertions, 12 deletions
@@ -87,3 +87,7 @@ VDR Plugin 'nOpacity' Revision History - Split of skins VDR menu configuration section in "Common", "Geometry" and "Fonts" sections for clearer arrangement - different minor changes and fixes + +Version 0.0.6 + +- Introduced new narrow displayed Recordings menu @@ -23,6 +23,7 @@ cNopacityConfig::cNopacityConfig() { fontEPGSize = 0; fontEPGSmallSize = 0; resolutionIconSize = 100; + statusIconSize = 64; //Display Replay replayHeight = 25; replayBorderVertical = 15; @@ -81,11 +82,14 @@ cNopacityConfig::cNopacityConfig() { detailViewLogoHeight = 200; epgImageWidth = 210; epgImageHeight = 160; + menuRecFolderSize = 128; fontHeader = 0; fontDate = 0; fontMenuitemLarge = 0; fontMenuitemSchedule = 0; fontMenuitemScheduleSmall = 0; + fontMenuitemRecordings = 0; + fontMenuitemRecordingsSmall = 0; fontMenuitemDefault = 0; fontDiskUsage = 0; fontTimersHead = 0; @@ -175,6 +179,7 @@ bool cNopacityConfig::SetupParse(const char *Name, const char *Value) { else if (strcmp(Name, "fontEPGSize") == 0) fontEPGSize = atoi(Value); else if (strcmp(Name, "fontEPGSmallSize") == 0) fontEPGSmallSize = atoi(Value); else if (strcmp(Name, "resolutionIconSize") == 0) resolutionIconSize = atoi(Value); + else if (strcmp(Name, "statusIconSize") == 0) statusIconSize = atoi(Value); else if (strcmp(Name, "replayHeight") == 0) replayHeight = atoi(Value); else if (strcmp(Name, "replayBorderVertical") == 0) replayBorderVertical = atoi(Value); else if (strcmp(Name, "replayBorderBottom") == 0) replayBorderBottom = atoi(Value); @@ -228,11 +233,14 @@ bool cNopacityConfig::SetupParse(const char *Name, const char *Value) { else if (strcmp(Name, "detailViewLogoHeight") == 0) detailViewLogoHeight = atoi(Value); else if (strcmp(Name, "epgImageWidth") == 0) epgImageWidth = atoi(Value); else if (strcmp(Name, "epgImageHeight") == 0) epgImageHeight = atoi(Value); + else if (strcmp(Name, "menuRecFolderSize") == 0) menuRecFolderSize = atoi(Value); else if (strcmp(Name, "fontHeader") == 0) fontHeader = atoi(Value); else if (strcmp(Name, "fontDate") == 0) fontDate = atoi(Value); else if (strcmp(Name, "fontMenuitemLarge") == 0) fontMenuitemLarge = atoi(Value); else if (strcmp(Name, "fontMenuitemSchedule") == 0) fontMenuitemSchedule = atoi(Value); else if (strcmp(Name, "fontMenuitemScheduleSmall") == 0) fontMenuitemScheduleSmall = atoi(Value); + else if (strcmp(Name, "fontMenuitemRecordings") == 0) fontMenuitemRecordings = atoi(Value); + else if (strcmp(Name, "fontMenuitemRecordingsSmall") == 0) fontMenuitemRecordingsSmall = atoi(Value); else if (strcmp(Name, "fontMenuitemDefault") == 0) fontMenuitemDefault = atoi(Value); else if (strcmp(Name, "fontDiskUsage") == 0) fontDiskUsage = atoi(Value); else if (strcmp(Name, "fontTimersHead") == 0) fontTimersHead = atoi(Value); @@ -41,6 +41,7 @@ class cNopacityConfig { int fontEPGSize;
int fontEPGSmallSize;
int resolutionIconSize;
+ int statusIconSize;
//DisplayReplay
int replayHeight;
int replayBorderVertical;
@@ -107,11 +108,14 @@ class cNopacityConfig { int detailViewLogoHeight;
int epgImageWidth;
int epgImageHeight;
+ int menuRecFolderSize;
int fontHeader;
int fontDate;
int fontMenuitemLarge;
int fontMenuitemSchedule;
int fontMenuitemScheduleSmall;
+ int fontMenuitemRecordings;
+ int fontMenuitemRecordingsSmall;
int fontMenuitemDefault;
int fontDiskUsage;
int fontTimersHead;
diff --git a/displaymenu.c b/displaymenu.c index 902d4d4..057c7db 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -38,7 +38,7 @@ cNopacityDisplayMenu::~cNopacityDisplayMenu() { delete detailView; } timers.Clear(); - for (int i=0; i<6; i++) + for (int i=0; i<8; i++) cOsdProvider::DropImage(handleBackgrounds[i]); for (int i=0; i<4; i++) cOsdProvider::DropImage(handleButtons[i]); @@ -108,6 +108,7 @@ int cNopacityDisplayMenu::MaxItems(void) { case mcScheduleNow: case mcScheduleNext: case mcChannel: + case mcRecording: maxItems = menuView->GetMaxItems(MenuCategory()); break; default: @@ -169,6 +170,7 @@ void cNopacityDisplayMenu::SetMenuCategory(eMenuCategory MenuCategory) { case mcScheduleNext: case mcChannel: case mcSetup: + case mcRecording: contentNarrow = true; break; default: @@ -250,7 +252,7 @@ bool cNopacityDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Cur cPoint itemSize; menuView->GetMenuItemSize(MenuCategory(), &itemSize); item->SetFont(menuView->GetMenuItemFont(mcSchedule)); - item->SetFontSmall(menuView->GetMenuItemFontSmall()); + item->SetFontSmall(menuView->GetMenuItemFontSmall(mcSchedule)); item->SetFontEPGWindow(menuView->GetEPGWindowFont()); int spaceTop = menuView->GetMenuTop(currentNumItems, itemSize.Y()); item->SetGeometry(Index, spaceTop, menuView->spaceMenu, itemSize.X(), itemSize.Y()); @@ -290,7 +292,7 @@ bool cNopacityDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bo cPoint itemSize; menuView->GetMenuItemSize(MenuCategory(), &itemSize); item->SetFont(menuView->GetMenuItemFont(mcChannel)); - item->SetFontSmall(menuView->GetMenuItemFontSmall()); + item->SetFontSmall(menuView->GetMenuItemFontSmall(mcChannel)); int spaceTop = menuView->GetMenuTop(currentNumItems, itemSize.Y()); item->SetGeometry(Index, spaceTop, menuView->spaceMenu, itemSize.X(), itemSize.Y()); item->SetCurrent(Current); @@ -319,8 +321,43 @@ bool cNopacityDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bo } bool cNopacityDisplayMenu::SetItemRecording(const cRecording *Recording, int Index, bool Current, bool Selectable, - int Level, int Total, int New) { - return false; + int Level, int Total, int New) { + if ((initMenu)&&(Index > menuItemIndexLast)) { + bool isFolder = false; + if (Total > 0) + isFolder = true; + cNopacityMenuItem *item = new cNopacityRecordingMenuItem(osd, Recording, Selectable, isFolder, Total, New); + cPoint itemSize; + menuView->GetMenuItemSize(MenuCategory(), &itemSize); + item->SetFont(menuView->GetMenuItemFont(mcRecording)); + item->SetFontSmall(menuView->GetMenuItemFontSmall(mcRecording)); + item->SetFontEPGWindow(menuView->GetEPGWindowFont()); + int spaceTop = menuView->GetMenuTop(currentNumItems, itemSize.Y()); + item->SetGeometry(Index, spaceTop, menuView->spaceMenu, itemSize.X(), itemSize.Y()); + item->SetTextWindow(menuView->GetDescriptionTextWindowSize()); + item->SetCurrent(Current); + item->SetBackgrounds(handleBackgrounds); + item->CreateText(); + int textWidth = item->CheckScrollable(false); + item->CreatePixmap(); + item->CreatePixmapIcon(); + item->CreatePixmapTextScroller(textWidth); + menuItems.Add(item); + item->Render(); + menuItemIndexLast = Index; + if (initial) { + if (FadeTime) { + item->SetAlpha(0); + item->SetAlphaIcon(0); + item->SetAlphaText(0); + } + } + } else { + cNopacityMenuItem *item = menuItems.Get(Index); + item->SetCurrent(Current); + item->Render(); + } + return true; } diff --git a/displaymenu.h b/displaymenu.h index f505b46..58abd27 100644 --- a/displaymenu.h +++ b/displaymenu.h @@ -20,7 +20,7 @@ private: bool contentNarrow, contentNarrowLast; cList<cNopacityTimer> timers; cList<cNopacityMenuItem> menuItems; - int handleBackgrounds[6]; + int handleBackgrounds[8]; int handleButtons[4]; void DrawDisk(void); void DrawTimers(void); diff --git a/displaymenuview.c b/displaymenuview.c index cca0872..31c4914 100644 --- a/displaymenuview.c +++ b/displaymenuview.c @@ -33,6 +33,8 @@ cNopacityDisplayMenuView::~cNopacityDisplayMenuView(void) { delete fontMenuitemLarge; delete fontMenuitemSchedule; delete fontMenuitemScheduleSmall; + delete fontMenuitemRecordings; + delete fontMenuitemRecordingsSmall; delete fontMenuitemDefault; delete fontDiskUsage; delete fontTimers; @@ -65,6 +67,7 @@ void cNopacityDisplayMenuView::SetGeometry(void) { menuItemHeightMain = config.iconHeight + 2; menuItemHeightSchedule = config.menuItemLogoHeight + 2; menuItemHeightDefault = contentHeight / config.numDefaultMenuItems - spaceMenu; + menuItemHeightRecordings = config.menuRecFolderSize + 2; diskUsageWidth = diskUsageHeight = timersWidth = osdWidth * config.menuWidthRightItems / 100; buttonsBorder = 10; buttonWidth = (osdWidth / 4) - 2 * buttonsBorder; @@ -132,6 +135,8 @@ void cNopacityDisplayMenuView::CreateFonts(void) { fontMenuitemLarge = cFont::CreateFont(config.fontName, menuItemHeightMain/3 + 4 + config.fontMenuitemLarge); fontMenuitemSchedule = cFont::CreateFont(config.fontName, menuItemHeightSchedule / 4 + 5 + config.fontMenuitemSchedule); fontMenuitemScheduleSmall = cFont::CreateFont(config.fontName, menuItemHeightSchedule / 4 - 5 + config.fontMenuitemScheduleSmall); + fontMenuitemRecordings = cFont::CreateFont(config.fontName, menuItemHeightRecordings / 2 - 14 + config.fontMenuitemRecordings); + fontMenuitemRecordingsSmall = cFont::CreateFont(config.fontName, menuItemHeightRecordings / 4 - 3 + config.fontMenuitemRecordingsSmall); fontMenuitemDefault = cFont::CreateFont(config.fontName, menuItemHeightDefault * 2 / 3 + config.fontMenuitemDefault); fontDiskUsage = cFont::CreateFont(config.fontName, (diskUsageHeight/4)/2 - 2 + config.fontDiskUsage); fontTimersHead = cFont::CreateFont(config.fontName, (contentHeight - 3*spaceMenu - diskUsageHeight) / 25 + config.fontTimersHead); @@ -151,13 +156,23 @@ cFont *cNopacityDisplayMenuView::GetMenuItemFont(eMenuCategory menuCat) { return fontMenuitemSchedule; case mcChannel: return fontMenuitemLarge; + case mcRecording: + return fontMenuitemRecordings; default: return fontMenuitemDefault; } return fontMenuitemDefault; } -cFont *cNopacityDisplayMenuView::GetMenuItemFontSmall() { +cFont *cNopacityDisplayMenuView::GetMenuItemFontSmall(eMenuCategory menuCat) { + switch (menuCat) { + case mcSchedule: + return fontMenuitemScheduleSmall; + case mcRecording: + return fontMenuitemRecordingsSmall; + default: + return fontMenuitemScheduleSmall; + } return fontMenuitemScheduleSmall; } @@ -187,6 +202,10 @@ void cNopacityDisplayMenuView::GetMenuItemSize(eMenuCategory menuCat, cPoint *it itemWidth = menuItemWidthMain; itemHeight = menuItemHeightSchedule; break; + case mcRecording: + itemWidth = menuItemWidthMain; + itemHeight = menuItemHeightRecordings; + break; default: itemWidth = menuItemWidthDefault; itemHeight = menuItemHeightDefault; @@ -208,6 +227,9 @@ int cNopacityDisplayMenuView::GetMaxItems(eMenuCategory menuCat) { case mcChannel: maxItems = contentHeight / (menuItemHeightSchedule + spaceMenu); break; + case mcRecording: + maxItems = contentHeight / (menuItemHeightRecordings + spaceMenu); + break; default: maxItems = config.numDefaultMenuItems; } @@ -263,6 +285,10 @@ void cNopacityDisplayMenuView::CreateBackgroundImages(int *handleBackgrounds, in handleBackgrounds[4] = cOsdProvider::StoreImage(imgLoader.GetImage()); imgLoader.DrawBackground(Theme.Color(clrMenuItemHigh), Theme.Color(clrMenuItemHighBlend), menuItemWidthMain-2, menuItemHeightSchedule-2); handleBackgrounds[5] = cOsdProvider::StoreImage(imgLoader.GetImage()); + imgLoader.DrawBackground(Theme.Color(clrMenuItem), Theme.Color(clrMenuItemBlend), menuItemWidthMain-2, menuItemHeightRecordings-2); + handleBackgrounds[6] = cOsdProvider::StoreImage(imgLoader.GetImage()); + imgLoader.DrawBackground(Theme.Color(clrMenuItemHigh), Theme.Color(clrMenuItemHighBlend), menuItemWidthMain-2, menuItemHeightRecordings-2); + handleBackgrounds[7] = cOsdProvider::StoreImage(imgLoader.GetImage()); tColor lutBg[] = { Theme.Color(clrButtonRed), Theme.Color(clrButtonGreen), Theme.Color(clrButtonYellow), Theme.Color(clrButtonBlue) }; diff --git a/displaymenuview.h b/displaymenuview.h index 274fd7e..e0d30b7 100644 --- a/displaymenuview.h +++ b/displaymenuview.h @@ -36,6 +36,8 @@ class cNopacityDisplayMenuView { cFont *fontMenuitemLarge; cFont *fontMenuitemSchedule; cFont *fontMenuitemScheduleSmall; + cFont *fontMenuitemRecordings; + cFont *fontMenuitemRecordingsSmall; cFont *fontMenuitemDefault; cFont *fontDiskUsage; cFont *fontTimers; @@ -52,6 +54,7 @@ class cNopacityDisplayMenuView { int menuItemWidthDefault, menuItemHeightDefault; int menuItemWidthMain, menuItemHeightMain; int menuItemHeightSchedule; + int menuItemHeightRecordings; int diskUsageWidth, diskUsageHeight; int timersWidth; int buttonsBorder, buttonWidth, buttonHeight; @@ -68,7 +71,7 @@ class cNopacityDisplayMenuView { void SetPixmapAlpha(int Alpha); void CreateFonts(void); cFont *GetMenuItemFont(eMenuCategory menuCat); - cFont *GetMenuItemFontSmall(void); + cFont *GetMenuItemFontSmall(eMenuCategory menuCat); cFont *GetEPGWindowFont(void); void GetMenuItemSize(eMenuCategory menuCat, cPoint *itemSize); int GetMaxItems(eMenuCategory menuCat); diff --git a/icons/newrecording.png b/icons/newrecording.png Binary files differnew file mode 100644 index 0000000..38f6030 --- /dev/null +++ b/icons/newrecording.png diff --git a/icons/radio.png b/icons/radio.png Binary files differnew file mode 100644 index 0000000..3a90a3e --- /dev/null +++ b/icons/radio.png diff --git a/icons/recordingcutted.png b/icons/recordingcutted.png Binary files differnew file mode 100644 index 0000000..3000f72 --- /dev/null +++ b/icons/recordingcutted.png diff --git a/icons/recordingdatetime.png b/icons/recordingdatetime.png Binary files differnew file mode 100644 index 0000000..9a42a93 --- /dev/null +++ b/icons/recordingdatetime.png diff --git a/icons/recordingfolder.png b/icons/recordingfolder.png Binary files differnew file mode 100644 index 0000000..687b149 --- /dev/null +++ b/icons/recordingfolder.png diff --git a/imageloader.c b/imageloader.c index 6ff417a..4b31aed 100644 --- a/imageloader.c +++ b/imageloader.c @@ -61,7 +61,7 @@ bool cImageLoader::LoadIcon(const char *cIcon, int width, int height) { } if (!success) return false; - buffer.scale(Geometry(width, height)); + buffer.sample(Geometry(width, height)); return true; } catch (...) { @@ -412,6 +412,10 @@ void cNopacityScheduleMenuItem::Render() { infoTextWindow->SetText(Event->Description()); infoTextWindow->Start(); } + } else { + int handleBgrd = (current)?handleBackgrounds[5]:handleBackgrounds[4]; + pixmap->Fill(Theme.Color(clrMenuBorder)); + pixmap->DrawImage(cPoint(1, 1), handleBgrd); } } @@ -555,6 +559,266 @@ void cNopacityChannelMenuItem::Render() { } } +// cNopacityRecordingMenuItem ------------- + +cNopacityRecordingMenuItem::cNopacityRecordingMenuItem(cOsd *osd, const cRecording *Recording, bool sel, bool isFolder, int Total, int New) : cNopacityMenuItem (osd, "", sel) { + this->Recording = Recording; + this->isFolder = isFolder; + this->Total = Total; + this->New = New; +} + +cNopacityRecordingMenuItem::~cNopacityRecordingMenuItem(void) { +} + +void cNopacityRecordingMenuItem::CreatePixmapTextScroller(int totalWidth) { + int pixmapLeft = 0; + int pixmapWidth = 0; + int drawPortWidth = totalWidth + 10; + + if (isFolder) { + pixmapLeft = left + 10 + config.menuRecFolderSize; + pixmapWidth = width - 10 - config.menuRecFolderSize; + } else { + pixmapLeft = left + 10; + pixmapWidth = width - 10; + } + + pixmapTextScroller = osd->CreatePixmap(4, cRect(pixmapLeft, top + index * (height + left), pixmapWidth, height), cRect(0, 0, drawPortWidth, height)); + pixmapTextScroller->Fill(clrTransparent); +} + +void cNopacityRecordingMenuItem::CreateText() { + if (isFolder) { + const cRecordingInfo *recInfo = Recording->Info(); + strRecName = recInfo->Title(); + } else { + std::string recName = Recording->Name(); + if (Recording->IsEdited()) { + try { + if (recName.at(0) == '%') { + recName = recName.substr(1); + } + } catch (...) {} + } + try { + if (recName.find(FOLDERDELIMCHAR) != std::string::npos) { + recName = recName.substr(recName.find(FOLDERDELIMCHAR) + 1); + } + } catch (...) {} + strRecName = recName.c_str(); + } +} + +int cNopacityRecordingMenuItem::CheckScrollable(bool hasIcon) { + int totalWidth = 0; + if (isFolder) + totalWidth = CheckScrollableFolder(); + else + totalWidth = CheckScrollableRecording(); + return totalWidth; +} + +int cNopacityRecordingMenuItem::CheckScrollableRecording(void) { + int spaceLeft = left; + int iconWidth = 0; + if (Recording->IsNew()) + iconWidth += font->Height() + 10; + if (Recording->IsEdited()) + iconWidth += font->Height() + 5; + int totalTextWidth = width - spaceLeft; + strRecNameFull = strRecName.c_str(); + if (font->Width(strRecName.c_str()) + iconWidth > (width - spaceLeft)) { + scrollable = true; + totalTextWidth = max(font->Width(strRecName.c_str()) + iconWidth, totalTextWidth); + cTextWrapper twEntry; + std::stringstream sstrEntry; + twEntry.Set(strRecName.c_str(), font, width - spaceLeft - iconWidth); + sstrEntry << twEntry.GetLine(0) << "..."; + strRecName = sstrEntry.str(); + } + return totalTextWidth; +} + +int cNopacityRecordingMenuItem::CheckScrollableFolder(void) { + int spaceLeft = left + config.menuRecFolderSize; + int totalTextWidth = width - spaceLeft; + strRecNameFull = strRecName.c_str(); + if (font->Width(strRecName.c_str()) > (width - spaceLeft)) { + scrollable = true; + totalTextWidth = max(font->Width(strRecName.c_str()), totalTextWidth); + cTextWrapper twEntry; + std::stringstream sstrEntry; + twEntry.Set(strRecName.c_str(), font, width - spaceLeft); + sstrEntry << twEntry.GetLine(0) << "..."; + strRecName = sstrEntry.str(); + } + return totalTextWidth; +} + + +void cNopacityRecordingMenuItem::SetTextFull(void) { + if (isFolder) + SetTextFullFolder(); + else + SetTextFullRecording(); +} + +void cNopacityRecordingMenuItem::SetTextFullFolder(void) { + tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); + pixmapTextScroller->Fill(clrTransparent); + DrawFolderIcon(); + int heightRecName = (2*height/3 - font->Height())/2 + 10; + pixmapTextScroller->DrawText(cPoint(0, heightRecName), strRecNameFull.c_str(), clrFont, clrTransparent, font); +} + +void cNopacityRecordingMenuItem::SetTextFullRecording(void) { + tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); + pixmapTextScroller->Fill(clrTransparent); + int textLeft = 5; + if (Recording->IsNew()) { + textLeft += DrawRecordingNewIcon(); + } + if (Recording->IsEdited()) { + textLeft += DrawRecordingEditedIcon(textLeft); + } + int heightRecName = (height / 2 - font->Height())/2; + pixmapTextScroller->DrawText(cPoint(textLeft, heightRecName), strRecNameFull.c_str(), clrFont, clrTransparent, font); +} + + +void cNopacityRecordingMenuItem::SetTextShort(void) { + if (isFolder) + SetTextShortFolder(); + else + SetTextShortRecording(); +} + +void cNopacityRecordingMenuItem::SetTextShortFolder(void) { + tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); + pixmapTextScroller->Fill(clrTransparent); + DrawFolderIcon(); + int heightRecName = (2*height/3 - font->Height())/2 + 10; + pixmapTextScroller->DrawText(cPoint(0, heightRecName), strRecName.c_str(), clrFont, clrTransparent, font); +} + +void cNopacityRecordingMenuItem::SetTextShortRecording(void) { + tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); + pixmapTextScroller->Fill(clrTransparent); + int textLeft = 5; + if (Recording->IsNew()) { + textLeft += DrawRecordingNewIcon(); + } + if (Recording->IsEdited()) { + textLeft += DrawRecordingEditedIcon(textLeft); + } + int heightRecName = (height / 2 - font->Height())/2; + pixmapTextScroller->DrawText(cPoint(textLeft, heightRecName), strRecName.c_str(), clrFont, clrTransparent, font); +} + + +int cNopacityRecordingMenuItem::DrawRecordingNewIcon(void) { + int iconNewSize = font->Height(); + cImageLoader imgLoader; + if (imgLoader.LoadIcon("newrecording", iconNewSize)) { + int iconHeight = (height/2 - iconNewSize)/2; + pixmapTextScroller->DrawImage(cPoint(1, iconHeight), imgLoader.GetImage()); + } + return iconNewSize; +} + +int cNopacityRecordingMenuItem::DrawRecordingEditedIcon(int startLeft) { + int iconEditedSize = font->Height() - 10; + cImageLoader imgLoader; + if (imgLoader.LoadIcon("recordingcutted", iconEditedSize)) { + int iconHeight = (height/2 - iconEditedSize)/2; + pixmapTextScroller->DrawImage(cPoint(startLeft + 5, iconHeight), imgLoader.GetImage()); + } + return iconEditedSize + 5; +} + +void cNopacityRecordingMenuItem::DrawFolderIcon(void) { + cImageLoader imgLoader; + if (imgLoader.LoadIcon("recordingfolder", config.menuRecFolderSize)) { + pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage()); + } +} + +void cNopacityRecordingMenuItem::DrawRecDateTime(void) { + int iconDateTimeSize = config.menuRecFolderSize / 2; + if (!drawn) { + cImageLoader imgLoader; + if (imgLoader.LoadIcon("recordingdatetime", iconDateTimeSize)) { + int iconHeight = height/2 + (height/2 - iconDateTimeSize)/2; + pixmapIcon->DrawImage(cPoint(3, iconHeight), imgLoader.GetImage()); + } + drawn = true; + } + const cEvent *Event = NULL; + Event = Recording->Info()->GetEvent(); + cString strDateTime(""); + cString strDuration(""); + if (Event) { + cString strDate = Event->GetDateString(); + cString strTime = Event->GetTimeString(); + strDateTime = cString::sprintf("%s - %s", *strDate, *strTime); + int duration = Event->Duration() / 60; + int recDuration = Recording->LengthInSeconds(); + recDuration = (recDuration>0)?(recDuration / 60):0; + strDuration = cString::sprintf("%s: %d %s, %s: %d %s", tr("Duration"), duration, tr("min"), tr("recording"), recDuration, tr("min")); + } + + int textHeight = height/2 + (height/4 - fontSmall->Height())/2; + pixmapIcon->DrawText(cPoint(iconDateTimeSize + 10, textHeight), *strDateTime, Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall); + textHeight += height/4; + pixmapIcon->DrawText(cPoint(iconDateTimeSize + 10, textHeight), *strDuration, Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall); + +} + +void cNopacityRecordingMenuItem::DrawFolderNewSeen(void) { + int textHeight = 2*height/3 + (height/3 - fontSmall->Height())/2 - 10; + cString strTotalNew = cString::sprintf("%d %s (%d %s)", Total, (Total > 1)?tr("recordings"):tr("recording"), New, tr("new")); + pixmapIcon->DrawText(cPoint(config.menuRecFolderSize + 10, textHeight), *strTotalNew, Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall); +} + +void cNopacityRecordingMenuItem::Render() { + + int handleBgrd = (current)?handleBackgrounds[7]:handleBackgrounds[6]; + if (selectable) { + pixmap->Fill(Theme.Color(clrMenuBorder)); + pixmap->DrawImage(cPoint(1, 1), handleBgrd); + if (isFolder) { + DrawFolderNewSeen(); + SetTextShort(); + } else { + DrawRecDateTime(); + SetTextShort(); + } + if (current && scrollable && !Running() && config.menuScrollSpeed) { + Start(); + } + if (wasCurrent && !current && scrollable && Running()) { + pixmapTextScroller->SetDrawPortPoint(cPoint(0, 0)); + SetTextShort(); + Cancel(-1); + } + if (!isFolder) { + if (wasCurrent) + if (infoTextWindow) { + delete infoTextWindow; + infoTextWindow = NULL; + } + if (current) { + infoTextWindow = new cNopacityTextWindow(osd, fontEPGWindow); + infoTextWindow->SetGeometry(textWindow); + infoTextWindow->SetText(Recording->Info()->Description()); + infoTextWindow->Start(); + } + } + } +} + + // cNopacityDefaultMenuItem ------------- cNopacityDefaultMenuItem::cNopacityDefaultMenuItem(cOsd *osd, const char *text, bool sel) : cNopacityMenuItem (osd, text, sel) { @@ -116,6 +116,35 @@ public: void Render(); }; +class cNopacityRecordingMenuItem : public cNopacityMenuItem { +private: + const cRecording *Recording; + bool isFolder; + int Total, New; + std::string strRecName; + std::string strRecNameFull; + void SetTextFull(void); + void SetTextShort(void); + void SetTextFullFolder(void); + void SetTextShortFolder(void); + void SetTextFullRecording(void); + void SetTextShortRecording(void); + int DrawRecordingNewIcon(void); + int DrawRecordingEditedIcon(int startLeft); + void DrawFolderIcon(void); + void DrawRecDateTime(void); + void DrawFolderNewSeen(void); + int CheckScrollableRecording(void); + int CheckScrollableFolder(void); +public: + cNopacityRecordingMenuItem(cOsd *osd, const cRecording *Recording, bool sel, bool isFolder, int Total, int New); + ~cNopacityRecordingMenuItem(void); + void CreatePixmapTextScroller(int totalWidth); + void CreateText(void); + int CheckScrollable(bool hasIcon); + void Render(); +}; + class cNopacityDefaultMenuItem : public cNopacityMenuItem { private: std::string strEntry; diff --git a/po/de_DE.po b/po/de_DE.po index 7dd671f..da86484 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: 2012-12-29 13:12+0100\n" +"POT-Creation-Date: 2013-01-02 15:58+0100\n" "PO-Revision-Date: 2012-11-11 17:49+0200\n" "Last-Translator: louis\n" "Language-Team: \n" @@ -27,7 +27,22 @@ msgid "Volume" msgstr "Lautstärke" msgid "RERUNS OF THIS SHOW" -msgstr "Wiederholungen" +msgstr "Wiederholungen dieser Sendung" + +msgid "Duration" +msgstr "Dauer" + +msgid "min" +msgstr "min" + +msgid "recording" +msgstr "Aufnahme" + +msgid "recordings" +msgstr "Aufnahmen" + +msgid "new" +msgstr "neu" msgid "Font" msgstr "Schriftart" @@ -149,6 +164,9 @@ msgstr "Höhe des Logos im Hauptmenü" msgid "Main Menu Header Logo Height" msgstr "Breite des Logos im Hauptmenü" +msgid "Recordings Menu Folder Icon Size" +msgstr "Ordner Icon Größe im Aufnahmeverzeichnis" + msgid "Detail EPG View Logo Width" msgstr "Breite der Kanallogos in der EPG Detailanzeige" @@ -176,6 +194,12 @@ msgstr "Schriftgröße anpassen - Programmübersicht Menübuttons" msgid "Adjust Font Size - Schedule Menu Item Small" msgstr "Schriftgröße anpassen - Programmübersicht Menübuttons klein" +msgid "Adjust Font Size - Recordings Menu Item" +msgstr "Schriftgröße anpassen - Aufzeichnungen Menübuttons" + +msgid "Adjust Font Size - Recordings Menu Item Small" +msgstr "Schriftgröße anpassen - Aufzeichnungen Menübuttons klein" + msgid "Adjust Font Size - Default Menu Item" msgstr "Schriftgröße anpassen - Default Menübuttons" @@ -230,6 +254,9 @@ msgstr "Signalstärke- und Qualität anzeigen" msgid "Screen Resolution Icon Size" msgstr "Größe des Icons zur Anzeige der Bildschirmauflösung" +msgid "Status Icons Size" +msgstr "Status Icon Größe" + msgid "Adjust Font Size - EPG Text" msgstr "Schriftgröße anpassen - EPG Text" @@ -277,4 +304,3 @@ msgstr "Breite der Lautstärken Anzeige (Proz. der OSD Breite)" msgid "Hight of Volume Display (Percent of OSD Height)" msgstr "Breite der Lautstärken Anzeige (Proz. der OSD Breite)" - @@ -73,6 +73,7 @@ void cNopacitySetup::Store(void) { SetupStore("fontEPGSize", config.fontEPGSize); SetupStore("fontEPGSmallSize", config.fontEPGSmallSize); SetupStore("resolutionIconSize", config.resolutionIconSize); + SetupStore("statusIconSize", config.statusIconSize); SetupStore("replayHeight", config.replayHeight); SetupStore("replayBorderVertical", config.replayBorderVertical); SetupStore("replayBorderBottom", config.replayBorderBottom); @@ -126,11 +127,14 @@ void cNopacitySetup::Store(void) { SetupStore("detailViewLogoHeight", config.detailViewLogoHeight); SetupStore("epgImageWidth", config.epgImageWidth); SetupStore("epgImageHeight", config.epgImageHeight); + SetupStore("menuRecFolderSize", config.menuRecFolderSize); SetupStore("fontHeader", config.fontHeader); SetupStore("fontDate", config.fontDate); SetupStore("fontMenuitemLarge", config.fontMenuitemLarge); SetupStore("fontMenuitemSchedule", config.fontMenuitemSchedule); SetupStore("fontMenuitemScheduleSmall", config.fontMenuitemScheduleSmall); + SetupStore("fontMenuitemRecordings", config.fontMenuitemRecordings); + SetupStore("fontMenuitemRecordingsSmall", config.fontMenuitemRecordingsSmall); SetupStore("fontMenuitemDefault", config.fontMenuitemDefault); SetupStore("fontDiskUsage", config.fontDiskUsage); SetupStore("fontTimersHead", config.fontTimersHead); @@ -225,6 +229,7 @@ void cNopacitySetupMenuDisplayGeometry::Set(void) { Add(new cMenuEditIntItem(tr("Channel Logo Height (on the Menu Buttons)"), &tmpNopacityConfig->menuItemLogoHeight, 30, 200)); Add(new cMenuEditIntItem(tr("Main Menu Header Logo Width"), &tmpNopacityConfig->menuHeaderLogoWidth, 30, 500)); Add(new cMenuEditIntItem(tr("Main Menu Header Logo Height"), &tmpNopacityConfig->menuHeaderLogoHeight, 30, 500)); + Add(new cMenuEditIntItem(tr("Recordings Menu Folder Icon Size"), &tmpNopacityConfig->menuRecFolderSize, 30, 300)); Add(new cMenuEditIntItem(tr("Detail EPG View Logo Width"), &tmpNopacityConfig->detailViewLogoWidth, 30, 500)); Add(new cMenuEditIntItem(tr("Detail EPG View Logo Height"), &tmpNopacityConfig->detailViewLogoHeight, 30, 500)); Add(new cMenuEditIntItem(tr("Detail EPG View EPG Image Width"), &tmpNopacityConfig->epgImageWidth, 30, 500)); @@ -247,6 +252,8 @@ void cNopacitySetupMenuDisplayFonts::Set(void) { Add(new cMenuEditIntItem(tr("Adjust Font Size - Large Menu Item"), &tmpNopacityConfig->fontMenuitemLarge, -20, 20)); Add(new cMenuEditIntItem(tr("Adjust Font Size - Schedule Menu Item"), &tmpNopacityConfig->fontMenuitemSchedule, -20, 20)); Add(new cMenuEditIntItem(tr("Adjust Font Size - Schedule Menu Item Small"), &tmpNopacityConfig->fontMenuitemScheduleSmall, -20, 20)); + Add(new cMenuEditIntItem(tr("Adjust Font Size - Recordings Menu Item"), &tmpNopacityConfig->fontMenuitemRecordings, -20, 20)); + Add(new cMenuEditIntItem(tr("Adjust Font Size - Recordings Menu Item Small"), &tmpNopacityConfig->fontMenuitemRecordingsSmall, -20, 20)); Add(new cMenuEditIntItem(tr("Adjust Font Size - Default Menu Item"), &tmpNopacityConfig->fontMenuitemDefault, -20, 20)); Add(new cMenuEditIntItem(tr("Adjust Font Size - Disc Usage"), &tmpNopacityConfig->fontDiskUsage, -20, 20)); Add(new cMenuEditIntItem(tr("Adjust Font Size - Timers Header"), &tmpNopacityConfig->fontTimersHead, -20, 20)); @@ -280,6 +287,7 @@ void cNopacitySetupChannelDisplay::Set(void) { Add(new cMenuEditIntItem(tr("Channel Logo Border"), &tmpNopacityConfig->logoBorder, 0, 200)); Add(new cMenuEditBoolItem(tr("Display Signal Strength & Quality"), &tmpNopacityConfig->displaySignalStrength)); Add(new cMenuEditIntItem(tr("Screen Resolution Icon Size"), &tmpNopacityConfig->resolutionIconSize, 30, 200)); + Add(new cMenuEditIntItem(tr("Status Icons Size"), &tmpNopacityConfig->statusIconSize, 30, 150)); Add(new cMenuEditIntItem(tr("Adjust Font Size - Header"), &tmpNopacityConfig->fontChannelHeaderSize, -20, 20)); Add(new cMenuEditIntItem(tr("Adjust Font Size - Date"), &tmpNopacityConfig->fontChannelDateSize, -20, 20)); Add(new cMenuEditIntItem(tr("Adjust Font Size - EPG Text"), &tmpNopacityConfig->fontEPGSize, -20, 20)); |