diff options
author | louis <louis.braun@gmx.de> | 2012-12-29 13:29:10 +0100 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2012-12-29 13:29:10 +0100 |
commit | c7fd4e9eaea25ac7b2a593e5402d52614e1df944 (patch) | |
tree | 5031bbc72986995154e24b552504deffd5704f63 | |
parent | 7c2a71393299eed572c1b4dfc2f35a7819e8843b (diff) | |
download | skin-nopacity-c7fd4e9eaea25ac7b2a593e5402d52614e1df944.tar.gz skin-nopacity-c7fd4e9eaea25ac7b2a593e5402d52614e1df944.tar.bz2 |
Version 0.0.5
-rw-r--r-- | HISTORY | 25 | ||||
-rw-r--r-- | Makefile | 67 | ||||
-rw-r--r-- | README | 88 | ||||
-rw-r--r-- | config.c | 50 | ||||
-rw-r--r-- | config.h | 10 | ||||
-rw-r--r-- | displaymenu.c | 306 | ||||
-rw-r--r-- | displaymenu.h | 7 | ||||
-rw-r--r-- | displaymenuview.c | 102 | ||||
-rw-r--r-- | displaymenuview.h | 8 | ||||
-rw-r--r-- | epgsearchconf.c | 317 | ||||
-rw-r--r-- | epgsearchconf.h | 31 | ||||
-rw-r--r-- | icons/CAM.png | bin | 0 -> 17598 bytes | |||
-rw-r--r-- | icons/DVB.png | bin | 0 -> 11742 bytes | |||
-rw-r--r-- | icons/EPG.png | bin | 0 -> 11190 bytes | |||
-rw-r--r-- | icons/LNB.png | bin | 0 -> 14553 bytes | |||
-rw-r--r-- | icons/Miscellaneous.png | bin | 0 -> 22604 bytes | |||
-rw-r--r-- | icons/OSD.png | bin | 0 -> 9733 bytes | |||
-rw-r--r-- | icons/Plugins.png | bin | 0 -> 15480 bytes | |||
-rw-r--r-- | icons/Recording.png | bin | 0 -> 19676 bytes | |||
-rw-r--r-- | icons/Replay.png | bin | 0 -> 19060 bytes | |||
-rw-r--r-- | icons/Restart.png | bin | 0 -> 15427 bytes | |||
-rw-r--r-- | icons/activetimer.png | bin | 0 -> 5553 bytes | |||
-rw-r--r-- | icons/activetimersmall.png | bin | 0 -> 2093 bytes | |||
-rw-r--r-- | icons/alternative/Channels.png | bin | 0 -> 20160 bytes | |||
-rw-r--r-- | icons/alternative/Info.png | bin | 0 -> 17298 bytes | |||
-rw-r--r-- | icons/alternative/Recordings.png | bin | 0 -> 22057 bytes | |||
-rw-r--r-- | icons/alternative/Recordings1.png | bin | 0 -> 25145 bytes | |||
-rw-r--r-- | icons/alternative/Recordings2.png | bin | 0 -> 20570 bytes | |||
-rw-r--r-- | icons/alternative/Schedule.png | bin | 0 -> 17644 bytes | |||
-rw-r--r-- | icons/alternative/System.png | bin | 0 -> 19700 bytes | |||
-rw-r--r-- | icons/alternative/System2.png | bin | 0 -> 18138 bytes | |||
-rw-r--r-- | icons/alternative/System3.png | bin | 0 -> 16161 bytes | |||
-rw-r--r-- | icons/alternative/Timers.png | bin | 0 -> 20944 bytes | |||
-rw-r--r-- | menuitem.c | 378 | ||||
-rw-r--r-- | menuitem.h | 51 | ||||
-rw-r--r-- | nopacity.c | 3 | ||||
-rw-r--r-- | patches/0003-softhddevice-video-scaling-without-YAEPG-vdr-1.7.33_v4.diff | 153 | ||||
-rw-r--r-- | patches/adminplug_meucats.patch | 20 | ||||
-rw-r--r-- | patches/epgsearch_menucats.patch | 126 | ||||
-rw-r--r-- | po/de_DE.po | 85 | ||||
-rw-r--r-- | setup.c | 69 | ||||
-rw-r--r-- | setup.h | 14 | ||||
-rw-r--r-- | skinnopacity.c | 6 | ||||
-rw-r--r-- | textwindow.c | 122 | ||||
-rw-r--r-- | textwindow.h | 22 |
45 files changed, 1105 insertions, 955 deletions
@@ -58,9 +58,32 @@ VDR Plugin 'nOpacity' Revision History more information about epgsearch integration) - Fixed "fade in" bug, cancelling threads correctly (Thanks to everybody who was involved) - - Fixed a crash when trying to access channel name in epg detail view - Fixed a crash when changing values in setup menu - Fixed a crash when opening and closing epg menus - Fixed a bug to only use epgsearchmenu.conf if lines for all possible menus are set + +2012-12-29: Version 0.0.5 + +- VDR version 1.7.34 mandatory +- Introducing of scrolling in menu elements if text is longer than + available space +- displaying first found jpeg in recordings folder as epg image for this + recording in recording detail view +- Configurable display of disc usage and timers in main menu +- yaepg patch no longer needed to scale video window, using native VDR + functionality now (thanks @Zoolook for providing the new code) +- Complete rewrite of menu category detection by using the eMenuCategory + enumeration integrated in VDR 1.7.31 - 34 +- Usage of new VDR interfaces SetItemsEvent(), SetItemsChannels for dispalying + Schedules menus and Channel menus + See README explaining consequences of this changes +- Displaying of detailed EPG information directly in schedules views in a + separate window if according menu item is selected a specific configurable time +- Some Improvements in menu element scrolling behaviour (suggeted by Taipan) +- Using narrow menu items in "Settings" category (thanks @BooStar for providing + the new icons) +- Split of skins VDR menu configuration section in "Common", "Geometry" and "Fonts" + sections for clearer arrangement +- different minor changes and fixes @@ -15,51 +15,44 @@ PLUGIN = skinnopacity VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') -### The C++ compiler and options: - -CXX ?= g++ -CXXFLAGS ?= -g -O3 -Wall -Werror=overloaded-virtual -Wno-parentheses - ### The directory environment: -VDRDIR ?= ../../.. -LIBDIR ?= ../../lib +# Use package data if installed...otherwise assume we're under the VDR source directory: +PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc)) +LIBDIR = $(DESTDIR)$(call PKGCFG,libdir) +LOCDIR = $(DESTDIR)$(call PKGCFG,locdir) TMPDIR ?= /tmp -### Make sure that necessary options are included: - -include $(VDRDIR)/Make.global - -### Allow user defined options to overwrite defaults: - --include $(VDRDIR)/Make.config - -### The version number of VDR's plugin API (taken from VDR's "config.h"): +### The compiler options: +export CFLAGS = $(call PKGCFG,cflags) +export CXXFLAGS = $(call PKGCFG,cxxflags) -APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h) +### The version number of VDR's plugin API: +APIVERSION = $(call PKGCFG,apiversion) ### The name of the distribution archive: ARCHIVE = $(PLUGIN)-$(VERSION) PACKAGE = vdr-$(ARCHIVE) +### The name of the shared object file: + +SOFILE = libvdr-$(PLUGIN).so + ### Includes and Defines (add further entries here): -INCLUDES += -I$(VDRDIR)/include +INCLUDES += INCLUDES += -I/usr/include/ImageMagick -DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' +DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -ifdef YAEPG -DEFINES += -DUSE_YAEPG -endif ### The object files (add further files here): OBJS = $(PLUGIN).o ### The main target: -all: libvdr-$(PLUGIN).so i18n +all: $(SOFILE) i18n ### Implicit rules: @@ -78,33 +71,38 @@ $(DEPFILE): Makefile ### Internationalization (I18N): PODIR = po -LOCALEDIR = $(VDRDIR)/locale I18Npo = $(wildcard $(PODIR)/*.po) -I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) +I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) +I18Nmsgs = $(addprefix $(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) I18Npot = $(PODIR)/$(PLUGIN).pot %.mo: %.po msgfmt -c -o $@ $< $(I18Npot): $(wildcard *.c) - xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ $^ + xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^` %.po: $(I18Npot) - msgmerge -U --no-wrap --no-location --backup=none -q $@ $< + msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $< @touch $@ -$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo - @mkdir -p $(dir $@) - cp $< $@ +$(I18Nmsgs): $(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo + install -D -m644 $< $@ .PHONY: i18n -i18n: $(I18Nmsgs) $(I18Npot) +i18n: $(I18Nmo) $(I18Npot) + +install-i18n: $(I18Nmsgs) ### Targets: -libvdr-$(PLUGIN).so: $(OBJS) +$(SOFILE): $(OBJS) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -lMagick++ -o $@ - @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION) + +install-lib: $(SOFILE) + install -D $^ $(LIBDIR)/$^.$(APIVERSION) + +install: install-lib install-i18n dist: $(I18Npo) clean @-rm -rf $(TMPDIR)/$(ARCHIVE) @@ -115,4 +113,5 @@ dist: $(I18Npo) clean @echo Distribution package created as $(PACKAGE).tgz clean: - @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot + @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot + @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ @@ -15,11 +15,10 @@ See the file COPYING for more information. Requirements ------------ -- VDR version >= 1.7.30 +- VDR version >= 1.7.34 - Installed ImageMagick for displaying png/jpg Icons, Channel Logos and EPG Images -- VDR Plugin epgsearch for displaying the progress bar in the schedulings "what's now" display. Description ----------- @@ -51,8 +50,8 @@ unzip it and place it accordingly the settings for the channel logos path. if no pathes are set for the different types of images, the following default paths are used: channel logos: {ResourceDirectory}/logos/ -icons: {ResourceDirectory}/icons/ -epg images: {CacheDirectory}/epgimages/ +icons: {ResourceDirectory}/icons/ +epg images: {CacheDirectory}/epgimages/ If directories for channel logos, icons or epg images are set via startup parameters, images are searched first in these directories. If the image @@ -100,50 +99,22 @@ In this example, as a dirty hack just create a folder in your channel logo direc With softhddevice as output plugin, use a Version newer than Revision f640ebde (0.5.1, 10.10.2012) to achieve a correct display of the screen resolution during channel switching. +For scaling the video picture to fit into the VDR menu window, currently you have to patch +softhddevice with the provided patch provided in ./patches/0003-softhddevice-video-scaling-without-YAEPG-vdr-1.7.33_v4.diff in the plugin sources. This patch should soon be included +in the softhddevice git. + + EPG Search Integration ------------------------- -nOpacity fully supports the alternative "schedules" menus provided by the EPG search plugin -(schedules, what's on now, what's on next, search results, favorites and "user defined times" -menu). If using the EPG search menus, please set "replace original schedule" to "true", -parallel usage of the vanilla VDR schedules menu and the schedules menu provided by EPG -search (with a dedicated main menu entry) is not supported. Please keep also in mind that -changing the schedules display behaviour needs to restart vdr, because nOpacity reads the -EPGSearch config only once at startup. - -If you use the default settings to display the EPG search schedule menus (if the file -epgsearchmenu.conf is not available in the epgserarch plugin config directory), everything -should work rather well out of the box. Just set "show progress in now" to "true" to achieve a -correct display of the progress bar in the "what's on now" view. - -Beside using the default settings you can also set up your own epgsearchmenu.conf file to -control the information which is diplayed in the various menus. All tokens described in the -epgsearchmenu.conf file in the epgsearch plugin sources (subdirectory ./conf/) are supported. -If epgsearchmenu is used, lines for all possible entries have to be set (see list below). -Otherwise the default epgsearch settings are used. -For me these entries for the different menus showed the best result: - -MenuWhatsOnNow=%chlng%:4|%progrT2S%:5|%time%:8|%status%:3|%title%:15|%subtitle%:25 -MenuWhatsOnNext=%chlng%:4|%time%:8|%status%:8|%title%:15|%subtitle%:25 -MenuWhatsOnElse=%chlng%:4|%time%:8|%status%:8|%title%:15|%subtitle%:25 -MenuSchedule=%time%:8|%status%:8|%title%:15|%subtitle%:25 -MenuSearchResults=%chlng%:12|%time_w% %datesh%:6|%time%:6|%status%:2|%title%:15|%subtitle%:25 -MenuFavorites=%chlng%:4|%time%:8|%status%:8|%title%:15|%subtitle%:25 -WarEagleIcons=1 - -Per default EPG search provides the short channel name (%chsh%), which is different to the "regular" -channel name for some channels. If %chsh% is used, for those channels no channel logos are displayed -if they are not appropriately renamed. - -The order of the tokens in the different sections of the epgsearchmenu.conf is not relevant how the -information in displayed in the skin. In fact the skin displays the various tokens in the way that -each menu item is displayed in three lines: -line 1: date and time information, status information -line 2: title -line 3: subtitle (if available) - -The first line is created out of the following tokens (if set) in this order: -%time_d% %time_w% %date% %datesh% %time% %timespan% %status% %t_status% %v_status% %r_status% +Since version 0.0.5 no special epg search integration is done anymore. Replacing the +original VDR schedules menu with the epg search menus is not possible currently. After the +epgsearch plugin has implemented the neccessary new VDR features, this will be possible again. +Use the additional main menu entry for accesing epg search. + +Until epg search has not implemented all new VDR features introduced in VDR 1.7.31 - 34, please +use the patch "epgsearch_menucats.patch" for epg search provided in the ./patches directory +in the source directory of the skin to grant correct functionality of epg search. Display of reruns of a show in detailed EPG View: if activated in the setup menu, nOpacity displays the reruns of a show via the EPG Search service interface in the detailed EPG view. @@ -156,19 +127,34 @@ Setup Options - Font: Used Font, all Fonts installed on your system are shown -* VDR menu: +* VDR menu: Common Settings: +- Number of Default Menu Entries: Number of menu items for the default menu view. +- Scale Video size to fit into menu window - Fade-In Time in ms (Zero for switching off fading): Default 300ms -- Scale Video size to fit into menu window: yaepg Patch needed +- Display Disk Usage: Display Disk Usage in Main Menu +- Display Timers: Display active Tiers in Main Menu +- Menu Items Scrolling Speed +- Menu Items Scrolling Delay in s: period which menu element has to be selected + till scrolling starts +- EPG Window Fade-In Time in ms (Zero for switching off fading) +- EPG Window Display Delay in s: period which schedules menu element has to be + selected till fade in of epg window starts +- EPG Window Scroll Delay in s: period which epg window has to be opened till + window text starts to scroll - Display Reruns in detailed EPG View: via epgsearch service - Number of reruns to display: Default 5 - Use Subtitle for reruns + +* VDR menu: Dimensions Settings: + - Width of narrow Menu Bar (% of OSD Width): Width of menu bar for the main menu, schedules menu and channels menu. Default: 30%. - Width of Disc Usage and Timers Display (% of OSD Width): Default: 12% +- Height of EPG Info Window (Percent of OSD Height): Height of text window which + is shown for schedules menu elements - Header Height (% of OSD Height): Default: 7% - Footer Height (% of OSD Height): Default: 7% -- Number of Default Menu Entries: Number of menu items for the default menu view. - Icon Size (Square Main Menu Icons): This size determinates the number of main menu entries per page. - Header Icon Size (Square Header Menu Icons) @@ -183,6 +169,9 @@ Setup Options - Detail EPG View Logo Height: Default 200px - Detail EPG View EPG Image Width: Default 210px - Detail EPG View EPG Image Height: Default 160px + +* VDR menu: Font Settings: + - Adjust Font Size - Header - Adjust Font Size - Date - Adjust Font Size - Large Menu Item: Font for Main menu and channels menu items @@ -196,7 +185,8 @@ Setup Options - Adjust Font Size - Detail View Text: Font for detailed EPG & recordings view text - Adjust Font Size - Detail View Header: Font for Header date/time and short text - Adjust Font Size - Detail View Header Large: Font for detailed EPG & recordings - view title + view title +- Adjust Font Size - EPG Info Window * Channel Switching: @@ -1,7 +1,6 @@ #include "config.h" cNopacityConfig::cNopacityConfig() { - epgSearchConf = NULL; logoPathSet = false; epgImagePathSet = false; iconPathSet = false; @@ -58,9 +57,14 @@ cNopacityConfig::cNopacityConfig() { numReruns = 5; useSubtitleRerun = 1; menuFadeTime = 300; + menuEPGWindowFadeTime = 300; menuWidthNarrow = 30; - menuScrollDelay = 1000; + menuHeightInfoWindow = 20; + menuScrollDelay = 1; menuScrollSpeed = 2; + menuInfoTextDelay = 2; + menuInfoScrollDelay = 5; + menuInfoScrollSpeed = 2; menuWidthRightItems = 12; showDiscUsage = 1; showTimers = 1; @@ -91,6 +95,7 @@ cNopacityConfig::cNopacityConfig() { fontDetailView = 0; fontDetailViewHeader = 0; fontDetailViewHeaderLarge = 0; + fontEPGInfoWindow = 0; } cNopacityConfig::~cNopacityConfig() { @@ -113,6 +118,7 @@ void cNopacityConfig::setDynamicValues() { tracksFrameTime = tracksFadeTime / 10; volumeFrameTime = volumeFadeTime / 10; menuFrameTime = menuFadeTime / 10; + menuEPGWindowFrameTime = menuEPGWindowFadeTime / 10; menuScrollFrameTime = 0; if (menuScrollSpeed == 1) @@ -121,8 +127,16 @@ void cNopacityConfig::setDynamicValues() { menuScrollFrameTime = 30; else if (menuScrollSpeed == 3) menuScrollFrameTime = 15; - - logoPathDefault = cString::sprintf("%s/logos/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N)); + + menuInfoScrollFrameTime = 0; + if (menuInfoScrollSpeed == 1) + menuInfoScrollFrameTime = 50; + else if (menuInfoScrollSpeed == 2) + menuInfoScrollFrameTime = 30; + else if (menuInfoScrollSpeed == 3) + menuInfoScrollFrameTime = 15; + + logoPathDefault = cString::sprintf("%s/logos/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N)); iconPathDefault = cString::sprintf("%s/icons/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N)); epgImagePathDefault = cString::sprintf("%s/epgimages/", cPlugin::CacheDirectory(PLUGIN_NAME_I18N)); @@ -131,27 +145,6 @@ void cNopacityConfig::setDynamicValues() { dsyslog("nopacity: using EPG Images Directory %s", (epgImagePathSet)?(*epgImagePath):(*epgImagePathDefault)); } -void cNopacityConfig::loadEPGSearchSettings(void) { - epgSearchConf = new cNopacityEPGSearchConfig(); - if (epgSearchConf->CheckEPGSearchAvailable()) { - dsyslog("nopacity: epgsearch plugin available"); - epgSearchConf->LoadEpgSearchConf(); - if (epgSearchConf->ReplaceScheduleActive()) { - if (!epgSearchConf->LoadEpgSearchMenuConf()) { - epgSearchConf->SetDefaultEPGSearchConf(); - } - } else { - dsyslog("nopacity: epgsearch plugin available, but not used for replacing schedules menu"); - dsyslog("nopacity: please enable \"replacing schedules menu\" in epgsearch settings"); - epgSearchConf->SetDefaultVDRConf(); - } - } else { - dsyslog("nopacity: no epgsearch plugin available"); - epgSearchConf->SetDefaultVDRConf(); - } - epgSearchConf->SetTimerConfilictCont(); -} - void cNopacityConfig::SetLogoPath(cString path) { logoPath = path; logoPathSet = true; @@ -207,14 +200,19 @@ bool cNopacityConfig::SetupParse(const char *Name, const char *Value) { else if (strcmp(Name, "volumeBorderBottom") == 0) volumeBorderBottom = atoi(Value); else if (strcmp(Name, "fontVolume") == 0) fontVolume = atoi(Value); else if (strcmp(Name, "menuFadeTime") == 0) menuFadeTime = atoi(Value); + else if (strcmp(Name, "menuEPGWindowFadeTime") == 0) menuEPGWindowFadeTime = atoi(Value); else if (strcmp(Name, "menuScrollDelay") == 0) menuScrollDelay = atoi(Value); else if (strcmp(Name, "menuScrollSpeed") == 0) menuScrollSpeed = atoi(Value); + else if (strcmp(Name, "menuInfoTextDelay") == 0) menuInfoTextDelay = atoi(Value); + else if (strcmp(Name, "menuInfoScrollDelay") == 0) menuInfoScrollDelay = atoi(Value); + else if (strcmp(Name, "menuInfoScrollSpeed") == 0) menuInfoScrollSpeed = atoi(Value); else if (strcmp(Name, "scalePicture") == 0) scalePicture = atoi(Value); else if (strcmp(Name, "displayRerunsDetailEPGView") == 0) displayRerunsDetailEPGView = atoi(Value); else if (strcmp(Name, "numReruns") == 0) numReruns = atoi(Value); else if (strcmp(Name, "useSubtitleRerun") == 0) useSubtitleRerun = atoi(Value); else if (strcmp(Name, "menuWidthNarrow") == 0) menuWidthNarrow = atoi(Value); else if (strcmp(Name, "menuWidthRightItems") == 0) menuWidthRightItems = atoi(Value); + else if (strcmp(Name, "menuHeightInfoWindow") == 0) menuHeightInfoWindow = atoi(Value); else if (strcmp(Name, "showDiscUsage") == 0) showDiscUsage = atoi(Value); else if (strcmp(Name, "showTimers") == 0) showTimers = atoi(Value); else if (strcmp(Name, "headerHeight") == 0) headerHeight = atoi(Value); @@ -244,6 +242,8 @@ bool cNopacityConfig::SetupParse(const char *Name, const char *Value) { else if (strcmp(Name, "fontDetailView") == 0) fontDetailView = atoi(Value); else if (strcmp(Name, "fontDetailViewHeader") == 0) fontDetailViewHeader = atoi(Value); else if (strcmp(Name, "fontDetailViewHeaderLarge") == 0) fontDetailViewHeaderLarge = atoi(Value); + else if (strcmp(Name, "fontEPGInfoWindow") == 0) fontEPGInfoWindow = atoi(Value); else return false; return true; + }
\ No newline at end of file @@ -17,7 +17,6 @@ class cNopacityConfig { cString iconPathDefault;
cString epgImagePathDefault;
void setDynamicValues();
- void loadEPGSearchSettings(void);
//Common
int fontIndex;
const char *fontDefaultName;
@@ -75,17 +74,23 @@ class cNopacityConfig { int volumeBorderBottom;
int fontVolume;
//DisplayMenu
- cNopacityEPGSearchConfig *epgSearchConf;
int scalePicture;
int displayRerunsDetailEPGView;
int numReruns;
int useSubtitleRerun;
int menuFadeTime;
+ int menuEPGWindowFadeTime;
int menuFrameTime;
+ int menuEPGWindowFrameTime;
int menuScrollDelay;
int menuScrollSpeed;
int menuScrollFrameTime;
+ int menuInfoTextDelay;
+ int menuInfoScrollDelay;
+ int menuInfoScrollSpeed;
+ int menuInfoScrollFrameTime;
int menuWidthNarrow;
+ int menuHeightInfoWindow;
int menuWidthRightItems;
int showDiscUsage;
int showTimers;
@@ -116,6 +121,7 @@ class cNopacityConfig { int fontDetailView;
int fontDetailViewHeader;
int fontDetailViewHeaderLarge;
+ int fontEPGInfoWindow;
};
#endif //__NOPACITY_CONFIG_H
\ No newline at end of file diff --git a/displaymenu.c b/displaymenu.c index 9ecec20..902d4d4 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -2,11 +2,8 @@ #include <string> cNopacityDisplayMenu::cNopacityDisplayMenu(void) { - int start = cTimeMs::Now(); config.setDynamicValues(); menuCategoryLast = mcUndefined; - menuSubCategory = mcSubUndefined; - menuSubCategoryLast = mcSubUndefined; FrameTime = config.menuFrameTime; FadeTime = config.menuFadeTime; initial = true; @@ -17,7 +14,6 @@ cNopacityDisplayMenu::cNopacityDisplayMenu(void) { lastTimersState = -1; menuItemIndexLast = -1; currentNumItems = 0; - menuHasIcons = true; detailView = NULL; contentNarrow = true; contentNarrowLast = true; @@ -30,7 +26,6 @@ cNopacityDisplayMenu::cNopacityDisplayMenu(void) { menuView->CreateBackgroundImages(handleBackgrounds, handleButtons); menuView->DrawHeaderLogo(); menuView->DrawBorderDecoration(); - dsyslog("nopacity: Construktor needed %d ms", int(cTimeMs::Now()-start)); } cNopacityDisplayMenu::~cNopacityDisplayMenu() { @@ -106,11 +101,17 @@ void cNopacityDisplayMenu::Scroll(bool Up, bool Page) { int cNopacityDisplayMenu::MaxItems(void) { int maxItems = 0; - if (((MenuCategory() == mcChannel) && (menuSubCategory == mcSubChannelEdit) && (menuSubCategoryLast != mcSubChannelEdit)) - || (menuSubCategory == mcSubScheduleTimer)){ - maxItems = config.numDefaultMenuItems; - } else { - maxItems = menuView->GetMaxItems(MenuCategory()); + switch (MenuCategory()) { + case mcMain: + case mcSetup: + case mcSchedule: + case mcScheduleNow: + case mcScheduleNext: + case mcChannel: + maxItems = menuView->GetMaxItems(MenuCategory()); + break; + default: + maxItems = config.numDefaultMenuItems; } currentNumItems = maxItems; return maxItems; @@ -127,24 +128,52 @@ void cNopacityDisplayMenu::Clear(void) { } void cNopacityDisplayMenu::SetMenuCategory(eMenuCategory MenuCategory) { - /* Categories: - mcUndefined = -1, - mcUnknown = 0, - mcMain = 1, - mcSchedule = 2, - mcChannel = 3, - mcTimer = 4, - mcRecording = 5, - mcPlugin = 6, - mcSetup = 7, - mcCommand = 8, - mcEvent = 9, - mcText = 10, - mcFolder = 11, - mcCam = 12 - */ + /* Categories: + mcUndefined = -1, + mcUnknown = 0, + 1 mcMain, + 2 mcSchedule, + 3 mcScheduleNow, + 4 mcScheduleNext, + 5 mcChannel, + 6 mcChannelEdit, + 7 mcTimer, + 8 mcTimerEdit, + 9 mcRecording, + 10 mcRecordingInfo, + 11 mcPlugin, + 12 mcPluginSetup, + 13 mcSetup, + 14 mcSetupOsd, + 15 mcSetupEpg, + 16 mcSetupDvb, + 17 mcSetupLnb, + 18 mcSetupCam, + 19 mcSetupRecord, + 20 mcSetupReplay, + 21 mcSetupMisc, + 22 mcSetupPlugins, + 23 mcCommand, + 24 mcEvent, + 25 mcText, + 26 mcFolder, + 27 mcCam + */ menuCategoryLast = this->MenuCategory(); + contentNarrowLast = contentNarrow; cSkinDisplayMenu::SetMenuCategory(MenuCategory); + switch (MenuCategory) { + case mcMain: + case mcSchedule: + case mcScheduleNow: + case mcScheduleNext: + case mcChannel: + case mcSetup: + contentNarrow = true; + break; + default: + contentNarrow = false; + } if ((menuCategoryLast == mcMain) && (MenuCategory != mcMain)) { if (config.showDiscUsage) { menuView->ShowDiskUsage(false); @@ -157,95 +186,26 @@ void cNopacityDisplayMenu::SetMenuCategory(eMenuCategory MenuCategory) { timersDrawn = false; } } + esyslog("nopacity: menuCat %d", MenuCategory); } void cNopacityDisplayMenu::SetTitle(const char *Title) { - contentNarrowLast = contentNarrow; - menuSubCategoryLast = menuSubCategory; int left = 5; menuView->DestroyHeaderIcon(); if (Title) { cString title = Title; - if (MenuCategory() == mcMain) { - title = cString::sprintf("%s %s", Title, VDRVERSION); - left += menuView->ShowHeaderLogo(true); - contentNarrow = true; - menuHasIcons = true; - } else { - std::string strTitle = Title; - menuView->ShowHeaderLogo(false); - if (MenuCategory() == mcSchedule) { - //Main Schedule - if (startswith(Title, trVDR("Schedule"))) { - menuSubCategory = mcSubSchedule; - left += menuView->ShowHeaderIconChannelLogo(Title); - menuHasIcons = false; - contentNarrow = true; - //What's on now - } else if ( (strTitle.find(trVDR("Button$Now")) != std::string::npos) - || (strTitle.find(trVDR("What's on now?")) != std::string::npos) ) { - menuSubCategory = mcSubScheduleWhatsOnNow; - left += menuView->DrawHeaderIcon(mcSchedule); - menuHasIcons = true; - contentNarrow = true; - //What's on next - } else if ( (strTitle.find(trVDR("Button$Next")) != std::string::npos) - || (strTitle.find(trVDR("What's on next?")) != std::string::npos) ) { - menuSubCategory = mcSubScheduleWhatsOnNext; - left += menuView->DrawHeaderIcon(mcSchedule); - menuHasIcons = true; - contentNarrow = true; - //EPGSearch search results - } else if ((strTitle.length() > 0) && isdigit(strTitle.at(0))) { - menuSubCategory = mcSubScheduleSearchResults; - left += menuView->DrawHeaderIcon(mcSchedule); - menuHasIcons = true; - contentNarrow = true; - //What's on else - } else if ( ((config.epgSearchConf->UserSet[0]) && (strTitle.find(config.epgSearchConf->User[0]) != std::string::npos)) - ||((config.epgSearchConf->UserSet[1]) && (strTitle.find(config.epgSearchConf->User[1]) != std::string::npos)) - ||((config.epgSearchConf->UserSet[2]) && (strTitle.find(config.epgSearchConf->User[2]) != std::string::npos)) - ||((config.epgSearchConf->UserSet[3]) && (strTitle.find(config.epgSearchConf->User[3]) != std::string::npos))) - { - menuSubCategory = mcSubScheduleWhatsOnElse; - left += menuView->DrawHeaderIcon(mcSchedule); - menuHasIcons = true; - contentNarrow = true; - //hack for epgsearch timer conflict view - } else if (endswith(Title, "%")) { - menuSubCategory = mcSubScheduleTimer; - menuHasIcons = false; - contentNarrow = false; - currentNumItems = config.numDefaultMenuItems; - //EPGSearch Favorites - } else if (strTitle.find(":") != std::string::npos) { - menuSubCategory = mcSubScheduleFavorites; - left += menuView->DrawHeaderIcon(mcSchedule); - menuHasIcons = true; - contentNarrow = true; - - } else { - menuSubCategory = mcSubScheduleTimerconflict; - left += menuView->DrawHeaderIcon(mcSchedule); - menuHasIcons = true; - contentNarrow = true; - } - } else if (MenuCategory() == mcChannel) { - left += menuView->DrawHeaderIcon(mcChannel); - if (startswith(Title, trVDR("Channels"))) { - contentNarrow = true; - menuSubCategory = mcSubChannels; - menuHasIcons = true; - } else { - contentNarrow = false; - menuSubCategory = mcSubChannelEdit; - menuHasIcons = false; - } - } else { + switch (MenuCategory()) { + case mcMain: + title = cString::sprintf("%s %s", Title, VDRVERSION); + left += menuView->ShowHeaderLogo(true); + break; + case mcSchedule: + menuView->ShowHeaderLogo(false); + left += menuView->ShowHeaderIconChannelLogo(Title); + break; + default: + menuView->ShowHeaderLogo(false); left += menuView->DrawHeaderIcon(MenuCategory()); - contentNarrow = false; - menuHasIcons = false; - } } menuView->AdjustContentBackground(contentNarrow, contentNarrowLast); menuView->DrawHeaderLabel(left, title); @@ -283,9 +243,89 @@ void cNopacityDisplayMenu::SetMessage(eMessageType Type, const char *Text) { } } +bool cNopacityDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current, + bool Selectable, const cChannel *Channel, bool WithDate, eTimerMatch TimerMatch) { + if ((initMenu)&&(Index > menuItemIndexLast)) { + cNopacityMenuItem *item = new cNopacityScheduleMenuItem(osd, Event, Channel, TimerMatch, Selectable, MenuCategory()); + cPoint itemSize; + menuView->GetMenuItemSize(MenuCategory(), &itemSize); + item->SetFont(menuView->GetMenuItemFont(mcSchedule)); + item->SetFontSmall(menuView->GetMenuItemFontSmall()); + 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((Channel)?true: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; +} + +bool cNopacityDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current, bool Selectable) { + return false; +} + +bool cNopacityDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool Current, bool Selectable, bool WithProvider) { + if ((initMenu)&&(Index > menuItemIndexLast)) { + cNopacityMenuItem *item = new cNopacityChannelMenuItem(osd, Channel, Selectable); + cPoint itemSize; + menuView->GetMenuItemSize(MenuCategory(), &itemSize); + item->SetFont(menuView->GetMenuItemFont(mcChannel)); + item->SetFontSmall(menuView->GetMenuItemFontSmall()); + int spaceTop = menuView->GetMenuTop(currentNumItems, itemSize.Y()); + item->SetGeometry(Index, spaceTop, menuView->spaceMenu, itemSize.X(), itemSize.Y()); + item->SetCurrent(Current); + item->SetBackgrounds(handleBackgrounds); + item->CreateText(); + int textWidth = item->CheckScrollable(true); + 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; +} + +bool cNopacityDisplayMenu::SetItemRecording(const cRecording *Recording, int Index, bool Current, bool Selectable, + int Level, int Total, int New) { + return false; +} + + void cNopacityDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable) { - int menuIconWidth = 0; - int menuIconHeight = 0; + bool hasIcons = false; cString *strItems = new cString[MaxTabs]; int *tabItems = new int[2*MaxTabs]; for (int i=0; i<MaxTabs; i++) { @@ -298,41 +338,18 @@ void cNopacityDisplayMenu::SetItem(const char *Text, int Index, bool Current, bo if (Index > menuItemIndexLast) { cNopacityMenuItem *item; cPoint itemSize; - if (MenuCategory() == mcMain) { - item = new cNopacityMainMenuItem(osd, Text, Selectable); - menuView->GetMenuItemSize(mcMain, &itemSize); - item->SetFont(menuView->GetMenuItemFont(mcMain)); - menuIconWidth = menuIconHeight = config.iconHeight; - } else if (MenuCategory() == mcSchedule) { - if (menuSubCategory == mcSubScheduleTimer) { + switch (MenuCategory()) { + case mcMain: + case mcSetup: + item = new cNopacityMainMenuItem(osd, Text, Selectable); + menuView->GetMenuItemSize(mcMain, &itemSize); + item->SetFont(menuView->GetMenuItemFont(mcMain)); + hasIcons = true; + break; + default: item = new cNopacityDefaultMenuItem(osd, Text, Selectable); menuView->GetMenuItemSize(mcUnknown, &itemSize); item->SetFont(menuView->GetMenuItemFont(mcUnknown)); - } else { - item = new cNopacityScheduleMenuItem(osd, Text, Selectable, menuSubCategory); - menuView->GetMenuItemSize(mcSchedule, &itemSize); - item->SetFont(menuView->GetMenuItemFont(mcSchedule)); - item->SetFontSmall(menuView->GetMenuItemFontSmall()); - item->SetDisplayMode(); - menuIconWidth = config.menuItemLogoWidth; - menuIconHeight = config.menuItemLogoHeight; - } - } else if (MenuCategory() == mcChannel) { - if (menuSubCategory == mcSubChannels) { - item = new cNopacityChannelMenuItem(osd, Text, Selectable); - menuView->GetMenuItemSize(mcChannel, &itemSize); - item->SetFont(menuView->GetMenuItemFont(mcChannel)); - menuIconWidth = config.menuItemLogoWidth; - menuIconHeight = config.menuItemLogoHeight; - } else { - item = new cNopacityDefaultMenuItem(osd, Text, Selectable); - menuView->GetMenuItemSize(mcUnknown, &itemSize); - item->SetFont(menuView->GetMenuItemFont(mcUnknown)); - } - } else { - item = new cNopacityDefaultMenuItem(osd, Text, Selectable); - menuView->GetMenuItemSize(mcUnknown, &itemSize); - item->SetFont(menuView->GetMenuItemFont(mcUnknown)); } int spaceTop = menuView->GetMenuTop(currentNumItems, itemSize.Y()); item->SetGeometry(Index, spaceTop, menuView->spaceMenu, itemSize.X(), itemSize.Y()); @@ -340,10 +357,11 @@ void cNopacityDisplayMenu::SetItem(const char *Text, int Index, bool Current, bo item->SetBackgrounds(handleBackgrounds); item->SetTabs(strItems, tabItems, MaxTabs); item->CreateText(); - int textWidth = item->CheckScrollable(menuHasIcons); + int textWidth = item->CheckScrollable(hasIcons); item->CreatePixmap(); - if (menuHasIcons) - item->CreatePixmapIcon(menuIconWidth, menuIconHeight); + if (hasIcons) { + item->CreatePixmapIcon(); + } if (textWidth > 0) item->CreatePixmapTextScroller(textWidth); menuItems.Add(item); diff --git a/displaymenu.h b/displaymenu.h index 72ada46..f505b46 100644 --- a/displaymenu.h +++ b/displaymenu.h @@ -7,8 +7,6 @@ private: cNopacityMenuDetailView *detailView; cOsd *osd; eMenuCategory menuCategoryLast; - eMenuSubCategory menuSubCategory; - eMenuSubCategory menuSubCategoryLast; int FrameTime; int FadeTime; bool initial; @@ -19,7 +17,6 @@ private: bool timersDrawn; int menuItemIndexLast; int currentNumItems; - bool menuHasIcons; bool contentNarrow, contentNarrowLast; cList<cNopacityTimer> timers; cList<cNopacityMenuItem> menuItems; @@ -42,6 +39,10 @@ public: virtual void SetButtons(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL); virtual void SetMessage(eMessageType Type, const char *Text); virtual void SetItem(const char *Text, int Index, bool Current, bool Selectable); + virtual bool SetItemEvent(const cEvent *Event, int Index, bool Current, bool Selectable, const cChannel *Channel, bool WithDate, eTimerMatch TimerMatch); + virtual bool SetItemTimer(const cTimer *Timer, int Index, bool Current, bool Selectable); + virtual bool SetItemChannel(const cChannel *Channel, int Index, bool Current, bool Selectable, bool WithProvider); + virtual bool SetItemRecording(const cRecording *Recording, int Index, bool Current, bool Selectable, int Level, int Total, int New); virtual void SetScrollbar(int Total, int Offset); virtual void SetEvent(const cEvent *Event); virtual void SetRecording(const cRecording *Recording); diff --git a/displaymenuview.c b/displaymenuview.c index ce8e7cc..cca0872 100644 --- a/displaymenuview.c +++ b/displaymenuview.c @@ -39,17 +39,7 @@ cNopacityDisplayMenuView::~cNopacityDisplayMenuView(void) { delete fontTimersHead; delete fontButtons; delete fontMessage; -#ifdef USE_YAEPG - if (config.scalePicture) { - tArea availableArea; - availableArea.x1 = -osdLeft; - availableArea.y1 = -osdTop; - availableArea.x2 = osdWidth + osdLeft; - availableArea.y2 = osdHeight + osdTop; - ScalePreserveAspect(osd->vidWin, vidAspect, availableArea); - osd->vidWin.bpp = 12; - } -#endif + delete fontEPGInfoWindow; } cOsd *cNopacityDisplayMenuView::createOsd(void) { @@ -58,7 +48,6 @@ cOsd *cNopacityDisplayMenuView::createOsd(void) { osdWidth = cOsd::OsdWidth(); osdHeight = cOsd::OsdHeight(); osd = CreateOsd(osdLeft, osdTop, osdWidth, osdHeight); - cDevice::PrimaryDevice()->GetVideoSize(vidWidth, vidHeight, vidAspect); return osd; } @@ -82,6 +71,15 @@ void cNopacityDisplayMenuView::SetGeometry(void) { buttonHeight = footerHeight - 3 * buttonsBorder; messageWidth = 0.8 * osdWidth; messageHeight = 0.1 * osdHeight; + SetDescriptionTextWindowSize(); +} + +void cNopacityDisplayMenuView::SetDescriptionTextWindowSize(void) { + int x = 2 * spaceMenu + contentWidthNarrow + widthScrollbar; + int height = config.menuHeightInfoWindow * (contentHeight - 2*spaceMenu) / 100; + int y = headerHeight + (contentHeight - height - spaceMenu); + int width = osdWidth - x - spaceMenu; + textWindowSize = cRect(x,y,width,height); } void cNopacityDisplayMenuView::CreatePixmaps(void) { @@ -139,7 +137,8 @@ void cNopacityDisplayMenuView::CreateFonts(void) { fontTimersHead = cFont::CreateFont(config.fontName, (contentHeight - 3*spaceMenu - diskUsageHeight) / 25 + config.fontTimersHead); fontTimers = cFont::CreateFont(config.fontName, (contentHeight - 3*spaceMenu - diskUsageHeight) / 25 - 6 + config.fontTimers); fontButtons = cFont::CreateFont(config.fontName, buttonHeight*0.8 + config.fontButtons); - fontMessage = cFont::CreateFont(config.fontName, messageHeight / 4 + config.fontMessageMenu); + fontMessage = cFont::CreateFont(config.fontName, messageHeight / 3 + config.fontMessageMenu); + fontEPGInfoWindow = cFont::CreateFont(config.fontName, (config.menuHeightInfoWindow * contentHeight / 100)/ 6 + config.fontEPGInfoWindow); } cFont *cNopacityDisplayMenuView::GetMenuItemFont(eMenuCategory menuCat) { @@ -162,6 +161,10 @@ cFont *cNopacityDisplayMenuView::GetMenuItemFontSmall() { return fontMenuitemScheduleSmall; } +cFont *cNopacityDisplayMenuView::GetEPGWindowFont(void) { + return fontEPGInfoWindow; +} + void cNopacityDisplayMenuView::GetMenuItemSize(eMenuCategory menuCat, cPoint *itemSize) { int itemWidth = 0; int itemHeight = 0; @@ -175,6 +178,8 @@ void cNopacityDisplayMenuView::GetMenuItemSize(eMenuCategory menuCat, cPoint *it itemHeight = menuItemHeightMain; break; case mcSchedule: + case mcScheduleNow: + case mcScheduleNext: itemWidth = menuItemWidthMain; itemHeight = menuItemHeightSchedule; break; @@ -193,13 +198,13 @@ void cNopacityDisplayMenuView::GetMenuItemSize(eMenuCategory menuCat, cPoint *it int cNopacityDisplayMenuView::GetMaxItems(eMenuCategory menuCat) { int maxItems = 0; switch (menuCat) { - case mcUnknown: - maxItems = config.numDefaultMenuItems; - break; case mcMain: + case mcSetup: maxItems = contentHeight / (menuItemHeightMain + spaceMenu); break; - case mcSchedule: + case mcSchedule: + case mcScheduleNow: + case mcScheduleNext: case mcChannel: maxItems = contentHeight / (menuItemHeightSchedule + spaceMenu); break; @@ -297,30 +302,21 @@ void cNopacityDisplayMenuView::DrawBorderDecoration() { void cNopacityDisplayMenuView::AdjustContentBackground(bool contentNarrow, bool contentNarrowLast) { if (contentNarrow) { pixmapContent->SetDrawPortPoint(cPoint(contentWidthNarrow - contentWidthFull, 0)); -#ifdef USE_YAEPG if (config.scalePicture) { - tArea availableArea; - availableArea.x1 = osdLeft + contentWidthNarrow; - availableArea.y1 = osdTop + headerHeight; - availableArea.x2 = contentWidthFull; - availableArea.y2 = availableArea.y1 + contentHeight; - ScalePreserveAspect(osd->vidWin, vidAspect, availableArea); - osd->vidWin.bpp = 12; + // ask output device to scale down + cRect availableRect( + osdLeft + contentWidthNarrow + widthScrollbar + 2 * spaceMenu, + osdTop + headerHeight, + contentWidthFull - osdLeft - contentWidthNarrow - widthScrollbar - 4 * spaceMenu, + contentHeight);// - osdTop - headerHeight); + cDevice::PrimaryDevice()->CanScaleVideo(availableRect); } -#endif } else { pixmapContent->SetDrawPortPoint(cPoint(0, 0)); -#ifdef USE_YAEPG if (config.scalePicture) { - tArea availableArea; - availableArea.x1 = -osdLeft; - availableArea.y1 = -osdTop; - availableArea.x2 = osdWidth + osdLeft; - availableArea.y2 = osdHeight + osdTop; - ScalePreserveAspect(osd->vidWin, vidAspect, availableArea); - osd->vidWin.bpp = 12; + // ask output device to restore full size + cDevice::PrimaryDevice()->CanScaleVideo(cRect::Null); } -#endif } if (contentNarrow != contentNarrowLast) { osd->DestroyPixmap(pixmapScrollbar); @@ -329,27 +325,6 @@ void cNopacityDisplayMenuView::AdjustContentBackground(bool contentNarrow, bool } } -void cNopacityDisplayMenuView::ScalePreserveAspect(tArea & videoWindowDest, const double & videoAspect, const tArea & availableArea) { - videoWindowDest.x1 = availableArea.x1; - videoWindowDest.x2 = availableArea.x2; - videoWindowDest.y1 = availableArea.y1; - videoWindowDest.y2 = availableArea.y2; - if (availableArea.Height() == 0) { - videoWindowDest.bpp = 0; // just for safety - return; - } - double availableAspect = double(availableArea.Width())/double(availableArea.Height()); - if (videoAspect < availableAspect) { - int offset = floor(double(availableArea.Width() - availableArea.Height() * videoAspect)/2); - videoWindowDest.x1 += offset; - videoWindowDest.x2 -= offset; - } else { - int offset = floor(double(availableArea.Height() - availableArea.Width() / videoAspect)/2); - videoWindowDest.y1 += offset; - videoWindowDest.y2 -= offset; - } -} - void cNopacityDisplayMenuView::DrawHeaderLogo(void) { cImageLoader imgLoader; if (imgLoader.LoadIcon("vdrlogo", config.menuHeaderLogoWidth, config.menuHeaderLogoHeight)) { @@ -370,7 +345,8 @@ int cNopacityDisplayMenuView::DrawHeaderIcon(eMenuCategory menuCat) { cString icon; bool drawIcon = true; switch (menuCat) { - case mcSchedule: + case mcScheduleNow: + case mcScheduleNext: icon = "Schedule"; break; case mcChannel: @@ -406,14 +382,18 @@ int cNopacityDisplayMenuView::DrawHeaderIcon(eMenuCategory menuCat) { } int cNopacityDisplayMenuView::ShowHeaderIconChannelLogo(const char *Title) { + int left = 0; pixmapHeaderIcon = osd->CreatePixmap(2, cRect(0, 0, config.menuItemLogoWidth, config.menuItemLogoHeight)); pixmapHeaderIcon->Fill(clrTransparent); std::string channel = Title; + if (channel.length() == 0) + return left; std::string remove = trVDR("Schedule"); - remove.append(" - "); - channel.erase(0, remove.length()); + try { + remove.append(" - "); + channel.erase(0, remove.length()); + } catch (...) {} cImageLoader imgLoader; - int left = 0; if (imgLoader.LoadLogo(channel.c_str(), config.menuItemLogoWidth, config.menuItemLogoHeight)) { pixmapHeaderIcon->DrawImage(cPoint(0, 0), imgLoader.GetImage()); left = config.menuItemLogoWidth + spaceMenu; @@ -635,4 +615,4 @@ void cNopacityDisplayMenuView::SetDetailViewSize(eDetailViewType detailViewType, height = contentHeight; top = headerHeight; detailView->SetGeometry(width, height, top, contentBorder, detailHeaderHeight); -}
\ No newline at end of file +} diff --git a/displaymenuview.h b/displaymenuview.h index 4c0db71..274fd7e 100644 --- a/displaymenuview.h +++ b/displaymenuview.h @@ -42,10 +42,9 @@ class cNopacityDisplayMenuView { cFont *fontTimersHead; cFont *fontButtons; cFont *fontMessage; + cFont *fontEPGInfoWindow; int osdWidth, osdHeight; int osdLeft, osdTop; - int vidWidth, vidHeight; - double vidAspect; int widthScrollbar; int dateWidth; int headerHeight, footerHeight, contentHeight; @@ -58,6 +57,8 @@ class cNopacityDisplayMenuView { int buttonsBorder, buttonWidth, buttonHeight; int messageWidth, messageHeight; int avrgFontWidth; + cRect textWindowSize; + void SetDescriptionTextWindowSize(void); public: cNopacityDisplayMenuView(); virtual ~cNopacityDisplayMenuView(void); @@ -68,6 +69,7 @@ class cNopacityDisplayMenuView { void CreateFonts(void); cFont *GetMenuItemFont(eMenuCategory menuCat); cFont *GetMenuItemFontSmall(void); + cFont *GetEPGWindowFont(void); void GetMenuItemSize(eMenuCategory menuCat, cPoint *itemSize); int GetMaxItems(eMenuCategory menuCat); int GetMenuTop(int numItems, int itemHeight); @@ -78,6 +80,7 @@ class cNopacityDisplayMenuView { int GetWidthDefaultMenu(void) {return menuItemWidthDefault;}; int GetTextAreaWidth(void); const cFont *GetTextAreaFont(bool FixedFont); + cRect *GetDescriptionTextWindowSize(void) {return &textWindowSize;}; void CreateBackgroundImages(int *handleBackgrounds, int *handleButtons); void AdjustContentBackground(bool contentNarrow, bool contentNarrowLast); void DrawBorderDecoration(void); @@ -100,7 +103,6 @@ class cNopacityDisplayMenuView { void DrawMessage(eMessageType Type, const char *Text); void ClearMessage(void); void SetDetailViewSize(eDetailViewType detailViewType, cNopacityMenuDetailView *detailView); - void ScalePreserveAspect(tArea & videoWindowDest, const double & videoAspect, const tArea & availableArea); int spaceMenu; }; diff --git a/epgsearchconf.c b/epgsearchconf.c deleted file mode 100644 index c0ffca5..0000000 --- a/epgsearchconf.c +++ /dev/null @@ -1,317 +0,0 @@ -enum eEpgSearchTokens { eEPGtime = 0, eEPGdate, eEPGdatesh, eEPGtime_w, eEPGtime_d, eEPGtimespan,
- eEPGtitle, eEPGsubtitle, eEPGt_status, eEPGv_status, eEPGr_status,
- eEPGstatus, eEPGchnr, eEPGchsh, eEPGchlng, eEPGprogr, eEPGprogrT2S};
-enum eEPGModes { eMenuSchedule = 0, eMenuWhatsOnNow, eMenuWhatsOnNext, eMenuWhatsOnElse,
- eMenuSearchResults, eMenuFavorites, eMenuTimerconflict};
-
-#include <string>
-#include "epgsearchconf.h"
-
-cNopacityEPGSearchConfig::cNopacityEPGSearchConfig(void) {
- ReplaceSchedule = false;
- ShowChannelNr = false;
- ShowProgress = false;
- for (int i=0; i<4; i++) {
- UserSet[i] = false;
- User[i] = "";
- }
- for (int i=0; i<EPGSEARCHCATS; i++)
- for (int j =0; j<EPGSEARCHTOKENS; j++)
- epgSearchConfig[i][j] = -1;
-
-}
-cNopacityEPGSearchConfig::~cNopacityEPGSearchConfig() {
-}
-
-bool cNopacityEPGSearchConfig::CheckEPGSearchAvailable(void) {
- cPlugin *epgSearchPlugin = NULL;
- epgSearchPlugin = cPluginManager::GetPlugin("epgsearch");
- if (epgSearchPlugin) {
- return true;
- }
- return false;
-}
-
-bool cNopacityEPGSearchConfig::LoadEpgSearchConf(void) {
- std::string ConfigDir = cPlugin::ConfigDirectory(NULL);
- ConfigDir = ConfigDir.substr(0, ConfigDir.find("/plugins"));
- cString vdrSetup = "setup.conf";
- cString fileName = AddDirectory(ConfigDir.c_str(), *vdrSetup);
- if (access(fileName, F_OK) == 0) {
- FILE *f = fopen(fileName, "r");
- if (f) {
- char *s;
- cReadLine ReadLine;
- while ((s = ReadLine.Read(f)) != NULL) {
- char *p = strchr(s, '#');
- if (p)
- *p = 0;
- stripspace(s);
- if (!isempty(s)) {
- std::string line = s;
- if (line.find("epgsearch.ReplaceOrgSchedule = 1") == 0) {
- ReplaceSchedule = true;
- } else if (line.find("epgsearch.ShowChannelNr = 1") == 0) {
- ShowChannelNr = true;
- } else if (line.find("epgsearch.ShowProgress = 1") == 0) {
- ShowProgress = true;
- } else {
- for (int i=0; i<4; i++) {
- cString strEPGUserMode = cString::sprintf("epgsearch.UserMode%dDescription =", i+1);
- if (line.find(*strEPGUserMode) == 0) {
- try {
- line = line.substr(line.find("=")+1);
- line = line.substr(line.find_first_not_of(" "));
- if (line.length() > 0) {
- User[i] = line.c_str();
- UserSet[i] = true;
- }
- } catch (...){}
- }
- }
- }
- }
- }
- }
- } else {
- return false;
- }
- return true;
-}
-
-bool cNopacityEPGSearchConfig::LoadEpgSearchMenuConf(void) {
- cString ConfigDir = cPlugin::ConfigDirectory("epgsearch");
- cString epgsearchConf = "epgsearchmenu.conf";
- cString fileName = AddDirectory(*ConfigDir, *epgsearchConf);
- bool foundMenuWhatsOnNow = false;
- bool foundMenuWhatsOnNext = false;
- bool foundMenuWhatsOnElse = false;
- bool foundMenuSchedule = false;
- bool foundMenuSearchResults = false;
- bool foundMenuFavorites = false;
- if (access(fileName, F_OK) == 0) {
- dsyslog("nopacity: config file %s found", *fileName);
- FILE *f = fopen(fileName, "r");
- if (f) {
- char *s;
- cReadLine ReadLine;
- while ((s = ReadLine.Read(f)) != NULL) {
- char *p = strchr(s, '#');
- if (p)
- *p = 0;
- stripspace(s);
- try {
- if (!isempty(s)) {
- std::string line = s;
- std::string *values = new std::string[MAXITEMTABS];
- if (line.find("MenuWhatsOnNow") == 0) {
- values = SplitEpgSearchMenuLine(line.substr(line.find_first_of("=") + 1));
- SetTokens(values, eMenuWhatsOnNow);
- foundMenuWhatsOnNow = true;
- } else if (line.find("MenuWhatsOnNext") == 0) {
- values = SplitEpgSearchMenuLine(line.substr(line.find_first_of("=") + 1));
- SetTokens(values, eMenuWhatsOnNext);
- foundMenuWhatsOnNext = true;
- } else if (line.find("MenuWhatsOnElse") == 0) {
- values = SplitEpgSearchMenuLine(line.substr(line.find_first_of("=") + 1));
- SetTokens(values, eMenuWhatsOnElse);
- foundMenuWhatsOnElse = true;
- } else if (line.find("MenuSchedule") == 0) {
- values = SplitEpgSearchMenuLine(line.substr(line.find_first_of("=") + 1));
- SetTokens(values, eMenuSchedule);
- foundMenuSchedule = true;
- } else if (line.find("MenuSearchResults") == 0) {
- values = SplitEpgSearchMenuLine(line.substr(line.find_first_of("=") + 1));
- SetTokens(values, eMenuSearchResults);
- foundMenuSearchResults = true;
- } else if (line.find("MenuFavorites") == 0) {
- values = SplitEpgSearchMenuLine(line.substr(line.find_first_of("=") + 1));
- SetTokens(values, eMenuFavorites);
- foundMenuFavorites = true;
- }
- delete[] values;
- }
- } catch (...){}
- }
- }
- if (!foundMenuWhatsOnNow ||
- !foundMenuWhatsOnNext ||
- !foundMenuWhatsOnElse ||
- !foundMenuSchedule ||
- !foundMenuSearchResults ||
- !foundMenuFavorites)
- {
- dsyslog("nopacity: config file not complete, using default");
- return false;
- }
- } else {
- dsyslog("nopacity: %s not available, using epgsearch default settings", *fileName);
- return false;
- }
- dsyslog("nopacity: config file complete");
- return true;
-}
-
-std::string *cNopacityEPGSearchConfig::SplitEpgSearchMenuLine(std::string line) {
- size_t posSeparator = -1;
- bool found = false;
- posSeparator = line.find_first_of("|") + 1;
- std::string *values = new std::string[MAXITEMTABS];
- for (int i=0; i < MAXITEMTABS; i++)
- values[i] = "";
- std::string value;
- int i=0;
- while (posSeparator > 0) {
- found = true;
- try {
- value = line.substr(0, posSeparator);
- value = value.substr(0, value.find_first_of(":"));
- value = value.substr(value.find_first_not_of(" "));
- value = value.substr(0, value.find_last_not_of(" ")+1);
- values[i] = value;
- line = line.substr(posSeparator);
- posSeparator = line.find_first_of("|") + 1;
- } catch (...) {}
- i++;
- }
- if (found) {
- try {
- value = line.substr(0, line.find_first_of(":"));
- value = value.substr(value.find_first_not_of(" "));
- value = value.substr(0, value.find_last_not_of(" ")+1);
- values[i] = value;
- } catch (...) {}
- }
- return values;
-}
-
-void cNopacityEPGSearchConfig::SetTokens(std::string *values, eEPGModes mode) {
- for (int i=0; i<MAXITEMTABS; i++) {
- toLowerCase(values[i]);
- if (values[i].find("%time%") == 0)
- epgSearchConfig[mode][eEPGtime] = i;
- else if (values[i].find("%date%") == 0)
- epgSearchConfig[mode][eEPGdate] = i;
- else if (values[i].find("%datesh%") == 0)
- epgSearchConfig[mode][eEPGdatesh] = i;
- else if (values[i].find("%time_w%") == 0)
- epgSearchConfig[mode][eEPGtime_w] = i;
- else if (values[i].find("%time_d%") == 0)
- epgSearchConfig[mode][eEPGtime_d] = i;
- else if (values[i].find("%timespan%") == 0)
- epgSearchConfig[mode][eEPGtimespan] = i;
- else if (values[i].find("%title%") == 0)
- epgSearchConfig[mode][eEPGtitle] = i;
- else if (values[i].find("%subtitle%") == 0)
- epgSearchConfig[mode][eEPGsubtitle] = i;
- else if (values[i].find("%t_status%") == 0)
- epgSearchConfig[mode][eEPGt_status] = i;
- else if (values[i].find("%v_status%") == 0)
- epgSearchConfig[mode][eEPGv_status] = i;
- else if (values[i].find("%r_status%") == 0)
- epgSearchConfig[mode][eEPGr_status] = i;
- else if (values[i].find("%status%") == 0)
- epgSearchConfig[mode][eEPGstatus] = i;
- else if (values[i].find("%chnr%") == 0)
- epgSearchConfig[mode][eEPGchnr] = i;
- else if (values[i].find("%chsh%") == 0)
- epgSearchConfig[mode][eEPGchsh] = i;
- else if (values[i].find("%chlng%") == 0)
- epgSearchConfig[mode][eEPGchlng] = i;
- else if (values[i].find("%progr%") == 0)
- epgSearchConfig[mode][eEPGprogr] = i;
- else if (values[i].find("%progrt2s%") == 0)
- epgSearchConfig[mode][eEPGprogrT2S] = i;
- }
-
-}
-
-void cNopacityEPGSearchConfig::SetDefaultEPGSearchConf(void) {
- //MenuSchedule
- epgSearchConfig[eMenuSchedule][eEPGtime_w] = 0;
- epgSearchConfig[eMenuSchedule][eEPGtime] = 1;
- epgSearchConfig[eMenuSchedule][eEPGstatus] = 2;
- epgSearchConfig[eMenuSchedule][eEPGtitle] = 3;
- //MenuWhatsOnNow
- int i=0;
- if (ShowChannelNr)
- epgSearchConfig[eMenuWhatsOnNow][eEPGchnr] = i++;
- epgSearchConfig[eMenuWhatsOnNow][eEPGchsh] = i++;
- epgSearchConfig[eMenuWhatsOnNow][eEPGtime] = i++;
- if(ShowProgress)
- epgSearchConfig[eMenuWhatsOnNow][eEPGprogrT2S] = i++;
- else
- epgSearchConfig[eMenuWhatsOnNow][eEPGprogr] = i++;
- epgSearchConfig[eMenuWhatsOnNow][eEPGstatus] = i++;
- epgSearchConfig[eMenuWhatsOnNow][eEPGtitle] = i++;
- //MenuWhatsOnNext
- i=0;
- if (ShowChannelNr)
- epgSearchConfig[eMenuWhatsOnNext][eEPGchnr] = i++;
- epgSearchConfig[eMenuWhatsOnNext][eEPGchsh] = i++;
- epgSearchConfig[eMenuWhatsOnNext][eEPGtime] = i++;
- epgSearchConfig[eMenuWhatsOnNext][eEPGstatus] = i++;
- epgSearchConfig[eMenuWhatsOnNext][eEPGtitle] = i++;
- //MenuWhatsOnElse
- i=0;
- if (ShowChannelNr)
- epgSearchConfig[eMenuWhatsOnElse][eEPGchnr] = i++;
- epgSearchConfig[eMenuWhatsOnElse][eEPGchsh] = i++;
- epgSearchConfig[eMenuWhatsOnElse][eEPGtime] = i++;
- epgSearchConfig[eMenuWhatsOnElse][eEPGstatus] = i++;
- epgSearchConfig[eMenuWhatsOnElse][eEPGtitle] = i++;
- //MenuSearchResults
- i=0;
- if (ShowChannelNr)
- epgSearchConfig[eMenuSearchResults][eEPGchnr] = i++;
- epgSearchConfig[eMenuSearchResults][eEPGchsh] = i++;
- epgSearchConfig[eMenuSearchResults][eEPGdatesh] = i++;
- epgSearchConfig[eMenuSearchResults][eEPGtime] = i++;
- epgSearchConfig[eMenuSearchResults][eEPGstatus] = i++;
- epgSearchConfig[eMenuSearchResults][eEPGtitle] = i++;
- //MenuFavorites
- i=0;
- if (ShowChannelNr)
- epgSearchConfig[eMenuFavorites][eEPGchnr] = i++;
- epgSearchConfig[eMenuFavorites][eEPGchsh] = i++;
- epgSearchConfig[eMenuFavorites][eEPGtime] = i++;
- epgSearchConfig[eMenuFavorites][eEPGtimespan] = i++;
- epgSearchConfig[eMenuFavorites][eEPGstatus] = i++;
- epgSearchConfig[eMenuFavorites][eEPGtitle] = i++;
-}
-
-void cNopacityEPGSearchConfig::SetTimerConfilictCont(void) {
- epgSearchConfig[eMenuTimerconflict][eEPGtime_d] = 0;
- epgSearchConfig[eMenuTimerconflict][eEPGchsh] = 1;
- epgSearchConfig[eMenuTimerconflict][eEPGdate] = 2;
- epgSearchConfig[eMenuTimerconflict][eEPGtime] = 3;
- epgSearchConfig[eMenuTimerconflict][eEPGtitle] = 4;
-}
-
-void cNopacityEPGSearchConfig::SetDefaultVDRConf(void) {
- //MenuSchedule
- epgSearchConfig[eMenuSchedule][eEPGdate] = 0;
- epgSearchConfig[eMenuSchedule][eEPGtime] = 1;
- epgSearchConfig[eMenuSchedule][eEPGstatus] = 2;
- epgSearchConfig[eMenuSchedule][eEPGtitle] = 3;
- //MenuWhatsOnNow
- epgSearchConfig[eMenuWhatsOnNow][eEPGchnr] = 0;
- epgSearchConfig[eMenuWhatsOnNow][eEPGchlng] = 1;
- epgSearchConfig[eMenuWhatsOnNow][eEPGtime] = 2;
- epgSearchConfig[eMenuWhatsOnNow][eEPGstatus] = 3;
- epgSearchConfig[eMenuWhatsOnNow][eEPGtitle] = 4;
- //MenuWhatsOnNext
- epgSearchConfig[eMenuWhatsOnNext][eEPGchnr] = 0;
- epgSearchConfig[eMenuWhatsOnNext][eEPGchlng] = 1;
- epgSearchConfig[eMenuWhatsOnNext][eEPGtime] = 2;
- epgSearchConfig[eMenuWhatsOnNext][eEPGstatus] = 3;
- epgSearchConfig[eMenuWhatsOnNext][eEPGtitle] = 4;
-}
-
-
-void cNopacityEPGSearchConfig::toLowerCase(std::string &str) {
- const int length = str.length();
- for(int i=0; i < length; ++i) {
- str[i] = std::tolower(str[i]);
- }
-}
\ No newline at end of file diff --git a/epgsearchconf.h b/epgsearchconf.h deleted file mode 100644 index 724437b..0000000 --- a/epgsearchconf.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __NOPACITY_EPGSEARCHCONFIG_H
-#define __NOPACITY_EPGSEARCHCONFIG_H
-
-#define EPGSEARCHCATS 7
-#define EPGSEARCHTOKENS 17
-#define MAXITEMTABS 6
-
-class cNopacityEPGSearchConfig {
- private:
- bool ReplaceSchedule;
- bool ShowChannelNr;
- bool ShowProgress;
- std::string *SplitEpgSearchMenuLine(std::string line);
- void SetTokens(std::string *values, eEPGModes mode);
- void toLowerCase(std::string &str);
- public:
- cNopacityEPGSearchConfig(void);
- virtual ~cNopacityEPGSearchConfig();
- bool CheckEPGSearchAvailable(void);
- bool ReplaceScheduleActive(void) {return ReplaceSchedule;};
- bool LoadEpgSearchConf(void);
- bool LoadEpgSearchMenuConf(void);
- void SetDefaultEPGSearchConf(void);
- void SetDefaultVDRConf(void);
- void SetTimerConfilictCont(void);
- bool UserSet[4];
- cString User[4];
- int epgSearchConfig[EPGSEARCHCATS][EPGSEARCHTOKENS];
-};
-
-#endif //__NOPACITY_EPGSEARCHCONFIG_H
\ No newline at end of file diff --git a/icons/CAM.png b/icons/CAM.png Binary files differnew file mode 100644 index 0000000..ef3f66a --- /dev/null +++ b/icons/CAM.png diff --git a/icons/DVB.png b/icons/DVB.png Binary files differnew file mode 100644 index 0000000..7c6cb4e --- /dev/null +++ b/icons/DVB.png diff --git a/icons/EPG.png b/icons/EPG.png Binary files differnew file mode 100644 index 0000000..9bfaf90 --- /dev/null +++ b/icons/EPG.png diff --git a/icons/LNB.png b/icons/LNB.png Binary files differnew file mode 100644 index 0000000..a275f3a --- /dev/null +++ b/icons/LNB.png diff --git a/icons/Miscellaneous.png b/icons/Miscellaneous.png Binary files differnew file mode 100644 index 0000000..e32b6c5 --- /dev/null +++ b/icons/Miscellaneous.png diff --git a/icons/OSD.png b/icons/OSD.png Binary files differnew file mode 100644 index 0000000..076e066 --- /dev/null +++ b/icons/OSD.png diff --git a/icons/Plugins.png b/icons/Plugins.png Binary files differnew file mode 100644 index 0000000..a7f3437 --- /dev/null +++ b/icons/Plugins.png diff --git a/icons/Recording.png b/icons/Recording.png Binary files differnew file mode 100644 index 0000000..4467dfc --- /dev/null +++ b/icons/Recording.png diff --git a/icons/Replay.png b/icons/Replay.png Binary files differnew file mode 100644 index 0000000..450e754 --- /dev/null +++ b/icons/Replay.png diff --git a/icons/Restart.png b/icons/Restart.png Binary files differnew file mode 100644 index 0000000..de21eaa --- /dev/null +++ b/icons/Restart.png diff --git a/icons/activetimer.png b/icons/activetimer.png Binary files differnew file mode 100644 index 0000000..8637ce3 --- /dev/null +++ b/icons/activetimer.png diff --git a/icons/activetimersmall.png b/icons/activetimersmall.png Binary files differnew file mode 100644 index 0000000..c6d78b1 --- /dev/null +++ b/icons/activetimersmall.png diff --git a/icons/alternative/Channels.png b/icons/alternative/Channels.png Binary files differnew file mode 100644 index 0000000..538a621 --- /dev/null +++ b/icons/alternative/Channels.png diff --git a/icons/alternative/Info.png b/icons/alternative/Info.png Binary files differnew file mode 100644 index 0000000..d4cd061 --- /dev/null +++ b/icons/alternative/Info.png diff --git a/icons/alternative/Recordings.png b/icons/alternative/Recordings.png Binary files differnew file mode 100644 index 0000000..57fdca1 --- /dev/null +++ b/icons/alternative/Recordings.png diff --git a/icons/alternative/Recordings1.png b/icons/alternative/Recordings1.png Binary files differnew file mode 100644 index 0000000..5154d07 --- /dev/null +++ b/icons/alternative/Recordings1.png diff --git a/icons/alternative/Recordings2.png b/icons/alternative/Recordings2.png Binary files differnew file mode 100644 index 0000000..800886d --- /dev/null +++ b/icons/alternative/Recordings2.png diff --git a/icons/alternative/Schedule.png b/icons/alternative/Schedule.png Binary files differnew file mode 100644 index 0000000..72c5dee --- /dev/null +++ b/icons/alternative/Schedule.png diff --git a/icons/alternative/System.png b/icons/alternative/System.png Binary files differnew file mode 100644 index 0000000..d910bb6 --- /dev/null +++ b/icons/alternative/System.png diff --git a/icons/alternative/System2.png b/icons/alternative/System2.png Binary files differnew file mode 100644 index 0000000..c71e773 --- /dev/null +++ b/icons/alternative/System2.png diff --git a/icons/alternative/System3.png b/icons/alternative/System3.png Binary files differnew file mode 100644 index 0000000..ae5080b --- /dev/null +++ b/icons/alternative/System3.png diff --git a/icons/alternative/Timers.png b/icons/alternative/Timers.png Binary files differnew file mode 100644 index 0000000..b17b3cc --- /dev/null +++ b/icons/alternative/Timers.png @@ -8,7 +8,6 @@ cNopacityMenuItem::cNopacityMenuItem(cOsd *osd, const char *text, bool sel) { this->osd = osd; - hasIcon = false; drawn = false; Text = text; selectable = sel; @@ -19,6 +18,7 @@ cNopacityMenuItem::cNopacityMenuItem(cOsd *osd, const char *text, bool sel) { tabWidth = NULL; pixmapIcon = NULL; pixmapTextScroller = NULL; + infoTextWindow = NULL; } cNopacityMenuItem::~cNopacityMenuItem(void) { @@ -34,6 +34,9 @@ cNopacityMenuItem::~cNopacityMenuItem(void) { if (pixmapTextScroller) { osd->DestroyPixmap(pixmapTextScroller); } + if (infoTextWindow) { + delete infoTextWindow; + } } void cNopacityMenuItem::SetCurrent(bool cur) { @@ -53,10 +56,9 @@ void cNopacityMenuItem::CreatePixmap() { pixmap = osd->CreatePixmap(3, cRect(left, top + index * (height + left), width, height)); } -void cNopacityMenuItem::CreatePixmapIcon(int iconWidth, int iconHeight) { - pixmapIcon = osd->CreatePixmap(5, cRect(left, top + index * (height + left), iconWidth, iconHeight)); +void cNopacityMenuItem::CreatePixmapIcon(void) { + pixmapIcon = osd->CreatePixmap(5, cRect(left, top + index * (height + left), width, height)); pixmapIcon->Fill(clrTransparent); - hasIcon = true; } void cNopacityMenuItem::CreatePixmapTextScroller(int totalWidth) { @@ -100,9 +102,8 @@ void cNopacityMenuItem::DrawDelimiter(const char *del, const char *icon, int han } void cNopacityMenuItem::Action(void) { - int sleepTime = 10; - for (int i = 0; Running() && (i*sleepTime < config.menuScrollDelay); i++) - cCondWait::SleepMs(sleepTime); + int scrollDelay = config.menuScrollDelay * 1000; + DoSleep(scrollDelay); cPixmap::Lock(); if (Running()) SetTextFull(); @@ -110,16 +111,23 @@ void cNopacityMenuItem::Action(void) { int drawPortX; int FrameTime = config.menuScrollFrameTime; int maxX = pixmapTextScroller->DrawPort().Width() - pixmapTextScroller->ViewPort().Width(); + bool doSleep = false; while (Running()) { + if (doSleep) { + DoSleep(scrollDelay); + doSleep = false; + } uint64_t Now = cTimeMs::Now(); cPixmap::Lock(); drawPortX = pixmapTextScroller->DrawPort().X(); drawPortX -= 1; + cPixmap::Unlock(); if (abs(drawPortX) > maxX) { - for (int i = 0; Running() && (i*sleepTime < config.menuScrollDelay); i++) - cCondWait::SleepMs(sleepTime); + DoSleep(scrollDelay); drawPortX = 0; + doSleep = true; } + cPixmap::Lock(); if (Running()) pixmapTextScroller->SetDrawPortPoint(cPoint(drawPortX, 0)); cPixmap::Unlock(); @@ -131,6 +139,12 @@ void cNopacityMenuItem::Action(void) { } } +void cNopacityMenuItem::DoSleep(int duration) { + int sleepSlice = 10; + for (int i = 0; Running() && (i*sleepSlice < duration); i++) + cCondWait::SleepMs(sleepSlice); +} + // cNopacityMainMenuItem ------------- cNopacityMainMenuItem::cNopacityMainMenuItem(cOsd *osd, const char *text, bool sel) : cNopacityMenuItem (osd, text, sel) { } @@ -138,11 +152,12 @@ cNopacityMainMenuItem::cNopacityMainMenuItem(cOsd *osd, const char *text, bool s cNopacityMainMenuItem::~cNopacityMainMenuItem(void) { } -std::string cNopacityMainMenuItem::items[6] = {"Schedule", "Channels", "Timers", "Recordings", "Setup", "Commands"}; +std::string cNopacityMainMenuItem::items[16] = { "Schedule", "Channels", "Timers", "Recordings", "Setup", "Commands", + "OSD", "EPG", "DVB", "LNB", "CAM", "Recording", "Replay", "Miscellaneous", "Plugins", "Restart"}; cString cNopacityMainMenuItem::GetIconName() { std::string element = *menuEntry; - for (int i=0; i<6; i++) { + for (int i=0; i<16; i++) { std::string s = trVDR(items[i].c_str()); if (s == element) return items[i].c_str(); @@ -151,10 +166,10 @@ cString cNopacityMainMenuItem::GetIconName() { } void cNopacityMainMenuItem::CreatePixmapTextScroller(int totalWidth) { + int pixmapLeft = left + config.iconHeight + 10; + int pixmapWidth = width - config.iconHeight - 10; int drawPortWidth = totalWidth + 10; - if (hasIcon) - drawPortWidth += config.iconHeight + 10; - pixmapTextScroller = osd->CreatePixmap(4, cRect(left, top + index * (height + left), width, height), cRect(0, 0, drawPortWidth, height)); + pixmapTextScroller = osd->CreatePixmap(4, cRect(pixmapLeft, top + index * (height + left), pixmapWidth, height), cRect(0, 0, drawPortWidth, height)); pixmapTextScroller->Fill(clrTransparent); } @@ -165,6 +180,12 @@ void cNopacityMainMenuItem::CreateText() { size_t i = 0; for (; i < text.length(); i++) { char s = text.at(i); + if (i==0) { + //if text directly starts with nonnumeric, break + if (!(s >= '0' && s <= '9')) { + break; + } + } if (found) { if (!(s >= '0' && s <= '9')) { doBreak = true; @@ -211,7 +232,7 @@ int cNopacityMainMenuItem::CheckScrollable(bool hasIcon) { void cNopacityMainMenuItem::SetTextFull(void) { tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); pixmapTextScroller->Fill(clrTransparent); - int x = config.iconHeight; + int x = 0; int numberTotalWidth = font->Width("xxx"); int numberWidth = font->Width(*menuNumber); pixmapTextScroller->DrawText(cPoint(x + (numberTotalWidth - numberWidth)/2, (height - font->Height())/2), *menuNumber, clrFont, clrTransparent, font); @@ -222,7 +243,7 @@ void cNopacityMainMenuItem::SetTextFull(void) { void cNopacityMainMenuItem::SetTextShort(void) { tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); pixmapTextScroller->Fill(clrTransparent); - int x = config.iconHeight; + int x = 0; int numberTotalWidth = font->Width("xxx"); int numberWidth = font->Width(*menuNumber); pixmapTextScroller->DrawText(cPoint(x + (numberTotalWidth - numberWidth)/2, (height - font->Height())/2), *menuNumber, clrFont, clrTransparent, font); @@ -259,17 +280,19 @@ void cNopacityMainMenuItem::Render() { // cNopacityScheduleMenuItem ------------- -cNopacityScheduleMenuItem::cNopacityScheduleMenuItem(cOsd *osd, const char *text, bool sel, eMenuSubCategory subCat) : cNopacityMenuItem (osd, text, sel) { - subCategory = subCat; +cNopacityScheduleMenuItem::cNopacityScheduleMenuItem(cOsd *osd, const cEvent *Event, const cChannel *Channel, eTimerMatch TimerMatch, bool sel, eMenuCategory category) +: cNopacityMenuItem (osd, "", sel) { + this->category = category; + this->Event = Event; + this->Channel = Channel; + this->TimerMatch = TimerMatch; strDateTime = ""; strTitle = ""; strSubTitle = ""; strTitleFull = ""; strSubTitleFull = ""; - strProgressbar = ""; - hasProgressBar = false; - hasLogo = false; - delimiterType = "daydelimiter"; + scrollTitle = false; + scrollSubTitle = false; } cNopacityScheduleMenuItem::~cNopacityScheduleMenuItem(void) { @@ -277,116 +300,30 @@ cNopacityScheduleMenuItem::~cNopacityScheduleMenuItem(void) { void cNopacityScheduleMenuItem::CreatePixmapTextScroller(int totalWidth) { int drawPortWidth = totalWidth + 10; - if (hasIcon) - drawPortWidth += config.menuItemLogoWidth + 10; - pixmapTextScroller = osd->CreatePixmap(4, cRect(left, top + index * (height + left), width, height), cRect(0, 0, drawPortWidth, height)); - pixmapTextScroller->Fill(clrTransparent); -} - -void cNopacityScheduleMenuItem::SetDisplayMode(void) { - switch (subCategory) { - case mcSubSchedule: - mode = eMenuSchedule; - break; - case mcSubScheduleWhatsOnNow: - mode = eMenuWhatsOnNow; - hasLogo = true; - delimiterType = "Channelseparator"; - break; - case mcSubScheduleWhatsOnNext: - mode = eMenuWhatsOnNext; - hasLogo = true; - delimiterType = "Channelseparator"; - break; - case mcSubScheduleSearchResults: - mode = eMenuSearchResults; - hasLogo = true; - delimiterType = "Channelseparator"; - break; - case mcSubScheduleWhatsOnElse: - mode = eMenuWhatsOnElse; - hasLogo = true; - break; - case mcSubScheduleFavorites: - mode = eMenuFavorites; - hasLogo = true; - break; - case mcSubScheduleTimerconflict: - mode = eMenuTimerconflict; - hasLogo = true; - break; - default: - mode = eMenuSchedule; - break; + int pixmapLeft = left; + int pixmapWidth = width; + if (Channel) { + pixmapLeft += config.menuItemLogoWidth + 5; + pixmapWidth = pixmapWidth - config.menuItemLogoWidth - 5; } + pixmapTextScroller = osd->CreatePixmap(4, cRect(pixmapLeft, top + index * (height + left), pixmapWidth, height), cRect(0, 0, drawPortWidth, height)); + pixmapTextScroller->Fill(clrTransparent); } void cNopacityScheduleMenuItem::CreateText() { std::stringstream sstrDateTime; - //Build Date & Time & Status - if ((config.epgSearchConf->epgSearchConfig[mode][eEPGtime_d] > -1) - &&(config.epgSearchConf->epgSearchConfig[mode][eEPGtime_d] < MAXITEMTABS)) - sstrDateTime << *itemTabs[config.epgSearchConf->epgSearchConfig[mode][eEPGtime_d]] << " "; - if ((config.epgSearchConf->epgSearchConfig[mode][eEPGtime_w] > -1) - &&(config.epgSearchConf->epgSearchConfig[mode][eEPGtime_w] < MAXITEMTABS)) - sstrDateTime << *itemTabs[config.epgSearchConf->epgSearchConfig[mode][eEPGtime_w]] << " "; - if ((config.epgSearchConf->epgSearchConfig[mode][eEPGdate] > -1) - &&(config.epgSearchConf->epgSearchConfig[mode][eEPGdate] < MAXITEMTABS)) - sstrDateTime << *itemTabs[config.epgSearchConf->epgSearchConfig[mode][eEPGdate]] << " "; - if ((config.epgSearchConf->epgSearchConfig[mode][eEPGdatesh] > -1) - &&(config.epgSearchConf->epgSearchConfig[mode][eEPGdatesh] < MAXITEMTABS)) - sstrDateTime << *itemTabs[config.epgSearchConf->epgSearchConfig[mode][eEPGdatesh]] << " "; - if ((config.epgSearchConf->epgSearchConfig[mode][eEPGtime] > -1) - &&(config.epgSearchConf->epgSearchConfig[mode][eEPGtime] < MAXITEMTABS)) - sstrDateTime << *itemTabs[config.epgSearchConf->epgSearchConfig[mode][eEPGtime]] << " "; - if ((config.epgSearchConf->epgSearchConfig[mode][eEPGtimespan] > -1) - &&(config.epgSearchConf->epgSearchConfig[mode][eEPGtimespan] < MAXITEMTABS)) - sstrDateTime << *itemTabs[config.epgSearchConf->epgSearchConfig[mode][eEPGtimespan]] << " "; - if ((config.epgSearchConf->epgSearchConfig[mode][eEPGstatus] > -1) - &&(config.epgSearchConf->epgSearchConfig[mode][eEPGstatus] < MAXITEMTABS)) - sstrDateTime << *itemTabs[config.epgSearchConf->epgSearchConfig[mode][eEPGstatus]] << " "; - if ((config.epgSearchConf->epgSearchConfig[mode][eEPGt_status] > -1) - &&(config.epgSearchConf->epgSearchConfig[mode][eEPGt_status] < MAXITEMTABS)) - sstrDateTime << *itemTabs[config.epgSearchConf->epgSearchConfig[mode][eEPGt_status]] << " "; - if ((config.epgSearchConf->epgSearchConfig[mode][eEPGv_status] > -1) - &&(config.epgSearchConf->epgSearchConfig[mode][eEPGv_status] < MAXITEMTABS)) - sstrDateTime << *itemTabs[config.epgSearchConf->epgSearchConfig[mode][eEPGv_status]] << " "; - if ((config.epgSearchConf->epgSearchConfig[mode][eEPGr_status] > -1) - &&(config.epgSearchConf->epgSearchConfig[mode][eEPGr_status] < MAXITEMTABS)) - sstrDateTime << *itemTabs[config.epgSearchConf->epgSearchConfig[mode][eEPGr_status]] << " "; + time_t now = time(NULL); + std::string dayNow = *WeekDayName(now); + std::string dayEvent = *WeekDayName(Event->StartTime()); + if ((Event->StartTime() - now > 86400) || (dayNow != dayEvent)) + sstrDateTime << dayEvent << " "; + sstrDateTime << *Event->GetTimeString(); + sstrDateTime << " - " << *Event->GetEndTimeString(); strDateTime = sstrDateTime.str(); - //Build title and subtitle - if ((config.epgSearchConf->epgSearchConfig[mode][eEPGtitle] > -1) - &&(config.epgSearchConf->epgSearchConfig[mode][eEPGtitle] < MAXITEMTABS)) { - strTitle = *itemTabs[config.epgSearchConf->epgSearchConfig[mode][eEPGtitle]]; - if ((config.epgSearchConf->epgSearchConfig[mode][eEPGsubtitle] > -1) - &&(config.epgSearchConf->epgSearchConfig[mode][eEPGsubtitle] < MAXITEMTABS)) { - strSubTitle = *itemTabs[config.epgSearchConf->epgSearchConfig[mode][eEPGsubtitle]]; - } else { - size_t delimiter = strTitle.find("~"); - if (delimiter != std::string::npos) { - strSubTitle = strTitle.substr(delimiter+2); - strTitle = strTitle.substr(0, delimiter); - } else { - strSubTitle = ""; - } - } - } - //Build Channel Name - if ((config.epgSearchConf->epgSearchConfig[mode][eEPGchlng] > -1) - &&(config.epgSearchConf->epgSearchConfig[mode][eEPGchlng] < MAXITEMTABS)) - strChannelName = *itemTabs[config.epgSearchConf->epgSearchConfig[mode][eEPGchlng]]; - else if ((config.epgSearchConf->epgSearchConfig[mode][eEPGchsh] > -1) - &&(config.epgSearchConf->epgSearchConfig[mode][eEPGchsh] < MAXITEMTABS)) - strChannelName = *itemTabs[config.epgSearchConf->epgSearchConfig[mode][eEPGchsh]]; - else - strChannelName = " "; - //Build Progressbar - if ((config.epgSearchConf->epgSearchConfig[mode][eEPGprogrT2S] > -1) - &&(config.epgSearchConf->epgSearchConfig[mode][eEPGprogrT2S] < MAXITEMTABS)) { - strProgressbar = *itemTabs[config.epgSearchConf->epgSearchConfig[mode][eEPGprogrT2S]]; - hasProgressBar = true; - } + if (Event->Title()) + strTitle = Event->Title(); + if (Event->ShortText()) + strSubTitle = Event->ShortText(); } int cNopacityScheduleMenuItem::CheckScrollable(bool hasIcon) { @@ -396,6 +333,7 @@ int cNopacityScheduleMenuItem::CheckScrollable(bool hasIcon) { int totalTextWidth = width - spaceLeft; if (font->Width(strTitle.c_str()) > (width - spaceLeft)) { scrollable = true; + scrollTitle = true; totalTextWidth = max(font->Width(strTitle.c_str()), totalTextWidth); strTitleFull = strTitle.c_str(); strSubTitleFull = strSubTitle.c_str(); @@ -411,6 +349,7 @@ int cNopacityScheduleMenuItem::CheckScrollable(bool hasIcon) { strTitleFull = strTitle.c_str(); strSubTitleFull = strSubTitle.c_str(); } + scrollSubTitle = true; totalTextWidth = max(fontSmall->Width(strSubTitle.c_str()), totalTextWidth); cTextWrapper twSubtitle; std::stringstream sstrSubtitle; @@ -424,55 +363,33 @@ int cNopacityScheduleMenuItem::CheckScrollable(bool hasIcon) { void cNopacityScheduleMenuItem::SetTextFull(void) { pixmapTextScroller->Fill(clrTransparent); - pixmapTextScroller->DrawText(cPoint(textLeft, 3), strDateTime.c_str(), Theme.Color(clrMenuFontMenuItem), clrTransparent, font); - pixmapTextScroller->DrawText(cPoint(textLeft, titleY), strTitleFull.c_str(), Theme.Color(clrMenuFontMenuItemTitle), clrTransparent, font); - pixmapTextScroller->DrawText(cPoint(textLeft, titleY + font->Height() - 2), strSubTitleFull.c_str(), Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall); + if (scrollTitle) + pixmapTextScroller->DrawText(cPoint(5, titleY), strTitleFull.c_str(), Theme.Color(clrMenuFontMenuItemTitle), clrTransparent, font); + if (scrollSubTitle) + pixmapTextScroller->DrawText(cPoint(5, titleY + font->Height() - 2), strSubTitleFull.c_str(), Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall); } void cNopacityScheduleMenuItem::SetTextShort(void) { pixmapTextScroller->Fill(clrTransparent); - pixmapTextScroller->DrawText(cPoint(textLeft, 3), strDateTime.c_str(), Theme.Color(clrMenuFontMenuItem), clrTransparent, font); - pixmapTextScroller->DrawText(cPoint(textLeft, titleY), strTitle.c_str(), Theme.Color(clrMenuFontMenuItemTitle), clrTransparent, font); - pixmapTextScroller->DrawText(cPoint(textLeft, titleY + font->Height() - 2), strSubTitle.c_str(), Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall); + if (scrollTitle) + pixmapTextScroller->DrawText(cPoint(5, titleY), strTitle.c_str(), Theme.Color(clrMenuFontMenuItemTitle), clrTransparent, font); + if (scrollSubTitle) + pixmapTextScroller->DrawText(cPoint(5, titleY + font->Height() - 2), strSubTitle.c_str(), Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall); } void cNopacityScheduleMenuItem::Render() { int logoWidth = config.menuItemLogoWidth; int logoHeight = config.menuItemLogoHeight; textLeft = 5; - int handleBgrd = (current)?handleBackgrounds[5]:handleBackgrounds[4]; - - pixmap->Fill(Theme.Color(clrMenuBorder)); - pixmap->DrawImage(cPoint(1, 1), handleBgrd); - - if (hasLogo) + if (Channel && Channel->Name()) textLeft = logoWidth + 10; - + if (selectable) { titleY = (height - font->Height())/2 - 2; - //draw ProgressBar - if (hasProgressBar) { - DrawRemaining(strProgressbar.c_str(), textLeft, height*7/8, width - textLeft - 10); - } - //draw new? + DrawBackground(textLeft); + DrawRemaining(textLeft, height*7/8, width - textLeft - 10); if (!drawn) { - //draw Icon - if (hasIcon) { - cImageLoader imgLoader; - if (imgLoader.LoadLogo(strChannelName.c_str(), logoWidth, logoHeight)) { - pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage()); - } else { - cTextWrapper channel; - channel.Set(strChannelName.c_str(), font, logoWidth); - int lines = channel.Lines(); - int lineHeight = height / 3; - int heightChannel = lines * lineHeight; - int y = (heightChannel>height)?0:(height-heightChannel)/2; - for (int line = 0; line < lines; line++) { - pixmapIcon->DrawText(cPoint((logoWidth - font->Width(channel.GetLine(line)))/2, y+lineHeight*line), channel.GetLine(line), Theme.Color(clrMenuFontMenuItemHigh), clrTransparent, font); - } - } - } + DrawLogo(logoWidth, logoHeight); SetTextShort(); drawn = true; } @@ -484,26 +401,69 @@ void cNopacityScheduleMenuItem::Render() { SetTextShort(); Cancel(-1); } - } else { - DrawDelimiter(*itemTabs[1], delimiterType.c_str(), handleBgrd); + if (wasCurrent) + if (infoTextWindow) { + delete infoTextWindow; + infoTextWindow = NULL; + } + if (current) { + infoTextWindow = new cNopacityTextWindow(osd, fontEPGWindow); + infoTextWindow->SetGeometry(textWindow); + infoTextWindow->SetText(Event->Description()); + infoTextWindow->Start(); + } } - } -void cNopacityScheduleMenuItem::DrawRemaining(cString remaining, int x, int y, int width) { - int seen = 0; - int total = 8; - if (*remaining) { - const char *p = *remaining; - p++; - while (*p) { - if (*p == '|') { - seen++; - p++; - } else - break; +void cNopacityScheduleMenuItem::DrawBackground(int textLeft) { + int handleBgrd = (current)?handleBackgrounds[5]:handleBackgrounds[4]; + pixmap->Fill(Theme.Color(clrMenuBorder)); + pixmap->DrawImage(cPoint(1, 1), handleBgrd); + pixmap->DrawText(cPoint(textLeft, 3), strDateTime.c_str(), Theme.Color(clrMenuFontMenuItem), clrTransparent, font); + if (TimerMatch == tmFull) { + cImageLoader imgLoader; + if (imgLoader.LoadIcon("activetimer", 64, 64)) { + pixmapIcon->DrawImage(cPoint(width - 66, 2), imgLoader.GetImage()); + } + } else if (TimerMatch == tmPartial) { + cImageLoader imgLoader; + if (imgLoader.LoadIcon("activetimersmall", 32, 32)) { + pixmapIcon->DrawImage(cPoint(width - 34, 2), imgLoader.GetImage()); + } + } + if (!scrollTitle) + pixmap->DrawText(cPoint(textLeft, titleY), strTitle.c_str(), Theme.Color(clrMenuFontMenuItemTitle), clrTransparent, font); + if (!scrollSubTitle) + pixmap->DrawText(cPoint(textLeft, titleY + font->Height() - 2), strSubTitle.c_str(), Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall); +} + +void cNopacityScheduleMenuItem::DrawLogo(int logoWidth, int logoHeight) { + if (Channel && Channel->Name()) { + cImageLoader imgLoader; + if (imgLoader.LoadLogo(Channel->Name(), logoWidth, logoHeight)) { + pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage()); + } else { + cTextWrapper channel; + channel.Set(Channel->Name(), font, logoWidth); + int lines = channel.Lines(); + int lineHeight = height / 3; + int heightChannel = lines * lineHeight; + int y = (heightChannel>height)?0:(height-heightChannel)/2; + for (int line = 0; line < lines; line++) { + pixmapIcon->DrawText(cPoint((logoWidth - font->Width(channel.GetLine(line)))/2, y+lineHeight*line), channel.GetLine(line), Theme.Color(clrMenuFontMenuItemHigh), clrTransparent, font); + } } } +} + +void cNopacityScheduleMenuItem::DrawRemaining(int x, int y, int width) { + time_t now = time(NULL); + if ((now < Event->StartTime()) || (now > Event->EndTime())) + return; + int seen = now - Event->StartTime(); + int total = Event->EndTime() - Event->StartTime(); + if (total == 0) + return; double percentSeen = (double)seen/total; pixmap->DrawEllipse(cRect(x, y, 7, 7), Theme.Color(clrProgressBarBack)); pixmap->DrawEllipse(cRect(x+width, y, 7, 7), Theme.Color(clrProgressBarBack)); @@ -516,33 +476,23 @@ void cNopacityScheduleMenuItem::DrawRemaining(cString remaining, int x, int y, i // cNopacityChannelMenuItem ------------- -cNopacityChannelMenuItem::cNopacityChannelMenuItem(cOsd *osd, const char *text, bool sel) : cNopacityMenuItem (osd, text, sel) { +cNopacityChannelMenuItem::cNopacityChannelMenuItem(cOsd *osd, const cChannel *Channel, bool sel) : cNopacityMenuItem (osd, "", sel) { + this->Channel = Channel; } cNopacityChannelMenuItem::~cNopacityChannelMenuItem(void) { } void cNopacityChannelMenuItem::CreatePixmapTextScroller(int totalWidth) { + int pixmapLeft = left + config.menuItemLogoWidth + 10; + int pixmapWidth = width - config.menuItemLogoWidth - 10; int drawPortWidth = totalWidth + 10; - if (hasIcon) - drawPortWidth += config.menuItemLogoWidth + 10; - pixmapTextScroller = osd->CreatePixmap(4, cRect(left, top + index * (height + left), width, height), cRect(0, 0, drawPortWidth, height)); + pixmapTextScroller = osd->CreatePixmap(4, cRect(pixmapLeft, top + index * (height + left), pixmapWidth, height), cRect(0, 0, drawPortWidth, height)); pixmapTextScroller->Fill(clrTransparent); } void cNopacityChannelMenuItem::CreateText() { - std::string strChannelNumber = *itemTabs[0]; - std::string strChannelName = *itemTabs[1]; - std::string name = strChannelName.c_str(); - if ((name.length() > 0) && !isalnum(name.at(0))) { - if (name.length() > 3) - name = name.substr(4); - } - name.erase(name.find_last_not_of(" ")+1); - std::stringstream sstrEntry; - sstrEntry << strChannelNumber << " " << name; - strEntry = sstrEntry.str(); - strLogo = name.c_str(); + strEntry = Channel->Name(); } int cNopacityChannelMenuItem::CheckScrollable(bool hasIcon) { @@ -566,13 +516,13 @@ int cNopacityChannelMenuItem::CheckScrollable(bool hasIcon) { void cNopacityChannelMenuItem::SetTextFull(void) { tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); pixmapTextScroller->Fill(clrTransparent); - pixmapTextScroller->DrawText(cPoint(config.menuItemLogoWidth + 10, (height - font->Height())/2), strEntryFull.c_str(), clrFont, clrTransparent, font); + pixmapTextScroller->DrawText(cPoint(5, (height - font->Height())/2), strEntryFull.c_str(), clrFont, clrTransparent, font); } void cNopacityChannelMenuItem::SetTextShort(void) { tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); pixmapTextScroller->Fill(clrTransparent); - pixmapTextScroller->DrawText(cPoint(config.menuItemLogoWidth + 10, (height - font->Height())/2), strEntry.c_str(), clrFont, clrTransparent, font); + pixmapTextScroller->DrawText(cPoint(5, (height - font->Height())/2), strEntry.c_str(), clrFont, clrTransparent, font); } void cNopacityChannelMenuItem::Render() { @@ -586,7 +536,7 @@ void cNopacityChannelMenuItem::Render() { pixmap->DrawImage(cPoint(1, 1), handleBgrd); if (!drawn) { cImageLoader imgLoader; - if (imgLoader.LoadLogo(strLogo.c_str(), logoWidth, logoHeight)) { + if (imgLoader.LoadLogo(Channel->Name(), logoWidth, logoHeight)) { pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage()); } drawn = true; @@ -601,7 +551,7 @@ void cNopacityChannelMenuItem::Render() { Cancel(-1); } } else { //Channelseparators - DrawDelimiter(*itemTabs[1], "Channelseparator", handleBgrd); + DrawDelimiter(Channel->Name(), "Channelseparator", handleBgrd); } } @@ -627,6 +577,8 @@ void cNopacityDefaultMenuItem::SetTextShort(void) { } int cNopacityDefaultMenuItem::CheckScrollable(bool hasIcon) { + if (!selectable) + return 0; int colWidth = 0; int colTextWidth = 0; for (int i=0; i<numTabs; i++) { @@ -634,14 +586,14 @@ int cNopacityDefaultMenuItem::CheckScrollable(bool hasIcon) { colWidth = tabWidth[i+cSkinDisplayMenu::MaxTabs]; colTextWidth = font->Width(*itemTabs[i]); if (colTextWidth > colWidth) { + cTextWrapper itemTextWrapped; scrollable = true; scrollCol = i; strEntryFull = *itemTabs[i]; - cTextWrapper itemTextWrapped; itemTextWrapped.Set(*itemTabs[i], font, colWidth - font->Width("... ")); strEntry = cString::sprintf("%s... ", itemTextWrapped.GetLine(0)); - break; } + break; } else break; } @@ -660,26 +612,34 @@ void cNopacityDefaultMenuItem::Render() { int colWidth = 0; int colTextWidth = 0; cString itemText(""); + std::stringstream sstrText; for (int i=0; i<numTabs; i++) { if (tabWidth[i] > 0) { - if (i != scrollCol) { - colWidth = tabWidth[i+cSkinDisplayMenu::MaxTabs]; - colTextWidth = font->Width(*itemTabs[i]); - if (colTextWidth > colWidth) { - cTextWrapper itemTextWrapped; - itemTextWrapped.Set(*itemTabs[i], font, colWidth - font->Width("... ")); - itemText = cString::sprintf("%s... ", itemTextWrapped.GetLine(0)); + if (selectable) { + if (i != scrollCol) { + colWidth = tabWidth[i+cSkinDisplayMenu::MaxTabs]; + colTextWidth = font->Width(*itemTabs[i]); + if (colTextWidth > colWidth) { + cTextWrapper itemTextWrapped; + itemTextWrapped.Set(*itemTabs[i], font, colWidth - font->Width("... ")); + itemText = cString::sprintf("%s... ", itemTextWrapped.GetLine(0)); + } else { + itemText = itemTabs[i]; + } + pixmap->DrawText(cPoint(tabWidth[i], (height - font->Height()) / 2), *itemText, clrFont, clrTransparent, font); } else { - itemText = itemTabs[i]; + if (!Running()) + SetTextShort(); } - pixmap->DrawText(cPoint(tabWidth[i], (height - font->Height()) / 2), *itemText, clrFont, clrTransparent, font); } else { - if (!Running()) - SetTextShort(); + sstrText << *itemTabs[i]; } } else break; } + if (!selectable) { + pixmap->DrawText(cPoint(1, (height - font->Height()) / 2), sstrText.str().c_str(), clrFont, clrTransparent, font); + } if (current && scrollable && !Running() && config.menuScrollSpeed) { Start(); } @@ -7,7 +7,6 @@ protected: cPixmap *pixmap; cPixmap *pixmapIcon; cPixmap *pixmapTextScroller; - bool hasIcon; int *handleBackgrounds; const char *Text; bool selectable; @@ -17,6 +16,7 @@ protected: bool drawn; cFont *font; cFont *fontSmall; + cFont *fontEPGWindow; int width, height; int top, left; int textLeft; @@ -24,27 +24,31 @@ protected: cString *itemTabs; int *tabWidth; int numTabs; + cRect *textWindow; + cNopacityTextWindow *infoTextWindow; void DrawDelimiter(const char *del, const char *icon, int handleBgrd); virtual void Action(void); + void DoSleep(int duration); virtual void SetTextFull(void) {}; virtual void SetTextShort(void) {}; public: cNopacityMenuItem(cOsd *osd, const char *text, bool sel); virtual ~cNopacityMenuItem(void); void CreatePixmap(); - void CreatePixmapIcon(int iconWidth, int iconHeight); + void CreatePixmapIcon(void); virtual void CreatePixmapTextScroller(int totalWidth); void SetGeometry(int index, int top, int left, int width, int height); void SetFont(cFont *font) {this->font = font;} void SetFontSmall(cFont *fontSmall) {this->fontSmall = fontSmall;} + void SetFontEPGWindow(cFont *font) {this->fontEPGWindow = font;} void SetCurrent(bool cur); void SetAlpha(int alpha) {this->pixmap->SetAlpha(alpha);} - void SetAlphaIcon(int alpha) {if (hasIcon) this->pixmapIcon->SetAlpha(alpha);} + void SetAlphaIcon(int alpha) {if (pixmapIcon) this->pixmapIcon->SetAlpha(alpha);} void SetAlphaText(int alpha) {if (pixmapTextScroller) this->pixmapTextScroller->SetAlpha(alpha);} void SetTabs(cString *tabs, int *tabWidths, int numtabs); void SetBackgrounds(int *handleBackgrounds); + void SetTextWindow(cRect *window) {textWindow = window;}; virtual void CreateText(void) {}; - virtual void SetDisplayMode(void) {}; virtual int CheckScrollable(bool hasIcon) {return 0;}; virtual void Render() = 0; }; @@ -55,7 +59,7 @@ private: cString menuEntry; std::string strEntry; std::string strEntryFull; - static std::string items[6]; + static std::string items[16]; cString GetIconName(); void SetTextFull(void); void SetTextShort(void); @@ -68,42 +72,29 @@ public: void Render(); }; -enum eMenuSubCategory { mcSubUndefined = -1, - mcSubSchedule = 0, - mcSubScheduleWhatsOn, - mcSubScheduleWhatsOnNow, - mcSubScheduleWhatsOnNext, - mcSubScheduleWhatsOnElse, - mcSubScheduleSearchResults, - mcSubScheduleFavorites, - mcSubScheduleTimerconflict, - mcSubScheduleTimer, - mcSubChannels, - mcSubChannelEdit}; - class cNopacityScheduleMenuItem : public cNopacityMenuItem { private: - eMenuSubCategory subCategory; + eMenuCategory category; + const cEvent *Event; + const cChannel *Channel; + eTimerMatch TimerMatch; std::string strDateTime; std::string strTitle; std::string strSubTitle; std::string strTitleFull; std::string strSubTitleFull; - std::string strChannelName; - std::string strProgressbar; - bool hasProgressBar; - eEPGModes mode; - bool hasLogo; + bool scrollTitle; + bool scrollSubTitle; int titleY; - std::string delimiterType; - void DrawRemaining(cString remaining, int x, int y, int width); + void DrawBackground(int textLeft); + void DrawLogo(int logoWidth, int logoHeight); + void DrawRemaining(int x, int y, int width); void SetTextFull(void); void SetTextShort(void); public: - cNopacityScheduleMenuItem(cOsd *osd, const char *text, bool sel, eMenuSubCategory subCat); + cNopacityScheduleMenuItem(cOsd *osd, const cEvent *Event, const cChannel *Channel, eTimerMatch TimerMatch, bool sel, eMenuCategory category); ~cNopacityScheduleMenuItem(void); void CreatePixmapTextScroller(int totalWidth); - void SetDisplayMode(void); void CreateText(void); int CheckScrollable(bool hasIcon); void Render(); @@ -111,13 +102,13 @@ public: class cNopacityChannelMenuItem : public cNopacityMenuItem { private: - std::string strLogo; + const cChannel *Channel; std::string strEntry; std::string strEntryFull; void SetTextFull(void); void SetTextShort(void); public: - cNopacityChannelMenuItem(cOsd *osd, const char *text, bool sel); + cNopacityChannelMenuItem(cOsd *osd, const cChannel *Channel, bool sel); ~cNopacityChannelMenuItem(void); void CreatePixmapTextScroller(int totalWidth); void CreateText(void); @@ -118,7 +118,6 @@ THEME_CLR(Theme, clrMessageWarning, CLR_MESSAGEWARNING); THEME_CLR(Theme, clrMessageError, CLR_MESSAGEERROR); THEME_CLR(Theme, clrMessageBlend, CLR_TRANSBLACK); -#include "epgsearchconf.c" #include "config.c" cNopacityConfig config; #include "setup.c" @@ -126,6 +125,7 @@ cNopacityConfig config; #include "nopacity.h" #include "helpers.c" #include "displaychannel.c" +#include "textwindow.c" #include "menuitem.c" #include "menudetailview.c" #include "displaymenuview.c" @@ -137,7 +137,6 @@ cNopacityConfig config; cNopacity::cNopacity(void) : cSkin("nOpacity", &::Theme) { config.setDynamicValues(); - config.loadEPGSearchSettings(); } const char *cNopacity::Description(void) { diff --git a/patches/0003-softhddevice-video-scaling-without-YAEPG-vdr-1.7.33_v4.diff b/patches/0003-softhddevice-video-scaling-without-YAEPG-vdr-1.7.33_v4.diff new file mode 100644 index 0000000..43d987e --- /dev/null +++ b/patches/0003-softhddevice-video-scaling-without-YAEPG-vdr-1.7.33_v4.diff @@ -0,0 +1,153 @@ +From ac0430c0b4c331d9adc87b8556545875e08ed82c Mon Sep 17 00:00:00 2001 +From: Lucian Muresan <lucianm@users.sourceforge.net> +Date: Tue, 18 Dec 2012 01:05:02 +0100 +Subject: [PATCH 3/3] softhddevice-video-scaling-without-YAEPG-vdr-1.7.33_v4 + +--- + softhddevice.cpp | 90 +++++++++++++++++++++++++++++++++++++++++--------------- + video.h | 2 +- + 2 files changed, 67 insertions(+), 25 deletions(-) + +diff --git a/softhddevice.cpp b/softhddevice.cpp +index d20f2cb..113efcc 100644 +--- a/softhddevice.cpp ++++ b/softhddevice.cpp +@@ -313,17 +313,9 @@ cSoftOsd::~cSoftOsd(void) + SetActive(false); + // done by SetActive: OsdClose(); + +-#ifdef USE_YAEPG +- // support yaepghd, video window +- if (vidWin.bpp) { // restore fullsized video +- int width; +- int height; +- double video_aspect; +- +- ::GetOsdSize(&width, &height, &video_aspect); +- // works osd relative +- VideoSetOutputPosition(0, 0, width, height); +- } ++#if APIVERSNUM >= 10733 ++ // rescale to full-size when Osd disappears ++ cDevice::PrimaryDevice()->ScaleVideo(); + #endif + } + +@@ -346,19 +338,9 @@ void cSoftOsd::Flush(void) + if (OsdLevel >= OSD_LEVEL_SUBTITLES && IsOpen()) { + return; + } +-#ifdef USE_YAEPG +- // support yaepghd, video window +- if (vidWin.bpp) { +-#ifdef OSD_DEBUG +- dsyslog("[softhddev]%s: %dx%d+%d+%d\n", __FUNCTION__, vidWin.Width(), +- vidWin.Height(), vidWin.x1, vidWin.y2); +-#endif +- +- // FIXME: vidWin is OSD relative not video window. +- VideoSetOutputPosition(Left() + vidWin.x1, Top() + vidWin.y1, +- vidWin.Width(), vidWin.Height()); +- } +-#endif ++ // scale to the size and position stored by the last call to cDevice::CanScaleVideo ++ // by passing a cRect(-1,-1,-1,-1) as by our convention ++ cDevice::PrimaryDevice()->ScaleVideo(cRect(-1,-1,-1,-1)); + + // + // VDR draws subtitle without clearing the old +@@ -1464,11 +1446,18 @@ class cSoftHdDevice:public cDevice + // Image Grab facilities + + virtual uchar *GrabImage(int &, bool, int, int, int); ++#if APIVERSNUM >= 10733 ++ virtual cRect CanScaleVideo(const cRect &Rect, int Alignment = taCenter); ++ virtual void ScaleVideo(const cRect &Rect = cRect::Null); ++ private: ++ cRect vidWinRect; // default constructor initializes with cRect::Null which is interpreted as "full size" ++#endif + + #if 0 + // SPU facilities + private: + cDvbSpuDecoder * spuDecoder; ++ + public: + virtual cSpuDecoder * GetSpuDecoder(void); + #endif +@@ -1888,6 +1877,59 @@ uchar *cSoftHdDevice::GrabImage(int &size, bool jpeg, int quality, int width, + return::GrabImage(&size, jpeg, quality, width, height); + } + ++#if APIVERSNUM >= 10733 ++///< Asks the output device whether it can scale the currently shown video in ++///< such a way that it fits into the given Rect, while retaining its proper ++///< aspect ratio. If the scaled video doesn't exactly fit into Rect, Alignment ++///< is used to determine how to align the actual rectangle with the requested ++///< one. The actual rectangle can be smaller, larger or the same size as the ++///< given Rect, and its location may differ, depending on the capabilities of ++///< the output device, which may not be able to display a scaled video at ++///< arbitrary sizes and locations. The device shall, however, do its best to ++///< match the requested Rect as closely as possible, preferring a size and ++///< location that fits completely into the requested Rect if possible. ++///< Returns the rectangle that can actually be used when scaling the video. ++///< A skin plugin using this function should rearrange its content according ++///< to the rectangle returned from calling this function, and should especially ++///< be prepared for cases where the returned rectangle is way off the requested ++///< Rect, or even Null. In such cases, the skin may want to fall back to ++///< working with full screen video. ++///< If this device can't scale the video, a Null rectangle is returned (this ++///< is also the default implementation). ++cRect cSoftHdDevice::CanScaleVideo(const cRect &Rect, int Alignment/* = taCenter*/) ++{ ++ // first implementation: we can always scale, we're a soft device ;-), ignore alignment for now ++ ++ // so let's just remember what the next call to ScaleVideo should actually use as a rectangle ++ // argument if called with cRect(-1,-1,-1,-1) ++ vidWinRect = Rect; ++ return vidWinRect; ++} ++ ++///< Scales the currently shown video in such a way that it fits into the given ++///< Rect. Rect should be one retrieved through a previous call to ++///< CanScaleVideo() (otherwise results may be undefined). ++///< Even if video output is scaled, the functions GetVideoSize() and ++///< GetOsdSize() must still return the same values as if in full screen mode! ++///< If this device can't scale the video, nothing happens. ++///< To restore full screen video, call this function with a Null rectangle. ++void cSoftHdDevice::ScaleVideo(const cRect &Rect/* = cRect::Null*/) ++{ ++ const cRect * actualRect = &Rect; ++ if (Rect == cRect(-1,-1,-1,-1)) { ++ // actual rectangle was stored here by the previous call to CanScaleVideo ++ actualRect = &vidWinRect; ++ } else { ++ // remember the value, just for the case we were called explicitly with a real value ++ vidWinRect = Rect; ++ } ++ ++ // let our specialized code do the actual resizing / repositioning ++ VideoSetOutputPosition((*actualRect).X(), (*actualRect).Y(), (*actualRect).Width(), (*actualRect).Height()); ++} ++#endif ++ ++ + /** + ** Call rgb to jpeg for C Plugin. + */ +diff --git a/video.h b/video.h +index 0868169..8a49b4c 100644 +--- a/video.h ++++ b/video.h +@@ -109,7 +109,7 @@ extern void VideoSetSaturation(int); + /// Set hue adjustment. + extern void VideoSetHue(int); + +- /// Set video output position. ++ /// Set video output position (Null width or height sets to full available window or screen). + extern void VideoSetOutputPosition(int, int, int, int); + + /// Set video mode. +-- +1.8.0 + diff --git a/patches/adminplug_meucats.patch b/patches/adminplug_meucats.patch new file mode 100644 index 0000000..dcf49d5 --- /dev/null +++ b/patches/adminplug_meucats.patch @@ -0,0 +1,20 @@ +--- admin.c.orig 2012-12-28 14:40:39.000000000 +0100 ++++ admin.c 2012-12-28 14:20:13.000000000 +0100 +@@ -95,6 +95,8 @@ cMenuSetupAdmin::cMenuSetupAdmin(void) + char *p1, *p2; + char buffer[512]; + ++ SetMenuCategory(mcSetupPlugins); ++ + usePageUpDn = false; + + bChanged = false; +@@ -331,6 +333,8 @@ cMenuSetupAdmin::cMenuSetupAdmin( ADMIN_ + isSubmenu = true; + char * title = NULL; + ++ SetMenuCategory(mcSetupPlugins); ++ + grpNum = groupNum; + usePageUpDn = true; + bDontCheckChanged = false; diff --git a/patches/epgsearch_menucats.patch b/patches/epgsearch_menucats.patch new file mode 100644 index 0000000..9ca5a75 --- /dev/null +++ b/patches/epgsearch_menucats.patch @@ -0,0 +1,126 @@ +diff -upr vdr-plugin-epgsearch_orig/changrp.c vdr-plugin-epgsearch/changrp.c +--- vdr-plugin-epgsearch_orig/changrp.c 2012-12-29 08:11:25.000000000 +0100 ++++ vdr-plugin-epgsearch/changrp.c 2012-12-27 14:46:38.000000000 +0100 +@@ -306,7 +306,7 @@ cMenuChannelGroups::cMenuChannelGroups(c + :cOsdMenu(tr("Channel groups"),20) + { + #if VDRVERSNUM >= 10728 +- SetMenuCategory(mcSetup); ++ //SetMenuCategory(mcSetup); + #endif + groupSel = -1; + groupName = GroupName; +@@ -411,7 +411,7 @@ cMenuEditChannelGroup::cMenuEditChannelG + :cOsdMenu(tr("Edit channel group"),30) + { + #if VDRVERSNUM >= 10728 +- SetMenuCategory(mcSetup); ++ //SetMenuCategory(mcSetup); + #endif + group = Group; + channelSel = group->CreateChannelSel(); +diff -upr vdr-plugin-epgsearch_orig/epgsearchsetup.c vdr-plugin-epgsearch/epgsearchsetup.c +--- vdr-plugin-epgsearch_orig/epgsearchsetup.c 2012-12-29 08:11:25.000000000 +0100 ++++ vdr-plugin-epgsearch/epgsearchsetup.c 2012-12-27 14:46:38.000000000 +0100 +@@ -55,7 +55,7 @@ cMenuSetupSubMenu::cMenuSetupSubMenu(con + : cOsdMenu(Title, 33) + { + #if VDRVERSNUM >= 10728 +- SetMenuCategory(mcSetup); ++ //SetMenuCategory(mcSetup); + #endif + data = Data; + } +diff -upr vdr-plugin-epgsearch_orig/menu_blacklistedit.c vdr-plugin-epgsearch/menu_blacklistedit.c +--- vdr-plugin-epgsearch_orig/menu_blacklistedit.c 2012-12-29 08:11:25.000000000 +0100 ++++ vdr-plugin-epgsearch/menu_blacklistedit.c 2012-12-27 14:46:38.000000000 +0100 +@@ -43,7 +43,7 @@ cMenuBlacklistEdit::cMenuBlacklistEdit(c + :cOsdMenu(tr("Edit blacklist"),32) + { + #if VDRVERSNUM >= 10728 +- SetMenuCategory(mcSetup); ++ //SetMenuCategory(mcSetup); + #endif + SearchModes[0] = strdup(tr("phrase")); + SearchModes[1] = strdup(tr("all words")); +diff -upr vdr-plugin-epgsearch_orig/menu_blacklists.c vdr-plugin-epgsearch/menu_blacklists.c +--- vdr-plugin-epgsearch_orig/menu_blacklists.c 2012-12-29 08:11:25.000000000 +0100 ++++ vdr-plugin-epgsearch/menu_blacklists.c 2012-12-27 14:46:38.000000000 +0100 +@@ -100,7 +100,7 @@ cMenuBlacklists::cMenuBlacklists() + :cOsdMenu(tr("Blacklists"), 3, 20, 11, 6, 5) + { + #if VDRVERSNUM >= 10728 +- SetMenuCategory(mcSetup); ++ //SetMenuCategory(mcSetup); + #endif + cMutexLock BlacklistLock(&Blacklists); + cBlacklist *Blacklist = Blacklists.First(); +diff -upr vdr-plugin-epgsearch_orig/menu_conflictcheck.c vdr-plugin-epgsearch/menu_conflictcheck.c +--- vdr-plugin-epgsearch_orig/menu_conflictcheck.c 2012-12-29 08:11:25.000000000 +0100 ++++ vdr-plugin-epgsearch/menu_conflictcheck.c 2012-12-27 14:46:38.000000000 +0100 +@@ -63,7 +63,7 @@ cMenuConflictCheck::cMenuConflictCheck() + :cOsdMenu("", 4, 12, 4, 5, 30) + { + #if VDRVERSNUM >= 10728 +- SetMenuCategory(mcSchedule); ++ //SetMenuCategory(mcSchedule); + #endif + showAll = false; + lastSel = -1; +@@ -198,7 +198,7 @@ cMenuConflictCheckDetails::cMenuConflict + :cOsdMenu(tr("Timer conflicts"), 2, 4, 13, 3, 2) + { + #if VDRVERSNUM >= 10728 +- SetMenuCategory(mcSchedule); ++ //SetMenuCategory(mcSchedule); + #endif + timerObj = TimerObj; + checktime = timerObj->conflCheckTime; +diff -upr vdr-plugin-epgsearch_orig/menu_deftimercheckmethod.c vdr-plugin-epgsearch/menu_deftimercheckmethod.c +--- vdr-plugin-epgsearch_orig/menu_deftimercheckmethod.c 2012-12-29 08:11:25.000000000 +0100 ++++ vdr-plugin-epgsearch/menu_deftimercheckmethod.c 2012-12-27 14:46:39.000000000 +0100 +@@ -121,7 +121,7 @@ cMenuDefTimerCheckMethod::cMenuDefTimerC + :cOsdMenu(tr("Default timer check method"), 20) + { + #if VDRVERSNUM >= 10728 +- SetMenuCategory(mcSetup); ++ //SetMenuCategory(mcSetup); + #endif + CheckModes[0] = tr("no check"); + CheckModes[UPD_CHDUR] = tr("by channel and time"); +diff -upr vdr-plugin-epgsearch_orig/menu_main.c vdr-plugin-epgsearch/menu_main.c +--- vdr-plugin-epgsearch_orig/menu_main.c 2012-12-29 08:11:25.000000000 +0100 ++++ vdr-plugin-epgsearch/menu_main.c 2012-12-27 14:46:38.000000000 +0100 +@@ -50,7 +50,7 @@ cMenuSearchMain::cMenuSearchMain(void) + :cOsdMenu("", GetTab(1), GetTab(2), GetTab(3), GetTab(4), GetTab(5)) + { + #if VDRVERSNUM >= 10728 +- SetMenuCategory(mcSchedule); ++ //SetMenuCategory(mcSchedule); + #endif + helpKeys = -1; + otherChannel = 0; +diff -upr vdr-plugin-epgsearch_orig/menu_searchresults.c vdr-plugin-epgsearch/menu_searchresults.c +--- vdr-plugin-epgsearch_orig/menu_searchresults.c 2012-12-29 08:11:25.000000000 +0100 ++++ vdr-plugin-epgsearch/menu_searchresults.c 2012-12-27 14:46:38.000000000 +0100 +@@ -192,7 +192,7 @@ cMenuSearchResults::cMenuSearchResults(c + :cOsdMenu("", MenuTemplate->Tab(0), MenuTemplate->Tab(1), MenuTemplate->Tab(2), MenuTemplate->Tab(3), MenuTemplate->Tab(4)) + { + #if VDRVERSNUM >= 10728 +- SetMenuCategory(mcSchedule); ++ //SetMenuCategory(mcSchedule); + #endif + + helpKeys = -1; +diff -upr vdr-plugin-epgsearch_orig/menu_whatson.c vdr-plugin-epgsearch/menu_whatson.c +--- vdr-plugin-epgsearch_orig/menu_whatson.c 2012-12-29 08:11:25.000000000 +0100 ++++ vdr-plugin-epgsearch/menu_whatson.c 2012-12-27 14:46:38.000000000 +0100 +@@ -260,7 +260,7 @@ cMenuWhatsOnSearch::cMenuWhatsOnSearch(c + :cOsdMenu("", GetTab(1), GetTab(2), GetTab(3), GetTab(4), GetTab(5)) + { + #if VDRVERSNUM >= 10728 +- SetMenuCategory(mcSchedule); ++ //SetMenuCategory(mcSchedule); + #endif + + helpKeys = -1; diff --git a/po/de_DE.po b/po/de_DE.po index af9841a..7830d75 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-19 19:25+0100\n" +"POT-Creation-Date: 2012-12-29 13:12+0100\n" "PO-Revision-Date: 2012-11-11 17:49+0200\n" "Last-Translator: louis\n" "Language-Team: \n" @@ -17,11 +17,29 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +msgid "Disc" +msgstr "Festplatte" + +msgid "free" +msgstr "frei" + +msgid "Volume" +msgstr "Lautstärke" + +msgid "RERUNS OF THIS SHOW" +msgstr "Wiederholungen" + msgid "Font" msgstr "Schriftart" -msgid "VDR Menu" -msgstr "VDR Menü" +msgid "VDR Menu: Common Settings" +msgstr "VDR Menü: Allgemeine Einstellungen" + +msgid "VDR Menu: Dimensions Settings" +msgstr "" + +msgid "VDR Menu: Font Sizes" +msgstr "VDR Menü: Schriftgrößen" msgid "Channel Switching" msgstr "Kanalwechsel" @@ -35,9 +53,6 @@ msgstr "Audio Spuren" msgid "Messages" msgstr "Nachrichten" -msgid "Volume" -msgstr "Lautstärke" - msgid "never" msgstr "nie" @@ -59,17 +74,38 @@ msgstr "mittel" msgid "fast" msgstr "schnell" +msgid "Number of Default Menu Entries per Page" +msgstr "Anzahl der Default-Menüelemente pro Seite" + +msgid "Scale Video size to fit into menu window" +msgstr "TV-Bildgröße in Menüfenster einpassen" + msgid "Fade-In Time in ms (Zero for switching off fading)" msgstr "Fade-In Zeit in ms (Null zum Abschalten)" -msgid "Scrolling Speed" -msgstr "Scroll Geschwindigkeit" +msgid "Display Disk Usage" +msgstr "Festplattenstatus anzeigen" + +msgid "Display Timers" +msgstr "Timer anzeigen" -msgid "Scrolling Delay in ms" -msgstr "Scroll Verzögerung in ms" +msgid "Menu Items Scrolling Speed" +msgstr "Scroll Geschwindigkeit der Menüelemente" -msgid "Scale Video size to fit into menu window" -msgstr "TV-Bildgröße in Menüfenster einpassen" +msgid "Menu Items Scrolling Delay in s" +msgstr "Scroll Verzögerung der Menüelemente in s" + +msgid "EPG Window Fade-In Time in ms (Zero for switching off fading)" +msgstr "Fade-In Zeit des EPG Fensters in ms (Null zum Abschalten)" + +msgid "EPG Window Display Delay in s" +msgstr "Anzeigeverzögerung des EPG Fensters in s" + +msgid "EPG Window Scroll Delay in s" +msgstr "Scroll Verzögerung des EPG Fensters in s" + +msgid "EPG Window Text Scrolling Speed" +msgstr "Text Scroll Geschwindigkeit des EPG Fensters" msgid "Display Reruns in detailed EPG View" msgstr "Wiederholungen in der detailierten EPG Ansicht anzeigen" @@ -83,24 +119,18 @@ msgstr "Untertitel für Wiederholungssuche nutzen" msgid "Width of narrow Menu Bar (Percent of OSD Width)" msgstr "Breite der schmalen Menüleiste (Proz. der OSD Breite)" -msgid "Display Disk Usage" -msgstr "Festplattenstatus anzeigen" - -msgid "Display Timers" -msgstr "Timer anzeigen" - msgid "Width of Disc Usage and Timers Display (Percent of OSD Width)" msgstr "Breite der Anzeige der Timer (Proz. der OSD Breite)" +msgid "Height of EPG Info Window (Percent of OSD Height)" +msgstr "Höhe des EPG Info Fensters (Proz. der OSD Höhe)" + msgid "Header Height (Percent of OSD Height)" msgstr "Header Höhe (in Prozent der OSD Höhe)" msgid "Footer Height (Percent of OSD Height)" msgstr "Footer Höhe (in Prozent der OSD Höhe)" -msgid "Number of Default Menu Entries per Page" -msgstr "Anzahl der Default-Menüelemente pro Seite" - msgid "Icon Size (Square Main Menu Icons)" msgstr "Größe der quadratischen Hauptmenü Icons" @@ -173,6 +203,9 @@ msgstr "Schriftgröße anpassen - Header EPG Detailanzeige" msgid "Adjust Font Size - Detail View Header Large" msgstr "Schriftgröße anpassen - Header Groß EPG Detailanzeige" +msgid "Adjust Font Size - EPG Info Window" +msgstr "Schriftgröße anpassen - EPG Infofenster" + msgid "Hight of Channel Display (Percent of OSD Height)" msgstr "Höhe der Kanalwechsel Anzeige (Proz. der OSD Höhe)" @@ -245,11 +278,5 @@ 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)" -msgid "RERUNS OF THIS SHOW" -msgstr "Wiederholungen" - -msgid "Disc" -msgstr "Festplatte" - -msgid "free" -msgstr "frei" +#~ msgid "VDR Menu: Size Settings" +#~ msgstr "VDR Menü: Größeneinstellungen" @@ -15,7 +15,9 @@ void cNopacitySetup::Setup(void) { int currentItem = Current(); Clear(); Add(new cMenuEditStraItem(tr("Font"), &tmpNopacityConfig.fontIndex, fontNames.Size(), &fontNames[0])); - Add(new cOsdItem(tr("VDR Menu"))); + Add(new cOsdItem(tr("VDR Menu: Common Settings"))); + Add(new cOsdItem(tr("VDR Menu: Dimensions Settings"))); + Add(new cOsdItem(tr("VDR Menu: Font Sizes"))); Add(new cOsdItem(tr("Channel Switching"))); Add(new cOsdItem(tr("Replay"))); Add(new cOsdItem(tr("Audio Tracks"))); @@ -34,8 +36,12 @@ eOSState cNopacitySetup::ProcessKey(eKeys Key) { if (!hadSubMenu && (state == osUnknown || Key == kOk)) { if ((Key == kOk && !hadSubMenu)) { const char* ItemText = Get(Current())->Text(); - if (strcmp(ItemText, tr("VDR Menu")) == 0) + if (strcmp(ItemText, tr("VDR Menu: Common Settings")) == 0) state = AddSubMenu(new cNopacitySetupMenuDisplay(&tmpNopacityConfig)); + if (strcmp(ItemText, tr("VDR Menu: Dimensions Settings")) == 0) + state = AddSubMenu(new cNopacitySetupMenuDisplayGeometry(&tmpNopacityConfig)); + if (strcmp(ItemText, tr("VDR Menu: Font Sizes")) == 0) + state = AddSubMenu(new cNopacitySetupMenuDisplayFonts(&tmpNopacityConfig)); if (strcmp(ItemText, tr("Channel Switching")) == 0) state = AddSubMenu(new cNopacitySetupChannelDisplay(&tmpNopacityConfig)); if (strcmp(ItemText, tr("Replay")) == 0) @@ -100,6 +106,11 @@ void cNopacitySetup::Store(void) { SetupStore("menuScrollSpeed", config.menuScrollSpeed); SetupStore("menuWidthNarrow", config.menuWidthNarrow); SetupStore("menuWidthRightItems", config.menuWidthRightItems); + SetupStore("menuHeightInfoWindow", config.menuHeightInfoWindow); + SetupStore("menuEPGWindowFadeTime", config.menuEPGWindowFadeTime); + SetupStore("menuInfoTextDelay", config.menuInfoTextDelay); + SetupStore("menuInfoScrollDelay", config.menuInfoScrollDelay); + SetupStore("menuInfoScrollSpeed", config.menuInfoScrollSpeed); SetupStore("showDiscUsage", config.showDiscUsage); SetupStore("showTimers", config.showTimers); SetupStore("headerHeight", config.headerHeight); @@ -129,6 +140,8 @@ void cNopacitySetup::Store(void) { SetupStore("fontDetailView", config.fontDetailView); SetupStore("fontDetailViewHeader", config.fontDetailViewHeader); SetupStore("fontDetailViewHeaderLarge", config.fontDetailViewHeaderLarge); + SetupStore("fontEPGInfoWindow", config.fontEPGInfoWindow); + } //------------------------------------------------------------------------------------------------------------------ @@ -157,9 +170,9 @@ eOSState cMenuSetupSubMenu::ProcessKey(eKeys Key) { return state; } -//-----MenuDisplay------------------------------------------------------------------------------------------------------------- +//-----MenuDisplay Common Settings ------------------------------------------------------------------------------------------------------------- -cNopacitySetupMenuDisplay::cNopacitySetupMenuDisplay(cNopacityConfig* data) : cMenuSetupSubMenu(tr("VDR Menu"), data) { +cNopacitySetupMenuDisplay::cNopacitySetupMenuDisplay(cNopacityConfig* data) : cMenuSetupSubMenu(tr("VDR Menu: Common Settings"), data) { useSubtitleRerunTexts[0] = tr("never"); useSubtitleRerunTexts[1] = tr("if exists"); useSubtitleRerunTexts[2] = tr("always"); @@ -173,20 +186,39 @@ cNopacitySetupMenuDisplay::cNopacitySetupMenuDisplay(cNopacityConfig* data) : c void cNopacitySetupMenuDisplay::Set(void) { int currentItem = Current(); Clear(); - Add(new cMenuEditIntItem(tr("Fade-In Time in ms (Zero for switching off fading)"), &tmpNopacityConfig->menuFadeTime, 0, 1000)); - Add(new cMenuEditStraItem(tr("Scrolling Speed"), &tmpNopacityConfig->menuScrollSpeed, 4, scrollSpeed)); - Add(new cMenuEditIntItem(tr("Scrolling Delay in ms"), &tmpNopacityConfig->menuScrollDelay, 0, 2000)); + Add(new cMenuEditIntItem(tr("Number of Default Menu Entries per Page"), &tmpNopacityConfig->numDefaultMenuItems, 10, 40)); Add(new cMenuEditBoolItem(tr("Scale Video size to fit into menu window"), &tmpNopacityConfig->scalePicture)); + Add(new cMenuEditIntItem(tr("Fade-In Time in ms (Zero for switching off fading)"), &tmpNopacityConfig->menuFadeTime, 0, 1000)); + Add(new cMenuEditBoolItem(tr("Display Disk Usage"), &tmpNopacityConfig->showDiscUsage)); + Add(new cMenuEditBoolItem(tr("Display Timers"), &tmpNopacityConfig->showTimers)); + Add(new cMenuEditStraItem(tr("Menu Items Scrolling Speed"), &tmpNopacityConfig->menuScrollSpeed, 4, scrollSpeed)); + Add(new cMenuEditIntItem(tr("Menu Items Scrolling Delay in s"), &tmpNopacityConfig->menuScrollDelay, 0, 3)); + Add(new cMenuEditIntItem(tr("EPG Window Fade-In Time in ms (Zero for switching off fading)"), &tmpNopacityConfig->menuEPGWindowFadeTime, 0, 1000)); + Add(new cMenuEditIntItem(tr("EPG Window Display Delay in s"), &tmpNopacityConfig->menuInfoTextDelay, 0, 10)); + Add(new cMenuEditIntItem(tr("EPG Window Scroll Delay in s"), &tmpNopacityConfig->menuInfoScrollDelay, 0, 10)); + Add(new cMenuEditStraItem(tr("EPG Window Text Scrolling Speed"), &tmpNopacityConfig->menuInfoScrollSpeed, 4, scrollSpeed)); Add(new cMenuEditBoolItem(tr("Display Reruns in detailed EPG View"), &tmpNopacityConfig->displayRerunsDetailEPGView)); Add(new cMenuEditIntItem(tr("Number of reruns to display"), &tmpNopacityConfig->numReruns, 1, 10)); Add(new cMenuEditStraItem(tr("Use Subtitle for reruns"), &tmpNopacityConfig->useSubtitleRerun, 3, useSubtitleRerunTexts)); + + SetCurrent(Get(currentItem)); + Display(); +} + +//-----MenuDisplay Size Settings ------------------------------------------------------------------------------------------------------------- + +cNopacitySetupMenuDisplayGeometry::cNopacitySetupMenuDisplayGeometry(cNopacityConfig* data) : cMenuSetupSubMenu(tr("VDR Menu: Dimensions Settings"), data) { + Set(); +} + +void cNopacitySetupMenuDisplayGeometry::Set(void) { + int currentItem = Current(); + Clear(); Add(new cMenuEditIntItem(tr("Width of narrow Menu Bar (Percent of OSD Width)"), &tmpNopacityConfig->menuWidthNarrow, 10, 100)); - Add(new cMenuEditBoolItem(tr("Display Disk Usage"), &tmpNopacityConfig->showDiscUsage)); - Add(new cMenuEditBoolItem(tr("Display Timers"), &tmpNopacityConfig->showTimers)); Add(new cMenuEditIntItem(tr("Width of Disc Usage and Timers Display (Percent of OSD Width)"), &tmpNopacityConfig->menuWidthRightItems, 10, 100)); + Add(new cMenuEditIntItem(tr("Height of EPG Info Window (Percent of OSD Height)"), &tmpNopacityConfig->menuHeightInfoWindow, 10, 100)); Add(new cMenuEditIntItem(tr("Header Height (Percent of OSD Height)"), &tmpNopacityConfig->headerHeight, 0, 30)); Add(new cMenuEditIntItem(tr("Footer Height (Percent of OSD Height)"), &tmpNopacityConfig->footerHeight, 0, 30)); - Add(new cMenuEditIntItem(tr("Number of Default Menu Entries per Page"), &tmpNopacityConfig->numDefaultMenuItems, 10, 40)); Add(new cMenuEditIntItem(tr("Icon Size (Square Main Menu Icons)"), &tmpNopacityConfig->iconHeight, 30, 200)); Add(new cMenuEditIntItem(tr("Header Icon Size (Square Header Menu Icons)"), &tmpNopacityConfig->headerIconHeight, 30, 200)); Add(new cMenuEditIntItem(tr("Channel Logo Width (on the Menu Buttons)"), &tmpNopacityConfig->menuItemLogoWidth, 30, 200)); @@ -197,6 +229,19 @@ void cNopacitySetupMenuDisplay::Set(void) { 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)); Add(new cMenuEditIntItem(tr("Detail EPG View EPG Image Height"), &tmpNopacityConfig->epgImageHeight, 30, 500)); + SetCurrent(Get(currentItem)); + Display(); +} + +//-----MenuDisplay Font Sizes ------------------------------------------------------------------------------------------------------------- + +cNopacitySetupMenuDisplayFonts::cNopacitySetupMenuDisplayFonts(cNopacityConfig* data) : cMenuSetupSubMenu(tr("VDR Menu: Font Sizes"), data) { + Set(); +} + +void cNopacitySetupMenuDisplayFonts::Set(void) { + int currentItem = Current(); + Clear(); Add(new cMenuEditIntItem(tr("Adjust Font Size - Header"), &tmpNopacityConfig->fontHeader, -20, 20)); Add(new cMenuEditIntItem(tr("Adjust Font Size - Date"), &tmpNopacityConfig->fontDate, -20, 20)); Add(new cMenuEditIntItem(tr("Adjust Font Size - Large Menu Item"), &tmpNopacityConfig->fontMenuitemLarge, -20, 20)); @@ -211,7 +256,7 @@ void cNopacitySetupMenuDisplay::Set(void) { Add(new cMenuEditIntItem(tr("Adjust Font Size - Detail View Text"), &tmpNopacityConfig->fontDetailView, -20, 20)); Add(new cMenuEditIntItem(tr("Adjust Font Size - Detail View Header"), &tmpNopacityConfig->fontDetailViewHeader, -20, 20)); Add(new cMenuEditIntItem(tr("Adjust Font Size - Detail View Header Large"), &tmpNopacityConfig->fontDetailViewHeaderLarge, -20, 20)); - + Add(new cMenuEditIntItem(tr("Adjust Font Size - EPG Info Window"), &tmpNopacityConfig->fontEPGInfoWindow, -20, 20)); SetCurrent(Get(currentItem)); Display(); } @@ -324,4 +369,4 @@ void cNopacitySetupVolumeDisplay::Set(void) { SetCurrent(Get(currentItem)); Display(); -}
\ No newline at end of file +} @@ -35,6 +35,20 @@ class cNopacitySetupMenuDisplay : public cMenuSetupSubMenu { cNopacitySetupMenuDisplay(cNopacityConfig *data); }; +class cNopacitySetupMenuDisplayGeometry : public cMenuSetupSubMenu { + protected: + void Set(void); + public: + cNopacitySetupMenuDisplayGeometry(cNopacityConfig *data); +}; + +class cNopacitySetupMenuDisplayFonts : public cMenuSetupSubMenu { + protected: + void Set(void); + public: + cNopacitySetupMenuDisplayFonts(cNopacityConfig *data); +}; + class cNopacitySetupChannelDisplay : public cMenuSetupSubMenu { protected: void Set(void); diff --git a/skinnopacity.c b/skinnopacity.c index a1ab3fc..90bf383 100644 --- a/skinnopacity.c +++ b/skinnopacity.c @@ -10,12 +10,12 @@ #include "nopacity.c" -#if defined(APIVERSNUM) && APIVERSNUM < 10730 -#error "VDR-1.7.30 API version or greater is required!" +#if defined(APIVERSNUM) && APIVERSNUM < 10734 +#error "VDR-1.7.34 API version or greater is required!" #endif -static const char *VERSION = "0.0.4"; +static const char *VERSION = "0.0.5"; static const char *DESCRIPTION = "'nOpacity' Skin"; static const char *MAINMENUENTRY = "nOpacity"; diff --git a/textwindow.c b/textwindow.c new file mode 100644 index 0000000..72f3c1b --- /dev/null +++ b/textwindow.c @@ -0,0 +1,122 @@ +#include "textwindow.h" + +cNopacityTextWindow::cNopacityTextWindow(cOsd *osd, cFont *font) { + this->osd = osd; + this->font = font; + pixmap = NULL; +} + +cNopacityTextWindow::~cNopacityTextWindow(void) { + Cancel(-1); + while (Active()) + cCondWait::SleepMs(10); + if (pixmap) { + osd->DestroyPixmap(pixmap); + pixmap = NULL; + } +} + +bool cNopacityTextWindow::CreatePixmap(int border) { + int lineHeight = font->Height(); + bool scrolling = false; + twText.Set(text, font, geometry->Width() - 2*border); + int pixmapTotalHeight = lineHeight * (twText.Lines()+1); + int drawportHeight = geometry->Height(); + if (pixmapTotalHeight > drawportHeight) { + drawportHeight = pixmapTotalHeight; + scrolling = true; + } + cPixmap::Lock(); + pixmap = osd->CreatePixmap(4, cRect(geometry->X(), geometry->Y(), geometry->Width(), geometry->Height()), + cRect(0, 0, geometry->Width(), drawportHeight)); + pixmap->SetAlpha(0); + pixmap->Fill(Theme.Color(clrMenuBorder)); + pixmap->DrawRectangle(cRect(1, 1, geometry->Width()-2, drawportHeight-2), Theme.Color(clrMenuBack)); + cPixmap::Unlock(); + return scrolling; +} + +void cNopacityTextWindow::DrawText(int border) { + int lineHeight = font->Height(); + 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); + currentLineHeight += lineHeight; + } + cPixmap::Unlock(); +} + +void cNopacityTextWindow::DoSleep(int duration) { + int sleepSlice = 10; + for (int i = 0; Running() && (i*sleepSlice < duration); i++) + cCondWait::SleepMs(sleepSlice); +} + +void cNopacityTextWindow::Action(void) { + DoSleep(config.menuInfoTextDelay*1000); + + int border = 5; + bool scrolling = false; + if (Running()) { + scrolling = CreatePixmap(border); + } + if (Running()) { + DrawText(border); + } + //FadeIn + if (config.menuEPGWindowFadeTime) { + uint64_t Start = cTimeMs::Now(); + int FadeTime = config.menuEPGWindowFadeTime; + int FadeFrameTime = config.menuEPGWindowFrameTime; + while (Running()) { + uint64_t Now = cTimeMs::Now(); + cPixmap::Lock(); + double t = min(double(Now - Start) / FadeTime, 1.0); + int Alpha = t * ALPHA_OPAQUE; + pixmap->SetAlpha(Alpha); + if (Running()) + osd->Flush(); + cPixmap::Unlock(); + int Delta = cTimeMs::Now() - Now; + if (Running() && (Delta < FadeFrameTime)) + cCondWait::SleepMs(FadeFrameTime - Delta); + if ((int)(Now - Start) > FadeTime) + break; + } + } + + if (scrolling && Running()) { + int scrollDelay = config.menuInfoScrollDelay * 1000; + DoSleep(scrollDelay); + int drawPortY; + int FrameTime = config.menuInfoScrollFrameTime; + int maxY = pixmap->DrawPort().Height() - pixmap->ViewPort().Height(); + bool doSleep = false; + while (Running()) { + uint64_t Now = cTimeMs::Now(); + cPixmap::Lock(); + drawPortY = pixmap->DrawPort().Y(); + drawPortY -= 1; + cPixmap::Unlock(); + if (abs(drawPortY) > maxY) { + doSleep = true; + DoSleep(scrollDelay); + drawPortY = 0; + } + cPixmap::Lock(); + if (Running()) + pixmap->SetDrawPortPoint(cPoint(0, drawPortY)); + cPixmap::Unlock(); + if (doSleep) { + doSleep = false; + DoSleep(scrollDelay); + } + int Delta = cTimeMs::Now() - Now; + if (Running()) + osd->Flush(); + if (Running() && (Delta < FrameTime)) + cCondWait::SleepMs(FrameTime - Delta); + } + } +}
\ No newline at end of file diff --git a/textwindow.h b/textwindow.h new file mode 100644 index 0000000..09fedc4 --- /dev/null +++ b/textwindow.h @@ -0,0 +1,22 @@ +#ifndef __NOPACITY_TEXTWINDOW_H +#define __NOPACITY_TEXTWINDOW_H +class cNopacityTextWindow : public cThread { +private: + cOsd *osd; + cFont *font; + cPixmap *pixmap; + cRect *geometry; + const char *text; + cTextWrapper twText; + bool CreatePixmap(int border); + void DrawText(int border); + void DoSleep(int duration); + virtual void Action(void); +public: + cNopacityTextWindow(cOsd *osd, cFont *font); + virtual ~cNopacityTextWindow(void); + void SetGeometry(cRect *geo) {geometry = geo;}; + void SetText(const char *Text) {text = Text;}; +}; + +#endif //__NOPACITY_TEXTWINDOW_H
\ No newline at end of file |