Compare commits

..

No commits in common. "master" and "0.6.2" have entirely different histories.

913 changed files with 24887 additions and 72928 deletions

152
HISTORY
View File

@ -67,9 +67,9 @@ Version 0.0.3
- fixed Bug that displaychannel was not shown after closing displaymenu with - fixed Bug that displaychannel was not shown after closing displaymenu with
"backspace" (with active menuorg plugin) "backspace" (with active menuorg plugin)
- fixed Bug with menuselection Patch - fixed Bug with menuselection Patch
- added tokens {month}, {monthname} and {year} in displaymenutimers listitem and - added tokens {month}, {monthname} and {year} in displaymenutimers listitem and
currentitem currentitem
- added dedicated tokens for posters and banners in <srapercontent> in - added dedicated tokens for posters and banners in <srapercontent> in
displaychannel and displayreplay displaychannel and displayreplay
- added Plugin Interface - added Plugin Interface
- fixed crash when clearing a message in displaychannel and displayreplay - fixed crash when clearing a message in displaychannel and displayreplay
@ -81,7 +81,7 @@ Version 0.0.4
Version 0.0.5 Version 0.0.5
- added {channelnumber} and {channelname} Tokens in displaymenudetailepg - added {channelnumber} and {channelname} Tokens in displaymenudetailepg
detailheader detailheader
- fixed {hasicon} Token in displaymenu header - fixed {hasicon} Token in displaymenu header
- added {newmails} Token in displaychannel statusinfo, mailbox plugin - added {newmails} Token in displaychannel statusinfo, mailbox plugin
@ -111,7 +111,7 @@ Version 0.0.8
Version 0.1.0 Version 0.1.0
- fixed display of color buttons in detailed views - fixed display of color buttons in detailed views
- fixed possible Nullpointer access in displaymenurootview - fixed possible Nullpointer access in displaymenurootview
- added currentschedule viewelement in displaymenumain - added currentschedule viewelement in displaymenumain
- fixed bug that wrong channel was shown in header of whatson - fixed bug that wrong channel was shown in header of whatson
if entering from whatsonnow if entering from whatsonnow
@ -180,7 +180,7 @@ Version 0.1.6
adds its vakues and potentially overrides valués from globals.xml adds its vakues and potentially overrides valués from globals.xml
- check icons, menuicons and skinparts additionally directly in skin folder - check icons, menuicons and skinparts additionally directly in skin folder
to allow default images which can be used for all skins to allow default images which can be used for all skins
- fixed bug that setup variables are sometimes not identified in case two - fixed bug that setup variables are sometimes not identified in case two
or more skin names start identically or more skin names start identically
Version 0.2.0 Version 0.2.0
@ -195,7 +195,7 @@ Version 0.2.1
- some more nopacity optimizations - thanx@utility - some more nopacity optimizations - thanx@utility
- added possibiliy to use submenus in the skin setup menus - added possibiliy to use submenus in the skin setup menus
- reloading active skin directly after closing setup menu so that - reloading active skin directly after closing setup menu so that
changes of setup parameters are immediately in use changes of setup parameters are immediately in use
Version 0.2.2 Version 0.2.2
@ -260,7 +260,7 @@ Version 0.3.3
no signal information will be fetched to improve performance. no signal information will be fetched to improve performance.
Version 0.3.4 Version 0.3.4
- fixed backward compatibility to VDR version < 2.1.1 where - fixed backward compatibility to VDR version < 2.1.1 where
cRecording::IsInUse() was introduced cRecording::IsInUse() was introduced
- automatically detect type of image if no file extension is available - automatically detect type of image if no file extension is available
@ -270,7 +270,7 @@ Version 0.4.0
- fixed bug that time was not correctly drawn if a submenu implements - fixed bug that time was not correctly drawn if a submenu implements
its own time display its own time display
- fixed bug that date was drawn every flush in displayreplay - fixed bug that date was drawn every flush in displayreplay
- fixed bug in metrixhd timers menu - fixed bug in metrixhd timers menu
- fixed bug that datetime was not correctly drawn if a submenu implements - fixed bug that datetime was not correctly drawn if a submenu implements
its own datetime display its own datetime display
@ -290,7 +290,7 @@ Version 0.4.2
- fixed bug that string tokens are not evaluated in area conditions - fixed bug that string tokens are not evaluated in area conditions
- added possibility to draw a debug grid in views - added possibility to draw a debug grid in views
- added more info if debugImage is activted in config - added more info if debugImage is activted in config
- added possibility for blinking images, texts, rectangles, ellipses - added possibility for blinking images, texts, rectangles, ellipses
and slopes and slopes
- adapted libskindesignerapi makefile for LCLBLD - adapted libskindesignerapi makefile for LCLBLD
@ -376,7 +376,7 @@ Version 0.5.3
- added SVG Template parsing - added SVG Template parsing
- fixed memory leak when creating fonts - fixed memory leak when creating fonts
- fixed crash using animated images in plugins - fixed crash using animated images in plugins
- added banner to displaymenuschedulescurrentview and - added banner to displaymenuschedulescurrentview and
displaymenureplaycurrentview displaymenureplaycurrentview
- immplemented areacontainers to group areas - immplemented areacontainers to group areas
- fixed bug displaying pixmaps with transparency - fixed bug displaying pixmaps with transparency
@ -397,135 +397,3 @@ Version 0.6.1
- added version check for skinrepositiries - added version check for skinrepositiries
Version 0.6.2 Version 0.6.2
- added progressmodeonly viewelement in displayreplay
- fixed bug in checking skin version
- added {watched} and {percentseen} to displaymenurecordings
current view
Version 0.6.3
- implemented horizontal menus
For displaying horizontal menus with VDR <= 2.2.x a VDR
patch is required (see /patches/vdr-2.2.0_horizontal_menu.patch
in the plugin source directory). Without this patch the keys
left/right and up/down are not toggled in horizontal menus.
With VDR >= 2.3.1 this patch is not needed anymore.
- added possibility to add conditions to <menuitems> elements
- added possibility to define a viewelement several times with
different conditions
- added "string" skin setup parameter with multiple options
- added "valign" option in <drawtextbox>. If the box height is set
and the text does not need the complete height, with valign="center"
the text can be placed horizontally centered inside the box borders.
- implemented optional horizontal main-, recordings- and
weatherforecast menu in metrixhd
Version 0.7.0
- fixed compiling fur unpatched VDR
Version 0.7.1
- fixed bug that setup int parameters do not respect the max value
- added possibility to define help texts for skin setup parameters
Version 0.7.2
Version 1.2.4 (horchi)
- added compatibility to vdr 2.3.8
Version 1.2.5 (horchi)
- added timer type to epg2vdr interface
Version 1.2.6 (horchi)
- extended epg2vdr timer interface for schedules
Version 1.2.7 (horchi)
- changed menu numbering handling vor mcMain
> now only numbers up to 999 are detected as 'Numbering'
Version 1.2.8 (kamel5)
- fixed some look sequence reports
- Updated Makefile
- Optimization for softhdcuvid
- Refactor reruns
- Update services/epgtimer.h
- Refresh imgCache if OsdProvider was changed
Version 1.2.9
- [pbiering] added tokens for framesPerSecond and isHD
- [pbiering] improve HD detection code, catch also stream content 9
Version 1.2.10 (buggy)
- [pbiering] added tokens for recordings: isUHD, isRadio
- [pbiering] added token for channels: isUHD
- [pbiering] expose to displaymenurecordings: recchannelname, recchannelid
- [pbiering] retrieve ChannelName from 'info' and fallback via ChannelID from active channel list
- [kamel5] Update skin estuary4vdr
Version 1.2.11 (buggy)
- [pbiering] align displayed tuner number (0,1,2 -> 1,2,3)
- [pbiering] SVDRP: do not reload in case plugin is not fully initialized (results in VDR crash)
- [pbiering] SVDRP: respond with proper error message in case of OSD is active or parsing error
- [kamel5] Fixed an error in displayreplay if no recording information are available
Version 1.2.12
- [pbiering] added token for recordings: isRecording
- [pbiering] fix crash caused by cVeDmDetailheaderRec::Parse introduced in 1.2.10
Version 1.2.13
- [kamel5] A bug with timeshift in connection with global timers has been fixed
- [kamel5] Fixed a bug in timeshift mode that prevented the progress bar from updating in pause mode
- [kamel5] Update Skin estuary4vdr
- Token eCeMenuSchedulesIT::durationminutes added
- Token eLeMenuDefaultIT::devstatus added
- [kamel5] An error with the remaining time in the channel display has been fixed
- [kamel5] Revision cViewReplay::SetTimeShiftValues
- [kamel5] In timeshift mode, the title of the actual playback position is displayed
- [kamel5] Add token recstart to displayreplay
- [kamel5] Add tokens eventstart and eventstop to eDRRecTitleST
- [kamel5] Disabled timeshift display for non timeshift recordings
- [kamel5] Add element timeShiftTimes with tokens recstart, playbacktime and timeshiftrest to displayreplay
Version 1.2.14
- [kamel5] Revert "Disabled timeshift display for non timeshift recordings"
- [kamel5] Add a different display mode to timeshift for currently active timer recordings
Version 1.2.15
- [kamel5] Update Update italian tanslation in metrixhd and estuary4vdr
- [pbiering] fix tuner device mapping in case tuners are not starting as first device
- [kamel5] Fix cutting marks wasn't updated
Version 1.2.16
- [pbiering] add additional recording flag {isInUse} - can be used in skins for e.g. records in cutting/copy(queue)
- [pbiering] add additional <vdrstatus> exposing {vdrIsRecordingsHandlersActive} and {vdrIsRecording} - can be used in skins for e.g. IDLE/BUSY REC/FREE
- [kamel5] Fix Incorrect detection of a recording that is currently running
- [kamel5] Fix segfault with mpv plugin (thx to @lnj at vdr-portal.de)
- [kamel5] Update skin estuary4vdr
- [pbiering] add {vdrHasTimers} to <vdrstatus> - can be used in skins for e.g. REC/SCHED/FREE (in combination with {vdrIsRecording})
- [pbiering] add <vdrstatus> also to displaymenu.xml to be able to display in header
- [kamel5] Fix display of recording sign in display channel
- [kamel5] Fix a device is currently recording
- [kamel5] Fix update timer in the main menu
Version 1.2.17
- [kamel5] Fix display of events in channel display
- [kamel5] Fix incorrect display of posters and banners in the recording menu
- [kamel5] Fix display of the background in the display channel
- [kamel5] Add token errors for recordings (VDR >= 2.5.4)
- [kamel5] Update Skin estuary4vdr to display errors in recording info
- [kamel5] Update Skin estuary4vdr
Version 1.2.18
- [pbiering] extend detection of isHD and isUHD in case of stored EPG info (event) is missing any information regarding video (e.g. if EPG is missing on a channel)
- [kamel5] Fix compiler error

119
Makefile
View File

@ -4,8 +4,7 @@
# $Id$ Makefile 1.0 2014/07/24 louis Exp $ # $Id$ Makefile 1.0 2014/07/24 louis Exp $
# Config # Config
CONFIG := #-DDOPROFILE # enable profiling code CONFIG := #-DDOPROFILE # enable profiling code
CONFIG += #-DDO_NOT_USE_SKININSTALLER # disable installer in skindesigner setup
# The official name of this plugin. # The official name of this plugin.
PLUGIN = skindesigner PLUGIN = skindesigner
@ -28,7 +27,7 @@ SKINDESIGNER_SCRIPTDIR ?= $(LIBDIR)/$(PLUGIN)/scripts
### The compiler options: ### The compiler options:
export CFLAGS = $(call PKGCFG,cflags) export CFLAGS = $(call PKGCFG,cflags)
export CXXFLAGS = $(call PKGCFG,cxxflags) export CXXFLAGS = $(call PKGCFG,cxxflags)
CXXFLAGS += -std=c++11
### Allow user defined options to overwrite defaults: ### Allow user defined options to overwrite defaults:
-include $(PLGCFG) -include $(PLGCFG)
@ -47,7 +46,6 @@ SOFILE = libvdr-$(PLUGIN).so
DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' $(CONFIG) DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' $(CONFIG)
DEFINES += $(shell xml2-config --cflags) DEFINES += $(shell xml2-config --cflags)
DEFINES += -DSCRIPTFOLDER='"$(SKINDESIGNER_SCRIPTDIR)"' DEFINES += -DSCRIPTFOLDER='"$(SKINDESIGNER_SCRIPTDIR)"'
DEFINES += -D__STL_CONFIG_H
INCLUDES += $(shell pkg-config --cflags freetype2 fontconfig) INCLUDES += $(shell pkg-config --cflags freetype2 fontconfig)
INCLUDES += $(shell pkg-config --cflags librsvg-2.0 cairo-png) -ljpeg INCLUDES += $(shell pkg-config --cflags librsvg-2.0 cairo-png) -ljpeg
@ -67,49 +65,51 @@ OBJS = $(PLUGIN).o \
displayreplay.o \ displayreplay.o \
displaytracks.o \ displaytracks.o \
displayvolume.o \ displayvolume.o \
extensions/cairoimage.o \ displayplugin.o \
extensions/curlfuncs.o \ libcore/cairoimage.o \
extensions/fontmanager.o \ libcore/curlfuncs.o \
extensions/globaltimers.o \ libcore/pixmapcontainer.o \
extensions/imagecache.o \ libcore/fontmanager.o \
extensions/helpers.o \ libcore/imagecache.o \
extensions/imageloader.o \ libcore/helpers.o \
extensions/libxmlwrapper.o \ libcore/imageloader.o \
extensions/pluginmanager.o \ libcore/libxmlwrapper.o \
extensions/recfolderinfo.o \ libcore/recfolderinfo.o \
extensions/scrapmanager.o \ libcore/skinsetup.o \
extensions/skinsetup.o \ libcore/skinrepo.o \
extensions/skinrepo.o \ libcore/extrecinfo.o \
extensions/extrecinfo.o \ libcore/timers.o \
coreengine/animation.o \ libtemplate/globals.o \
coreengine/attribute.o \ libtemplate/parameter.o \
coreengine/attributes.o \ libtemplate/template.o \
coreengine/functions.o \ libtemplate/templateview.o \
coreengine/complextypes.o \ libtemplate/templateviewelement.o \
coreengine/globals.o \ libtemplate/templateviewlist.o \
coreengine/gridelement.o \ libtemplate/templateviewgrid.o \
coreengine/osdwrapper.o \ libtemplate/templatepixmap.o \
coreengine/view.o \ libtemplate/templateviewtab.o \
coreengine/viewdisplaychannel.o \ libtemplate/templatefunction.o \
coreengine/viewdisplaymenu.o \ libtemplate/templateloopfunction.o \
coreengine/viewdisplaymessage.o \ libtemplate/xmlparser.o \
coreengine/viewdisplayreplay.o \ views/animation.o \
coreengine/viewdisplaytracks.o \ views/view.o \
coreengine/viewdisplayvolume.o \ views/viewgrid.o \
coreengine/viewdisplayplugin.o \ views/viewhelpers.o \
coreengine/viewelement.o \ views/displayviewelements.o \
coreengine/viewelementplugin.o \ views/displaychannelview.o \
coreengine/viewelementscommon.o \ views/displaymenurootview.o \
coreengine/viewelementsdisplaychannel.o \ views/displaymenuview.o \
coreengine/viewelementsdisplaymenu.o \ views/displaymenulistview.o \
coreengine/viewelementsdisplayreplay.o \ views/displaymenuitemview.o \
coreengine/viewelementsdisplaytracks.o \ views/displaymenuitemcurrentview.o \
coreengine/viewgrid.o \ views/displaymenudetailview.o \
coreengine/viewlist.o \ views/displaymenutabview.o \
coreengine/viewdetail.o \ views/displaymessageview.o \
coreengine/listelements.o \ views/displayreplayview.o \
coreengine/area.o \ views/displayreplayonpauseview.o \
coreengine/xmlparser.o views/displayvolumeview.o \
views/displayaudiotracksview.o \
views/displaypluginview.o
### The main target: ### The main target:
@ -138,8 +138,7 @@ $(SOFILE): SUB_LIBS = libskindesignerapi/libskindesignerapi.so.$(shell pkg-confi
### Implicit rules: ### Implicit rules:
%.o: %.c %.o: %.c
@echo CC $@ $(CXX) $(CXXFLAGS) -c $(DEFINES) $(SUB_DEFINES) $(INCLUDES) -o $@ $<
$(Q)$(CXX) $(CXXFLAGS) $(CPPFLAGS) -std=c++11 -c $(DEFINES) $(SUB_DEFINES) $(INCLUDES) -o $@ $<
### Dependencies: ### Dependencies:
@ -159,21 +158,17 @@ I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLU
I18Npot = $(PODIR)/$(PLUGIN).pot I18Npot = $(PODIR)/$(PLUGIN).pot
%.mo: %.po %.mo: %.po
@echo MO $@ msgfmt -c -o $@ $<
$(Q)msgfmt -c -o $@ $<
$(I18Npot): $(wildcard *.c) $(I18Npot): $(wildcard *.c)
@echo GT $@ xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^`
$(Q)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) %.po: $(I18Npot)
@echo PO $@ msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $<
$(Q)msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $<
@touch $@ @touch $@
$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo $(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
@echo IN $@ install -D -m644 $< $@
$(Q)install -D -m644 $< $@
.PHONY: i18n .PHONY: i18n
i18n: $(I18Nmo) $(I18Npot) i18n: $(I18Nmo) $(I18Npot)
@ -183,12 +178,10 @@ install-i18n: $(I18Nmsgs)
### Targets: ### Targets:
$(SOFILE): $(OBJS) $(SOFILE): $(OBJS)
@echo LD $@ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) $(SUB_LIBS) -o $@
$(Q)$(CXX) $(CXXFLAGS) -std=c++11 $(LDFLAGS) -shared $(OBJS) $(LIBS) $(SUB_LIBS) -o $@
install-lib: $(SOFILE) install-lib: $(SOFILE)
@echo IN $@ install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
$(Q)install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
install-themes: install-themes:
mkdir -p $(DESTDIR)$(VDRCONFDIR)/themes mkdir -p $(DESTDIR)$(VDRCONFDIR)/themes
@ -204,7 +197,7 @@ install-scripts:
mkdir -p $(DESTDIR)$(SKINDESIGNER_SCRIPTDIR) mkdir -p $(DESTDIR)$(SKINDESIGNER_SCRIPTDIR)
cp -r scripts/* $(DESTDIR)$(SKINDESIGNER_SCRIPTDIR) cp -r scripts/* $(DESTDIR)$(SKINDESIGNER_SCRIPTDIR)
install: install-lib install-i18n install-themes install-skins install-scripts install-subprojects install: install-subprojects install-lib install-i18n install-themes install-skins install-scripts
dist: $(I18Npo) clean dist: $(I18Npo) clean
@-rm -rf $(TMPDIR)/$(ARCHIVE) @-rm -rf $(TMPDIR)/$(ARCHIVE)
@ -216,4 +209,4 @@ dist: $(I18Npo) clean
clean: clean-subprojects clean: clean-subprojects
@-rm -f $(PODIR)/*.mo $(PODIR)/*.pot @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz *~ @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~

18
README
View File

@ -24,7 +24,7 @@ Currently three XML Skins (MetrixHD, nOpacity freestyle and blackhole) are inclu
Requirements Requirements
------------ ------------
- VDR version >= 2.2.0 - VDR version >= 2.0.0
- cairo - cairo
@ -34,13 +34,8 @@ Requirements
- libcurl - libcurl
- softhddevice plugin revision ec58e456 (2015-06-13) or newer. With older - for scaling the video picture to fit into the VDR menu window please use
versions shifting does not work properly softhddevice plugin revision 87c1c7be (2013-01-01) or newer.
- For displaying horizontal menus with VDR <= 2.2.x a VDR patch is required
(see /patches/vdr-2.2.0_horizontal_menu.patch in the plugin source directory)
Without this patch the keys left/right and up/down are not toggled in
horizontal menus. With VDR >= 2.3.1 this patch is not needed anymore.
- epgsearch Git since commit ba7c6277 (2013-01-03) to correctly replace the - epgsearch Git since commit ba7c6277 (2013-01-03) to correctly replace the
schedules menu with epgsearch schedules menu with epgsearch
@ -56,7 +51,7 @@ the library has to be proper installed on your system.
With a "make install" both the plugin and the library are installed on your With a "make install" both the plugin and the library are installed on your
system. The destination where the library will be installed can be set with system. The destination where the library will be installed can be set with
the PREFIX parameter: "PREFIX=/usr make install". Default of PREFIX is the PREFIX parameter: "PREFIX=/usr make install". Default of PREFIX is
/usr/local. /usr/local.
After installation check if libskindesignerapi.pc is correctly found in your After installation check if libskindesignerapi.pc is correctly found in your
PKG_CONFIG_PATH. Other Plugins using the library issue the following PKG_CONFIG_PATH. Other Plugins using the library issue the following
@ -68,11 +63,6 @@ pkg-config --modversion libskindesignerapi
Note that skindesigner itself and all plugins which use libSkindesignerAPI have to Note that skindesigner itself and all plugins which use libSkindesignerAPI have to
be build against the same major verison of the library to be compatible. be build against the same major verison of the library to be compatible.
If you like to disable the possibility to install skins from skindesigner setup
menu, you can enable the option in the makefile or set the option
DO_NOT_USE_SKININSTALLER manually via CPP Flags:
make CPPFLAGS="-DDO_NOT_USE_SKININSTALLER"
After installation you have to care about the paths for the XML skins and epg images. After installation you have to care about the paths for the XML skins and epg images.
The following paths can be set at startup: The following paths can be set at startup:

164
config.c
View File

@ -1,6 +1,6 @@
#include "config.h" #include "config.h"
#include "extensions/helpers.h" #include "libcore/helpers.h"
#include "extensions/imageloader.h" #include "libcore/imageloader.h"
cDesignerConfig::cDesignerConfig() { cDesignerConfig::cDesignerConfig() {
tmplGlobals = NULL; tmplGlobals = NULL;
@ -9,21 +9,20 @@ cDesignerConfig::cDesignerConfig() {
installerSkinPathSet = false; installerSkinPathSet = false;
logoPathSet = false; logoPathSet = false;
//Common //Common
cacheImagesInitial = 1;
numLogosPerSizeInitial = 30; numLogosPerSizeInitial = 30;
limitLogoCache = 1; limitLogoCache = 1;
numLogosMax = 200; numLogosMax = 200;
debugImageLoading = 0; debugImageLoading = 0;
replaceDecPoint = false; replaceDecPoint = false;
//settings for rerun display //settings for rerun display
useSubtitleRerun = 0;
rerunAmount = 10; rerunAmount = 10;
rerunDistance = 2; rerunDistance = 2;
rerunMaxChannel = 0; rerunMaxChannel = 0;
//max number of custom int and string tokens //menu display style, display menu items
numCustomTokens = 10; //one after each other or in one step
//Frames per Second to display animations blockFlush = 1;
FPS = 50; //frames per second for fading and shifting
framesPerSecond = 40;
//remember current skin and theme, osd size and osd fonts //remember current skin and theme, osd size and osd fonts
SetSkin(); SetSkin();
SetOSDSize(); SetOSDSize();
@ -34,9 +33,6 @@ cDesignerConfig::cDesignerConfig() {
cDesignerConfig::~cDesignerConfig() { cDesignerConfig::~cDesignerConfig() {
ClearSkinSetups(); ClearSkinSetups();
for (vector<cTheme*>::iterator it = themes.begin(); it != themes.end(); it++) {
delete *it;
}
} }
void cDesignerConfig::SetPathes(void) { void cDesignerConfig::SetPathes(void) {
@ -50,9 +46,7 @@ void cDesignerConfig::SetPathes(void) {
epgImagePath = cString::sprintf("%s/epgimages/", cPlugin::CacheDirectory(PLUGIN_NAME_I18N)); epgImagePath = cString::sprintf("%s/epgimages/", cPlugin::CacheDirectory(PLUGIN_NAME_I18N));
dsyslog("skindesigner: using Skin Directory %s", *skinPath); dsyslog("skindesigner: using Skin Directory %s", *skinPath);
#ifndef DO_NOT_USE_SKININSTALLER
dsyslog("skindesigner: using Installer Skin Directory %s", *installerSkinPath); dsyslog("skindesigner: using Installer Skin Directory %s", *installerSkinPath);
#endif
dsyslog("skindesigner: using common ChannelLogo Directory %s", *logoPath); dsyslog("skindesigner: using common ChannelLogo Directory %s", *logoPath);
dsyslog("skindesigner: using EPG Images Directory %s", *epgImagePath); dsyslog("skindesigner: using EPG Images Directory %s", *epgImagePath);
@ -89,10 +83,6 @@ bool cDesignerConfig::GetThemeColor(string &name, tColor &col) {
return tmplGlobals->GetColor(name, col); return tmplGlobals->GetColor(name, col);
} }
void cDesignerConfig::StoreTheme(cTheme *theme) {
themes.push_back(theme);
}
void cDesignerConfig::ReadSkinFolder(cString &skinFolder, vector<string> *container) { void cDesignerConfig::ReadSkinFolder(cString &skinFolder, vector<string> *container) {
DIR *folder = NULL; DIR *folder = NULL;
struct dirent *dirEntry; struct dirent *dirEntry;
@ -104,10 +94,7 @@ void cDesignerConfig::ReadSkinFolder(cString &skinFolder, vector<string> *contai
while (dirEntry = readdir(folder)) { while (dirEntry = readdir(folder)) {
string dirEntryName = dirEntry->d_name; string dirEntryName = dirEntry->d_name;
int dirEntryType = dirEntry->d_type; int dirEntryType = dirEntry->d_type;
cString subfolder = cString::sprintf("%s%s", *skinFolder, dirEntryName.c_str()); if (!dirEntryName.compare(".") || !dirEntryName.compare("..") || !dirEntryName.compare("skinrepositories") || dirEntryType != DT_DIR)
if (!dirEntryName.compare(".") || !dirEntryName.compare("..") || !dirEntryName.compare("skinrepositories"))
continue;
if (dirEntryType != DT_DIR && dirEntryType != DT_LNK && !DirectoryOk(*subfolder, false))
continue; continue;
container->push_back(dirEntryName); container->push_back(dirEntryName);
} }
@ -118,13 +105,10 @@ void cDesignerConfig::ReadSkinFolder(cString &skinFolder, vector<string> *contai
void cDesignerConfig::ReadSkins(void) { void cDesignerConfig::ReadSkins(void) {
ReadSkinFolder(skinPath, &deliveredSkins); ReadSkinFolder(skinPath, &deliveredSkins);
#ifndef DO_NOT_USE_SKININSTALLER
ReadSkinFolder(installerSkinPath, &installerSkins); ReadSkinFolder(installerSkinPath, &installerSkins);
#endif
for (vector<string>::iterator it = deliveredSkins.begin(); it != deliveredSkins.end(); it++) { for (vector<string>::iterator it = deliveredSkins.begin(); it != deliveredSkins.end(); it++) {
skins.push_back(*it); skins.push_back(*it);
} }
#ifndef DO_NOT_USE_SKININSTALLER
for (vector<string>::iterator it = installerSkins.begin(); it != installerSkins.end(); it++) { for (vector<string>::iterator it = installerSkins.begin(); it != installerSkins.end(); it++) {
string instSkin = *it; string instSkin = *it;
bool found = false; bool found = false;
@ -137,7 +121,6 @@ void cDesignerConfig::ReadSkins(void) {
if (!found) if (!found)
skins.push_back(instSkin); skins.push_back(instSkin);
} }
#endif
} }
void cDesignerConfig::ClearSkinSetups(void) { void cDesignerConfig::ClearSkinSetups(void) {
@ -190,9 +173,7 @@ cString cDesignerConfig::GetSkinPath(string skin) {
} }
void cDesignerConfig::AddNewSkinRef(string skin) { void cDesignerConfig::AddNewSkinRef(string skin) {
cTheme *theme = new cTheme(); cSkinDesigner *newSkin = new cSkinDesigner(skin);
StoreTheme(theme);
cSkinDesigner *newSkin = new cSkinDesigner(skin, theme);
AddSkin(newSkin); AddSkin(newSkin);
skins.push_back(skin); skins.push_back(skin);
installerSkins.push_back(skin); installerSkins.push_back(skin);
@ -347,11 +328,9 @@ void cDesignerConfig::SetSkinSetupParameters(void) {
} }
void cDesignerConfig::ReadSkinRepos(void) { void cDesignerConfig::ReadSkinRepos(void) {
#ifndef DO_NOT_USE_SKININSTALLER
skinRepos.Init(*installerSkinPath); skinRepos.Init(*installerSkinPath);
skinRepos.Read(*installerSkinPath); skinRepos.Read(*installerSkinPath);
dsyslog("skindesigner: read %d skinrepositories from %s", skinRepos.Count(), *installerSkinPath); dsyslog("skindesigner: read %d skinrepositories from %s", skinRepos.Count(), *installerSkinPath);
#endif
} }
bool cDesignerConfig::CheckVersion(string name, string &neededVersion) { bool cDesignerConfig::CheckVersion(string name, string &neededVersion) {
@ -368,7 +347,7 @@ bool cDesignerConfig::CheckVersion(string name, string &neededVersion) {
} }
splitstring ver(version.c_str()); splitstring ver(version.c_str());
vector<string> tokensVer = ver.split('.', 1); vector<string> tokensVer = ver.split('.', 1);
if (tokensVer.size() < 3) { if (tokensVer.size() != 3) {
esyslog("skindesigner: incorrect version definition: %s", version.c_str()); esyslog("skindesigner: incorrect version definition: %s", version.c_str());
return false; return false;
} }
@ -380,17 +359,14 @@ bool cDesignerConfig::CheckVersion(string name, string &neededVersion) {
int verMinor = atoi(tokensVer[1].c_str()); int verMinor = atoi(tokensVer[1].c_str());
int verMikro = atoi(tokensVer[2].c_str()); int verMikro = atoi(tokensVer[2].c_str());
if (minVerMajor < verMajor) if (minVerMajor > verMajor) {
return true;
if (minVerMajor > verMajor)
return false; return false;
if (minVerMinor < verMinor) } else if (minVerMinor > verMinor) {
return true;
if (minVerMinor > verMinor)
return false; return false;
if (minVerMikro <= verMikro) } else if (minVerMikro > verMikro) {
return true; return false;
return false; }
return true;
} }
bool cDesignerConfig::SkinInstalled(string name) { bool cDesignerConfig::SkinInstalled(string name) {
@ -462,16 +438,6 @@ bool cDesignerConfig::OsdSizeChanged(void) {
return false; return false;
} }
// If softhddevice is suspended, it gives the video size 0x0
// We use this for detect a play mode change and drop the cache, because it is corrupted after being suspended
bool cDesignerConfig::PlayModeChanged(void) {
if (mode_changed) {
mode_changed = 0;
return true;
}
return false;
}
void cDesignerConfig::SetOSDFonts(void) { void cDesignerConfig::SetOSDFonts(void) {
fontFix = Setup.FontFix; fontFix = Setup.FontFix;
fontOsd = Setup.FontOsd; fontOsd = Setup.FontOsd;
@ -506,6 +472,98 @@ cString cDesignerConfig::GetSkinRessourcePath(void) {
return cString::sprintf("%s%s", *skinPath, osdSkin.c_str()); return cString::sprintf("%s%s", *skinPath, osdSkin.c_str());
} }
void cDesignerConfig::AddPluginMenus(string name, map< int, string > menus) {
pluginMenus.insert(pair< string, map < int, string > >(name, menus));
}
void cDesignerConfig::AddPluginViews(string name,
map< int, string > views,
multimap< int, pair <int, string> > subViews,
map< int, map <int, string> > viewElements,
map< int, map <int, string> > viewGrids) {
pluginViews.insert(pair< string, map < int, string > >(name, views));
pluginSubViews.insert(pair< string, multimap< int, pair <int, string> > >(name, subViews));
pluginViewElements.insert(pair< string, map< int, map <int, string> > >(name, viewElements));
pluginViewGrids.insert(pair< string, map< int, map <int, string> > >(name, viewGrids));
}
void cDesignerConfig::InitPluginMenuIterator(void) {
plugMenuIt = pluginMenus.begin();
}
map <int,string> *cDesignerConfig::GetPluginTemplates(string &name) {
if (plugMenuIt == pluginMenus.end())
return NULL;
name = plugMenuIt->first;
map <int,string> *templates = &plugMenuIt->second;
plugMenuIt++;
return templates;
}
void cDesignerConfig::InitPluginViewIterator(void) {
plugViewIt = pluginViews.begin();
}
map <int,string> *cDesignerConfig::GetPluginViews(string &name) {
if (plugViewIt == pluginViews.end())
return NULL;
name = plugViewIt->first;
map <int,string> *views = &plugViewIt->second;
plugViewIt++;
return views;
}
map <int,string> cDesignerConfig::GetPluginSubViews(string name, int viewID) {
map <int,string> subViews;
map < string, multimap< int, pair <int, string> > >::iterator hit = pluginSubViews.find(name);
if (hit == pluginSubViews.end())
return subViews;
multimap< int, pair<int, string> > subs = hit->second;
pair < multimap< int, pair<int, string> >::iterator, multimap< int, pair<int, string> >::iterator> viewSubViews;
viewSubViews = subs.equal_range(viewID);
for (multimap< int, pair<int, string> >::iterator it=viewSubViews.first; it!=viewSubViews.second; ++it) {
pair<int, string> subViewFound = it->second;
subViews.insert(pair<int,string>(subViewFound.first, subViewFound.second));
}
return subViews;
}
int cDesignerConfig::GetPluginViewElementID(string pluginName, string viewElementName, int viewID) {
map < string, map< int, map <int, string> > >::iterator hit = pluginViewElements.find(pluginName);
if (hit == pluginViewElements.end())
return -1;
map< int, map <int, string> >::iterator hit2 = (hit->second).find(viewID);
if (hit2 == (hit->second).end())
return -1;
map <int, string> viewElements = hit2->second;
for (map <int, string>::iterator it = viewElements.begin(); it != viewElements.end(); it++) {
if (!(it->second).compare(viewElementName))
return it->first;
}
return -1;
}
int cDesignerConfig::GetPluginViewGridID(string pluginName, string viewGridName, int viewID) {
map < string, map< int, map <int, string> > >::iterator hit = pluginViewGrids.find(pluginName);
if (hit == pluginViewGrids.end())
return -1;
map< int, map <int, string> >::iterator hit2 = (hit->second).find(viewID);
if (hit2 == (hit->second).end())
return -1;
map <int, string> viewGrids = hit2->second;
for (map <int, string>::iterator it = viewGrids.begin(); it != viewGrids.end(); it++) {
if (!(it->second).compare(viewGridName))
return it->first;
}
return -1;
}
cString cDesignerConfig::CheckSlashAtEnd(std::string path) { cString cDesignerConfig::CheckSlashAtEnd(std::string path) {
try { try {
if (!(path.at(path.size()-1) == '/')) if (!(path.at(path.size()-1) == '/'))
@ -517,16 +575,14 @@ cString cDesignerConfig::CheckSlashAtEnd(std::string path) {
bool cDesignerConfig::SetupParse(const char *Name, const char *Value) { bool cDesignerConfig::SetupParse(const char *Name, const char *Value) {
bool pluginSetupParam = true; bool pluginSetupParam = true;
if (!strcasecmp(Name, "DebugImageLoading")) debugImageLoading = atoi(Value); if (!strcasecmp(Name, "DebugImageLoading")) debugImageLoading = atoi(Value);
else if (!strcasecmp(Name, "CacheImagesInitial")) cacheImagesInitial = atoi(Value);
else if (!strcasecmp(Name, "LimitChannelLogoCache")) limitLogoCache = atoi(Value); else if (!strcasecmp(Name, "LimitChannelLogoCache")) limitLogoCache = atoi(Value);
else if (!strcasecmp(Name, "NumberLogosInitially")) numLogosPerSizeInitial = atoi(Value); else if (!strcasecmp(Name, "NumberLogosInitially")) numLogosPerSizeInitial = atoi(Value);
else if (!strcasecmp(Name, "NumberLogosMax")) numLogosMax = atoi(Value); else if (!strcasecmp(Name, "NumberLogosMax")) numLogosMax = atoi(Value);
else if (!strcasecmp(Name, "UseSubtitleRerun")) useSubtitleRerun = atoi(Value);
else if (!strcasecmp(Name, "RerunAmount")) rerunAmount = atoi(Value); else if (!strcasecmp(Name, "RerunAmount")) rerunAmount = atoi(Value);
else if (!strcasecmp(Name, "RerunDistance")) rerunDistance = atoi(Value); else if (!strcasecmp(Name, "RerunDistance")) rerunDistance = atoi(Value);
else if (!strcasecmp(Name, "RerunMaxChannel")) rerunMaxChannel = atoi(Value); else if (!strcasecmp(Name, "RerunMaxChannel")) rerunMaxChannel = atoi(Value);
else if (!strcasecmp(Name, "NumCustomTokens")) numCustomTokens = atoi(Value); else if (!strcasecmp(Name, "BlockFlush")) blockFlush = atoi(Value);
else if (!strcasecmp(Name, "FPS")) FPS = atoi(Value); else if (!strcasecmp(Name, "FramesPerSecond")) framesPerSecond = atoi(Value);
else pluginSetupParam = false; else pluginSetupParam = false;
if (!pluginSetupParam) { if (!pluginSetupParam) {

View File

@ -8,13 +8,11 @@
#include <vdr/skins.h> #include <vdr/skins.h>
#include <vdr/plugin.h> #include <vdr/plugin.h>
#include "designer.h" #include "designer.h"
#include "extensions/pluginmanager.h" #include "libcore/fontmanager.h"
#include "extensions/fontmanager.h" #include "libcore/imagecache.h"
#include "extensions/imagecache.h" #include "libcore/recfolderinfo.h"
#include "extensions/recfolderinfo.h" #include "libcore/skinsetup.h"
#include "extensions/skinsetup.h" #include "libcore/skinrepo.h"
#include "extensions/skinrepo.h"
#include "libskindesignerapi/skindesignerapi.h"
#define SCRIPTOUTPUTPATH "/tmp/skindesigner" #define SCRIPTOUTPUTPATH "/tmp/skindesigner"
@ -34,8 +32,14 @@ private:
string fontSml; string fontSml;
string osdLanguage; string osdLanguage;
cGlobals *tmplGlobals; cGlobals *tmplGlobals;
map < string, map < int, string > > pluginMenus;
map < string, map < int, string > >::iterator plugMenuIt;
map < string, map < int, string > > pluginViews;
map < string, map < int, string > >::iterator plugViewIt;
map < string, multimap< int, pair <int, string> > > pluginSubViews;
map < string, map< int, map <int, string> > > pluginViewElements;
map < string, map< int, map <int, string> > > pluginViewGrids;
vector<cSkinDesigner*> skinRefs; vector<cSkinDesigner*> skinRefs;
vector<cTheme*> themes;
vector<cSkinDesigner*>::iterator skinRefsIterator; vector<cSkinDesigner*>::iterator skinRefsIterator;
vector<string> deliveredSkins; vector<string> deliveredSkins;
vector<string> installerSkins; vector<string> installerSkins;
@ -57,7 +61,6 @@ public:
void SetLogoPath(cString path); void SetLogoPath(cString path);
void SetEpgImagePath(cString path); void SetEpgImagePath(cString path);
bool GetThemeColor(string &name, tColor &col); bool GetThemeColor(string &name, tColor &col);
void StoreTheme(cTheme *theme);
void ReadSkins(void); void ReadSkins(void);
void ReadSkinSetup(string skin); void ReadSkinSetup(string skin);
void InitSkinIterator(void) { skinIterator = skins.begin(); }; void InitSkinIterator(void) { skinIterator = skins.begin(); };
@ -92,12 +95,20 @@ public:
bool SkinChanged(void); bool SkinChanged(void);
void SetOSDSize(void); void SetOSDSize(void);
bool OsdSizeChanged(void); bool OsdSizeChanged(void);
bool PlayModeChanged(void);
void SetOSDFonts(void); void SetOSDFonts(void);
bool OsdFontsChanged(void); bool OsdFontsChanged(void);
void SetOsdLanguage(void) { osdLanguage = Setup.OSDLanguage; }; void SetOsdLanguage(void) { osdLanguage = Setup.OSDLanguage; };
bool OsdLanguageChanged(void); bool OsdLanguageChanged(void);
cString GetSkinRessourcePath(void); cString GetSkinRessourcePath(void);
void AddPluginMenus(string name, map< int, string > menus);
void AddPluginViews(string name, map< int, string > views, multimap< int, pair <int, string> > subViews, map< int, map <int, string> > viewElements, map< int, map <int, string> > viewGrids);
void InitPluginMenuIterator(void);
map <int,string> *GetPluginTemplates(string &name);
void InitPluginViewIterator(void);
map <int,string> *GetPluginViews(string &name);
map <int,string> GetPluginSubViews(string name, int viewID);
int GetPluginViewElementID(string pluginName, string viewElementName, int viewID);
int GetPluginViewGridID(string pluginName, string viewGridName, int viewID);
cString skinPath; cString skinPath;
cString installerSkinPath; cString installerSkinPath;
cString logoPath; cString logoPath;
@ -106,33 +117,30 @@ public:
bool replaceDecPoint; bool replaceDecPoint;
char decPoint; char decPoint;
//Setup Parameter //Setup Parameter
int cacheImagesInitial;
int numLogosPerSizeInitial; int numLogosPerSizeInitial;
int limitLogoCache; int limitLogoCache;
int numLogosMax; int numLogosMax;
int debugImageLoading; int debugImageLoading;
int useSubtitleRerun;
int rerunAmount; int rerunAmount;
int rerunDistance; int rerunDistance;
int rerunMaxChannel; int rerunMaxChannel;
int numCustomTokens; int blockFlush;
int FPS; int framesPerSecond;
//TemplateReload on Setup Close //TemplateReload on Setup Close
bool setupCloseDoReload; bool setupCloseDoReload;
int mode_changed;
}; };
#ifdef DEFINE_CONFIG #ifdef DEFINE_CONFIG
cDesignerConfig config; cDesignerConfig config;
cSDPluginManager *plgManager = NULL;
cFontManager *fontManager = NULL; cFontManager *fontManager = NULL;
cImageCache *imgCache = NULL; cImageCache *imgCache = NULL;
cRecordingsFolderInfo recFolderInfo; cTheme Theme;
cRecordingsFolderInfo recFolderInfo(Recordings);
#else #else
extern cDesignerConfig config; extern cDesignerConfig config;
extern cSDPluginManager *plgManager;
extern cFontManager *fontManager; extern cFontManager *fontManager;
extern cImageCache *imgCache; extern cImageCache *imgCache;
extern cTheme Theme;
extern cRecordingsFolderInfo recFolderInfo; extern cRecordingsFolderInfo recFolderInfo;
#endif #endif

View File

@ -1,679 +0,0 @@
#include "../config.h"
#include "animation.h"
#include <math.h>
/******************************************************************
* cDetacher
******************************************************************/
cDetacher::cDetacher(cDetachable *detachable, bool wait, bool animation) : cThread("detacher thread") {
this->detachable = detachable;
waitOnWakeup = wait;
keepSleeping = false;
doAnimation = animation;
}
cDetacher::~cDetacher(void) {
sleepWait.Signal();
Cancel(2);
}
void cDetacher::WakeUp(void) {
sleepWait.Signal();
}
void cDetacher::ResetSleep(void) {
keepSleeping = true;
sleepWait.Signal();
}
void cDetacher::Stop(bool deletePixmaps) {
sleepWait.Signal();
Cancel(2);
}
void cDetacher::Action(void) {
if (!detachable) {
return;
}
if (waitOnWakeup) {
Wait();
int delay = 50 + detachable->Delay();
Sleep(delay);
} else {
int delay = detachable->Delay();
if (delay > 0)
Sleep(delay);
}
detachable->ParseDetached();
detachable->RenderDetached();
if (!doAnimation)
detachable->Flush();
if (!Running()) return;
if (doAnimation) {
detachable->StartAnimation();
}
}
void cDetacher::Sleep(int duration) {
if (duration <= 0)
return;
do {
keepSleeping = false;
sleepWait.Wait(duration);
} while (keepSleeping);
}
void cDetacher::Wait(void) {
//wait has to be waked up from outside
sleepWait.Wait(0);
}
/******************************************************************
* cAnimaton
******************************************************************/
cAnimation::cAnimation(void) {
started = 0;
finished = false;
persistent = false;
frametime = 1000 / config.FPS;
}
cAnimation::~cAnimation(void) {
}
/******************************************************************
* cScroller
******************************************************************/
cScroller::cScroller(cScrollable *scrollable) {
this->scrollable = scrollable;
paused = true;
pauseTime = 0;
scrollingStarted = false;
secondDelay = false;
delScrollPix = true;
Init();
}
cScroller::~cScroller(void) {
}
void cScroller::Init(void) {
delay = scrollable->ScrollDelay();
orientation = scrollable->ScrollOrientation();
if (orientation == eOrientation::horizontal) {
scrollLength = scrollable->ScrollWidth();
} else if (orientation == eOrientation::vertical) {
scrollLength = scrollable->ScrollHeight();
}
eScrollMode mode = scrollable->ScrollMode();
carriageReturn = (mode == eScrollMode::carriagereturn) ? true : false;
drawPortX = 0.0f;
drawPortY = 0.0f;
eScrollSpeed speed = scrollable->ScrollSpeed();
if (speed == eScrollSpeed::slow)
scrollDelta = 0.5f;
else if (speed == eScrollSpeed::fast)
scrollDelta = 2.0f;
else
scrollDelta = 1.0f;
}
void cScroller::Reactivate(void) {}
void cScroller::SetInitial(void) {
scrollable->SetScrollingStarted();
}
bool cScroller::Pause(void) {
if (!paused)
return false;
if ((pauseTime + frametime) > delay) {
paused = false;
pauseTime = 0;
return false;
}
pauseTime += frametime;
return true;
}
bool cScroller::Overflow(void) {
if (orientation == eOrientation::horizontal) {
if (!carriageReturn && (drawPortX >= 1)) {
drawPortX = 0;
scrollDelta *= -1;
paused = true;
return true;
}
if (carriageReturn && (drawPortX >= 0) && secondDelay) {
cPoint drawPortPoint(drawPortX,0);
scrollable->SetDrawPort(drawPortPoint);
drawPortX = -1;
paused = true;
secondDelay = false;
return true;
}
if (abs((int)drawPortX) < scrollLength)
return false;
if (carriageReturn) {
drawPortX = 0;
secondDelay = true;
} else {
scrollDelta *= -1;
drawPortX -= scrollDelta;
}
} else if (orientation == eOrientation::vertical) {
if ((drawPortY >= 0) && secondDelay) {
cPoint drawPortPoint(0, drawPortY);
scrollable->SetDrawPort(drawPortPoint);
drawPortY = -1;
paused = true;
secondDelay = false;
return true;
}
if (abs((int)drawPortY) < scrollLength)
return false;
secondDelay = true;
drawPortY = 0;
}
paused = true;
return true;
}
void cScroller::SetFinished(void) {
finished = true;
if (delScrollPix) {
scrollable->StopScrolling();
}
}
bool cScroller::Tick(void) {
if (finished) {
return false;
}
if (Pause())
return true;
if (!scrollingStarted) {
scrollable->StartScrolling();
scrollingStarted = true;
}
if (Overflow())
return true;
cPoint drawPortPoint(0,0);
if (orientation == eOrientation::horizontal) {
drawPortX -= scrollDelta;
drawPortPoint.SetX(drawPortX);
} else if (orientation == eOrientation::vertical) {
drawPortY -= scrollDelta;
drawPortPoint.SetY(drawPortY);
}
scrollable->SetDrawPort(drawPortPoint);
return true;
};
/******************************************************************
* cFader
******************************************************************/
cFader::cFader(cFadable *fadable) {
this->fadable = fadable;
fadein = true;
fadetime = fadable->FadeTime();
step = 100.0f / ((double)fadetime / (double)frametime);
transparency = 100;
hideWhenFinished = false;
}
cFader::~cFader(void) {
}
void cFader::Reactivate(void) {
started = 0;
finished = false;
fadein = false;
}
void cFader::SetInitial(void) {
fadable->SetTransparency(transparency);
}
void cFader::SetFadeOut(void) {
fadein = false;
transparency = 0;
}
void cFader::SetFinished(void) {
finished = true;
if (hideWhenFinished)
fadable->SetTransparency(100);
}
bool cFader::Tick(void) {
if (finished) {
if (fadein)
fadable->SetTransparency(0);
else
fadable->SetTransparency(100);
return false;
}
if (!started) {
started = cTimeMs::Now();
}
if ((int)(cTimeMs::Now() - started) > fadetime) {
if (fadein)
fadable->SetTransparency(0);
else
fadable->SetTransparency(100);
finished = true;
return false;
}
fadable->SetTransparency(transparency);
if (fadein) {
transparency -= step;
} else {
transparency += step;
}
return true;
};
/******************************************************************
* cShifter
******************************************************************/
cShifter::cShifter(cShiftable *shiftable) {
this->shiftable = shiftable;
step = 0;
shiftin = true;
shifttime = 0;
x = 0.0f;
y = 0.0f;
stepXLinear = 0.0f;
stepYLinear = 0.0f;
stepsFast = 0;
stepXFast = 0.0f;
stepXSlow = 0.0f;
stepYFast = 0.0f;
stepYSlow = 0.0f;
Init();
}
cShifter::~cShifter(void) {
}
void cShifter::Init(void) {
shifttime = shiftable->ShiftTime();
mode = (eShiftMode)shiftable->ShiftMode();
shiftable->ShiftPositions(&start, &end);
int steps = (double)shifttime / (double)frametime;
if (steps <= 0) steps = 1;
float percentFast = 33.3f;
float distanceFast = 85.0f;
stepsFast = (float)steps * percentFast / 100.0f;
if (start.X() == end.X()) {
stepYLinear = (float)(end.Y() - start.Y()) / (float)steps;
stepYFast = (float)(end.Y() - start.Y()) * distanceFast / 100.0f / (float)stepsFast;
stepYSlow = (float)(end.Y() - start.Y()) * (100.0f - distanceFast) / 100.0f / (float)(steps-stepsFast);
} else if (start.Y() == end.Y()) {
stepXLinear = (float)(end.X() - start.X()) / (float)steps;
stepXFast = (float)(end.X() - start.X()) * distanceFast / 100.0f / (float)stepsFast;
stepXSlow = (float)(end.X() - start.X()) * (100.0f - distanceFast) / 100.0f / (float)(steps-stepsFast);
} else {
stepXLinear = (float)(end.X() - start.X()) / (float)steps;
stepXFast = (float)(end.X() - start.X()) * distanceFast / 100.0f / (float)stepsFast;
stepXSlow = (float)(end.X() - start.X()) * (100.0f - distanceFast) / 100.0f / (float)(steps-stepsFast);
stepYLinear = (float)(end.Y() - start.Y()) / (float)steps;
stepYFast = (float)(end.Y() - start.Y()) * distanceFast / 100.0f / (float)stepsFast;
stepYSlow = (float)(end.Y() - start.Y()) * (100.0f - distanceFast) / 100.0f / (float)(steps-stepsFast);
}
if (shiftin) {
x = start.X();
y = start.Y();
} else {
x = end.X();
y = end.Y();
}
}
void cShifter::Reactivate(void) {
started = 0;
finished = false;
shiftin = false;
step = 0;
Init();
}
void cShifter::SetInitial(void) {
cPoint pos(x, y);
shiftable->SetPosition(pos, end);
}
void cShifter::NextPosition(void) {
if (mode == eShiftMode::linear) {
if (shiftin) {
x += stepXLinear;
y += stepYLinear;
} else {
x -= stepXLinear;
y -= stepYLinear;
}
} else if (mode == eShiftMode::slowedDown) {
if (shiftin) {
if (step <= stepsFast) {
x += stepXFast;
y += stepYFast;
} else {
x += stepXSlow;
y += stepYSlow;
}
} else {
if (step <= stepsFast) {
x -= stepXFast;
y -= stepYFast;
} else {
x -= stepXSlow;
y -= stepYSlow;
}
}
}
}
bool cShifter::Tick(void) {
if (finished)
return false;
if (!started) {
started = cTimeMs::Now();
}
if ((int)(cTimeMs::Now() - started) > shifttime) {
if (shiftin)
shiftable->SetPosition(end, end);
else
shiftable->SetPosition(start, end);
finished = true;
return false;
}
cPoint pos(x, y);
shiftable->SetPosition(pos, end);
step++;
NextPosition();
return true;
};
/******************************************************************
* cListShifter
******************************************************************/
cListShifter::cListShifter(cListShiftable *shiftable) {
this->shiftable = shiftable;
shifttime = shiftable->ListShiftTime();
distance = shiftable->ShiftDistance();
orientation = shiftable->ShiftOrientation();
int steps = (double)shifttime / (double)frametime;
if (steps <= 0) steps = 1;
step = distance / steps;
shiftin = true;
fromtop = true;
}
cListShifter::~cListShifter(void) {
}
void cListShifter::Reactivate(void) {}
void cListShifter::SetInitial(void) {
if (shiftin) {
if (orientation == eOrientation::horizontal) {
if (fromtop) {
pos.SetX(-1 * distance);
pos.SetY(0);
} else {
pos.SetX(distance);
pos.SetY(0);
}
} else {
if (fromtop) {
pos.SetX(0);
pos.SetY(-1 * distance);
} else {
pos.SetX(0);
pos.SetY(distance);
}
}
}
shiftable->SetIndicatorPosition(pos);
}
void cListShifter::NextPosition(void) {
int x = pos.X();
int y = pos.Y();
if (orientation == eOrientation::horizontal) {
if (fromtop) {
pos.SetX(x+step);
} else {
pos.SetX(x-step);
}
} else {
if (fromtop) {
pos.SetY(y+step);
} else {
pos.SetY(y-step);
}
}
}
void cListShifter::EndPosition(void) {
if (shiftin) {
pos.SetX(0);
pos.SetY(0);
} else {
if (orientation == eOrientation::horizontal) {
pos.SetX(distance);
} else {
pos.SetY(distance);
}
}
shiftable->SetIndicatorPosition(pos);
}
bool cListShifter::Tick(void) {
if (finished) {
EndPosition();
return false;
}
if (!started) {
started = cTimeMs::Now();
}
if ((int)(cTimeMs::Now() - started) > shifttime) {
EndPosition();
finished = true;
return false;
}
shiftable->SetIndicatorPosition(pos);
NextPosition();
return true;
};
/******************************************************************
* cBlinker
******************************************************************/
cBlinker::cBlinker(cBlinkable *blinkable, int blinkFunc) {
this->blinkable = blinkable;
this->blinkFunc = blinkFunc;
freq = blinkable->BlinkFreq(blinkFunc);
blinkOn = false;
paused = true;
pauseTime = 0;
}
cBlinker::~cBlinker(void) {
}
void cBlinker::Reactivate(void) {}
void cBlinker::SetInitial(void) {}
bool cBlinker::Pause(void) {
if (!paused)
return false;
if ((pauseTime + frametime) > freq) {
paused = false;
pauseTime = 0;
return false;
}
pauseTime += frametime;
return true;
}
bool cBlinker::Tick(void) {
if (finished)
return false;
if (Pause())
return true;
blinkable->DoBlink(blinkFunc, blinkOn);
blinkOn = !blinkOn;
paused = true;
pauseTime = 0;
return true;
};
/******************************************************************
* cAnimator
******************************************************************/
cAnimator::cAnimator(cSdOsd *osd) : cThread("animator thread") {
this->osd = osd;
timeneeded = 0;
timeslice = 1000 / config.FPS;
}
cAnimator::~cAnimator(void) {
Stop();
}
void cAnimator::Sleep(uint64_t start) {
timeneeded = cTimeMs::Now() - start;
int sleepTime = (timeslice - timeneeded) > 0 ? timeslice - timeneeded : 0;
if (sleepTime)
sleepWait.Wait(sleepTime);
}
void cAnimator::DoTick(bool &animActive) {
animLock.Lock();
for (cAnimation *animation = animations.First(); animation; animation = animations.Next(animation)) {
if (Running()) {
bool currentAnimActive = animation->Tick();
animActive = animActive || currentAnimActive;
}
}
animLock.Unlock();
}
/*****************************************************************************************
* Cleanup Anims
* removes finished anims
* remembers persistent anims
*****************************************************************************************/
void cAnimator::CleanupAnims(void) {
bool found;
animLock.Lock();
do {
found = false;
for (cAnimation *animation = animations.First(); animation; animation = animations.Next(animation)) {
if (!animation->Finished())
continue;
if (animation->Persistent()) {
animations.Del(animation, false);
animationsPersistent.Add(animation);
} else {
animations.Del(animation);
}
found = true;
break;
}
} while (found);
animLock.Unlock();
}
/*****************************************************************************************
* Main Loop
*****************************************************************************************/
void cAnimator::Action(void) {
while(Running()) {
bool animActive = false;
uint64_t start = cTimeMs::Now();
DoTick(animActive); if (!Running()) break;
osd->Flush(); if (!Running()) break;
CleanupAnims(); if (!Running()) break;
if (!animActive) {
pauseWait.Wait();
} else {
Sleep(start);
}
}
}
/*****************************************************************************************
* Add Animation
* if startAnim is set to true, main loop gets waked up
*****************************************************************************************/
void cAnimator::AddAnimation(cAnimation *animation, bool startAnim) {
animation->SetInitial();
animLock.Lock();
animations.Ins(animation);
animLock.Unlock();
if (startAnim)
pauseWait.Signal();
}
/*****************************************************************************************
* Remove Animation
* animation will be set to finished and removed later by Cleanup()
*****************************************************************************************/
void cAnimator::RemoveAnimation(cAnimation *remove) {
animLock.Lock();
for (cAnimation *animation = animations.First(); animation; animation = animations.Next(animation)) {
if (animation == remove) {
animation->SetFinished();
break;
}
}
animLock.Unlock();
}
/*****************************************************************************************
* Finish Main Loop
*****************************************************************************************/
void cAnimator::Stop(void) {
if (!Running())
return;
Cancel(-1);
pauseWait.Signal();
sleepWait.Signal();
Cancel(2);
}
/*****************************************************************************************
* shift or fade out persistent animations
*****************************************************************************************/
void cAnimator::Finish(void) {
bool animActive = true;
bool reactivate = true;
while(animActive) {
animActive = false;
uint64_t start = cTimeMs::Now();
animLock.Lock();
for (cAnimation *animation = animationsPersistent.First(); animation; animation = animationsPersistent.Next(animation)) {
if (reactivate)
animation->Reactivate();
bool currentAnimActive = animation->Tick();
animActive = animActive || currentAnimActive;
}
animLock.Unlock();
reactivate = false;
if (!animActive)
break;
osd->Flush();
Sleep(start);
}
}

View File

@ -1,268 +0,0 @@
#ifndef __ANIMATION_H
#define __ANIMATION_H
#include <vdr/skins.h>
#include <vdr/thread.h>
#include "definitions.h"
#include "osdwrapper.h"
/******************************************************************
* Detaching
******************************************************************/
class cDetachable {
protected:
cDetachable(void) {};
~cDetachable(void) {};
public:
virtual int Delay(void) = 0;
virtual void StartAnimation(void) = 0;
virtual void ParseDetached(void) = 0;
virtual void RenderDetached(void) = 0;
virtual void Flush(void) = 0;
};
class cDetacher : public cThread, public cListObject {
private:
cCondWait sleepWait;
cDetachable *detachable;
bool waitOnWakeup;
bool keepSleeping;
bool doAnimation;
void Sleep(int duration);
void Wait(void);
virtual void Action(void);
public:
cDetacher(cDetachable *detachable, bool wait, bool animation);
~cDetacher(void);
void WakeUp(void);
void ResetSleep(void);
void Stop(bool deletePixmaps);
};
/******************************************************************
* cAnimation
******************************************************************/
class cAnimation : public cListObject {
protected:
uint64_t started;
bool finished;
bool persistent;
int frametime;
public:
cAnimation(void);
virtual ~cAnimation(void);
virtual void SetInitial(void) = 0;
virtual void Reactivate(void) = 0;
virtual bool Tick(void) = 0;
bool Finished(void) { return finished; };
virtual void SetFinished(void) { finished = true; };
void SetPersistent(void) { persistent = true; };
bool Persistent(void) { return persistent; };
};
/******************************************************************
* Scrolling
******************************************************************/
class cScrollable {
protected:
cScrollable(void) {};
~cScrollable(void) {};
public:
virtual int ScrollDelay(void) = 0;
virtual int ScrollWidth(void) = 0;
virtual int ScrollHeight(void) = 0;
virtual eScrollMode ScrollMode(void) = 0;
virtual eScrollSpeed ScrollSpeed(void) = 0;
virtual eOrientation ScrollOrientation(void) = 0;
virtual void SetScrollingStarted(void) = 0;
virtual void StartScrolling(void) = 0;
virtual void StopScrolling(void) = 0;
virtual void SetDrawPort(cPoint &point) = 0;
};
class cScroller : public cAnimation {
private:
cScrollable *scrollable;
int delay;
bool paused;
int pauseTime;
bool scrollingStarted;
bool secondDelay;
eOrientation orientation;
int scrollLength;
bool carriageReturn;
float drawPortX;
float drawPortY;
float scrollDelta;
bool delScrollPix;
void Init(void);
bool Pause(void);
bool Overflow(void);
public:
cScroller(cScrollable *scrollable);
~cScroller(void);
void SetInitial(void);
void Reactivate(void);
void SetFinished(void);
void UnsetDelScrollPix(void) { delScrollPix = false; };
bool Tick(void);
};
/******************************************************************
* Fading
******************************************************************/
class cFadable {
protected:
cFadable(void) {};
~cFadable(void) {};
public:
virtual int Delay(void) = 0;
virtual int FadeTime(void) = 0;
virtual void SetTransparency(int transparency, bool force = false) = 0;
};
class cFader : public cAnimation {
private:
cFadable *fadable;
bool fadein;
int fadetime;
int step;
int transparency;
bool hideWhenFinished;
public:
cFader(cFadable *fadable);
~cFader(void);
void SetInitial(void);
void Reactivate(void);
void SetFadeOut(void);
void SetFinished(void);
void SetHideWhenFinished(void) { hideWhenFinished = true; };
bool Tick(void);
};
/******************************************************************
* Shifting
******************************************************************/
class cShiftable {
protected:
cShiftable(void) {};
~cShiftable(void) {};
public:
virtual int Delay(void) = 0;
virtual int ShiftTime(void) = 0;
virtual int ShiftMode(void) = 0;
virtual void ShiftPositions(cPoint *start, cPoint *end) = 0;
virtual void SetPosition(cPoint &position, cPoint &reference, bool force = false) = 0;
};
class cListShiftable {
protected:
cListShiftable(void) {};
~cListShiftable(void) {};
public:
virtual int ListShiftTime(void) = 0;
virtual int ShiftDistance(void) = 0;
virtual eOrientation ShiftOrientation(void) = 0;
virtual void SetIndicatorPosition(cPoint &position) = 0;
};
class cShifter : public cAnimation {
private:
cShiftable *shiftable;
bool shiftin;
cPoint start, end;
int shifttime;
eShiftMode mode;
int step;
float stepXLinear, stepYLinear;
int stepsFast;
float stepXFast, stepXSlow;
float stepYFast, stepYSlow;
float x, y;
void Init(void);
void NextPosition(void);
public:
cShifter(cShiftable *shiftable);
~cShifter(void);
void SetInitial(void);
void Reactivate(void);
bool Tick(void);
};
class cListShifter : public cAnimation {
private:
cListShiftable *shiftable;
bool shiftin;
bool fromtop;
int distance;
eOrientation orientation;
int shifttime;
int step;
cPoint pos;
void NextPosition(void);
void EndPosition(void);
public:
cListShifter(cListShiftable *shiftable);
~cListShifter(void);
void SetInitial(void);
void Reactivate(void);
void SetShiftOut(void) { shiftin = false; };
void SetDirection(bool fromTop) { fromtop = fromTop; };
bool Tick(void);
};
/******************************************************************
* Blinking
******************************************************************/
class cBlinkable {
protected:
cBlinkable(void) {};
~cBlinkable(void) {};
public:
virtual int BlinkFreq(int func) = 0;
virtual void DoBlink(int func, bool on) = 0;
};
class cBlinker : public cAnimation {
private:
cBlinkable *blinkable;
int blinkFunc;
int freq;
bool blinkOn;
bool paused;
int pauseTime;
bool Pause(void);
public:
cBlinker(cBlinkable *blinkable, int blinkFunc);
~cBlinker(void);
void SetInitial(void);
void Reactivate(void);
bool Tick(void);
};
/******************************************************************
* cAnimator
******************************************************************/
class cAnimator : public cThread {
private:
cSdOsd *osd;
cCondWait sleepWait;
cCondWait pauseWait;
int timeslice;
int timeneeded;
cMutex animLock;
cList<cAnimation> animations;
cList<cAnimation> animationsPersistent;
void Sleep(uint64_t start);
void DoTick(bool &animActive);
void CleanupAnims(void);
virtual void Action(void);
public:
cAnimator(cSdOsd *osd);
~cAnimator(void);
void AddAnimation(cAnimation *animation, bool startAnim = true);
void RemoveAnimation(cAnimation *remove);
void Stop(void);
void Finish(void);
};
#endif //__ANIMATION_H

View File

@ -1,824 +0,0 @@
#include "area.h"
#include "../config.h"
/******************************************************************
* cAreaNode
******************************************************************/
cAreaNode::cAreaNode(void) {
globals = NULL;
isTab = false;
activeTab = false;
}
cAreaNode::~cAreaNode(void) {
}
void cAreaNode::SetContainer(int x, int y, int width, int height) {
container.SetX(x);
container.SetY(y);
container.SetWidth(width);
container.SetHeight(height);
}
/******************************************************************
* cArea
******************************************************************/
cArea::cArea(void) {
sdOsd = NULL;
init = true;
isBackgroundArea = false;
attribs = new cAreaAttribs((int)eAreaAttribs::count);
scrolling = false;
isScrolling = false;
scrollingStarted = false;
scrollFunc = NULL;
blinking = false;
areaContainer = NULL;
pix = NULL;
}
cArea::cArea(const cArea &other) {
sdOsd = other.sdOsd;
init = true;
isBackgroundArea = false;
pix = NULL;
globals = other.globals;
attribs = new cAreaAttribs(*other.attribs);
//area container is set from outside during cloning of areacontainer
areaContainer = NULL;
scrollingStarted = false;
//scrolling is set from outside by ScrollFunc(), see below
scrolling = other.scrolling;
isScrolling = false;
blinking = false;
scrollFunc = NULL;
for (const cFunction *func = other.functions.First(); func; func = other.functions.Next(func)) {
if (cFuncFill *f = dynamic_cast<cFuncFill*>((cFunction*)func)) {
cFuncFill *fFill = new cFuncFill(*f);
fFill->SetOwner(this);
functions.Add(fFill);
} else if (cFuncDrawRectangle *f = dynamic_cast<cFuncDrawRectangle*>((cFunction*)func)) {
cFuncDrawRectangle *fDrawRect = new cFuncDrawRectangle(*f);
fDrawRect->SetOwner(this);
functions.Add(fDrawRect);
} else if (cFuncDrawEllipse *f = dynamic_cast<cFuncDrawEllipse*>((cFunction*)func)) {
cFuncDrawEllipse *fDrawEllipse = new cFuncDrawEllipse(*f);
fDrawEllipse->SetOwner(this);
functions.Add(fDrawEllipse);
} else if (cFuncDrawSlope *f = dynamic_cast<cFuncDrawSlope*>((cFunction*)func)) {
cFuncDrawSlope *fDrawSlope = new cFuncDrawSlope(*f);
fDrawSlope->SetOwner(this);
functions.Add(fDrawSlope);
} else if (cFuncDrawText *f = dynamic_cast<cFuncDrawText*>((cFunction*)func)) {
cFuncDrawText *fDrawText = new cFuncDrawText(*f);
fDrawText->SetOwner(this);
functions.Add(fDrawText);
} else if (cFuncDrawTextVertical *f = dynamic_cast<cFuncDrawTextVertical*>((cFunction*)func)) {
cFuncDrawTextVertical *fDrawTextVertical = new cFuncDrawTextVertical(*f);
fDrawTextVertical->SetOwner(this);
functions.Add(fDrawTextVertical);
} else if (cFuncDrawTextBox *f = dynamic_cast<cFuncDrawTextBox*>((cFunction*)func)) {
cFuncDrawTextBox *fDrawTextBox = new cFuncDrawTextBox(*f);
fDrawTextBox->SetOwner(this);
functions.Add(fDrawTextBox);
} else if (cFuncDrawImage *f = dynamic_cast<cFuncDrawImage*>((cFunction*)func)) {
cFuncDrawImage *fDrawImage = new cFuncDrawImage(*f);
fDrawImage->SetOwner(this);
functions.Add(fDrawImage);
} else {
esyslog("skindesigner: ERROR: unknown function in area cloning!!!");
}
}
//func references have to be set from outside if already cached clone is wanted
for (cFunction *f = functions.First(); f; f = functions.Next(f)) {
f->CacheFuncReferences();
}
if (scrolling) {
SetScrollFunc();
}
}
cArea::~cArea(void) {
StopBlinkers();
delete attribs;
}
void cArea::SetGlobals(cGlobals *globals) {
this->globals = globals;
attribs->SetGlobals(globals);
for (cFunction *f = functions.First(); f; f = functions.Next(f)) {
f->SetGlobals(globals);
}
}
void cArea::SetTokenContainer(skindesignerapi::cTokenContainer *tokenContainer) {
attribs->SetTokenContainer(tokenContainer);
for (cFunction *f = functions.First(); f; f = functions.Next(f)) {
f->SetTokenContainer(tokenContainer);
}
}
void cArea::SetTokenContainerDeep(skindesignerapi::cTokenContainer *tokenContainer) {
attribs->SetTokenContainerDeep(tokenContainer);
for (cFunction *f = functions.First(); f; f = functions.Next(f)) {
f->SetTokenContainerDeep(tokenContainer);
}
}
void cArea::SetAttributes(vector<stringpair> &attributes) {
attribs->Set(attributes);
}
bool cArea::ValidFunction(const char *func) {
if (!strcmp(func, "fill")) return true;
if (!strcmp(func, "drawtext")) return true;
if (!strcmp(func, "drawtextbox")) return true;
if (!strcmp(func, "drawtextvertical")) return true;
if (!strcmp(func, "drawimage")) return true;
if (!strcmp(func, "drawrectangle")) return true;
if (!strcmp(func, "drawellipse")) return true;
if (!strcmp(func, "drawslope")) return true;
esyslog("skindesigner: unknown function \"%s\"", func);
return false;
}
cFunction *cArea::AddFunction(const char *name, vector<stringpair> attribs, cFuncLoop *loopFunc) {
cFunction *f = NULL;
if (!strcmp(name, "fill")) {
f = new cFuncFill(this, (int)eFillAttribs::count);
} else if (!strcmp(name, "drawrectangle")) {
f = new cFuncDrawRectangle(this, (int)eDrawRectangleAttribs::count);
} else if (!strcmp(name, "drawellipse")) {
f = new cFuncDrawEllipse(this, (int)eDrawEllipseAttribs::count);
} else if (!strcmp(name, "drawslope")) {
f = new cFuncDrawSlope(this, (int)eDrawSlopeAttribs::count);
} else if (!strcmp(name, "drawtext")) {
f = new cFuncDrawText(this, (int)eDrawTextAttribs::count);
} else if (!strcmp(name, "drawtextvertical")) {
f = new cFuncDrawTextVertical(this, (int)eDrawTextAttribs::count);
} else if (!strcmp(name, "drawtextbox")) {
f = new cFuncDrawTextBox(this, (int)eDrawTextBoxAttribs::count);
} else if (!strcmp(name, "drawimage")) {
f = new cFuncDrawImage(this, (int)eDrawImageAttribs::count);
} else if (!strcmp(name, "loop")) {
f = new cFuncLoop(this, (int)eLoopAttribs::count);
}
if (!f) {
esyslog("skindesigner: TODO: function \"%s\" not implemented", name);
return NULL;
}
f->Set(attribs);
if (!loopFunc)
functions.Add(f);
else
loopFunc->AddFunction(f);
return f;
}
cFunction *cArea::GetFunction(const char *name) {
for (cFunction *f = functions.First(); f; f = functions.Next(f)) {
const char *funcName = f->Name();
if (funcName && !strcmp(funcName, name)) {
return f;
}
cFuncLoop *loopFunc = dynamic_cast<cFuncLoop*>(f);
if (loopFunc) {
cFunction *lf = loopFunc->GetFunction(name);
if (lf)
return lf;
}
}
if (!areaContainer)
return NULL;
return areaContainer->GetFunction(name);
}
void cArea::SetX(int x) {
attribs->SetX(x);
}
void cArea::SetY(int y) {
attribs->SetY(y);
}
void cArea::SetWidth(int width) {
attribs->SetWidth(width);
for (cFunction *f = functions.First(); f; f = functions.Next(f)) {
f->SetContainer(0, 0, attribs->Width(), attribs->Height());
}
}
void cArea::SetHeight(int height) {
attribs->SetHeight(height);
for (cFunction *f = functions.First(); f; f = functions.Next(f)) {
f->SetContainer(0, 0, attribs->Width(), attribs->Height());
}
}
void cArea::Cache(void) {
attribs->SetContainer(container.X(), container.Y(), container.Width(), container.Height());
attribs->Cache();
attribs->CheckDynamic();
isBackgroundArea = attribs->BackgroundArea();
for (cFunction *f = functions.First(); f; f = functions.Next(f)) {
if (!attribs->Dynamic()) {
f->SetContainer(0, 0, attribs->Width(), attribs->Height());
} else {
f->SetContainer(0, 0, -1, -1);
}
f->Cache();
}
for (cFunction *f = functions.First(); f; f = functions.Next(f)) {
f->CacheFuncReferences();
}
if (scrolling) {
SetScrollFunc();
}
}
void cArea::Close(void) {
StopBlinkers();
if (pix) {
sdOsd->DestroyPixmap(pix);
pix = NULL;
}
init = true;
scrollingStarted = false;
}
void cArea::Clear(bool forceClearBackground) {
if (!init && isBackgroundArea && !forceClearBackground) {
return;
}
StopBlinkers();
if (pix) {
pix->SetDrawPortPoint(cPoint(0,0));
pix->Fill(clrTransparent);
}
scrollingStarted = false;
}
void cArea::ClearWithoutIndicators(void) {
if (attribs->IndicatorArea()) {
return;
}
StopBlinkers();
if (pix) {
pix->Fill(clrTransparent);
}
scrollingStarted = false;
}
void cArea::Hide(void) {
StopBlinkers();
if (pix) {
pix->SetLayer(-1);
}
}
void cArea::Show(void) {
StartBlinkers();
if (pix) {
pix->SetLayer(attribs->Layer());
}
}
void cArea::Render(void) {
if (attribs->DoDebug())
Debug();
if (init) {
InitFunctions();
init = false;
}
if (!isScrolling && scrollFunc && attribs->Orientation() == (int)eOrientation::horizontal) {
scrollFunc->Scrolling(false);
} else if (isScrolling && scrollFunc && attribs->Orientation() == (int)eOrientation::horizontal) {
scrollFunc->Scrolling(true);
}
if (!pix) {
if (!IsTab())
CreatePixmap();
else {
int overlap = ScrollHeight();
if (overlap > 0) {
cRect drawport;
drawport.SetX(0);
drawport.SetY(0);
drawport.SetWidth(attribs->Width());
drawport.SetHeight(overlap + attribs->Height());
CreatePixmap(drawport);
} else {
CreatePixmap();
}
}
}
for (cFunction *f = functions.First(); f; f = functions.Next(f)) {
if (f->DoDebug())
f->Debug();
if (!f->DoExecute())
continue;
if (pix) {
f->Render(pix);
}
}
StartBlinkers();
}
bool cArea::Execute(void) {
return attribs->DoExecute();
}
void cArea::SetTransparency(int transparency, bool absolute) {
if (transparency < 0 || transparency > 100)
return;
int alpha = (100 - transparency)*255/100;
if (!absolute) {
int pixTransparency = attribs->Transparency();
if (pixTransparency > 0) {
alpha = (100 - pixTransparency) * alpha / 100;
}
}
if (pix) {
pix->SetAlpha(alpha);
}
}
void cArea::SetIndicatorTransparency(int transparency) {
if (!attribs->IndicatorArea())
return;
if (transparency < 0 || transparency > 100)
return;
int alpha = (100 - transparency)*255/100;
if (pix) {
pix->SetAlpha(alpha);
}
}
void cArea::SetIndicatorPosition(cPoint &pos) {
if (!attribs->IndicatorArea())
return;
SetDrawPort(pos);
}
bool cArea::Scrolling(void) {
if (!scrolling)
return false;
if (!Execute())
return false;
if (ScrollOrientation() == eOrientation::horizontal) {
if (!scrollFunc)
return false;
if (scrollFunc->X() + scrollFunc->FuncWidth() > attribs->Width())
return true;
} else if (ScrollOrientation() == eOrientation::vertical) {
int maxHeight = 0;
for (cFunction *f = functions.First(); f; f = functions.Next(f)) {
int funcHeight = f->FuncY() + f->FuncHeight();
if (funcHeight > maxHeight)
maxHeight = funcHeight;
}
if (maxHeight > attribs->Height())
return true;
}
return false;
}
int cArea::ScrollWidth(void) {
if (!scrollFunc)
return 0;
return scrollFunc->X() + scrollFunc->FuncWidth() + 10 - attribs->Width();
}
int cArea::ScrollHeight(void) {
int maxHeight = 0;
for (cFunction *f = functions.First(); f; f = functions.Next(f)) {
if (!f->DoExecute())
continue;
int funcHeight = f->FuncY() + f->FuncHeight();
if (funcHeight > maxHeight)
maxHeight = funcHeight;
}
return maxHeight - attribs->Height();
}
int cArea::ScrollDelay(void) {
return attribs->Delay();
}
eScrollMode cArea::ScrollMode(void) {
return (eScrollMode)attribs->Mode();
}
eScrollSpeed cArea::ScrollSpeed(void) {
return (eScrollSpeed)attribs->ScrollSpeed();
}
eOrientation cArea::ScrollOrientation(void) {
return (eOrientation)attribs->Orientation();
}
void cArea::StartScrolling(void) {
cRect drawport;
drawport.SetX(0);
drawport.SetY(0);
if (ScrollOrientation() == eOrientation::horizontal) {
drawport.SetWidth(ScrollWidth() + attribs->Width());
drawport.SetHeight(attribs->Height());
} else if (ScrollOrientation() == eOrientation::vertical) {
drawport.SetWidth(attribs->Width());
drawport.SetHeight(ScrollHeight() + attribs->Height() + 10);
}
isScrolling = true;
CreatePixmap(drawport);
Render();
}
void cArea::StopScrolling(void) {
isScrolling = false;
if (pix && !(pix->ViewPort().Size() == pix->DrawPort().Size())) {
sdOsd->DestroyPixmap(pix);
pix = NULL;
}
}
void cArea::SetViewPort(cRect &vp) {
if (!pix)
return;
pix->SetViewPort(vp);
}
void cArea::SetPosition(cPoint &pos, cPoint &ref) {
if (!pix)
return;
int x0 = attribs->X() == -1 ? 0 : attribs->X();
int y0 = attribs->Y() == -1 ? 0 : attribs->Y();
int x = (x0 - ref.X()) + pos.X();
int y = (y0 - ref.Y()) + pos.Y();
/* Enable for xineliboutput OSD Bug
if (x < 0) x = 0;
if (y < 0) y = 0;
*/
pix->SetViewPort(cRect(x, y, pix->ViewPort().Width(), pix->ViewPort().Height()));
}
void cArea::SetDrawPort(cPoint &point) {
if (!pix)
return;
pix->SetDrawPortPoint(point);
}
cRect cArea::ViewPort(void) {
if (!pix)
return cRect::Null;
cRect vp = pix->ViewPort();
return vp;
}
cRect cArea::CoveringArea(void) {
return ViewPort();
}
cRect cArea::DrawPort(void) {
if (!pix)
return cRect::Null;
cRect dp = pix->DrawPort();
return dp;
}
int cArea::BlinkFreq(int func) {
cFunction *blinkFunc = functions.Get(func);
if (!blinkFunc)
return -1;
return blinkFunc->BlinkFreq();
}
void cArea::DoBlink(int func, bool on) {
cFunction *blinker = functions.Get(func);
if (!blinker)
return;
if (on) {
if (pix) {
blinker->Render(pix);
}
} else {
cRect blinkRect = cRect(blinker->GetX((eAlign)blinker->Align(), 0, 0),
blinker->GetY((eAlign)blinker->Valign(), 0, 0),
blinker->FuncWidth(),
blinker->FuncHeight());
if (pix) {
pix->DrawRectangle(blinkRect, clrTransparent);
}
}
}
void cArea::Debug(bool full) {
esyslog("skindesigner: --> area");
esyslog("skindesigner: container %d %d %dx%d", container.X(), container.Y(), container.Width(), container.Height());
attribs->Debug();
if (!full)
return;
for (cFunction *f = functions.First(); f; f = functions.Next(f)) {
f->Debug();
}
}
/******************************************************************
* Private Functions
******************************************************************/
void cArea::InitFunctions(void) {
if (!attribs->Dynamic())
return;
for (cFunction *f = functions.First(); f; f = functions.Next(f)) {
f->SetContainer(0, 0, attribs->Width(), attribs->Height());
}
}
void cArea::CreatePixmap(cRect drawPort) {
if (pix) {
sdOsd->DestroyPixmap(pix);
pix = NULL;
}
if (attribs->Width() <=0 || attribs->Height() <= 0) {
return;
}
int layer = attribs->Layer();
cRect viewPort(attribs->X() == -1 ? 0 : attribs->X(), attribs->Y() == -1 ? 0 : attribs->Y(), attribs->Width(), attribs->Height());
pix = sdOsd->CreatePixmap(layer, viewPort, drawPort);
if (pix)
pix->Clear();
int pixTransparency = attribs->Transparency();
if (pixTransparency > 0) {
SetTransparency(pixTransparency, true);
}
}
void cArea::SetScrollFunc(void) {
//if area has only one function, take this anyway
if (functions.Count() == 1) {
scrollFunc = functions.First();
return;
}
//else use scrollelement name
const char *scrollFuncName = attribs->GetScrollElement();
if (!scrollFuncName)
return;
for (cFunction *f = functions.First(); f; f = functions.Next(f)) {
if (!f->Name())
continue;
if (!strcmp(f->Name(), scrollFuncName)) {
scrollFunc = f;
return;
}
}
}
void cArea::StartBlinkers(void) {
if (blinking)
return;
blinking = true;
int func = 0;
for (cFunction *f = functions.First(); f; f = functions.Next(f)) {
if (!f->DoExecute()) {
func++;
continue;
}
if (f->Blinking()) {
cBlinker *blinker = new cBlinker((cBlinkable*)this, func);
blinkers.push_back(blinker);
cView::AddAnimation(blinker);
}
func++;
}
}
void cArea::StopBlinkers(void) {
blinking = false;
for (list<cBlinker*>::iterator it = blinkers.begin(); it != blinkers.end(); it++) {
cView::RemoveAnimation(*it);
}
blinkers.clear();
}
/******************************************************************
* cAreaContainer
******************************************************************/
cAreaContainer::cAreaContainer(void) {
attribs = new cAreaContainerAttribs((int)eAreaContainerAttribs::count);
}
cAreaContainer::cAreaContainer(const cAreaContainer &other) {
globals = other.globals;
attribs = new cAreaContainerAttribs(*other.attribs);
for (const cArea *area = other.areas.First(); area; area = other.areas.Next(area)) {
cArea *a = new cArea(*area);
a->SetAreaContainer(this);
areas.Add(a);
}
}
cAreaContainer::~cAreaContainer(void) {
delete attribs;
}
void cAreaContainer::SetAttributes(vector<stringpair> &attributes) {
attribs->Set(attributes);
}
void cAreaContainer::SetGlobals(cGlobals *globals) {
this->globals = globals;
attribs->SetGlobals(globals);
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->SetGlobals(globals);
}
}
void cAreaContainer::SetTokenContainer(skindesignerapi::cTokenContainer *tokenContainer) {
attribs->SetTokenContainer(tokenContainer);
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->SetTokenContainer(tokenContainer);
}
}
void cAreaContainer::SetTokenContainerDeep(skindesignerapi::cTokenContainer *tokenContainer) {
attribs->SetTokenContainerDeep(tokenContainer);
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->SetTokenContainerDeep(tokenContainer);
}
}
void cAreaContainer::AddArea(cArea *area) {
area->SetAreaContainer(this);
areas.Add(area);
}
cFunction *cAreaContainer::GetFunction(const char *name) {
cFunction *fRef = NULL;
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
fRef = area->GetFunction(name);
if (fRef)
return fRef;
}
return NULL;
}
void cAreaContainer::SetX(int x) {
attribs->SetX(x);
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->SetX(x);
}
}
void cAreaContainer::SetY(int y) {
attribs->SetY(y);
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->SetY(y);
}
}
void cAreaContainer::SetWidth(int width) {
attribs->SetWidth(width);
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->SetWidth(width);
}
}
void cAreaContainer::SetHeight(int height) {
attribs->SetHeight(height);
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->SetHeight(height);
}
}
void cAreaContainer::Cache(void) {
attribs->SetContainer(container.X(), container.Y(), container.Width(), container.Height());
attribs->Cache();
int x = attribs->X() > -1 ? attribs->X() : container.X();
int y = attribs->Y() > -1 ? attribs->Y() : container.Y();
int width = attribs->Width() > -1 ? attribs->Width() : container.Width();
int height = attribs->Height() > -1 ? attribs->Height() : container.Height();
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->SetContainer(x, y, width, height);
if (attribs->Width() > -1) {
area->SetWidth(width);
}
if (attribs->Height() > -1) {
area->SetHeight(height);
}
area->Cache();
}
}
void cAreaContainer::Close(void) {
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->Close();
}
}
void cAreaContainer::Clear(bool forceClearBackground) {
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->Clear(forceClearBackground);
}
}
void cAreaContainer::ClearWithoutIndicators(void) {
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->ClearWithoutIndicators();
}
}
void cAreaContainer::Hide(void) {
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->Hide();
}
}
void cAreaContainer::Show(void) {
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->Show();
}
}
void cAreaContainer::Render(void) {
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
if (area->Execute())
area->Render();
}
}
bool cAreaContainer::Execute(void) {
return attribs->DoExecute();
}
void cAreaContainer::SetTransparency(int transparency, bool absolute) {
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->SetTransparency(transparency, absolute);
}
}
void cAreaContainer::SetIndicatorTransparency(int transparency) {
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->SetIndicatorTransparency(transparency);
}
}
void cAreaContainer::SetIndicatorPosition(cPoint &pos) {
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->SetIndicatorPosition(pos);
}
}
void cAreaContainer::SetViewPort(cRect &vp) {
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->SetViewPort(vp);
}
}
void cAreaContainer::SetPosition(cPoint &pos, cPoint &ref) {
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->SetPosition(pos, ref);
}
}
cRect cAreaContainer::CoveringArea(void) {
cRect unionArea;
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
unionArea.Combine(area->CoveringArea());
}
return unionArea;
}
bool cAreaContainer::Scrolling(void) {
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
if (area->Scrolling())
return true;
}
return false;
}
cArea *cAreaContainer::ScrollingArea(void) {
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
if (area->Execute() && area->Scrolling())
return area;
}
return NULL;
}
void cAreaContainer::Debug(bool full) {
esyslog("skindesigner: --> area container");
esyslog("skindesigner: container %d %d %dx%d", container.X(), container.Y(), container.Width(), container.Height());
attribs->Debug();
if (!full)
return;
for (cArea *area = areas.First(); area; area = areas.Next(area)) {
area->Debug(full);
}
}

View File

@ -1,193 +0,0 @@
#ifndef __TEMPLATEAREA_H
#define __TEMPLATEAREA_H
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <list>
#include "osdwrapper.h"
#include "definitions.h"
#include "globals.h"
#include "../libskindesignerapi/tokencontainer.h"
#include "attributes.h"
#include "functions.h"
#include "animation.h"
class cArea;
/******************************************************************
* cAreaNode
******************************************************************/
class cAreaNode : public cListObject {
protected:
cGlobals *globals;
cRect container;
bool isTab;
bool activeTab;
public:
cAreaNode(void);
virtual ~cAreaNode(void);
virtual void SetGlobals(cGlobals *globals) {};
virtual void SetTokenContainer(skindesignerapi::cTokenContainer *tokenContainer) {};
virtual void SetTokenContainerDeep(skindesignerapi::cTokenContainer *tokenContainer) {};
void SetContainer(int x, int y, int width, int height);
virtual void SetAttributes(vector<stringpair> &attributes) {};
virtual void SetX(int x) {};
virtual void SetY(int y) {};
virtual void SetWidth(int width) {};
virtual void SetHeight(int height) {};
void SetTab(void) { isTab = true; };
bool IsTab(void) { return isTab; };
void SetActiveTab(bool active) { activeTab = active; };
bool ActiveTab(void) { return activeTab; };
virtual int GetWidth(void) { return 0; };
virtual void Cache(void) {};
virtual void Close(void) {};
virtual void StopBlinkers(void) {};
virtual void Clear(bool forceClearBackground = false) {};
virtual void ClearWithoutIndicators(void) {};
virtual void Hide(void) {};
virtual void Show(void) {};
virtual void Render(void) {};
virtual bool Execute(void) { return true; };
virtual void SetTransparency(int transparency, bool absolute = false) {};
virtual void SetIndicatorTransparency(int transparency) {};
virtual void SetViewPort(cRect &vp) {};
virtual void SetPosition(cPoint &pos, cPoint &ref) {};
virtual void SetIndicatorPosition(cPoint &pos) {};
virtual cRect CoveringArea(void) { return cRect::Null; };
virtual bool Scrolling(void) { return false; };
virtual bool ScrollingStarted(void) { return false; };
virtual cArea *ScrollingArea(void) { return NULL; };
virtual cFunction *GetFunction(const char *name) { return NULL; };
virtual const char *Name(void) { return NULL; };
virtual bool BackgroundArea(void) { return false; };
virtual void Debug(bool full = false) {};
};
class cAreaContainer;
/******************************************************************
* cArea
******************************************************************/
class cArea : public cAreaNode, public cScrollable, public cBlinkable {
private:
cSdOsd *sdOsd;
bool init;
bool isBackgroundArea;
cPixmap *pix;
cAreaAttribs *attribs;
cAreaContainer *areaContainer;
cList<cFunction> functions;
bool scrolling;
bool isScrolling;
bool scrollingStarted;
cFunction *scrollFunc;
list<cBlinker*> blinkers;
bool blinking;
void InitFunctions(void);
void CreatePixmap(cRect drawPort = cRect::Null);
void SetScrollFunc(void);
void StartBlinkers(void);
public:
cArea(void);
cArea(const cArea &other);
virtual ~cArea(void);
void SetOsd(cSdOsd *osd) { sdOsd = osd; };
void SetGlobals(cGlobals *globals);
void SetTokenContainer(skindesignerapi::cTokenContainer *tokenContainer);
void SetTokenContainerDeep(skindesignerapi::cTokenContainer *tokenContainer);
void SetAttributes(vector<stringpair> &attributes);
void SetScrolling(void) { scrolling = true; };
void SetAreaContainer(cAreaContainer *ac) { areaContainer = ac; };
bool ValidFunction(const char *func);
cFunction *AddFunction(const char *name, vector<stringpair> attribs, cFuncLoop *loopFunc = NULL);
cFunction *GetFunction(const char *name);
void SetX(int x);
void SetY(int y);
void SetWidth(int width);
void SetHeight(int height);
void Cache(void);
int GetWidth(void) { return attribs->Width(); };
void Close(void);
void Clear(bool forceClearBackground = false);
void ClearWithoutIndicators(void);
void Hide(void);
void Show(void);
void Render(void);
bool Execute(void);
bool IsIndicatorArea(void) { return attribs->IndicatorArea(); };
void SetTransparency(int transparency, bool absolute = false);
void SetIndicatorTransparency(int transparency);
void SetIndicatorPosition(cPoint &pos);
cRect CoveringArea(void);
//Scrollable
bool Scrolling(void);
void SetScrollingStarted(void) { scrollingStarted = true; };
bool ScrollingStarted(void) { return scrollingStarted; };
int ScrollWidth(void);
int ScrollHeight(void);
int ScrollDelay(void);
eScrollMode ScrollMode(void);
eScrollSpeed ScrollSpeed(void);
eOrientation ScrollOrientation(void);
cArea *ScrollingArea(void) { return this; };
void StartScrolling(void);
void StopScrolling(void);
cRect ViewPort(void);
void SetDrawPort(cPoint &point);
void SetViewPort(cRect &vp);
void SetPosition(cPoint &pos, cPoint &ref);
cRect DrawPort(void);
int ScrollStep(void) { return attribs->ScrollStep(); };
//Blinkable
int BlinkFreq(int func);
void DoBlink(int func, bool on);
void StopBlinkers(void);
//Common
const char *Name(void) { return attribs->Name(); };
bool BackgroundArea(void) { return attribs->BackgroundArea(); };
void Debug(bool full = false);
};
/******************************************************************
* cAreaContainer
******************************************************************/
class cAreaContainer : public cAreaNode {
private:
cAreaContainerAttribs *attribs;
cList<cArea> areas;
public:
cAreaContainer(void);
cAreaContainer(const cAreaContainer &other);
virtual ~cAreaContainer(void);
void SetGlobals(cGlobals *globals);
void SetTokenContainer(skindesignerapi::cTokenContainer *tokenContainer);
void SetTokenContainerDeep(skindesignerapi::cTokenContainer *tokenContainer);
void SetAttributes(vector<stringpair> &attributes);
void AddArea(cArea *area);
cFunction *GetFunction(const char *name);
void SetX(int x);
void SetY(int y);
void SetWidth(int width);
void SetHeight(int height);
void Cache(void);
void Close(void);
void Clear(bool forceClearBackground = false);
void ClearWithoutIndicators(void);
void Hide(void);
void Show(void);
void Render(void);
bool Execute(void);
void SetTransparency(int transparency, bool absolute = false);
void SetIndicatorTransparency(int transparency);
void SetIndicatorPosition(cPoint &pos);
void SetViewPort(cRect &vp);
void SetPosition(cPoint &pos, cPoint &ref);
cRect CoveringArea(void);
bool Scrolling(void);
cArea *ScrollingArea(void);
void Debug(bool full = false);
};
#endif //__TEMPLATEAREA_H

View File

@ -1,486 +0,0 @@
#include "attribute.h"
#include "../config.h"
/***************************************************************************
* cAttributes
***************************************************************************/
cAttributes::cAttributes(int numAttributes) {
globals = NULL;
tokenContainer = NULL;
numAttribs = (int)eCommonAttribs::count + numAttributes;
attribs = new int[numAttribs];
for (int i=0; i < numAttribs; i++)
attribs[i] = ATTR_UNKNOWN;
attribCtors = new cNumericExpr*[numAttribs];
for (int i=0; i < numAttribs; i++)
attribCtors[i] = NULL;
cond = NULL;
SetCommonAttributesDefs();
}
cAttributes::cAttributes(const cAttributes &other) : cAttributes(other.numAttribs - (int)eCommonAttribs::count){
globals = other.globals;
for (int i=0; i < numAttribs; i++) {
attribs[i] = other.attribs[i];
if (other.attribCtors[i]) {
attribCtors[i] = new cNumericExpr(*other.attribCtors[i]);
attribCtors[i]->SetContainer(&container);
}
}
cond = NULL;
if (other.cond) {
cond = new cCondition(*other.cond);
}
attribIDs = other.attribIDs;
attribNames = other.attribNames;
}
cAttributes::~cAttributes(void) {
delete[] attribs;
for (int i=0; i < numAttribs; i++) {
delete attribCtors[i];
}
delete[] attribCtors;
delete cond;
}
void cAttributes::SetTokenContainer(skindesignerapi::cTokenContainer *tokenContainer) {
this->tokenContainer = tokenContainer;
}
void cAttributes::SetTokenContainerDeep(skindesignerapi::cTokenContainer *tokenContainer) {
this->tokenContainer = tokenContainer;
if (cond) {
cond->SetTokenContainer(tokenContainer);
}
for (int i=0; i < numAttribs; i++) {
if (!attribCtors[i])
continue;
attribCtors[i]->SetTokenContainer(tokenContainer);
}
}
void cAttributes::SetContainer(int x, int y, int width, int height) {
container.SetX(x);
container.SetY(y);
container.SetWidth(width);
container.SetHeight(height);
}
void cAttributes::SetX(int x) {
attribs[(int)eCommonAttribs::x] = x;
}
void cAttributes::SetY(int y) {
attribs[(int)eCommonAttribs::y] = y;
}
void cAttributes::SetWidth(int width) {
attribs[(int)eCommonAttribs::width] = width;
}
void cAttributes::SetHeight(int height) {
attribs[(int)eCommonAttribs::height] = height;
}
void cAttributes::Cache(void) {
if (cond) {
cond->SetGlobals(globals);
cond->SetTokenContainer(tokenContainer);
cond->Prepare();
}
for (int i=0; i < numAttribs; i++) {
if (!attribCtors[i])
continue;
attribCtors[i]->SetContainer(&container);
attribCtors[i]->SetGlobals(globals);
attribCtors[i]->SetTokenContainer(tokenContainer);
if (attribCtors[i]->CacheStatic()) {
int val = attribCtors[i]->GetValue();
attribs[i] = val;
delete attribCtors[i];
attribCtors[i] = NULL;
} else {
attribCtors[i]->PrepareTokens();
}
}
}
int cAttributes::GetValue(int id) {
if (!attribCtors[id + (int)eCommonAttribs::count])
return attribs[(int)id + (int)eCommonAttribs::count];
return attribCtors[id + (int)eCommonAttribs::count]->Calculate();
}
int cAttributes::X(void) {
int x = 0;
if (!attribCtors[(int)eCommonAttribs::x])
x = attribs[(int)eCommonAttribs::x];
else
x = attribCtors[(int)eCommonAttribs::x]->Calculate();
x += container.X();
return x;
}
int cAttributes::Y(void) {
int y = 0;
if (!attribCtors[(int)eCommonAttribs::y])
y = attribs[(int)eCommonAttribs::y];
else
y = attribCtors[(int)eCommonAttribs::y]->Calculate();
y += container.Y();
return y;
}
int cAttributes::Width(void) {
if (!attribCtors[(int)eCommonAttribs::width])
return attribs[(int)eCommonAttribs::width];
return attribCtors[(int)eCommonAttribs::width]->Calculate();
}
int cAttributes::Height(void) {
if (!attribCtors[(int)eCommonAttribs::height])
return attribs[(int)eCommonAttribs::height];
return attribCtors[(int)eCommonAttribs::height]->Calculate();
}
bool cAttributes::DoExecute(void) {
if (!cond)
return true;
return cond->True();
}
void cAttributes::Debug(void) {
esyslog("skindesigner: container %d %d %dx%d", container.X(), container.Y(), container.Width(), container.Height());
for (int i=0; i < numAttribs; i++) {
if (attribs[i] != ATTR_UNKNOWN) {
if (i == (int)eCommonAttribs::debug)
continue;
const char *attName = "attribute";
if (i < (int)eCommonAttribs::count)
attName = CommonAttributeName(i);
else
attName = AttributeName(i - (int)eCommonAttribs::count);
dsyslog("skindesigner: fixed Value %s = %d", attName, attribs[i]);
}
if (attribCtors[i]) {
const char *attName = "attribute";
if (i < (int)eCommonAttribs::count)
attName = CommonAttributeName(i);
else
attName = AttributeName(i - (int)eCommonAttribs::count);
dsyslog("skindesigner: %s constructor:", attName);
attribCtors[i]->Debug();
}
}
if (cond) {
cond->Debug();
}
}
/***************************************************************************
* Protected Functions
***************************************************************************/
int cAttributes::CommonAttributeId(const char *att) {
if (!strcmp(att, "condition"))
return ATTR_COND;
map<string, int>::iterator hit = commonAttribIDs.find(att);
if (hit != commonAttribIDs.end())
return hit->second;
return ATTR_UNKNOWN;
}
const char *cAttributes::CommonAttributeName(int id) {
if (id < 0 || id >= (int)eCommonAttribs::count)
return "";
map<int, string>::iterator hit = commonAttribNames.find(id);
if (hit != commonAttribNames.end())
return hit->second.c_str();
return "";
}
int cAttributes::AttributeId(const char *att) {
int id = CommonAttributeId(att);
if (id != ATTR_UNKNOWN)
return id;
map<string, int>::iterator hit = attribIDs.find(att);
if (hit != attribIDs.end())
id = (int)hit->second + (int)eCommonAttribs::count;
return id;
}
const char *cAttributes::AttributeName(int id) {
map<int, string>::iterator hit = attribNames.find(id);
if (hit != attribNames.end())
return hit->second.c_str();
return "";
}
bool cAttributes::SetCommon(int id, const char *val) {
if (id == ATTR_COND) {
cond = new cCondition(val);
return true;
}
if (id == (int)eCommonAttribs::debug) {
SetBool(id, val);
return true;
} else if (id == (int)eCommonAttribs::x || id == (int)eCommonAttribs::width) {
attribCtors[id] = new cNumericExpr(val);
return true;
} else if (id == (int)eCommonAttribs::y || id == (int)eCommonAttribs::height) {
attribCtors[id] = new cNumericExpr(val);
attribCtors[id]->SetVertical();
return true;
}
return false;
}
bool cAttributes::IdEqual(int id, int compId) {
if (compId + (int)eCommonAttribs::count == id)
return true;
return false;
}
void cAttributes::SetBool(int id, const char *val) {
if (!strcmp(val, "true")) {
attribs[id] = 1;
} else {
attribs[id] = 0;
}
}
void cAttributes::SetViewElementMode(int id, const char *val) {
eViewElementMode mode = eViewElementMode::regular;
if (!strcmp(val, "light"))
mode = eViewElementMode::light;
attribs[id] = (int)mode;
}
void cAttributes::SetShiftType(int id, const char *val) {
eShiftType shiftType = eShiftType::none;
if (!strcmp(val, "left"))
shiftType = eShiftType::left;
else if (!strcmp(val, "right"))
shiftType = eShiftType::right;
else if (!strcmp(val, "top"))
shiftType = eShiftType::top;
else if (!strcmp(val, "bottom"))
shiftType = eShiftType::bottom;
else {
esyslog("skindesigner: unknown shift type \"%s\"", val);
return;
}
attribs[id] = (int)shiftType;
}
void cAttributes::SetShiftMode(int id, const char *val) {
eShiftMode shiftMode = eShiftMode::linear;
if (!strcmp(val, "slowed"))
shiftMode = eShiftMode::slowedDown;
attribs[id] = (int)shiftMode;
}
void cAttributes::SetScrollMode(int id, const char *val) {
eScrollMode mode = eScrollMode::none;
if (!strcmp(val, "forthandback"))
mode = eScrollMode::forthandback;
else if (!strcmp(val, "carriagereturn"))
mode = eScrollMode::carriagereturn;
attribs[id] = (int)mode;
}
void cAttributes::SetScrollSpeed(int id, const char *val) {
eScrollSpeed speed = eScrollSpeed::medium;
if (!strcmp(val, "slow"))
speed = eScrollSpeed::slow;
else if (!strcmp(val, "fast"))
speed = eScrollSpeed::fast;
else if (!strcmp(val, "medium"))
speed = eScrollSpeed::medium;
attribs[id] = (int)speed;
}
void cAttributes::SetOrientation(int id, const char *val) {
eOrientation orientation = eOrientation::none;
if (!strcmp(val, "horizontal"))
orientation = eOrientation::horizontal;
else if (!strcmp(val, "vertical"))
orientation = eOrientation::vertical;
else if (!strcmp(val, "absolute"))
orientation = eOrientation::absolute;
attribs[id] = (int)orientation;
}
void cAttributes::SetAlign(int id, const char *val) {
eAlign align = eAlign::left;
if (!strcmp(val, "center")) {
align = eAlign::center;
} else if (!strcmp(val, "right")) {
align = eAlign::right;
} else if (!strcmp(val, "top")) {
align = eAlign::top;
} else if (!strcmp(val, "bottom")) {
align = eAlign::bottom;
} else if (!strcmp(val, "left")) {
align = eAlign::left;
}
attribs[id] = (int)align;
}
void cAttributes::SetDirection(int id, const char *val) {
eDirection direction = eDirection::none;
if (!strcmp(val, "bottomup"))
direction = eDirection::bottomup;
else if (!strcmp(val, "topdown"))
direction = eDirection::topdown;
attribs[id] = (int)direction;
}
void cAttributes::SetButton(int id, const char *val) {
eButtonType button = eButtonType::none;
if (!strcmp(val, "left"))
button = eButtonType::left;
else if (!strcmp(val, "right"))
button = eButtonType::right;
attribs[id] = (int)button;
}
/***************************************************************************
* Private Functions
***************************************************************************/
void cAttributes::SetCommonAttributesDefs(void) {
commonAttribIDs.insert(pair<string, int>("x", (int)eCommonAttribs::x));
commonAttribIDs.insert(pair<string, int>("y", (int)eCommonAttribs::y));
commonAttribIDs.insert(pair<string, int>("width", (int)eCommonAttribs::width));
commonAttribIDs.insert(pair<string, int>("height", (int)eCommonAttribs::height));
commonAttribIDs.insert(pair<string, int>("debug", (int)eCommonAttribs::debug));
commonAttribNames.insert(pair<int, string>((int)eCommonAttribs::x, "x"));
commonAttribNames.insert(pair<int, string>((int)eCommonAttribs::y, "y"));
commonAttribNames.insert(pair<int, string>((int)eCommonAttribs::width, "width"));
commonAttribNames.insert(pair<int, string>((int)eCommonAttribs::height, "height"));
commonAttribNames.insert(pair<int, string>((int)eCommonAttribs::debug, "debug"));
}
/***************************************************************************
* cFunction
***************************************************************************/
cFunction::cFunction(cArea *owner, int numAttributes) : cAttributes(numAttributes) {
funcType = "Unknown";
owningArea = owner;
color = NULL;
name = NULL;
scrolling = false;
}
cFunction::cFunction(const cFunction &other) : cAttributes(other) {
funcType = other.funcType;
owningArea = NULL;
color = NULL;
if (other.color)
color = new cColor(*other.color);
name = NULL;
if (other.name)
name = strdup(other.name);
scrolling = other.scrolling;
}
cFunction::~cFunction(void) {
delete color;
free(name);
}
void cFunction::SetLoopInfo(cLoopInfo *loopInfo) {
for (int i=0; i < numAttribs; i++) {
if (!attribCtors[i])
continue;
attribCtors[i]->SetLoopInfo(loopInfo);
}
if (cond)
cond->SetLoopInfo(loopInfo);
}
void cFunction::Cache(void) {
if (color) {
color->SetGlobals(globals);
color->Cache();
}
cAttributes::Cache();
}
void cFunction::CacheFuncReferences(void) {
for (int i=0; i < numAttribs; i++) {
if (!attribCtors[i])
continue;
vector<cFactor*> refFactors = attribCtors[i]->GetRefFactors();
for (vector<cFactor*>::iterator it = refFactors.begin(); it != refFactors.end(); it++) {
cFactor *f = *it;
if (!f->funcRefName)
continue;
cFunction *fRef = owningArea->GetFunction(f->funcRefName);
if (fRef) {
f->funcRef = fRef;
}
}
}
}
int cFunction::GetX(eAlign align, int x0, int colWidth) {
int containerWidth = colWidth > 0 ? colWidth : container.Width();
int x = x0 + X();
if (align == eAlign::right) {
x = x0 + containerWidth - FuncWidth();
} else if (align == eAlign::center) {
x = x0 + (containerWidth - FuncWidth()) / 2;
}
return x;
}
int cFunction::GetY(eAlign valign, int y0, int rowHeight) {
int containerHeight = rowHeight > 0 ? rowHeight : container.Height();
int y = y0 + Y();
if (valign == eAlign::bottom) {
y = y0 + containerHeight - FuncHeight();
} else if (valign == eAlign::center) {
y = y0 + (containerHeight - FuncHeight()) / 2;
}
return y;
}
void cFunction::Debug(void) {
esyslog("skindesigner: ---> Function %s", funcType);
cAttributes::Debug();
if (name) {
esyslog("skindesigner: name %s", name);
}
if (color) {
color->Debug();
}
}
/***************************************************************************
* Protected Functions
***************************************************************************/
void cFunction::SetColor(const char *val) {
color = new cColor(val);
}
void cFunction::SetAnimType(int id, const char *val) {
eAnimType animType = eAnimType::none;
if (!strcmp(val, "blink"))
animType = eAnimType::blink;
else if (!strcmp(val, "animated"))
animType = eAnimType::animated;
attribs[id] = (int)animType;
}
void cFunction::SetOverflow(int id, const char *val) {
eOverflowType overflowType = eOverflowType::none;
if (!strcmp(val, "linewrap"))
overflowType = eOverflowType::wrap;
else if (!strcmp(val, "cut"))
overflowType = eOverflowType::cut;
attribs[id] = (int)overflowType;
}

View File

@ -1,127 +0,0 @@
#ifndef __ATTRIBUTE_H
#define __ATTRIBUTE_H
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <map>
#include <vector>
#include <vdr/skins.h>
#include "globals.h"
#include "../libskindesignerapi/tokencontainer.h"
#include "definitions.h"
#include "complextypes.h"
class cArea;
/******************************************************************
* cAttributes
******************************************************************/
class cAttributes {
private:
map<string, int> commonAttribIDs;
map<int, string> commonAttribNames;
void SetCommonAttributesDefs(void);
protected:
cGlobals *globals;
skindesignerapi::cTokenContainer *tokenContainer;
cRect container;
int numAttribs;
int *attribs;
cNumericExpr **attribCtors;
cCondition *cond;
map<string, int> attribIDs;
map<int, string> attribNames;
int CommonAttributeId(const char *att);
const char *CommonAttributeName(int id);
int AttributeId(const char *att);
const char *AttributeName(int id);
bool SetCommon(int id, const char *val);
virtual bool IdEqual(int id, int compId);
void SetBool(int id, const char *val);
void SetViewElementMode(int id, const char *val);
void SetShiftType(int id, const char *val);
void SetShiftMode(int id, const char *val);
void SetScrollMode(int id, const char *val);
void SetScrollSpeed(int id, const char *val);
void SetOrientation(int id, const char *val);
void SetDirection(int id, const char *val);
void SetAlign(int id, const char *val);
void SetButton(int id, const char *val);
public:
cAttributes(int numAttributes);
cAttributes(const cAttributes &other);
virtual ~cAttributes(void);
void SetGlobals(cGlobals *globals) { this->globals = globals; };
void SetTokenContainer(skindesignerapi::cTokenContainer *tokenContainer);
virtual void SetTokenContainerDeep(skindesignerapi::cTokenContainer *tokenContainer);
virtual void SetContainer(int x, int y, int width, int height);
virtual void Set(vector<stringpair> &attributes) {};
void SetX(int width);
void SetY(int height);
void SetWidth(int width);
void SetHeight(int height);
virtual void Cache(void);
int GetValue(int id);
int X(void);
int Y(void);
int Width(void);
int Height(void);
int DoDebug(void) { return attribs[(int)eCommonAttribs::debug] == 1 ? true : false; };
bool DoExecute(void);
virtual void Debug(void);
};
/******************************************************************
* cLoopInfo
******************************************************************/
class cLoopInfo {
public:
int colWidth;
int rowHeight;
int index;
int row;
cLoopInfo(void) {
colWidth = 0;
rowHeight = 0;
index = 0;
row = 0;
};
};
/******************************************************************
* cFunction
******************************************************************/
class cFunction : public cAttributes, public cListObject {
private:
cArea *owningArea;
protected:
const char *funcType;
cColor *color;
char *name;
bool scrolling;
void SetColor(const char *val);
void SetAnimType(int id, const char *val);
void SetOverflow(int id, const char *val);
public:
cFunction(cArea *owner, int numAttributes);
cFunction(const cFunction &other);
virtual ~cFunction(void);
virtual void SetLoopInfo(cLoopInfo *loopInfo);
void SetOwner(cArea *owner) { owningArea = owner; };
const char *Name(void) { return name; };
virtual void Cache(void);
void CacheFuncReferences(void);
void Scrolling(bool scrolling) { this->scrolling = scrolling; };
virtual void Render(cPixmap *p, int x0 = 0, int y0 = 0, int colWidth = 0, int rowHeight = 0) {};
virtual int FuncX(void) { return X(); };
virtual int FuncY(void) { return Y(); };
virtual int FuncWidth(void) { return Width(); };
virtual int FuncHeight(void) { return Height(); };
virtual int Align(void) { return (int)eAlign::left; };
virtual int Valign(void) { return (int)eAlign::top; };
int GetX(eAlign align, int x0, int colWidth);
int GetY(eAlign valign, int y0, int rowHeight);
virtual bool Blinking(void) { return false; };
virtual int BlinkFreq(void) { return -1; };
virtual void Debug(void);
};
#endif //__ATTRIBUTE_H

View File

@ -1,484 +0,0 @@
#include "attributes.h"
#include "../config.h"
/***************************************************************************
* cViewAttribs
***************************************************************************/
cViewAttribs::cViewAttribs(int numAttributes) : cAttributes(numAttributes) {
orientation = NULL;
SetAttributesDefs();
}
cViewAttribs::~cViewAttribs(void) {
delete orientation;
}
void cViewAttribs::Set(vector<stringpair> &attributes) {
for (vector<stringpair>::iterator att = attributes.begin(); att != attributes.end(); att++) {
const char *attName = (*att).first.c_str();
const char *attVal = (*att).second.c_str();
int id = AttributeId(attName);
if (id == ATTR_UNKNOWN) {
esyslog("skindesigner: unknown view attribute \"%s\" = \"%s\"", attName, attVal);
continue;
}
if (SetCommon(id, attVal))
continue;
if (IdEqual(id, (int)eViewAttribs::shifttype)) {
SetShiftType(id, attVal);
} else if (IdEqual(id, (int)eViewAttribs::shiftmode)) {
SetShiftMode(id, attVal);
} else if (IdEqual(id, (int)eViewAttribs::orientation)) {
SetOrientationDynamic(id, attVal);
} else if (IdEqual(id, (int)eViewAttribs::hideroot)) {
SetBool(id, attVal);
} else {
attribCtors[id] = new cNumericExpr(attVal);
if ( (id == (int)eViewAttribs::starty + (int)eCommonAttribs::count) ||
(id == (int)eViewAttribs::scaletvy + (int)eCommonAttribs::count) ||
(id == (int)eViewAttribs::scaletvheight + (int)eCommonAttribs::count) ) {
attribCtors[id]->SetVertical();
}
}
}
}
void cViewAttribs::SetAttributesDefs(void) {
attribIDs.insert(pair<string, int>("fadetime", (int)eViewAttribs::fadetime));
attribIDs.insert(pair<string, int>("shifttime", (int)eViewAttribs::shifttime));
attribIDs.insert(pair<string, int>("shifttype", (int)eViewAttribs::shifttype));
attribIDs.insert(pair<string, int>("shiftmode", (int)eViewAttribs::shiftmode));
attribIDs.insert(pair<string, int>("startx", (int)eViewAttribs::startx));
attribIDs.insert(pair<string, int>("starty", (int)eViewAttribs::starty));
attribIDs.insert(pair<string, int>("scaletvx", (int)eViewAttribs::scaletvx));
attribIDs.insert(pair<string, int>("scaletvy", (int)eViewAttribs::scaletvy));
attribIDs.insert(pair<string, int>("scaletvwidth", (int)eViewAttribs::scaletvwidth));
attribIDs.insert(pair<string, int>("scaletvheight", (int)eViewAttribs::scaletvheight));
attribIDs.insert(pair<string, int>("orientation", (int)eViewAttribs::orientation));
attribIDs.insert(pair<string, int>("debuggrid", (int)eViewAttribs::debuggrid));
attribIDs.insert(pair<string, int>("hideroot", (int)eViewAttribs::hideroot));
attribNames.insert(pair<int, string>((int)eViewAttribs::fadetime, "fadetime"));
attribNames.insert(pair<int, string>((int)eViewAttribs::shifttime, "shifttime"));
attribNames.insert(pair<int, string>((int)eViewAttribs::shifttype, "shifttype"));
attribNames.insert(pair<int, string>((int)eViewAttribs::shiftmode, "shiftmode"));
attribNames.insert(pair<int, string>((int)eViewAttribs::startx, "startx"));
attribNames.insert(pair<int, string>((int)eViewAttribs::starty, "starty"));
attribNames.insert(pair<int, string>((int)eViewAttribs::scaletvx, "scaletvx"));
attribNames.insert(pair<int, string>((int)eViewAttribs::scaletvy, "scaletvy"));
attribNames.insert(pair<int, string>((int)eViewAttribs::scaletvwidth, "scaletvwidth"));
attribNames.insert(pair<int, string>((int)eViewAttribs::scaletvheight, "scaletvheight"));
attribNames.insert(pair<int, string>((int)eViewAttribs::orientation, "orientation"));
attribNames.insert(pair<int, string>((int)eViewAttribs::debuggrid, "debuggrid"));
attribNames.insert(pair<int, string>((int)eViewAttribs::hideroot, "hideroot"));
}
void cViewAttribs::Cache(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
cAttributes::Cache();
if (orientation) {
orientation->SetGlobals(globals);
orientation->SetTokenContainer(tokenContainer);
orientation->Cache();
char *res = orientation->DeterminateText();
if (res) {
SetOrientation((int)eViewAttribs::orientation + (int)eCommonAttribs::count, res);
}
free(res);
}
}
void cViewAttribs::Debug(void) {
esyslog("skindesigner: --> View Attribs");
cAttributes::Debug();
}
eOrientation cViewAttribs::Orientation(void) {
int orientation = GetValue((int)eViewAttribs::orientation);
if (orientation == -1)
return eOrientation::vertical;
if (orientation == (int)eOrientation::none)
return eOrientation::vertical;
return (eOrientation)orientation;
}
cRect cViewAttribs::TvFrame(void) {
int frameX = GetValue((int)eViewAttribs::scaletvx);
int frameY = GetValue((int)eViewAttribs::scaletvy);
int frameWidth = GetValue((int)eViewAttribs::scaletvwidth);
int frameHeight = GetValue((int)eViewAttribs::scaletvheight);
if (frameX < 0 || frameY < 0 || frameWidth <= 0 || frameHeight <= 0)
return cRect::Null;
frameX += cOsd::OsdLeft();
frameY += cOsd::OsdTop();
return cRect(frameX, frameY, frameWidth, frameHeight);
}
void cViewAttribs::SetOrientationDynamic(int id, const char *val) {
if (strchr(val, '{') && strchr(val, '}')) {
orientation = new cTextExpr(val);
} else {
SetOrientation(id, val);
}
}
/***************************************************************************
* cViewElementAttribs
***************************************************************************/
cViewElementAttribs::cViewElementAttribs(int numAttributes) : cAttributes(numAttributes) {
name = NULL;
clearOnDisplay = NULL;
SetAttributesDefs();
}
cViewElementAttribs::cViewElementAttribs(const cViewElementAttribs &other) : cAttributes(other) {
name = NULL;
clearOnDisplay = NULL;
}
cViewElementAttribs::~cViewElementAttribs(void) {
free(name);
free(clearOnDisplay);
}
void cViewElementAttribs::Set(vector<stringpair> &attributes) {
for (vector<stringpair>::iterator att = attributes.begin(); att != attributes.end(); att++) {
const char *attName = (*att).first.c_str();
const char *attVal = (*att).second.c_str();
int id = AttributeId(attName);
if (id == ATTR_UNKNOWN) {
esyslog("skindesigner: unknown view element attribute \"%s\" = \"%s\"", attName, attVal);
continue;
}
if (SetCommon(id, attVal))
continue;
if (IdEqual(id, (int)eViewElementAttribs::mode)) {
SetViewElementMode(id, attVal);
} else if (IdEqual(id, (int)eViewElementAttribs::shifttype)) {
SetShiftType(id, attVal);
} else if (IdEqual(id, (int)eViewElementAttribs::shiftmode)) {
SetShiftMode(id, attVal);
} else if (IdEqual(id, (int)eViewElementAttribs::orientation)) {
SetOrientation(id, attVal);
} else if (IdEqual(id, (int)eViewElementAttribs::name)) {
name = strdup(attVal);
} else if (IdEqual(id, (int)eViewElementAttribs::clearondisplay)) {
clearOnDisplay = strdup(attVal);
} else {
attribCtors[id] = new cNumericExpr(attVal);
if (id == (int)eViewElementAttribs::starty + (int)eCommonAttribs::count) {
attribCtors[id]->SetVertical();
}
}
}
}
void cViewElementAttribs::SetAttributesDefs(void) {
attribIDs.insert(pair<string, int>("delay", (int)eViewElementAttribs::delay));
attribIDs.insert(pair<string, int>("fadetime", (int)eViewElementAttribs::fadetime));
attribIDs.insert(pair<string, int>("shifttime", (int)eViewElementAttribs::shifttime));
attribIDs.insert(pair<string, int>("shifttype", (int)eViewElementAttribs::shifttype));
attribIDs.insert(pair<string, int>("shiftmode", (int)eViewElementAttribs::shiftmode));
attribIDs.insert(pair<string, int>("startx", (int)eViewElementAttribs::startx));
attribIDs.insert(pair<string, int>("starty", (int)eViewElementAttribs::starty));
attribIDs.insert(pair<string, int>("orientation", (int)eViewElementAttribs::orientation));
attribIDs.insert(pair<string, int>("mode", (int)eViewElementAttribs::mode));
attribIDs.insert(pair<string, int>("name", (int)eViewElementAttribs::name));
attribIDs.insert(pair<string, int>("clearondisplay", (int)eViewElementAttribs::clearondisplay));
attribNames.insert(pair<int, string>((int)eViewElementAttribs::delay, "delay"));
attribNames.insert(pair<int, string>((int)eViewElementAttribs::fadetime, "fadetime"));
attribNames.insert(pair<int, string>((int)eViewElementAttribs::shifttime, "shifttime"));
attribNames.insert(pair<int, string>((int)eViewElementAttribs::shifttype, "shifttype"));
attribNames.insert(pair<int, string>((int)eViewElementAttribs::shiftmode, "shiftmode"));
attribNames.insert(pair<int, string>((int)eViewElementAttribs::startx, "startx"));
attribNames.insert(pair<int, string>((int)eViewElementAttribs::starty, "starty"));
attribNames.insert(pair<int, string>((int)eViewElementAttribs::orientation, "orientation"));
attribNames.insert(pair<int, string>((int)eViewElementAttribs::mode, "mode"));
attribNames.insert(pair<int, string>((int)eViewElementAttribs::name, "name"));
attribNames.insert(pair<int, string>((int)eViewElementAttribs::clearondisplay, "clearondisplay"));
}
eOrientation cViewElementAttribs::Orientation(void) {
int orientation = GetValue((int)eViewElementAttribs::orientation);
if (orientation == -1)
return eOrientation::vertical;
if (orientation == (int)eOrientation::none)
return eOrientation::vertical;
return (eOrientation)orientation;
}
void cViewElementAttribs::Debug(void) {
esyslog("skindesigner: ---> View Element Attribs");
cAttributes::Debug();
}
/***************************************************************************
* cViewListAttribs
***************************************************************************/
cViewListAttribs::cViewListAttribs(int numAttributes) : cAttributes(numAttributes) {
determinateFont = NULL;
SetAttributesDefs();
}
cViewListAttribs::~cViewListAttribs(void) {
free(determinateFont);
}
void cViewListAttribs::Set(vector<stringpair> &attributes) {
for (vector<stringpair>::iterator att = attributes.begin(); att != attributes.end(); att++) {
const char *attName = (*att).first.c_str();
const char *attVal = (*att).second.c_str();
int id = AttributeId(attName);
if (id == ATTR_UNKNOWN) {
esyslog("skindesigner: unknown view list attribute \"%s\" = \"%s\"", attName, attVal);
continue;
}
if (SetCommon(id, attVal))
continue;
if (IdEqual(id, (int)eViewListAttribs::align)) {
SetAlign(id, attVal);
} else if (IdEqual(id, (int)eViewListAttribs::determinatefont)) {
determinateFont = strdup(attVal);
} else if (IdEqual(id, (int)eViewListAttribs::orientation)) {
SetOrientation(id, attVal);
} else if (IdEqual(id, (int)eViewListAttribs::shifttype)) {
SetShiftType(id, attVal);
} else if (IdEqual(id, (int)eViewListAttribs::shiftmode)) {
SetShiftMode(id, attVal);
} else if (IdEqual(id, (int)eViewListAttribs::button)) {
SetButton(id, attVal);
} else {
attribCtors[id] = new cNumericExpr(attVal);
}
}
}
int cViewListAttribs::NumListElements(void) {
return GetValue((int)eViewListAttribs::numlistelements);
}
int cViewListAttribs::MenuItemWidth(void) {
return GetValue((int)eViewListAttribs::menuitemwidth);
}
const char *cViewListAttribs::DeterminateFont(void) {
return determinateFont;
}
eAlign cViewListAttribs::Align(void) {
int align = GetValue((int)eViewListAttribs::align);
if (align < 0)
return eAlign::top;
return (eAlign)align;
}
eOrientation cViewListAttribs::Orientation(void) {
int orientation = GetValue((int)eViewListAttribs::orientation);
if (orientation < 0)
return eOrientation::vertical;
return (eOrientation)orientation;
}
void cViewListAttribs::SetAttributesDefs(void) {
attribIDs.insert(pair<string, int>("align", (int)eViewListAttribs::align));
attribIDs.insert(pair<string, int>("menuitemwidth", (int)eViewListAttribs::menuitemwidth));
attribIDs.insert(pair<string, int>("determinatefont", (int)eViewListAttribs::determinatefont));
attribIDs.insert(pair<string, int>("numlistelements", (int)eViewListAttribs::numlistelements));
attribIDs.insert(pair<string, int>("orientation", (int)eViewListAttribs::orientation));
attribIDs.insert(pair<string, int>("fadetime", (int)eViewListAttribs::fadetime));
attribIDs.insert(pair<string, int>("shifttime", (int)eViewListAttribs::shifttime));
attribIDs.insert(pair<string, int>("shifttype", (int)eViewListAttribs::shifttype));
attribIDs.insert(pair<string, int>("shiftmode", (int)eViewListAttribs::shiftmode));
attribIDs.insert(pair<string, int>("startx", (int)eViewListAttribs::startx));
attribIDs.insert(pair<string, int>("starty", (int)eViewListAttribs::starty));
attribIDs.insert(pair<string, int>("condition", (int)eViewListAttribs::condition));
attribIDs.insert(pair<string, int>("button", (int)eViewListAttribs::button));
attribNames.insert(pair<int, string>((int)eViewListAttribs::align, "align"));
attribNames.insert(pair<int, string>((int)eViewListAttribs::menuitemwidth, "menuitemwidth"));
attribNames.insert(pair<int, string>((int)eViewListAttribs::determinatefont, "determinatefont"));
attribNames.insert(pair<int, string>((int)eViewListAttribs::numlistelements, "numlistelements"));
attribNames.insert(pair<int, string>((int)eViewListAttribs::orientation, "orientation"));
attribNames.insert(pair<int, string>((int)eViewListAttribs::fadetime, "fadetime"));
attribNames.insert(pair<int, string>((int)eViewListAttribs::shifttime, "shifttime"));
attribNames.insert(pair<int, string>((int)eViewListAttribs::shifttype, "shifttype"));
attribNames.insert(pair<int, string>((int)eViewListAttribs::shiftmode, "shiftmode"));
attribNames.insert(pair<int, string>((int)eViewListAttribs::startx, "startx"));
attribNames.insert(pair<int, string>((int)eViewListAttribs::starty, "starty"));
attribNames.insert(pair<int, string>((int)eViewListAttribs::condition, "condition"));
attribNames.insert(pair<int, string>((int)eViewListAttribs::button, "button"));
}
void cViewListAttribs::Debug(void) {
esyslog("skindesigner: ---> View List Attribs");
esyslog("skindesigner: DeterminateFont %s", determinateFont);
cAttributes::Debug();
}
/***************************************************************************
* cAreaAttribs
***************************************************************************/
cAreaAttribs::cAreaAttribs(int numAttributes) : cAttributes(numAttributes) {
name = NULL;
scrollElement = NULL;
dynamic = false;
SetAttributesDefs();
}
cAreaAttribs::cAreaAttribs(const cAreaAttribs &other) : cAttributes(other) {
name = NULL;
if (other.name)
name = new cTextExpr(*other.name);
scrollElement = NULL;
if (other.scrollElement)
scrollElement = strdup(other.scrollElement);
dynamic = false;
}
cAreaAttribs::~cAreaAttribs(void) {
delete name;
free(scrollElement);
}
void cAreaAttribs::Set(vector<stringpair> &attributes) {
for (vector<stringpair>::iterator att = attributes.begin(); att != attributes.end(); att++) {
const char *attName = (*att).first.c_str();
const char *attVal = (*att).second.c_str();
int id = AttributeId(attName);
if (id == ATTR_UNKNOWN) {
esyslog("skindesigner: unknown area attribute \"%s\" = \"%s\"", attName, attVal);
continue;
}
if (SetCommon(id, attVal))
continue;
if (IdEqual(id, (int)eAreaAttribs::scrollelement)) {
scrollElement = strdup(attVal);
} else if (IdEqual(id, (int)eAreaAttribs::mode)) {
SetScrollMode(id, attVal);
} else if (IdEqual(id, (int)eAreaAttribs::orientation)) {
SetOrientation(id, attVal);
} else if (IdEqual(id, (int)eAreaAttribs::scrollspeed)) {
SetScrollSpeed(id, attVal);
} else if (IdEqual(id, (int)eAreaAttribs::background)) {
SetBool(id, attVal);
} else if (IdEqual(id, (int)eAreaAttribs::indicator)) {
SetBool(id, attVal);
} else if (IdEqual(id, (int)eAreaAttribs::name)) {
name = new cTextExpr(attVal);
} else {
attribCtors[id] = new cNumericExpr(attVal);
}
}
}
int cAreaAttribs::Layer(void) {
if (GetValue((int)eAreaAttribs::layer) > 0) {
return GetValue((int)eAreaAttribs::layer);
}
return 1;
}
bool cAreaAttribs::BackgroundArea(void) {
int isBackground = GetValue((int)eAreaAttribs::background);
if (isBackground == 1)
return true;
return false;
}
bool cAreaAttribs::IndicatorArea(void) {
int isIndicator = GetValue((int)eAreaAttribs::indicator);
if (isIndicator == 1)
return true;
return false;
}
void cAreaAttribs::CheckDynamic(void) {
for (int i = (int)eCommonAttribs::x; i <= (int)eCommonAttribs::height; ++i ) {
if (attribCtors[i] && attribCtors[i]->Dynamic()) {
dynamic = true;
return;
}
}
}
const char *cAreaAttribs::Name(void) {
if (name)
return name->DeterminateText();
return NULL;
}
void cAreaAttribs::SetAttributesDefs(void) {
attribIDs.insert(pair<string, int>("layer", (int)eAreaAttribs::layer));
attribIDs.insert(pair<string, int>("transparency", (int)eAreaAttribs::transparency));
attribIDs.insert(pair<string, int>("mode", (int)eAreaAttribs::mode));
attribIDs.insert(pair<string, int>("orientation", (int)eAreaAttribs::orientation));
attribIDs.insert(pair<string, int>("scrollelement", (int)eAreaAttribs::scrollelement));
attribIDs.insert(pair<string, int>("scrollspeed", (int)eAreaAttribs::scrollspeed));
attribIDs.insert(pair<string, int>("delay", (int)eAreaAttribs::delay));
attribIDs.insert(pair<string, int>("background", (int)eAreaAttribs::background));
attribIDs.insert(pair<string, int>("indicator", (int)eAreaAttribs::indicator));
attribIDs.insert(pair<string, int>("name", (int)eAreaAttribs::name));
attribIDs.insert(pair<string, int>("scrollheight", (int)eAreaAttribs::scrollheight));
attribNames.insert(pair<int, string>((int)eAreaAttribs::layer, "layer"));
attribNames.insert(pair<int, string>((int)eAreaAttribs::transparency, "transparency"));
attribNames.insert(pair<int, string>((int)eAreaAttribs::mode, "mode"));
attribNames.insert(pair<int, string>((int)eAreaAttribs::orientation, "orientation"));
attribNames.insert(pair<int, string>((int)eAreaAttribs::scrollelement, "scrollelement"));
attribNames.insert(pair<int, string>((int)eAreaAttribs::scrollspeed, "scrollspeed"));
attribNames.insert(pair<int, string>((int)eAreaAttribs::delay, "delay"));
attribNames.insert(pair<int, string>((int)eAreaAttribs::background, "background"));
attribNames.insert(pair<int, string>((int)eAreaAttribs::name, "name"));
attribNames.insert(pair<int, string>((int)eAreaAttribs::scrollheight, "scrollheight"));
}
void cAreaAttribs::Cache(void) {
cAttributes::Cache();
if (name) {
name->SetGlobals(globals);
name->SetTokenContainer(tokenContainer);
name->Cache();
}
}
void cAreaAttribs::Debug(void) {
if (!name) {
esyslog("skindesigner: ---> Area Attribs");
} else {
esyslog("skindesigner: ---> Tab %s Attribs", name->DeterminateText());
}
cAttributes::Debug();
}
/***************************************************************************
* cAreaContainerAttribs
***************************************************************************/
cAreaContainerAttribs::cAreaContainerAttribs(int numAttributes) : cAttributes(numAttributes) {
SetAttributesDefs();
}
cAreaContainerAttribs::cAreaContainerAttribs(const cAreaContainerAttribs &other) : cAttributes(other) {
}
cAreaContainerAttribs::~cAreaContainerAttribs(void) {
}
void cAreaContainerAttribs::Set(vector<stringpair> &attributes) {
for (vector<stringpair>::iterator att = attributes.begin(); att != attributes.end(); att++) {
const char *attName = (*att).first.c_str();
const char *attVal = (*att).second.c_str();
int id = AttributeId(attName);
if (id == ATTR_UNKNOWN) {
esyslog("skindesigner: unknown area container attribute \"%s\" = \"%s\"", attName, attVal);
continue;
}
if (SetCommon(id, attVal))
continue;
}
}
void cAreaContainerAttribs::SetAttributesDefs(void) {
}
void cAreaContainerAttribs::Debug(void) {
esyslog("skindesigner: ---> Area Container Attribs");
cAttributes::Debug();
}

View File

@ -1,120 +0,0 @@
#ifndef __ATTRIBUTES_H
#define __ATTRIBUTES_H
#include "attribute.h"
/******************************************************************
* cViewAttribs
******************************************************************/
class cViewAttribs : public cAttributes {
private:
cTextExpr *orientation;
void SetAttributesDefs(void);
void SetOrientationDynamic(int id, const char *val);
public:
cViewAttribs(int numAttributes);
virtual ~cViewAttribs(void);
void Set(vector<stringpair> &attributes);
eOrientation Orientation(void);
int FadeTime(void) { return GetValue((int)eViewAttribs::fadetime); };
int ShiftTime(void) { return GetValue((int)eViewAttribs::shifttime); };
cPoint ShiftStartpoint(void) { return cPoint(GetValue((int)eViewAttribs::startx), GetValue((int)eViewAttribs::starty)); };
int ShiftType(void) { return GetValue((int)eViewAttribs::shifttype); };
int ShiftMode(void) { return GetValue((int)eViewAttribs::shiftmode); };
cRect TvFrame(void);
void Cache(void);
void Debug(void);
};
/******************************************************************
* cViewElementAttribs
******************************************************************/
class cViewElementAttribs : public cAttributes {
private:
char *name;
char *clearOnDisplay;
void SetAttributesDefs(void);
public:
cViewElementAttribs(int numAttributes);
cViewElementAttribs(const cViewElementAttribs &other);
virtual ~cViewElementAttribs(void);
void Set(vector<stringpair> &attributes);
int Mode(void) { return GetValue((int)eViewElementAttribs::mode); };
int Delay(void) { return GetValue((int)eViewElementAttribs::delay); };
eOrientation Orientation(void);
int FadeTime(void) { return GetValue((int)eViewElementAttribs::fadetime); };
int ShiftTime(void) { return GetValue((int)eViewElementAttribs::shifttime); };
cPoint ShiftStartpoint(void) { return cPoint(GetValue((int)eViewElementAttribs::startx), GetValue((int)eViewElementAttribs::starty)); };
int ShiftType(void) { return GetValue((int)eViewElementAttribs::shifttype); };
int ShiftMode(void) { return GetValue((int)eViewElementAttribs::shiftmode); };
const char *Name(void) { return name; };
const char *ClearOnDisplay(void) { return clearOnDisplay; };
void Debug(void);
};
/******************************************************************
* cViewListAttribs
******************************************************************/
class cViewListAttribs : public cAttributes {
private:
char *determinateFont;
void SetAttributesDefs(void);
public:
cViewListAttribs(int numAttributes);
virtual ~cViewListAttribs(void);
void Set(vector<stringpair> &attributes);
int NumListElements(void);
int MenuItemWidth(void);
const char *DeterminateFont(void);
eAlign Align(void);
eOrientation Orientation(void);
int FadeTime(void) { return GetValue((int)eViewListAttribs::fadetime); };
int ShiftTime(void) { return GetValue((int)eViewListAttribs::shifttime); };
cPoint ShiftStartpoint(void) { return cPoint(GetValue((int)eViewListAttribs::startx), GetValue((int)eViewListAttribs::starty)); };
int ShiftType(void) { return GetValue((int)eViewListAttribs::shifttype); };
int ShiftMode(void) { return GetValue((int)eViewListAttribs::shiftmode); };
eButtonType Button(void) { return (eButtonType)GetValue((int)eViewListAttribs::button); }
void Debug(void);
};
/******************************************************************
* cAreaAttribs
******************************************************************/
class cAreaAttribs : public cAttributes {
private:
cTextExpr *name;
char *scrollElement;
void SetAttributesDefs(void);
bool dynamic;
public:
cAreaAttribs(int numAttributes);
cAreaAttribs(const cAreaAttribs &other);
virtual ~cAreaAttribs(void);
void Set(vector<stringpair> &attributes);
const char *GetScrollElement(void) { return scrollElement; };
int Orientation(void) { return GetValue((int)eAreaAttribs::orientation); };
int Delay(void) { return GetValue((int)eAreaAttribs::delay); };
int Mode(void) { return GetValue((int)eAreaAttribs::mode); };
int ScrollSpeed(void) { return GetValue((int)eAreaAttribs::scrollspeed); };
int Transparency(void) { return GetValue((int)eAreaAttribs::transparency); };
int Layer(void);
int ScrollStep(void) { return GetValue((int)eAreaAttribs::scrollheight); };
bool BackgroundArea(void);
bool IndicatorArea(void);
const char *Name(void);
void CheckDynamic(void);
bool Dynamic(void) {return dynamic; };
void Cache(void);
void Debug(void);
};
/******************************************************************
* cAreaContainerAttribs
******************************************************************/
class cAreaContainerAttribs : public cAttributes {
private:
void SetAttributesDefs(void);
public:
cAreaContainerAttribs(int numAttributes);
cAreaContainerAttribs(const cAreaContainerAttribs &other);
virtual ~cAreaContainerAttribs(void);
void Set(vector<stringpair> &attributes);
void Debug(void);
};
#endif //__ATTRIBUTES_H

File diff suppressed because it is too large Load Diff

View File

@ -1,319 +0,0 @@
#ifndef __COMPLEXTYPES_H
#define __COMPLEXTYPES_H
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <vdr/skins.h>
#include "globals.h"
#include "../libskindesignerapi/tokencontainer.h"
class cLoopInfo;
class cFunction;
/******************************************************************
* helpers
******************************************************************/
char *RemoveSpace(char *e);
void ReplaceDecimalpoint(char *e);
void ReplaceStart(char *e, int num);
void ReplaceEnd(char *e, int num);
/******************************************************************
* cCondition
******************************************************************/
enum class eCondOp {
tAnd,
tOr
};
enum class eCondType {
token,
negtoken,
lowerInt,
equalInt,
notequalInt,
greaterInt,
isset,
empty,
equalString,
notEqualString,
contains,
notContains
};
enum class eCondTokenType {
inttoken,
stringtoken,
looptoken
};
class cCond : public cListObject {
public:
cCond(const char *expression);
cCond(const cCond &other);
virtual ~cCond(void);
void Debug(void);
char *expr;
eCondOp operation;
eCondType type;
eCondTokenType tokenType;
bool constant;
bool isTrue;
int tokenIndex;
int compareValue;
char *compareStrValue;
};
class cCondition {
private:
char *expr;
cGlobals *globals;
skindesignerapi::cTokenContainer *tokenContainer;
cLoopInfo *loopInfo;
cList<cCond> conds;
void Tokenize(void);
void PrepareTokens(void);
void SetTokenCond(cCond *c);
void SetIntegerCond(cCond *c);
void SetStringCond(cCond *c);
void SetStringCompareCond(cCond *c);
void SetTokenIndex(cCond *c, const char *token);
public:
cCondition(const char *expression);
cCondition(const cCondition &other);
virtual ~cCondition(void);
void SetGlobals(cGlobals *globals) { this->globals = globals; };
void SetTokenContainer(skindesignerapi::cTokenContainer *tokenContainer) {this->tokenContainer = tokenContainer; };
void SetLoopInfo(cLoopInfo *loopInfo) { this->loopInfo = loopInfo; };
void Prepare(void);
bool True(void);
void Debug(void);
};
/******************************************************************
* cNumericExpr
******************************************************************/
enum class eFactorType {
constant = 0,
stringtoken,
inttoken,
looptoken,
xref,
yref,
widthref,
heightref,
areawidth,
areaheight,
columnwidth,
rowheight
};
class cFactor: public cListObject {
public:
cFactor(void) {
multiplication = true;
type = eFactorType::constant;
constValue = 1.0f;
tokenIndex = -1;
funcRefName = NULL;
funcRef = NULL;
};
cFactor(const cFactor &other) {
multiplication = other.multiplication;
type = other.type;
constValue = other.constValue;
tokenIndex = other.tokenIndex;
funcRefName = NULL;
if (other.funcRefName)
funcRefName = strdup(other.funcRefName);
funcRef = other.funcRef;
}
~cFactor(void) {
free(funcRefName);
};
bool multiplication;
eFactorType type;
double constValue;
int tokenIndex;
char *funcRefName;
cFunction *funcRef;
};
class cSummand : public cListObject {
public:
cSummand(const char *summand);
cSummand(const cSummand &other);
~cSummand(void);
void Debug(void);
char *summand;
bool positive;
cList<cFactor> factors;
};
class cNumericExpr {
private:
cGlobals *globals;
cRect *container;
skindesignerapi::cTokenContainer *tokenContainer;
cLoopInfo *loopInfo;
char *expr;
cList<cSummand> summands;
bool horizontal;
int value;
bool dynamic;
//common string functions
bool IsNumeric(const char *e);
bool IsNumericExpression(const char *e);
bool PercentValue(const char *e);
char *ReplacePercentValue(char *e);
char *ReplaceToken(char *e, const char* token, int value);
char *ReplaceTokens(char *e, const char* token, int value);
//calculate numeric expressions
int EvaluateExpression(char *e);
double EvaluateExpressionDouble(char *e);
double ParseAtom(char*& e);
double ParseFactors(char*& e);
double ParseSummands(char*& e);
//prepare expressions with tokens
void CreateSummands(void);
void CreateFactors(void);
bool SetTokenFactor(cFactor *f, char *tokenName);
bool SetReferenceFactor(cFactor *f, char *tokenName);
bool SetGeometryFactor(cFactor *f, char *tokenName);
void ConsolidateSummand(void);
void ConsolidateFactors(void);
public:
cNumericExpr(const char *expression);
cNumericExpr(const cNumericExpr &other);
virtual ~cNumericExpr(void);
void SetContainer(cRect *container) { this->container = container; };
void SetGlobals(cGlobals *globals) { this->globals = globals; };
void SetTokenContainer(skindesignerapi::cTokenContainer *tokenContainer) { this->tokenContainer = tokenContainer; };
void SetLoopInfo(cLoopInfo *loopInfo) { this->loopInfo = loopInfo; };
void SetVertical(void) { horizontal = false; };
bool CacheStatic(void);
void PrepareTokens(void);
vector<cFactor*> GetRefFactors(void);
int GetValue(void) { return value; };
bool Dynamic(void) { return dynamic; };
int Calculate(void);
void Debug(void);
};
/******************************************************************
* cColor
******************************************************************/
class cColor {
private:
cGlobals *globals;
char *expr;
tColor value;
public:
cColor(const char *expression);
cColor(const cColor &other);
virtual ~cColor(void);
void SetGlobals(cGlobals *globals) { this->globals = globals; };
void Cache(void);
tColor Color(void);
void Debug(void);
};
/******************************************************************
* cTextExpr
******************************************************************/
enum class eTexttokenType {
constant = 0,
stringtoken,
inttoken,
looptoken,
printftoken,
condstringtoken,
condinttoken,
};
enum class ePrintfVarType {
stringtoken,
inttoken,
looptoken
};
struct sPrintfInfo {
ePrintfVarType type;
int index;
};
class cTextToken: public cListObject {
public:
cTextToken(void) {
type = eTexttokenType::constant;
constValue = NULL;
printfExpr = NULL;
printfResult = NULL;
tokenIndex = -1;
condStart = NULL;
condEnd = NULL;
};
cTextToken(const cTextToken &other) {
type = other.type;
constValue = NULL;
if (other.constValue)
constValue = strdup(other.constValue);
printfExpr = NULL;
if (other.printfExpr)
printfExpr = strdup(other.printfExpr);
printfVarIndices = other.printfVarIndices;
printfResult = NULL;
if (other.printfResult)
printfResult = strdup(other.printfResult);
tokenIndex = other.tokenIndex;
condStart = NULL;
if (other.condStart)
condStart = strdup(other.condStart);
condEnd = NULL;
if (other.condEnd)
condEnd = strdup(other.condEnd);
};
~cTextToken(void) {
free(constValue);
free(printfExpr);
};
eTexttokenType type;
char *constValue;
int tokenIndex;
char *printfExpr;
vector<sPrintfInfo> printfVarIndices;
char *printfResult;
char *condStart;
char *condEnd;
};
class cTextExpr {
private:
cGlobals *globals;
skindesignerapi::cTokenContainer *tokenContainer;
cLoopInfo *loopInfo;
char *expr;
cList<cTextToken> textTokens;
void Translate(void);
void Tokenize(void);
void PrepareTokens(void);
bool CheckGlobals(cTextToken *t);
bool ParsePrintfToken(cTextToken *t);
void DeterminatePrintfToken(cTextToken *t);
void ParseCondToken(cTextToken *t);
char *CopyTextPart(char *start, char *stop, bool incLastChar= true);
public:
cTextExpr(const char *expression);
cTextExpr(const cTextExpr &other);
virtual ~cTextExpr(void);
void SetGlobals(cGlobals *globals) { this->globals = globals; };
void SetTokenContainer(skindesignerapi::cTokenContainer *tokenContainer) { this->tokenContainer = tokenContainer; };
void SetLoopInfo(cLoopInfo *loopInfo) { this->loopInfo = loopInfo; };
void CorrectImagePath(void);
void Cache(void);
char *DeterminateText(void);
void Debug(const char *exprName);
};
#endif //__COMPLEXTYPES_H

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,221 +0,0 @@
#ifndef __FUNCTIONS_H
#define __FUNCTIONS_H
#include "functions.h"
class cFuncFill : public cFunction {
private:
void SetAttributesDefs(void);
public:
cFuncFill(cArea *owner, int numAttributes);
cFuncFill(const cFuncFill &other);
virtual ~cFuncFill(void);
void Set(vector<stringpair> &attributes);
void Render(cPixmap *p, int x0 = 0, int y0 = 0, int colWidth = 0, int rowHeight = 0);
};
class cFuncDrawRectangle : public cFunction {
private:
void SetAttributesDefs(void);
public:
cFuncDrawRectangle(cArea *owner, int numAttributes);
cFuncDrawRectangle(const cFuncDrawRectangle &other);
virtual ~cFuncDrawRectangle(void);
void Set(vector<stringpair> &attributes);
void Render(cPixmap *p, int x0 = 0, int y0 = 0, int colWidth = 0, int rowHeight = 0);
bool Blinking(void) { return GetValue((int)eDrawRectangleAttribs::animtype) == (int)eAnimType::blink; };
int BlinkFreq(void) { return GetValue((int)eDrawRectangleAttribs::animfreq); };
int Align(void) { return GetValue((int)eDrawRectangleAttribs::align); };
int Valign(void) { return GetValue((int)eDrawRectangleAttribs::valign); };
};
class cFuncDrawEllipse : public cFunction {
private:
void SetAttributesDefs(void);
public:
cFuncDrawEllipse(cArea *owner, int numAttributes);
cFuncDrawEllipse(const cFuncDrawEllipse &other);
virtual ~cFuncDrawEllipse(void);
void Set(vector<stringpair> &attributes);
void Render(cPixmap *p, int x0 = 0, int y0 = 0, int colWidth = 0, int rowHeight = 0);
bool Blinking(void) { return GetValue((int)eDrawEllipseAttribs::animtype) == (int)eAnimType::blink; };
int BlinkFreq(void) { return GetValue((int)eDrawEllipseAttribs::animfreq); };
int Align(void) { return GetValue((int)eDrawEllipseAttribs::align); };
int Valign(void) { return GetValue((int)eDrawEllipseAttribs::valign); };
};
class cFuncDrawSlope : public cFunction {
private:
void SetAttributesDefs(void);
public:
cFuncDrawSlope(cArea *owner, int numAttributes);
cFuncDrawSlope(const cFuncDrawSlope &other);
virtual ~cFuncDrawSlope(void);
void Set(vector<stringpair> &attributes);
void Render(cPixmap *p, int x0 = 0, int y0 = 0, int colWidth = 0, int rowHeight = 0);
bool Blinking(void) { return GetValue((int)eDrawSlopeAttribs::animtype) == (int)eAnimType::blink; };
int BlinkFreq(void) { return GetValue((int)eDrawSlopeAttribs::animfreq); };
int Align(void) { return GetValue((int)eDrawSlopeAttribs::align); };
int Valign(void) { return GetValue((int)eDrawSlopeAttribs::valign); };
};
class cTextDrawer {
private:
static cMutex fontLock;
protected:
const cFont *font;
char *fontName;
int fontSize;
void CacheFont(cGlobals *globals, int size);
void LoadFont(int size);
int TextWidth(const char *text);
int FontHeight(void);
public:
cTextDrawer(void);
virtual ~cTextDrawer(void);
};
class cFuncDrawText : public cFunction, public cTextDrawer {
private:
cTextExpr *text;
void SetAttributesDefs(void);
char *Cut(char *expr, int width);
public:
cFuncDrawText(cArea *owner, int numAttributes);
cFuncDrawText(const cFuncDrawText &other);
virtual ~cFuncDrawText(void);
void SetLoopInfo(cLoopInfo *loopInfo);
void SetTokenContainerDeep(skindesignerapi::cTokenContainer *tokenContainer);
void Set(vector<stringpair> &attributes);
void Cache(void);
void Render(cPixmap *p, int x0 = 0, int y0 = 0, int colWidth = 0, int rowHeight = 0);
int FuncX(void);
int FuncY(void);
int FuncWidth(void);
int FuncHeight(void);
int AvrgFontWidth(void);
const cFont *GetFont(void);
bool Blinking(void) { return GetValue((int)eDrawTextAttribs::animtype) == (int)eAnimType::blink; };
int BlinkFreq(void) { return GetValue((int)eDrawTextAttribs::animfreq); };
int Align(void) { return GetValue((int)eDrawTextAttribs::align); };
int Valign(void) { return GetValue((int)eDrawTextAttribs::valign); };
void Debug(void);
};
class cFuncDrawTextVertical : public cFunction, public cTextDrawer {
private:
cTextExpr *text;
void SetAttributesDefs(void);
public:
cFuncDrawTextVertical(cArea *owner, int numAttributes);
cFuncDrawTextVertical(const cFuncDrawTextVertical &other);
virtual ~cFuncDrawTextVertical(void);
void SetLoopInfo(cLoopInfo *loopInfo);
void SetTokenContainerDeep(skindesignerapi::cTokenContainer *tokenContainer);
void Set(vector<stringpair> &attributes);
void Cache(void);
void Render(cPixmap *p, int x0 = 0, int y0 = 0, int colWidth = 0, int rowHeight = 0);
int FuncWidth(void);
int FuncHeight(void);
bool Blinking(void) { return GetValue((int)eDrawTextAttribsVertical::animtype) == (int)eAnimType::blink; };
int BlinkFreq(void) { return GetValue((int)eDrawTextAttribsVertical::animfreq); };
int Align(void) { return GetValue((int)eDrawTextAttribsVertical::align); };
int Valign(void) { return GetValue((int)eDrawTextAttribsVertical::valign); };
void Debug(void);
};
class cTextFloater;
class cFuncDrawTextBox : public cFunction, public cTextDrawer {
private:
cTextExpr *text;
cTextFloater *floater;
void SetFloater(void);
void SetAttributesDefs(void);
void SetFloatMode(int id, const char *val);
public:
cFuncDrawTextBox(cArea *owner, int numAttributes);
cFuncDrawTextBox(const cFuncDrawTextBox &other);
virtual ~cFuncDrawTextBox(void);
void SetLoopInfo(cLoopInfo *loopInfo);
void SetTokenContainerDeep(skindesignerapi::cTokenContainer *tokenContainer);
void Set(vector<stringpair> &attributes);
void Cache(void);
void Render(cPixmap *p, int x0 = 0, int y0 = 0, int colWidth = 0, int rowHeight = 0);
int FuncWidth(void);
int FuncHeight(void);
void Debug(void);
};
class cFuncDrawImage : public cFunction {
private:
cTextExpr *path;
void SetAttributesDefs(void);
void SetImageType(int id, const char *val);
void PreCacheImage(void);
public:
cFuncDrawImage(cArea *owner, int numAttributes);
cFuncDrawImage(const cFuncDrawImage &other);
virtual ~cFuncDrawImage(void);
void SetLoopInfo(cLoopInfo *loopInfo);
void SetTokenContainerDeep(skindesignerapi::cTokenContainer *tokenContainer);
void Set(vector<stringpair> &attributes);
void Cache(void);
void Render(cPixmap *p, int x0 = 0, int y0 = 0, int colWidth = 0, int rowHeight = 0);
bool Blinking(void) { return GetValue((int)eDrawImageAttribs::animtype) == (int)eAnimType::blink; };
int BlinkFreq(void) { return GetValue((int)eDrawImageAttribs::animfreq); };
int Align(void) { return GetValue((int)eDrawImageAttribs::align); };
int Valign(void) { return GetValue((int)eDrawImageAttribs::valign); };
void Debug(void);
};
class cFuncLoop : public cFunction {
private:
cLoopInfo loopInfo;
cList<cFunction> functions;
void SetAttributesDefs(void);
int ColumnWidth(void);
int RowHeight(void);
public:
cFuncLoop(cArea *owner, int numAttributes);
virtual ~cFuncLoop(void);
void Set(vector<stringpair> &attributes);
void SetContainer(int x, int y, int width, int height);
void Cache(void);
void AddFunction(cFunction *f);
cFunction *GetFunction(const char *name);
void Render(cPixmap *p, int x0 = 0, int y0 = 0, int colWidth = 0, int rowHeight = 0);
int FuncWidth(void);
int FuncHeight(void);
int Valign(void) { return GetValue((int)eLoopAttribs::valign); };
void Debug(void);
};
class cTextFloater {
private:
char *text;
char *eol;
int lines;
int lastLine;
public:
cTextFloater(void);
cTextFloater(const char *text, const cFont *font, int width, int height = 0, int floatWidth = 0, int floatHeight = 0, int maxLines = 0);
~cTextFloater();
void Set(const char *Text, const cFont *font, int width, int height = 0, int floatWidth = 0, int floatHeight = 0, int maxLines = 0);
///< Wraps the Text to make it fit into the area defined by the given Width
///< when displayed with the given Font.
///< Wrapping is done by inserting the necessary number of newline
///< characters into the string.
///< if height is set, new lines are only set till height is reached
///< if floatwidth and floatheight are set, the first lines (depending on
///< size of floatheight) are set to floatwidth
const char *Text(void);
///< Returns the full wrapped text.
int Lines(void) { return lines; }
///< Returns the actual number of lines needed to display the full wrapped text.
const char *GetLine(int line);
///< Returns the given Line. The first line is numbered 0.
};
#endif //__FUNCTIONS_H

View File

@ -1,57 +0,0 @@
#include "gridelement.h"
#include "../config.h"
cGridElement::cGridElement(void) {
current = false;
indexCurrent = -1;
viewId = -1;
plugId = -1;
}
cGridElement::cGridElement(const cGridElement &other) : cViewElement(other) {
current = false;
viewId = other.viewId;
plugId = other.plugId;
tokenContainer = new skindesignerapi::cTokenContainer(*other.tokenContainer);
indexCurrent = other.indexCurrent;
InheritTokenContainerDeep();
}
cGridElement::~cGridElement(void) {
}
void cGridElement::SetTokenContainer(void) {
skindesignerapi::cTokenContainer *tkGe = plgManager->GetTokenContainerGE(plugId, viewId, id);
if (!tkGe)
return;
tokenContainer = new skindesignerapi::cTokenContainer(*tkGe);
indexCurrent = tokenContainer->GetNumDefinedIntTokens();
tokenContainer->DefineIntToken("{current}", indexCurrent);
InheritTokenContainer();
}
void cGridElement::Set(skindesignerapi::cTokenContainer *tk) {
tokenContainer->Clear();
tokenContainer->SetTokens(tk);
SetDirty();
}
void cGridElement::SetCurrent(bool current) {
this->current = current;
SetDirty();
}
bool cGridElement::Parse(bool forced) {
if (!dirty)
return false;
tokenContainer->AddIntToken(indexCurrent, current);
return true;
}
int cGridElement::Width(void) {
return container.Width();
}
int cGridElement::Height(void) {
return container.Height();
}

View File

@ -1,27 +0,0 @@
#ifndef __GRIDELEMENT_H
#define __GRIDELEMENT_H
#include "viewelement.h"
class cGridElement : public cViewElement {
private:
int viewId;
int plugId;
bool current;
int indexCurrent;
public:
cGridElement(void);
cGridElement(const cGridElement &other);
virtual ~cGridElement(void);
void SetPluginId(int plugId) { this->plugId = plugId; };
void SetViewId(int viewId) { this->viewId = viewId; };
void SetTokenContainer(void);
skindesignerapi::cTokenContainer *GetTokenContainer(void) { return tokenContainer; };
void Set(skindesignerapi::cTokenContainer *tk);
void SetCurrent(bool current);
bool Parse(bool forced = true);
int Width(void);
int Height(void);
};
#endif //__GRIDELEMENT_H

File diff suppressed because it is too large Load Diff

View File

@ -1,392 +0,0 @@
#ifndef __LISTELEMENTS_H
#define __LISTELEMENTS_H
#include "viewelement.h"
#include "../extensions/scrapmanager.h"
#define MAX_TABS 6
/******************************************************************
* cListElement
******************************************************************/
class cListElement : public cViewElement , public cListShiftable {
protected:
eMenuCategory menuCat;
eOrientation orientation;
int num;
bool current;
bool wasCurrent;
bool selectable;
bool selectedFromTop;
bool suppressAnimation;
cListShifter *listShifter;
cViewElement *currentElement;
char *ParseSeparator(const char *text);
void StartListAnimation(void);
public:
cListElement(void);
cListElement(const cListElement &other);
virtual ~cListElement(void) {};
void SetMenuCategory(eMenuCategory menuCat) { this->menuCat = menuCat; };
void SetOrientation(eOrientation orientation) { this->orientation = orientation; };
void SetNumber(int number) { num = number; };
void SetCurrent(bool cur);
bool Current(void) { return current; };
bool WasCurrent(void) { return wasCurrent; };
void WakeCurrent(void);
void SetSelectable(bool sel) { selectable = sel; };
void SetSelectedFromTop(void) { selectedFromTop = true; };
void SetSelectedFromBottom(void) { selectedFromTop = false; };
void SetSuppressAnimation(bool suppress) { suppressAnimation = suppress; };
bool DoScroll(void) { return current; };
void Render(void);
virtual void RenderCurrent(void) { };
virtual void Close(void);
int ListShiftTime(void) { return ShiftTime(); };
int ShiftDistance(void);
eOrientation ShiftOrientation(void);
void SetIndicatorPosition(cPoint &position);
void SetTransparency(int transparency, bool force = false);
void StopListAnimation(void);
virtual void Clear(bool forceClearBackground = false);
};
/******************************************************************
* cCurrentElement
******************************************************************/
class cCurrentElement : public cViewElement {
protected:
int listX;
int listY;
int listWidth;
int listHeight;
int listNum;
public:
cCurrentElement(void);
virtual ~cCurrentElement(void) {};
void SetListPosition(int x, int y, int width, int height, int num);
void SetListTokens(skindesignerapi::cTokenContainer *tokenContainer);
};
/******************************************************************
* cLeMenuDefault
******************************************************************/
class cLeMenuDefault : public cListElement {
private:
char *text;
int *colX;
int *colWidths;
const char *plugName;
const char *GetTabbedText(const char *s, int tab);
void SetMenuCategory(void);
void CheckProgressBar(const char *text, int tab);
public:
cLeMenuDefault(void);
cLeMenuDefault(const cLeMenuDefault &other);
virtual ~cLeMenuDefault(void);
void SetListInfo(int *colX, int *colWidths);
void SetText(const char *text);
void SetPlugin(const char *plugName) { this->plugName = plugName; };
void SetTokenContainer(void);
bool Parse(bool forced = true);
void Clear(bool forceClearBackground = false);
};
/******************************************************************
* cVeMenuMain
******************************************************************/
class cVeMenuMain {
protected:
char *text;
char *number;
char *label;
void SplitText(void);
public:
cVeMenuMain(void);
virtual ~cVeMenuMain(void);
void SetText(const char *text);
};
/******************************************************************
* cLeMenuMain
******************************************************************/
class cCeMenuMain;
class cLeMenuMain : public cListElement, public cVeMenuMain {
private:
cCeMenuMain *currentMain;
public:
cLeMenuMain(void);
cLeMenuMain(const cLeMenuMain &other);
virtual ~cLeMenuMain(void);
void SetTokenContainer(void);
void SetCurrentElement(cCeMenuMain *cur) { currentMain = cur; currentElement = (cViewElement*)cur; };
void ClearCurrentElement(void);
void SetText(const char *text);
bool Parse(bool forced = true);
void RenderCurrent(void);
const char *PluginName(void);
};
/******************************************************************
* cCeMenuMain
******************************************************************/
class cCeMenuMain : public cCurrentElement, public cVeMenuMain {
private:
public:
cCeMenuMain(void);
virtual ~cCeMenuMain(void);
void SetTokenContainer(void);
void SetText(const char *text);
bool Parse(bool forced = true);
};
/******************************************************************
* cVeMenuSchedules
******************************************************************/
class cVeMenuSchedules {
protected:
const cEvent *event;
const cChannel *channel;
bool withDate;
eTimerMatch timerMatch;
bool epgSearchFav;
public:
cVeMenuSchedules(void);
virtual ~cVeMenuSchedules(void){};
void SetEpgSearchFav(bool isFav) { epgSearchFav = isFav; };
};
/******************************************************************
* cLeMenuSchedules
******************************************************************/
class cCeMenuSchedules;
class cLeMenuSchedules : public cListElement, public cVeMenuSchedules {
private:
cCeMenuSchedules *currentSchedules;
public:
cLeMenuSchedules(void);
cLeMenuSchedules(const cLeMenuSchedules &other);
virtual ~cLeMenuSchedules(void);
void SetTokenContainer(void);
void SetCurrentElement(cCeMenuSchedules *cur) { currentSchedules = cur; currentElement = (cViewElement*)cur; };
void ClearCurrentElement(void);
void Set(const cEvent *event, const cChannel *channel, bool withDate, eTimerMatch timerMatch);
bool Parse(bool forced = true);
void RenderCurrent(void);
};
/******************************************************************
* cCeMenuSchedules
******************************************************************/
class cCeMenuSchedules : public cCurrentElement, public cVeMenuSchedules, public cScrapManager {
private:
eMenuCategory menuCat;
int schedulesIndex;
public:
cCeMenuSchedules(void);
virtual ~cCeMenuSchedules(void);
void SetTokenContainer(void);
void Set(const cEvent *event, const cChannel *channel, bool withDate, eTimerMatch timerMatch, eMenuCategory menuCat);
bool Parse(bool forced = true);
};
/******************************************************************
* cLeMenuChannels
******************************************************************/
class cCeMenuChannels;
class cLeMenuChannels : public cListElement {
private:
cCeMenuChannels *currentChannel;
const cChannel *channel;
bool withProvider;
public:
cLeMenuChannels(void);
cLeMenuChannels(const cLeMenuChannels &other);
virtual ~cLeMenuChannels(void);
void SetTokenContainer(void);
void SetCurrentElement(cCeMenuChannels *cur) { currentChannel = cur; currentElement = (cViewElement*)cur; };
void ClearCurrentElement(void);
void Set(const cChannel *channel, bool withProvider);
bool Parse(bool forced = true);
void RenderCurrent(void);
};
/******************************************************************
* cCeMenuChannels
******************************************************************/
class cCeMenuChannels : public cCurrentElement, public cScrapManager {
private:
const cChannel *channel;
bool withProvider;
int schedulesIndex;
public:
cCeMenuChannels(void);
virtual ~cCeMenuChannels(void);
void SetTokenContainer(void);
void Set(const cChannel *channel, bool withProvider);
bool Parse(bool forced = true);
};
/******************************************************************
* cLeMenuTimers
******************************************************************/
class cCeMenuTimers;
class cLeMenuTimers : public cListElement {
private:
cCeMenuTimers *currentTimer;
const cTimer *timer;
public:
cLeMenuTimers(void);
cLeMenuTimers(const cLeMenuTimers &other);
virtual ~cLeMenuTimers(void);
void SetTokenContainer(void);
void SetCurrentElement(cCeMenuTimers *cur) { currentTimer = cur; currentElement = (cViewElement*)cur; };
void ClearCurrentElement(void);
void Set(const cTimer *timer);
bool Parse(bool forced = true);
void RenderCurrent(void);
};
/******************************************************************
* cCeMenuTimers
******************************************************************/
class cCeMenuTimers : public cCurrentElement, public cScrapManager {
private:
const cTimer *timer;
public:
cCeMenuTimers(void);
virtual ~cCeMenuTimers(void);
void SetTokenContainer(void);
void Set(const cTimer *timer);
bool Parse(bool forced = true);
};
/******************************************************************
* cLeMenuRecordings
******************************************************************/
class cCeMenuRecordings;
class cLeMenuRecordings : public cListElement, public cScrapManager {
private:
cCeMenuRecordings *currentRecording;
const cRecording *recording;
int level;
int total;
int New;
char *RecName(const char *path, int level);
char *FolderName(const char *path, int level);
public:
cLeMenuRecordings(void);
cLeMenuRecordings(const cLeMenuRecordings &other);
virtual ~cLeMenuRecordings(void);
void SetTokenContainer(void);
void SetCurrentElement(cCeMenuRecordings *cur) { currentRecording = cur; currentElement = (cViewElement*)cur; };
void ClearCurrentElement(void);
void Set(const cRecording *recording, int level, int total, int New);
bool Parse(bool forced = true);
void RenderCurrent(void);
void Clear(bool forceClearBackground = false);
void Close(void);
};
/******************************************************************
* cCeMenuRecordings
******************************************************************/
class cCeMenuRecordings : public cCurrentElement, public cScrapManager {
private:
const cRecording *recording;
int level;
int total;
int New;
public:
cCeMenuRecordings(void);
virtual ~cCeMenuRecordings(void);
void SetTokenContainer(void);
void Set(const cRecording *recording, int level, int total, int New);
bool Parse(bool forced = true);
};
/******************************************************************
* cLeMenuPlugin
******************************************************************/
class cCeMenuPlugin;
class cLeMenuPlugin : public cListElement {
private:
int plugId;
int plugMenuId;
cCeMenuPlugin *currentPlugin;
public:
cLeMenuPlugin(void);
cLeMenuPlugin(const cLeMenuPlugin &other);
virtual ~cLeMenuPlugin(void);
void SetTokenContainer(void);
void SetPlugId(int id) { plugId = id; };
void SetPlugMenuId(int id) { plugMenuId = id; };
void SetCurrentElement(cCeMenuPlugin *cur) { currentPlugin = cur; currentElement = (cViewElement*)cur; };
void ClearCurrentElement(void);
void Set(skindesignerapi::cTokenContainer *tk);
bool Parse(bool forced = true);
void RenderCurrent(void);
};
/******************************************************************
* cCeMenuPlugin
******************************************************************/
class cCeMenuPlugin : public cCurrentElement {
private:
int plugId;
int plugMenuId;
public:
cCeMenuPlugin(void);
virtual ~cCeMenuPlugin(void);
void SetTokenContainer(void);
void SetPlugId(int id) { plugId = id; };
void SetPlugMenuId(int id) { plugMenuId = id; };
void Set(skindesignerapi::cTokenContainer *tk);
bool Parse(bool forced = true);
};
/******************************************************************
* cLeAudioTracks
******************************************************************/
class cLeAudioTracks : public cListElement {
private:
char *text;
public:
cLeAudioTracks(void);
virtual ~cLeAudioTracks(void);
void SetTokenContainer(void);
void Set(const char *text);
bool Parse(bool forced = true);
};
/******************************************************************
* cLeChannelList
******************************************************************/
class cLeChannelList : public cListElement {
private:
const cChannel *channel;
public:
cLeChannelList(void);
cLeChannelList(const cLeChannelList &other);
virtual ~cLeChannelList(void);
void SetTokenContainer(void);
void Set(const cChannel *channel);
bool Parse(bool forced = true);
};
/******************************************************************
* cLeGroupList
******************************************************************/
class cLeGroupList : public cListElement {
private:
const char *group;
int numChannels;
public:
cLeGroupList(void);
cLeGroupList(const cLeGroupList &other);
virtual ~cLeGroupList(void);
void SetTokenContainer(void);
void Set(const char *group, int numChannels);
bool Parse(bool forced = true);
};
#endif //__LISTELEMENTS_H

View File

@ -1,57 +0,0 @@
#include "osdwrapper.h"
cSdOsd::cSdOsd(void) {
osd = NULL;
}
cSdOsd::~cSdOsd(void) {
DeleteOsd();
}
void cSdOsd::Lock(void) {
mutex.Lock();
}
void cSdOsd::Unlock(void) {
mutex.Unlock();
}
bool cSdOsd::CreateOsd(int x, int y, int width, int height) {
cOsd *newOsd = cOsdProvider::NewOsd(cOsd::OsdLeft() + x, cOsd::OsdTop() + y);
if (newOsd) {
tArea Area = { 0, 0, width - 1, height - 1, 32 };
if (newOsd->SetAreas(&Area, 1) == oeOk) {
Lock();
osd = newOsd;
Unlock();
return true;
}
}
return false;
}
void cSdOsd::DeleteOsd(void) {
Lock();
delete osd;
osd = NULL;
Unlock();
}
cPixmap *cSdOsd::CreatePixmap(int layer, cRect &viewPort, cRect &drawPort) {
if (osd) {
return osd->CreatePixmap(layer, viewPort, drawPort);
}
return NULL;
}
void cSdOsd::DestroyPixmap(cPixmap *pix) {
if (osd) {
osd->DestroyPixmap(pix);
}
}
void cSdOsd::Flush(void) {
if (osd) {
osd->Flush();
}
}

View File

@ -1,23 +0,0 @@
#ifndef __OSDWRAPPER_H
#define __OSDWRAPPER_H
#include <vdr/osd.h>
#include <vdr/thread.h>
class cSdOsd {
private:
cOsd *osd;
cMutex mutex;
public:
cSdOsd(void);
virtual ~cSdOsd(void);
void Lock(void);
void Unlock(void);
bool CreateOsd(int x, int y, int width, int height);
void DeleteOsd(void);
cPixmap *CreatePixmap(int layer, cRect &viewPort, cRect &drawPort);
void DestroyPixmap(cPixmap *pix);
void Flush(void);
};
#endif //__OSDWRAPPER_H

View File

@ -1,482 +0,0 @@
#include "../config.h"
#include "view.h"
// --- cView -------------------------------------------------------------
cAnimator* cView::animator = NULL;
cView::cView(void) {
globals = NULL;
viewName = NULL;
attribs = new cViewAttribs((int)eViewAttribs::count);
numViewElements = 0;
viewElements = NULL;
viewElementsHorizontal = NULL;
shifting = false;
currentTvFrame = NULL;
newTvFrame = NULL;
menuInit = false;
}
cView::~cView() {
for (int i=0; i< numViewElements; i++)
delete viewElements[i];
delete[] viewElements;
if (viewElementsHorizontal) {
for (int i=0; i< numViewElements; i++)
delete viewElementsHorizontal[i];
delete[] viewElementsHorizontal;
}
delete attribs;
free(viewName);
delete animator;
animator = NULL;
shifting = false;
sdOsd.DeleteOsd();
}
/*******************************************************************
* Public Functions
*******************************************************************/
bool cView::ReadFromXML(void) {
const char *xmlFile;
switch (viewId) {
case eViewType::DisplayChannel:
xmlFile = "displaychannel.xml";
break;
case eViewType::DisplayMenu:
xmlFile = "displaymenu.xml";
break;
case eViewType::DisplayMessage:
xmlFile = "displaymessage.xml";
break;
case eViewType::DisplayReplay:
xmlFile = "displayreplay.xml";
break;
case eViewType::DisplayVolume:
xmlFile = "displayvolume.xml";
break;
case eViewType::DisplayTracks:
xmlFile = "displayaudiotracks.xml";
break;
default:
return false;
}
cXmlParser parser;
parser.SetOsd(&sdOsd);
if (!parser.ReadView(this, xmlFile)) {
return false;
}
if (!parser.ParseView()) {
return false;
}
//read additional plugin menu templates
bool ok = true;
if (viewId == eViewType::DisplayMenu) {
plgManager->InitPluginMenuIterator();
map <int,skindesignerapi::sPlugMenu> *plugMenus = NULL;
string plugName = "";
int plugId = -1;
while ( plugMenus = plgManager->GetPluginMenus(plugName, plugId) ) {
for (map <int,skindesignerapi::sPlugMenu>::iterator it = plugMenus->begin(); it != plugMenus->end(); it++) {
int templateNumber = it->first;
int menuType = it->second.type;
cString templateName = cString::sprintf("plug-%s-%s", plugName.c_str(), it->second.tplname.c_str());
if (parser.ReadPluginView(*templateName)) {
ok = parser.ParsePluginView(plugName, plugId, templateNumber, menuType);
} else {
dsyslog("skindesigner: template %s for plugin %s not available", *templateName, plugName.c_str());
}
}
}
}
return ok;
}
void cView::SetGlobals(cGlobals *globals) {
this->globals = globals;
attribs->SetGlobals(globals);
for (int i=0; i < numViewElements; ++i) {
if (viewElements[i]) {
viewElements[i]->SetGlobals(globals);
}
if (viewElementsHorizontal && viewElementsHorizontal[i]) {
viewElementsHorizontal[i]->SetGlobals(globals);
}
}
}
void cView::SetContainer(int x, int y, int width, int height) {
container.SetX(x);
container.SetY(y);
container.SetWidth(width);
container.SetHeight(height);
}
void cView::SetAttributes(vector<stringpair> &attributes) {
attribs->Set(attributes);
}
void cView::AddViewElement(const char *sViewElement, cViewElement *viewElement) {
int id = ViewElementId(sViewElement);
if (id == ATTR_UNKNOWN)
return;
viewElement->SetId(id);
viewElement->SetTokenContainer();
eOrientation orientation = viewElement->Orientation();
if (viewElementsHorizontal && orientation == eOrientation::horizontal) {
viewElementsHorizontal[id] = viewElement;
} else {
viewElements[id] = viewElement;
}
}
bool cView::ValidViewElement(const char *viewElement) {
if (ViewElementId(viewElement) != ATTR_UNKNOWN)
return true;
return false;
}
bool cView::ValidViewList(const char *viewList) {
if (!strcmp(viewList, "menuitems"))
return true;
else if (!strcmp(viewList, "channellist"))
return true;
else if (!strcmp(viewList, "grouplist"))
return true;
else if (!strcmp(viewList, "groupchannellist"))
return true;
return false;
}
void cView::PreCache(void) {
bool rootView = (container.Width() == 0) ? true : false;
if (rootView) {
SetContainer(0, 0, cOsd::OsdWidth(), cOsd::OsdHeight());
attribs->SetContainer(0, 0, cOsd::OsdWidth(), cOsd::OsdHeight());
attribs->Cache();
rootView = true;
}
//set frame for scaling tv picture
tvFrame = attribs->TvFrame();
//cache viewelements
int contX = rootView ? 0 : ((attribs->X() > -1) ? attribs->X() : 0);
int contY = rootView ? 0 : ((attribs->Y() > -1) ? attribs->Y() : 0);
for (int i=0; i < numViewElements; i++) {
if (!viewElements[i])
continue;
viewElements[i]->SetContainer(contX, contY, attribs->Width(), attribs->Height());
viewElements[i]->Cache();
if (const char *clearOnDisplay = viewElements[i]->ClearOnDisplay())
SetClearOnDisplay(i, clearOnDisplay);
}
if (viewElementsHorizontal) {
for (int i=0; i < numViewElements; i++) {
if (!viewElementsHorizontal[i])
continue;
viewElementsHorizontal[i]->SetContainer(contX, contY, attribs->Width(), attribs->Height());
viewElementsHorizontal[i]->Cache();
}
}
//cleanup viewelements
for (int i=0; i < numViewElements; i++) {
if (!viewElements[i])
continue;
if (!viewElements[i]->Execute()) {
delete viewElements[i];
viewElements[i] = NULL;
}
}
if (viewElementsHorizontal) {
for (int i=0; i < numViewElements; i++) {
if (!viewElementsHorizontal[i])
continue;
if (!viewElementsHorizontal[i]->Execute()) {
delete viewElementsHorizontal[i];
viewElementsHorizontal[i] = NULL;
}
}
}
//set viewelement objects for each view
SetViewElementObjects();
}
void cView::AddAnimation(cAnimation *animation, bool startAnimation) {
if (!animator)
return;
animator->AddAnimation(animation, startAnimation);
}
void cView::RemoveAnimation(cAnimation *animation) {
if (!animator)
return;
animator->RemoveAnimation(animation);
}
bool cView::Init(void) {
int osdX = attribs->X();
int osdY = attribs->Y();
int osdWidth = attribs->Width();
int osdHeight = attribs->Height();
if (!animator)
animator = new cAnimator(&sdOsd);
else
esyslog("skindesigner: ERROR: animator already exists");
return sdOsd.CreateOsd(osdX, osdY, osdWidth, osdHeight);
}
void cView::Clear(int ve, bool forceClearBackground) {
if (!viewElements[ve])
return;
viewElements[ve]->Clear(forceClearBackground);
}
void cView::SetDirty(int ve) {
if (!viewElements[ve])
return;
viewElements[ve]->SetDirty();
viewElements[ve]->SetRestartAnimation();
}
void cView::Render(int ve, bool force) {
if (!viewElements[ve])
return;
if (viewElements[ve]->Parse(force))
viewElements[ve]->Render();
}
void cView::Hide(int ve) {
if (!viewElements[ve])
return;
viewElements[ve]->Hide();
}
void cView::Show(int ve) {
if (!viewElements[ve])
return;
viewElements[ve]->Show();
}
void cView::SetViewelementsAnimOut(void) {
for (int i=0; i< numViewElements; i++)
if (viewElements[i])
viewElements[i]->SetAnimOut();
}
void cView::Close(void) {
if (animator) {
animator->Stop();
animator->Finish();
delete animator;
animator = NULL;
}
UnScaleTv();
ClearVariables();
for (int i=0; i < numViewElements; i++) {
if (!viewElements[i])
continue;
viewElements[i]->Close();
}
// sdOsd.Flush();
sdOsd.DeleteOsd();
}
int cView::FadeTime(void) {
return attribs->FadeTime();
}
void cView::SetTransparency(int transparency, bool force) {
for (int i = 0; i < numViewElements; i++) {
if (viewElements[i] && (!viewElements[i]->Fading() || force)) {
viewElements[i]->SetTransparency(transparency);
}
}
}
int cView::ShiftTime(void) {
return attribs->ShiftTime();
}
int cView::ShiftMode(void) {
int mode = attribs->ShiftMode();
if (mode < 0) mode = 0;
return mode;
}
void cView::ShiftPositions(cPoint *start, cPoint *end) {
cRect shiftbox = CoveredArea();
cPoint startPoint = ShiftStart(shiftbox);
start->Set(startPoint);
end->Set(shiftbox.X(), shiftbox.Y());
}
void cView::SetPosition(cPoint &position, cPoint &reference, bool force) {
for (int i = 0; i < numViewElements; i++) {
if (viewElements[i] && (!viewElements[i]->Shifting() || force)) {
viewElements[i]->SetPosition(position, reference);
}
}
}
void cView::Flush(void) {
if (init) {
init = false;
StartAnimation();
menuInit = true;
}
if (menuInit) {
ScaleTv();
WakeViewElements();
menuInit = false;
}
sdOsd.Flush();
}
void cView::Debug(void) {
esyslog("skindesigner: ---> view %s", viewName);
attribs->Debug();
for (int i=0; i < numViewElements; i++) {
if (!viewElements[i])
continue;
esyslog("skindesigner: debugging ve %d", i);
viewElements[i]->Debug(true);
}
}
/*******************************************************************
* Protected Functions
*******************************************************************/
void cView::ClearVariables(void) {
init = true;
newTvFrame = NULL;
currentTvFrame = NULL;
menuInit = false;
}
int cView::ViewElementId(const char *name) {
map<string, int>::iterator hit = viewElementNames.find(name);
if (hit != viewElementNames.end())
return (int)hit->second;
return ATTR_UNKNOWN;
}
void cView::StartAnimation(void) {
if (viewId != eViewType::DisplayMenu &&
viewId != eViewType::DisplayPlugin) {
if (ShiftTime() > 0) {
cShifter *shifter = new cShifter((cShiftable*)this);
shifter->SetPersistent();
cView::AddAnimation(shifter);
} else if (FadeTime() > 0) {
cFader *fader = new cFader((cFadable*)this);
fader->SetPersistent();
cView::AddAnimation(fader);
}
}
animator->Start();
}
void cView::WakeViewElements(void) {
for (int i = 0; i < numViewElements; i++) {
if (viewElements[i]) {
viewElements[i]->WakeUp();
}
}
if (!viewElementsHorizontal)
return;
for (int i = 0; i < numViewElements; i++) {
if (viewElementsHorizontal[i]) {
viewElementsHorizontal[i]->WakeUp();
}
}
}
cPoint cView::ShiftStart(cRect &shiftbox) {
eShiftType type = (eShiftType)attribs->ShiftType();
cPoint start;
if (type == eShiftType::none) {
start = attribs->ShiftStartpoint();
} else if (type == eShiftType::left) {
start.SetX(-shiftbox.Width());
start.SetY(shiftbox.Y());
} else if (type == eShiftType::right) {
start.SetX(attribs->Width());
start.SetY(shiftbox.Y());
} else if (type == eShiftType::top) {
start.SetX(shiftbox.X());
start.SetY(-shiftbox.Height());
} else if (type == eShiftType::bottom) {
start.SetX(shiftbox.X());
start.SetY(attribs->Height());
}
return start;
}
cRect cView::CoveredArea(void) {
cRect unionArea;
for (int i = 0; i < numViewElements; i++) {
if (viewElements[i] && !viewElements[i]->Shifting()) {
unionArea.Combine(viewElements[i]->CoveredArea());
}
}
return unionArea;
}
void cView::ScaleTv(void) {
bool scale = false;
if (newTvFrame) {
if (currentTvFrame) {
if (*newTvFrame != *currentTvFrame) {
scale = true;
}
} else {
scale = true;
}
currentTvFrame = newTvFrame;
} else {
if (tvFrame != cRect::Null) {
scale = true;
currentTvFrame = &tvFrame;
}
}
if (currentTvFrame && scale) {
DoScaleTv(currentTvFrame);
}
}
void cView::UnScaleTv(void) {
if (currentTvFrame) {
DoScaleTv(&cRect::Null);
currentTvFrame = NULL;
}
}
void cView::DoScaleTv(const cRect *frame) {
if (*frame == cRect::Null) {
cDevice::PrimaryDevice()->ScaleVideo(cRect::Null);
} else {
cRect scalingWindow = cDevice::PrimaryDevice()->CanScaleVideo(*frame);
if (scalingWindow != cRect::Null) {
cDevice::PrimaryDevice()->ScaleVideo(scalingWindow);
}
}
}
void cView::SetClearOnDisplay(int ve, const char *clearOnDisplay) {
if (!strcmp(clearOnDisplay, "all")) {
viewElements[ve]->SetClearAll();
return;
}
vector<int> clearVEs;
for (map<string,int>::iterator it = viewElementNames.begin(); it != viewElementNames.end(); it++) {
string name = it->first;
int id = it->second;
if (strstr(clearOnDisplay, name.c_str())) {
clearVEs.push_back(id);
}
}
viewElements[ve]->SetClearOnDisplay(clearVEs);
}

View File

@ -1,101 +0,0 @@
#ifndef __VIEW_H
#define __VIEW_H
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string>
#include "osdwrapper.h"
#include "globals.h"
#include "../libskindesignerapi/tokencontainer.h"
#include "viewelementplugin.h"
#include "viewelementscommon.h"
#include "viewelementsdisplaychannel.h"
#include "viewelementsdisplaymenu.h"
#include "viewelementsdisplayreplay.h"
#include "viewelementsdisplaytracks.h"
#include "viewlist.h"
class cView;
#include "xmlparser.h"
#include "animation.h"
using namespace std;
class cView : public cFadable, public cShiftable {
private:
void DoScaleTv(const cRect *frame);
void SetClearOnDisplay(int ve, const char *clearOnDisplay);
protected:
cSdOsd sdOsd;
static cAnimator *animator;
cViewAttribs *attribs;
cRect container;
bool init;
eViewType viewId;
cGlobals *globals;
char *viewName;
int numViewElements;
cViewElement **viewElements;
cViewElement **viewElementsHorizontal;
map<string,int> viewElementNames;
bool shifting;
cRect tvFrame;
cRect *currentTvFrame;
cRect *newTvFrame;
bool menuInit;
int ViewElementId(const char *name);
virtual void ClearVariables(void);
virtual void SetViewElementObjects(void) { };
virtual void StartAnimation(void);
virtual void WakeViewElements(void);
cPoint ShiftStart(cRect &shiftbox);
virtual cRect CoveredArea(void);
void ScaleTv(void);
void UnScaleTv(void);
public:
cView(void);
virtual ~cView(void);
//Loading and Caching functionality
bool ReadFromXML(void);
virtual void SetGlobals(cGlobals *globals);
const char *GetViewName(void) { return viewName; };
void SetContainer(int x, int y, int width, int height);
void SetAttributes(vector<stringpair> &attributes);
void AddViewElement(const char *sViewElement, cViewElement *viewElement);
bool ValidViewElement(const char *viewElement);
virtual void AddViewList(cViewList *viewList) { };
bool ValidViewList(const char *viewList);
virtual void PreCache(void);
cRect *GetTvFrame(void) { return &tvFrame; };
virtual const cFont *GetTextAreaFont(void) { return NULL; };
virtual int GetTextAreaWidth(void) { return 0; };
virtual int GetListWidth(void) { return 0; };
static void AddAnimation(cAnimation *animation, bool startAnimation = true);
static void RemoveAnimation(cAnimation *animation);
//View API
virtual bool Init(void);
void Clear(int ve, bool forceClearBackground = false);
void SetDirty(int ve);
void Render(int ve, bool force = false);
void Hide(int ve);
void Show(int ve);
virtual void Close(void);
virtual void Flush(void);
virtual void Debug(void);
void SetViewelementsAnimOut(void);
//Fadable
int Delay(void) { return 0; };
int FadeTime(void);
virtual void SetTransparency(int transparency, bool force = false);
//Shiftable
int ShiftTime(void);
int ShiftMode(void);
void ShiftPositions(cPoint *start, cPoint *end);
virtual void SetPosition(cPoint &position, cPoint &reference, bool force = false);
void SetStartShifting(void) { shifting = true; };
void SetEndShifting(void) { shifting = false; };
};
#endif //__VIEW_H

File diff suppressed because it is too large Load Diff

View File

@ -1,114 +0,0 @@
#ifndef __VIEWDETAIL_H
#define __VIEWDETAIL_H
#include "../services/epgsearch.h"
#include "../extensions/scrapmanager.h"
#include "viewelement.h"
/******************************************************************
* cViewDetail
******************************************************************/
class cViewDetail : public cViewElement, public cScrapManager {
protected:
int plugId;
int plugMenuId;
cArea *activeTab;
int activeTabIndex;
int numTabs;
void SetActiveTab(void);
public:
cViewDetail(void);
virtual ~cViewDetail(void);
void SetPlugId(int id) { plugId = id; };
void SetPlugMenuId(int id) { plugMenuId = id; };
int GetWidth(void);
void ResetTabs(void);
void Clear(bool forceClearBackground = false);
void Close(void);
void Render(void);
void Scrollbar(int &barheight, int &offset, bool &end);
bool ScrollUp(bool page = false);
bool ScrollDown(bool page = false);
int GetTabs(vector<const char*> &tabs);
int NumTabs(void) { return numTabs; };
int ActiveTab(void) { return activeTabIndex; };
void NextTab(void);
void PrevTab(void);
void SetTransparency(int transparency, bool forceDetached = false);
};
/******************************************************************
* cViewDetailEpg
******************************************************************/
class cViewDetailEpg : public cViewDetail {
protected:
const cEvent *event;
int rerunsIndex;
int actorsIndex;
cList<Epgsearch_searchresults_v1_0::cServiceSearchResult> *LoadReruns(void);
void SetReruns(cList<Epgsearch_searchresults_v1_0::cServiceSearchResult> *reruns);
void SetEpgPictures(int eventId);
public:
cViewDetailEpg(void);
virtual ~cViewDetailEpg(void);
void SetTokenContainer(void);
void SetEvent(const cEvent *event) { this->event = event; };
bool Parse(bool forced = false);
};
/******************************************************************
* cViewDetailRec
******************************************************************/
class cViewDetailRec : public cViewDetail {
protected:
const cRecording *recording;
int actorsIndex;
void SetRecInfos(void);
int ReadSizeVdr(const char *strPath);
string StripXmlTag(string &Line, const char *Tag);
void SetRecordingImages(const char *recPath);
public:
cViewDetailRec(void);
virtual ~cViewDetailRec(void);
void SetTokenContainer(void);
void SetRecording(const cRecording *recording) { this->recording = recording; };
bool Parse(bool forced = false);
};
/******************************************************************
* cViewDetailText
******************************************************************/
class cViewDetailText : public cViewDetail {
protected:
const char *text;
public:
cViewDetailText(void);
virtual ~cViewDetailText(void);
void SetTokenContainer(void);
void SetText(const char *text) { this->text = text; };
bool Parse(bool forced = false);
};
/******************************************************************
* cViewDetailPlugin
******************************************************************/
class cViewDetailPlugin : public cViewDetail {
protected:
public:
cViewDetailPlugin(void);
virtual ~cViewDetailPlugin(void);
void SetTokenContainer(void);
void Set(skindesignerapi::cTokenContainer *tk);
bool Parse(bool forced = false);
};
/******************************************************************
* cViewDetailAdvancedPlugin
******************************************************************/
class cViewDetailAdvancedPlugin : public cViewDetail {
protected:
int plugViewId;
public:
cViewDetailAdvancedPlugin(int viewId, int plugId);
virtual ~cViewDetailAdvancedPlugin(void);
void SetTokenContainer(void);
void Set(skindesignerapi::cTokenContainer *tk);
bool Parse(bool forced = false);
};
#endif //__VIEWDETAIL_H

View File

@ -1,605 +0,0 @@
#include "viewdisplaychannel.h"
#include "../config.h"
/************************************************************************************
* cViewChannel
************************************************************************************/
cViewChannel::cViewChannel(void) {
veCustomTokens = NULL;
ClearVariables();
viewId = eViewType::DisplayChannel;
viewName = strdup("displaychannel");
numViewElements = (int)eVeDisplayChannel::count;
viewElements = new cViewElement*[numViewElements];
for (int i=0; i < numViewElements; i++) {
viewElements[i] = NULL;
}
SetViewElements();
veMessage = NULL;
veChannelInfo = NULL;
veChannelGroup = NULL;
veEpgInfo = NULL;
veProgressBar = NULL;
veStatusInfo = NULL;
veScraperContent = NULL;
veEcmInfo = NULL;
#ifdef USE_ZAPCOCKPIT
veChannelHints = NULL;
veChannelDetail = NULL;
veChannelListDetail = NULL;
veGroupChannelListDetail = NULL;
channelList = NULL;
groupList = NULL;
groupChannelList = NULL;
#endif
}
cViewChannel::~cViewChannel() {
#ifdef USE_ZAPCOCKPIT
delete channelList;
delete groupList;
delete groupChannelList;
#endif
}
void cViewChannel::SetGlobals(cGlobals *globals) {
cView::SetGlobals(globals);
#ifdef USE_ZAPCOCKPIT
if (channelList)
channelList->SetGlobals(globals);
if (groupList)
groupList->SetGlobals(globals);
if (groupChannelList)
groupChannelList->SetGlobals(globals);
#endif
}
void cViewChannel::PreCache(void) {
cView::PreCache();
#ifdef USE_ZAPCOCKPIT
if (channelList) {
channelList->SetContainer(attribs->X(), attribs->Y(), attribs->Width(), attribs->Height());
channelList->PreCache();
}
if (groupList) {
groupList->SetContainer(attribs->X(), attribs->Y(), attribs->Width(), attribs->Height());
groupList->PreCache();
}
if (groupChannelList) {
groupChannelList->SetContainer(attribs->X(), attribs->Y(), attribs->Width(), attribs->Height());
groupChannelList->PreCache();
}
#endif
if (viewElements[(int)eVeDisplayChannel::channellistback])
viewElements[(int)eVeDisplayChannel::channellistback]->UnsetStartAnim();
if (viewElements[(int)eVeDisplayChannel::grouplistback])
viewElements[(int)eVeDisplayChannel::grouplistback]->UnsetStartAnim();
if (viewElements[(int)eVeDisplayChannel::groupchannellistback])
viewElements[(int)eVeDisplayChannel::groupchannellistback]->UnsetStartAnim();
SetViewelementsAnimOut();
}
void cViewChannel::AddChannelViewList(const char *listName, cViewList *viewList) {
#ifdef USE_ZAPCOCKPIT
if (!strcmp(listName, "channellist"))
channelList = dynamic_cast<cViewListChannelList*>(viewList);
else if (!strcmp(listName, "grouplist"))
groupList = dynamic_cast<cViewListGroupList*>(viewList);
else if (!strcmp(listName, "groupchannellist"))
groupChannelList = dynamic_cast<cViewListChannelList*>(viewList);
else
esyslog("skindesigner: invalid view list %s in displaychannel", listName);
#endif
}
void cViewChannel::SetViewElements(void) {
viewElementNames.insert(pair<string, int>("background", (int)eVeDisplayChannel::background));
viewElementNames.insert(pair<string, int>("channelgroup", (int)eVeDisplayChannel::channelgroup));
viewElementNames.insert(pair<string, int>("channelinfo", (int)eVeDisplayChannel::channelinfo));
viewElementNames.insert(pair<string, int>("epginfo", (int)eVeDisplayChannel::epginfo));
viewElementNames.insert(pair<string, int>("progressbar", (int)eVeDisplayChannel::progressbar));
viewElementNames.insert(pair<string, int>("statusinfo", (int)eVeDisplayChannel::statusinfo));
viewElementNames.insert(pair<string, int>("audioinfo", (int)eVeDisplayChannel::audioinfo));
viewElementNames.insert(pair<string, int>("ecminfo", (int)eVeDisplayChannel::ecminfo));
viewElementNames.insert(pair<string, int>("screenresolution", (int)eVeDisplayChannel::screenresolution));
viewElementNames.insert(pair<string, int>("signalquality", (int)eVeDisplayChannel::signalquality));
viewElementNames.insert(pair<string, int>("devices", (int)eVeDisplayChannel::devices));
viewElementNames.insert(pair<string, int>("currentweather", (int)eVeDisplayChannel::currentweather));
viewElementNames.insert(pair<string, int>("scrapercontent", (int)eVeDisplayChannel::scrapercontent));
viewElementNames.insert(pair<string, int>("channelhints", (int)eVeDisplayChannel::channelhints));
viewElementNames.insert(pair<string, int>("channeldetail", (int)eVeDisplayChannel::channeldetail));
viewElementNames.insert(pair<string, int>("channellistback", (int)eVeDisplayChannel::channellistback));
viewElementNames.insert(pair<string, int>("channellistdetail", (int)eVeDisplayChannel::channellistdetail));
viewElementNames.insert(pair<string, int>("grouplistback", (int)eVeDisplayChannel::grouplistback));
viewElementNames.insert(pair<string, int>("groupchannellistback", (int)eVeDisplayChannel::groupchannellistback));
viewElementNames.insert(pair<string, int>("groupchannellistdetail", (int)eVeDisplayChannel::groupchannellistdetail));
viewElementNames.insert(pair<string, int>("datetime", (int)eVeDisplayChannel::datetime));
viewElementNames.insert(pair<string, int>("time", (int)eVeDisplayChannel::time));
viewElementNames.insert(pair<string, int>("message", (int)eVeDisplayChannel::message));
viewElementNames.insert(pair<string, int>("customtokens", (int)eVeDisplayChannel::customtokens));
}
void cViewChannel::SetViewElementObjects(void) {
for (int i = 0; i < numViewElements; i++) {
if (!viewElements[i])
continue;
if (dynamic_cast<cVeMessage*>(viewElements[i]))
{
veMessage = dynamic_cast<cVeMessage*>(viewElements[i]);
}
else if (dynamic_cast<cVeDcChannelInfo*>(viewElements[i])) {
veChannelInfo = dynamic_cast<cVeDcChannelInfo*>(viewElements[i]);
}
else if (dynamic_cast<cVeDcChannelGroup*>(viewElements[i]))
{
veChannelGroup = dynamic_cast<cVeDcChannelGroup*>(viewElements[i]);
}
else if (dynamic_cast<cVeDcEpgInfo*>(viewElements[i]))
{
veEpgInfo = dynamic_cast<cVeDcEpgInfo*>(viewElements[i]);
veEpgInfo->SetGlobalTimers(&globalTimers);
}
else if (dynamic_cast<cVeDcProgressBar*>(viewElements[i]))
{
veProgressBar = dynamic_cast<cVeDcProgressBar*>(viewElements[i]);
}
else if (dynamic_cast<cVeDcStatusInfo*>(viewElements[i]))
{
veStatusInfo = dynamic_cast<cVeDcStatusInfo*>(viewElements[i]);
veStatusInfo->SetGlobalTimers(&globalTimers);
}
else if (dynamic_cast<cVeDcScraperContent*>(viewElements[i]))
{
veScraperContent = dynamic_cast<cVeDcScraperContent*>(viewElements[i]);
}
#ifdef USE_ZAPCOCKPIT
else if (dynamic_cast<cVeDcChannelListDetail*>(viewElements[i]))
{
veChannelListDetail = dynamic_cast<cVeDcChannelListDetail*>(viewElements[i]);
}
else if (dynamic_cast<cVeDcGroupChannelListDetail*>(viewElements[i]))
{
veGroupChannelListDetail = dynamic_cast<cVeDcGroupChannelListDetail*>(viewElements[i]);
}
else if (dynamic_cast<cVeDcChannelHints*>(viewElements[i]))
{
veChannelHints = dynamic_cast<cVeDcChannelHints*>(viewElements[i]);
}
else if (dynamic_cast<cVeDcChannelDetail*>(viewElements[i]))
{
veChannelDetail = dynamic_cast<cVeDcChannelDetail*>(viewElements[i]);
}
#endif
else if (dynamic_cast<cVeDcEcmInfo*>(viewElements[i]))
{
veEcmInfo = dynamic_cast<cVeDcEcmInfo*>(viewElements[i]);
}
else if (dynamic_cast<cVeCustomTokens*>(viewElements[i]))
{
veCustomTokens = dynamic_cast<cVeCustomTokens*>(viewElements[i]);
}
else if (dynamic_cast<cVeDevices*>(viewElements[i]))
{
viewElements[i]->SetDetached();
}
}
}
void cViewChannel::ClearVariables(void) {
cView::ClearVariables();
#ifdef USE_ZAPCOCKPIT
viewType = dcDefault;
viewTypeLast = dcDefault;
initExtended = true;
displayList = false;
initList = false;
channelInput = false;
#endif
channelChange = false;
mode = dmDefault;
if (veCustomTokens)
veCustomTokens->Reset();
timersLoaded = false;
globalTimers.ClearTimers();
}
void cViewChannel::GetTimers(void) {
if (!timersLoaded) {
timersLoaded = true;
globalTimers.LoadTimers();
}
}
void cViewChannel::SetChannel(const cChannel *channel, int number) {
channelChange = true;
//check if channelgroups have to be cleared
bool clearChannelGroups = (mode == dmChannelGroups) ? true : false;
mode = dmDefault;
#ifdef USE_ZAPCOCKPIT
//check if channel hints have to be cleared
if (number) {
channelInput = true;
} else if (channelInput) {
channelInput = false;
if (veChannelHints)
veChannelHints->Close();
}
if (veChannelDetail)
veChannelDetail->Clear(true);
#endif
if (veChannelInfo) {
veChannelInfo->Clear();
veChannelInfo->Set(channel, number);
}
if (channel) {
if (!channel->GroupSep()) {
if (clearChannelGroups)
Clear((int)eVeDisplayChannel::channelgroup);
if (veStatusInfo)
veStatusInfo->Set(channel);
if (veEcmInfo)
veEcmInfo->Set(channel);
} else {
mode = dmChannelGroups;
ClearBasic(false);
if (veChannelGroup)
veChannelGroup->Set(channel);
}
}
}
void cViewChannel::SetEvents(const cEvent *present, const cEvent *following) {
Clear((int)eVeDisplayChannel::epginfo);
Clear((int)eVeDisplayChannel::progressbar);
Clear((int)eVeDisplayChannel::scrapercontent);
if (veProgressBar)
veProgressBar->Set(present);
if (veEpgInfo)
veEpgInfo->Set(present, following);
if (veScraperContent)
veScraperContent->Set(present);
}
void cViewChannel::SetMessage(eMessageType type, const char *text) {
if (veMessage) {
if (text)
veMessage->Set(type, text);
else
veMessage->Clear();
}
}
#ifdef USE_ZAPCOCKPIT
void cViewChannel::SetViewType(eDisplaychannelView viewType) {
viewTypeLast = this->viewType;
this->viewType = viewType;
}
int cViewChannel::MaxItems(void) {
initList = true;
if (viewType == dcChannelList && channelList)
return channelList->NumItems();
else if (viewType == dcGroupsList && groupList)
return groupList->NumItems();
else if (viewType == dcGroupsChannelList && groupChannelList)
return groupChannelList->NumItems();
return 0;
}
bool cViewChannel::KeyRightOpensChannellist(void) {
if (channelList) {
if (channelList->Button() == eButtonType::left)
return false;
else if (channelList->Button() == eButtonType::right)
return true;
}
if (groupList) {
if (groupList->Button() == eButtonType::left)
return true;
else if (groupList->Button() == eButtonType::right)
return false;
}
return true;
}
void cViewChannel::SetChannelInfo(const cChannel *channel) {
if (!channel)
return;
if (viewType == dcChannelInfo && veChannelDetail) {
ClearOnDisplay();
veChannelDetail->Set(channel);
Render((int)eVeDisplayChannel::channeldetail);
} else if (viewType == dcChannelListInfo && veChannelListDetail) {
veChannelListDetail->Set(channel);
Render((int)eVeDisplayChannel::channellistdetail);
} else if (viewType == dcGroupsChannelListInfo && veGroupChannelListDetail) {
veGroupChannelListDetail->Set(channel);
Render((int)eVeDisplayChannel::groupchannellistdetail);
}
}
void cViewChannel::SetChannelList(const cChannel *channel, int index, bool current) {
displayList = true;
if (viewType == dcChannelList && channelList) {
channelList->Set(channel, index, current);
} else if (viewType == dcGroupsChannelList && groupChannelList) {
groupChannelList->Set(channel, index, current);
}
}
void cViewChannel::SetGroupList(const char *group, int numChannels, int index, bool current) {
displayList = true;
if (groupList) {
groupList->Set(group, numChannels, index, current);
}
}
void cViewChannel::ClearList(void) {
if (viewType == dcChannelList && channelList)
channelList->Clear();
if (viewType == dcGroupsList && groupList)
groupList->Clear();
if (viewType == dcGroupsChannelList && groupChannelList)
groupChannelList->Clear();
}
void cViewChannel::SetNumChannelHints(int num) {
if (veChannelHints)
veChannelHints->SetNumHints(num);
channelHints = true;
}
void cViewChannel::SetChannelHint(const cChannel *channel) {
if (veChannelHints)
veChannelHints->SetHint(channel);
}
#endif //USE_ZAPCOCKPIT
void cViewChannel::Close(void) {
bool doAnim = true;
#ifdef USE_ZAPCOCKPIT
if (viewType != dcDefault || viewTypeLast != dcDefault)
doAnim = false;
#endif
if (doAnim) {
animator->Stop();
animator->Finish();
}
delete animator;
animator = NULL;
UnScaleTv();
ClearVariables();
for (int i=0; i < numViewElements; i++) {
if (!viewElements[i])
continue;
viewElements[i]->Close();
}
#ifdef USE_ZAPCOCKPIT
if (channelList)
channelList->Close();
if (groupList)
groupList->Close();
if (groupChannelList)
groupChannelList->Close();
#endif
// sdOsd.Flush();
sdOsd.DeleteOsd();
}
void cViewChannel::ClearBasic(bool clearBackground) {
if (clearBackground) {
Clear((int)eVeDisplayChannel::background, true);
Clear((int)eVeDisplayChannel::currentweather, true);
}
Clear((int)eVeDisplayChannel::channelinfo, true);
Clear((int)eVeDisplayChannel::epginfo, true);
Clear((int)eVeDisplayChannel::statusinfo, true);
Clear((int)eVeDisplayChannel::scrapercontent, true);
Clear((int)eVeDisplayChannel::progressbar, true);
Clear((int)eVeDisplayChannel::screenresolution, true);
Clear((int)eVeDisplayChannel::signalquality, true);
Clear((int)eVeDisplayChannel::audioinfo, true);
Clear((int)eVeDisplayChannel::ecminfo, true);
Clear((int)eVeDisplayChannel::devices, true);
Clear((int)eVeDisplayChannel::customtokens, true);
}
void cViewChannel::ClearExtended(void) {
#ifdef USE_ZAPCOCKPIT
//exit from channel list
if ((viewTypeLast == dcChannelList || viewTypeLast == dcChannelListInfo) && viewType == dcDefault && channelList) {
channelList->Clear();
Clear((int)eVeDisplayChannel::channellistback);
Clear((int)eVeDisplayChannel::channellistdetail);
SetDirty((int)eVeDisplayChannel::channellistback);
initExtended = true;
init = true;
ShowBasic();
}
//exit from channellist info to channel list
if (viewTypeLast == dcChannelListInfo && viewType == dcChannelList) {
Clear((int)eVeDisplayChannel::channellistdetail);
SetDirty((int)eVeDisplayChannel::channellistdetail);
}
//exit from group list
if (viewTypeLast == dcGroupsList && viewType == dcDefault && groupList) {
groupList->Clear();
Clear((int)eVeDisplayChannel::grouplistback);
SetDirty((int)eVeDisplayChannel::grouplistback);
initExtended = true;
init = true;
ShowBasic();
}
//exit from group channel list to group list
if (viewTypeLast == dcGroupsChannelList && viewType == dcGroupsList && groupChannelList) {
groupChannelList->Clear();
Clear((int)eVeDisplayChannel::groupchannellistback);
SetDirty((int)eVeDisplayChannel::groupchannellistback);
}
//exit from groupchannellist info to groupchannel list
if (viewTypeLast == dcGroupsChannelListInfo && viewType == dcGroupsChannelList) {
Clear((int)eVeDisplayChannel::groupchannellistdetail);
SetDirty((int)eVeDisplayChannel::groupchannellistdetail);
}
//exit from channel list
if ((viewTypeLast == dcGroupsChannelList || viewTypeLast == dcGroupsChannelListInfo) && viewType == dcDefault && groupList && groupChannelList) {
groupList->Clear();
groupChannelList->Clear();
Clear((int)eVeDisplayChannel::grouplistback);
Clear((int)eVeDisplayChannel::groupchannellistback);
Clear((int)eVeDisplayChannel::groupchannellistdetail);
SetDirty((int)eVeDisplayChannel::groupchannellistback);
SetDirty((int)eVeDisplayChannel::grouplistback);
SetDirty((int)eVeDisplayChannel::groupchannellistdetail);
initExtended = true;
init = true;
ShowBasic();
}
//exit from channel info to channel or group list
if (viewTypeLast == dcChannelInfo && (viewType == dcChannelList || viewType == dcGroupsList)) {
Clear((int)eVeDisplayChannel::channeldetail, true);
}
viewTypeLast = dcDefault;
#endif
}
void cViewChannel::ClearOnDisplay(void) {
#ifdef USE_ZAPCOCKPIT
if (viewType == dcChannelInfo && veChannelDetail) {
vector<int> clear = veChannelDetail->GetClearOnDisplay();
for (vector<int>::iterator ve = clear.begin(); ve != clear.end(); ve++) {
Hide(*ve);
}
} else {
cViewElement *listBack = NULL;
if (viewType == dcChannelList)
listBack = viewElements[(int)eVeDisplayChannel::channellistback];
else if (viewType == dcGroupsList)
listBack = viewElements[(int)eVeDisplayChannel::grouplistback];
if (!listBack)
return;
if (listBack->DoClearAll()) {
HideBasic();
return;
}
vector<int> clear = listBack->GetClearOnDisplay();
for (vector<int>::iterator ve = clear.begin(); ve != clear.end(); ve++) {
Hide(*ve);
}
}
#endif
}
void cViewChannel::DrawBasic(bool initial) {
if (initial) {
Render((int)eVeDisplayChannel::background);
Render((int)eVeDisplayChannel::currentweather);
}
Render((int)eVeDisplayChannel::channelinfo);
Render((int)eVeDisplayChannel::epginfo);
Render((int)eVeDisplayChannel::statusinfo);
Render((int)eVeDisplayChannel::scrapercontent);
Render((int)eVeDisplayChannel::progressbar, channelChange);
Render((int)eVeDisplayChannel::screenresolution);
Render((int)eVeDisplayChannel::signalquality);
Render((int)eVeDisplayChannel::audioinfo);
Render((int)eVeDisplayChannel::ecminfo);
Render((int)eVeDisplayChannel::devices);
Render((int)eVeDisplayChannel::customtokens);
Render((int)eVeDisplayChannel::message);
#ifdef USE_ZAPCOCKPIT
if (channelHints) {
channelHints = false;
if (veChannelHints) {
if (veChannelHints->Active())
veChannelHints->Close();
veChannelHints->Parse();
veChannelHints->Render();
}
}
#endif
}
void cViewChannel::HideBasic(void) {
for (int ve = (int)eVeDisplayChannel::background; ve <= (int)eVeDisplayChannel::ecminfo; ve++) {
Hide(ve);
}
}
void cViewChannel::ShowBasic(void) {
for (int ve = (int)eVeDisplayChannel::background; ve <= (int)eVeDisplayChannel::ecminfo; ve++) {
Show(ve);
}
}
void cViewChannel::DrawExtended(void) {
#ifdef USE_ZAPCOCKPIT
if (!displayList)
return;
if (initExtended) {
ClearOnDisplay();
initExtended = false;
}
if (viewType == dcChannelList && channelList) {
Render((int)eVeDisplayChannel::channellistback);
channelList->Draw(mcUndefined);
if (initList)
channelList->StartAnimation();
} else if (viewType == dcGroupsList && groupList) {
Render((int)eVeDisplayChannel::grouplistback);
groupList->Draw(mcUndefined);
if (initList)
groupList->StartAnimation();
} else if (viewType == dcGroupsChannelList && groupChannelList) {
Render((int)eVeDisplayChannel::groupchannellistback);
groupChannelList->Draw(mcUndefined);
if (initList)
groupChannelList->StartAnimation();
}
displayList = false;
initList = false;
#endif
}
void cViewChannel::Flush(void) {
#ifdef USE_ZAPCOCKPIT
ClearExtended();
#endif
#ifdef USE_ZAPCOCKPIT
if (viewType < dcChannelList) {
#endif
//Basic Display Handling
if (mode == dmDefault) {
DrawBasic(init);
} else if (mode == dmChannelGroups) {
if (init) {
Render((int)eVeDisplayChannel::background);
Render((int)eVeDisplayChannel::currentweather);
}
Render((int)eVeDisplayChannel::channelgroup);
}
Render((int)eVeDisplayChannel::datetime);
Render((int)eVeDisplayChannel::time);
#ifdef USE_ZAPCOCKPIT
}
#endif
channelChange = false;
#ifdef USE_ZAPCOCKPIT
DrawExtended();
#endif
cView::Flush();
}

View File

@ -1,78 +0,0 @@
#ifndef __VIEWDISPLAYCHANNEL_H
#define __VIEWDISPLAYCHANNEL_H
#include "view.h"
#include "../extensions/globaltimers.h"
enum eDisplayMode {
dmDefault,
dmChannelGroups
};
class cViewChannel : public cView {
private:
cVeMessage *veMessage;
cVeCustomTokens *veCustomTokens;
cVeDcChannelInfo *veChannelInfo;
cVeDcChannelGroup *veChannelGroup;
cVeDcEpgInfo *veEpgInfo;
cVeDcProgressBar *veProgressBar;
cVeDcStatusInfo *veStatusInfo;
cVeDcScraperContent *veScraperContent;
cVeDcEcmInfo *veEcmInfo;
#ifdef USE_ZAPCOCKPIT
cVeDcChannelHints *veChannelHints;
cVeDcChannelDetail *veChannelDetail;
cVeDcChannelListDetail *veChannelListDetail;
cVeDcGroupChannelListDetail *veGroupChannelListDetail;
cViewListChannelList *channelList;
cViewListGroupList *groupList;
cViewListChannelList *groupChannelList;
eDisplaychannelView viewType;
eDisplaychannelView viewTypeLast;
bool initExtended;
bool displayList;
bool initList;
bool channelHints;
bool channelInput;
#endif
bool channelChange;
eDisplayMode mode;
bool timersLoaded;
cGlobalTimers globalTimers;
void SetViewElements(void);
void ClearVariables(void);
void SetViewElementObjects(void);
void ClearBasic(bool clearBackground);
void ClearExtended(void);
void ClearOnDisplay(void);
void DrawBasic(bool initial);
void HideBasic(void);
void ShowBasic(void);
void DrawExtended(void);
public:
cViewChannel(void);
virtual ~cViewChannel(void);
void SetGlobals(cGlobals *globals);
void PreCache(void);
void AddChannelViewList(const char *listName, cViewList *viewList);
void GetTimers(void);
void SetChannel(const cChannel *channel, int number);
void SetEvents(const cEvent *present, const cEvent *following);
void SetMessage(eMessageType type, const char *text);
#ifdef USE_ZAPCOCKPIT
void SetViewType(eDisplaychannelView viewType);
int MaxItems(void);
bool KeyRightOpensChannellist(void);
void SetChannelInfo(const cChannel *channel);
void SetChannelList(const cChannel *channel, int index, bool current);
void SetGroupList(const char *group, int numChannels, int index, bool current);
void ClearList(void);
void SetNumChannelHints(int num);
void SetChannelHint(const cChannel *channel);
#endif
void Close(void);
void Flush(void);
};
#endif //__VIEWDISPLAYCHANNEL_H

File diff suppressed because it is too large Load Diff

View File

@ -1,327 +0,0 @@
#ifndef __VIEWDISPLAYMENU_H
#define __VIEWDISPLAYMENU_H
#include "view.h"
#include "viewdetail.h"
#if defined(APIVERSNUM) && APIVERSNUM < 20301
#ifndef MENU_ORIENTATION_DEFINED
enum eMenuOrientation {
moVertical = 0,
moHorizontal
};
#endif
#endif
/***********************************************************
* cViewMenu
***********************************************************/
class cSubView;
class cViewMenuDefault;
class cViewMenuMain;
class cViewMenuSetup;
class cViewMenuSchedules;
class cViewMenuChannels;
class cViewMenuTimers;
class cViewMenuRecordings;
class cViewMenuDetail;
class cViewMenu : public cView {
protected:
map<string,int> subviewNames;
cSubView **subViews;
int numSubviews;
cSubView *activeSubview;
cSubView *activeSubviewLast;
cViewMenuDefault *menuDefault;
cViewMenuMain *menuMain;
cViewMenuSetup *menuSetup;
cViewMenuSchedules *menuSchedules;
cViewMenuChannels *menuChannels;
cViewMenuTimers *menuTimers;
cViewMenuRecordings *menuRecordings;
cViewMenuDetail *menuDetailedEpg;
cViewMenuDetail *menuDetailedRec;
cViewMenuDetail *menuDetailedText;
eMenuCategory menuCat;
//name of current plugin for menu icon
const char *plugName;
//external plugin menus
bool pluginIdSet;
int plugId;
int plugMenuId;
//status variables
bool menuChange;
bool listChange;
bool detailViewInit;
void SetViewElements(void);
void SetViewElementObjects(void);
void SetSubViews(void);
void ClearVariables(void);
int SubviewId(const char *name);
bool SetPluginSubView(eMenuCategory menuCat);
void WakeViewElements(void);
public:
cViewMenu(void);
virtual ~cViewMenu(void);
void SetGlobals(cGlobals *globals);
void PreCache(void);
bool ValidSubView(const char *subView);
static cSubView *CreateSubview(const char *name);
static cSubView *CreatePluginview(const char *plugname, int plugId, int menuNumber, int menuType);
void AddSubview(const char *sSubView, cSubView *subView);
void AddPluginview(cSubView *plugView);
void SetSubView(eMenuCategory MenuCat);
eMenuCategory MenuCat(void) { return menuCat; };
void SetSortMode(eMenuSortMode sortMode);
void SetPluginMenu(int plugId, int plugMenuId);
int NumListItems(void);
eMenuOrientation MenuOrientation(void);
const cFont *GetTextAreaFont(void);
int GetTextAreaWidth(void);
int GetListWidth(void);
void SetTitleHeader(const char *title);
void SetChannelHeader(const cEvent *event);
void SetMessage(eMessageType type, const char *text);
void SetMenuButtons(const char *red, const char *green, const char *yellow, const char *blue);
void SetScrollbar(int total, int offset);
void SetTabs(int tab1, int tab2, int tab3, int tab4, int tab5);
void SetItem(const char *text, int index, bool current, bool selectable);
bool SetItemEvent(const cEvent *event, int index, bool current, bool selectable, const cChannel *channel, bool withDate, eTimerMatch timerMatch);
bool SetItemTimer(const cTimer *timer, int index, bool current, bool selectable);
bool SetItemChannel(const cChannel *channel, int index, bool current, bool selectable, bool withProvider);
bool SetItemRecording(const cRecording *recording, int index, bool current, bool selectable, int level, int total, int New);
bool SetItemPlugin(skindesignerapi::cTokenContainer *tk, int index, bool current, bool selectable);
void SetEvent(const cEvent *event);
void SetRecording(const cRecording *recording);
void SetText(const char *text);
bool SetPluginText(skindesignerapi::cTokenContainer *tk);
void SetCurrentRecording(const char *currentRec);
void KeyDetailView(bool up, bool page);
bool Init(void);
void Close(void);
void Clear(void);
void Flush(void);
void SetTransparency(int transparency, bool forceDetached = false);
void Debug(void);
};
/***********************************************************
* cSubView
***********************************************************/
class cSubView : public cView {
protected:
eMenuCategory menuCat;
int plugId;
int plugMenuId;
cViewList *viewList;
vector<cViewList*> viewLists;
cViewElement *background;
cVeDmHeader *header;
cVeDateTime *datetime;
cVeTime *time;
cVeDmVdrstatus *vdrstatus;
cVeMessage *message;
cVeDmSortmode *sortmode;
cVeDmColorbuttons *colorbuttons;
cVeDmScrollbar *scrollbar;
virtual void SetViewElementObjects(void);
virtual void SetViewElements(void);
public:
cSubView(const char *name);
virtual ~cSubView(void);
virtual void SetGlobals(cGlobals *globals);
virtual void PreCache(void);
bool ViewElementSet(int ve);
bool ViewElementHorizontalSet(int ve);
void SetViewElement(eVeDisplayMenu ve, cViewElement *viewElement);
void SetViewElementHorizontal(eVeDisplayMenu ve, cViewElement *viewElement);
void AddViewList(cViewList *viewList);
virtual void AddTab(cArea *tab) {};
int NumListItems(void);
eMenuOrientation MenuOrientation(void);
void SetMenuCategory(eMenuCategory menuCat) { this->menuCat = menuCat; };
void SetPlugId(int id) { plugId = id; };
void SetPlugMenuId(int id) { plugMenuId = id; };
void SetTitle(const char *title);
void SetMessage(eMessageType type, const char *text);
void SetChannel(const cChannel *channel);
void SetMenuButtons(const char *red, const char *green, const char *yellow, const char *blue);
void SetScrollbar(int total, int offset);
void SetSortMode(eMenuSortMode sortMode);
virtual void Close(void);
virtual void Clear(void);
void ClearViewList(void);
void WakeViewElements(void);
virtual void DrawStaticVEs(void);
virtual void DrawDynamicVEs(void);
void DrawList(void);
virtual void DrawDetailedView(void) {};
virtual void UpdateDetailedView(void) {};
void SetTransparency(int transparency, bool forceDetached = false);
};
/***********************************************************
* cViewMenuDefault
***********************************************************/
class cViewMenuDefault : public cSubView {
private:
cViewListDefault *listDefault;
void SetViewElementObjects(void);
public:
cViewMenuDefault(const char *name);
virtual ~cViewMenuDefault(void);
void SetTabs(int tab1, int tab2, int tab3, int tab4, int tab5);
void SetPlugin(const char *plugName);
void SetItem(const char *text, int index, bool current, bool selectable);
const cFont *GetTextAreaFont(void);
int GetListWidth(void);
};
/***********************************************************
* cViewMenuMain
***********************************************************/
class cViewMenuMain : public cSubView {
private:
cViewListMain *listMain;
cVeDmTimers *timers;
cVeDevices *devices;
cVeCurrentWeather *weather;
cVeDmDiscusage *discusage;
cVeDmSystemload *load;
cVeDmSystemmemory *memory;
cVeDmVdrstatistics *vdrstats;
cVeDmVdrstatus *vdrstatus;
cVeDmTemperatures *temperatures;
cVeDmCurrentschedule *currentSchedule;
cVeDmLastrecordings *lastRecordings;
cVeCustomTokens *customTokens;
uint64_t lastDrawDynamic;
void ClearVariables(void);
void SetViewElements(void);
void SetViewElementObjects(void);
public:
cViewMenuMain(const char *name);
virtual ~cViewMenuMain(void);
void Clear(void);
void SetItem(const char *text, int index, bool current, bool selectable);
void SetCurrentRecording(const char *currentRec);
void DrawStaticVEs(void);
void DrawDynamicVEs(void);
const char *GetPlugin(void);
};
/***********************************************************
* cViewMenuSetup
***********************************************************/
class cViewMenuSetup : public cSubView {
private:
cViewListMain *listSetup;
void SetViewElementObjects(void);
public:
cViewMenuSetup(const char *name);
virtual ~cViewMenuSetup(void);
void SetItem(const char *text, int index, bool current, bool selectable);
};
/***********************************************************
* cViewMenuSchedules
***********************************************************/
class cViewMenuSchedules : public cSubView {
private:
cViewListSchedules *listSchedules;
void SetViewElementObjects(void);
public:
cViewMenuSchedules(const char *name);
virtual ~cViewMenuSchedules(void);
void SetItem(const cEvent *event, int index, bool current, bool selectable, const cChannel *channel, bool withDate, eTimerMatch timerMatch);
};
/***********************************************************
* cViewMenuChannels
***********************************************************/
class cViewMenuChannels : public cSubView {
private:
cViewListChannels *listChannels;
void SetViewElementObjects(void);
public:
cViewMenuChannels(const char *name);
virtual ~cViewMenuChannels(void);
void SetItem(const cChannel *channel, int index, bool current, bool selectable, bool withProvider);
};
/***********************************************************
* cViewMenuTimers
***********************************************************/
class cViewMenuTimers : public cSubView {
private:
cViewListTimers *listTimers;
void SetViewElementObjects(void);
public:
cViewMenuTimers(const char *name);
virtual ~cViewMenuTimers(void);
void SetItem(const cTimer *timer, int index, bool current, bool selectable);
};
/***********************************************************
* cViewMenuRecordings
***********************************************************/
class cViewMenuRecordings : public cSubView {
private:
cViewListRecordings *listRecordings;
void SetViewElementObjects(void);
public:
cViewMenuRecordings(const char *name);
virtual ~cViewMenuRecordings(void);
void SetItem(const cRecording *recording, int index, bool current, bool selectable, int level, int total, int New);
};
/***********************************************************
* cViewMenuPlugins
***********************************************************/
class cViewMenuPlugin : public cSubView {
private:
cViewListPlugin *listPlugin;
void SetViewElementObjects(void);
public:
cViewMenuPlugin(const char *name);
virtual ~cViewMenuPlugin(void);
void SetItem(skindesignerapi::cTokenContainer *tk, int index, bool current, bool selectable);
};
/***********************************************************
* cViewMenuDetail
***********************************************************/
class cViewMenuDetail : public cSubView {
private:
bool firstTab;
cVeDmDetailheaderEpg *detailedheaderEpg;
cVeDmDetailheaderRec *detailedheaderRec;
cVeDmDetailheaderPlugin *detailedheaderPlug;
cVeDmTablabels *tablabels;
cViewDetail *detailView;
cViewDetailEpg *detailViewEpg;
cViewDetailRec *detailViewRec;
cViewDetailText *detailViewText;
cViewDetailPlugin *detailViewPlugin;
void SetDetailedView(void);
void SetViewElements(void);
void SetViewElementObjects(void);
void DrawScrollbar(void);
public:
cViewMenuDetail(const char *name);
virtual ~cViewMenuDetail(void);
void SetGlobals(cGlobals *globals);
void AddTab(cArea *tab);
void PreCache(void);
int GetWidth(void);
void SetEvent(const cEvent *event);
void SetRecording(const cRecording *recording);
void SetText(const char *text);
void SetPluginText(skindesignerapi::cTokenContainer *tk);
void Clear(void);
void Close(void);
void DrawStaticVEs(void);
void DrawDynamicVEs(void);
void DrawDetailedView(void);
void KeyLeft(void);
void KeyRight(void);
void KeyUp(void);
void KeyDown(void);
void SetTransparency(int transparency, bool forceDetached = false);
};
#endif //__VIEWDISPLAYMENU_H

View File

@ -1,53 +0,0 @@
#include "viewdisplaymessage.h"
#include "../config.h"
/************************************************************************************
* cViewMessage
************************************************************************************/
cViewMessage::cViewMessage(void) {
ClearVariables();
viewId = eViewType::DisplayMessage;
viewName = strdup("displaymessage");
numViewElements = (int)eVeDisplayMessage::count;
viewElements = new cViewElement*[numViewElements];
for (int i=0; i < numViewElements; i++) {
viewElements[i] = NULL;
}
SetViewElements();
veMessage = NULL;
}
cViewMessage::~cViewMessage() {
}
void cViewMessage::SetViewElements(void) {
viewElementNames.insert(pair<string, int>("background", (int)eVeDisplayMessage::background));
viewElementNames.insert(pair<string, int>("message", (int)eVeDisplayMessage::message));
}
void cViewMessage::SetViewElementObjects(void) {
if (!viewElements[(int)eVeDisplayMessage::message])
return;
veMessage = dynamic_cast<cVeMessage*>(viewElements[(int)eVeDisplayMessage::message]);
}
void cViewMessage::ClearVariables(void) {
init = true;
}
void cViewMessage::SetMessage(eMessageType type, const char *text) {
if (!text)
veMessage->Clear();
else
veMessage->Set(type, text);
}
void cViewMessage::Flush(void) {
if (init) {
Render((int)eVeDisplayMessage::background);
}
Render((int)eVeDisplayMessage::message);
cView::Flush();
}

View File

@ -1,19 +0,0 @@
#ifndef __VIEWDISPLAYMESSAGE_H
#define __VIEWDISPLAYMESSAGE_H
#include "view.h"
class cViewMessage : public cView {
private:
cVeMessage *veMessage;
void SetViewElements(void);
void SetViewElementObjects(void);
void ClearVariables(void);
public:
cViewMessage(void);
virtual ~cViewMessage(void);
void SetMessage(eMessageType type, const char *text);
void Flush(void);
};
#endif //__VIEWDISPLAYMESSAGE_H

View File

@ -1,556 +0,0 @@
#include "viewdisplayplugin.h"
#include "../config.h"
/***********************************************************
* cViewPlugin
***********************************************************/
cViewPlugin::cViewPlugin(int id, int plugId) {
this->id = id;
this->plugId = plugId;
viewId = eViewType::DisplayPlugin;
viewName = strdup("displayplugin");
if (id == 0)
numViews = plgManager->GetNumSubviews(plugId) + 1;
else
numViews = 1;
views = new cViewPlugin*[numViews];
views[0] = this;
for (int i=1; i < numViews; i++) {
views[i] = NULL;
}
numViewElements = plgManager->GetNumViewElements(plugId, id);
viewElements = new cViewElement*[numViewElements];
for (int i=0; i < numViewElements; i++) {
viewElements[i] = NULL;
}
SetViewElements();
numViewGrids = plgManager->GetNumViewGrids(plugId, id);
viewGrids = new cViewGrid*[numViewGrids];
for (int i=0; i < numViewGrids; i++) {
viewGrids[i] = NULL;
}
SetViewGrids();
tabView = NULL;
viewChanged = true;
newViewId = 0;
}
cViewPlugin::~cViewPlugin(void) {
for (int i=0; i< numViewGrids; i++)
delete viewGrids[i];
delete[] viewGrids;
delete tabView;
for (int i=1; i < numViews; i++) {
delete views[i];
}
delete[] views;
}
/***********************************************************
* Public Functions
***********************************************************/
bool cViewPlugin::ReadFromXML(const char *plugName, const char *tplName, cSdOsd *osd) {
cString xmlFile = cString::sprintf("plug-%s-%s", plugName, tplName);
cXmlParser parser;
if (osd)
parser.SetOsd(osd);
else
parser.SetOsd(&sdOsd);
if (!parser.ReadView(this, *xmlFile)) {
return false;
}
if (!parser.ParsePluginView()) {
return false;
}
return true;
}
bool cViewPlugin::ReadSubViews(const char *plugName) {
plgManager->InitPluginSubviewIterator(plugId);
int svId = -1;
string svTpl = "";
while (plgManager->GetNextSubView(svId, svTpl)) {
cViewPlugin *plugSubView = new cViewPlugin(svId, plugId);
if (!plugSubView->ReadFromXML(plugName, svTpl.c_str(), &sdOsd))
return false;
views[svId] = plugSubView;
}
return true;
}
void cViewPlugin::SetGlobals(cGlobals *globals) {
cView::SetGlobals(globals);
for (int i=0; i < numViewGrids; i++) {
if (viewGrids[i])
viewGrids[i]->SetGlobals(globals);
}
for (int i=1; i < numViews; i++) {
views[i]->SetGlobals(globals);
}
if (tabView) {
tabView->SetGlobals(globals);
}
}
void cViewPlugin::AddViewElement(cVePlugin *viewElement) {
int veId = ViewElementId(viewElement->Name());
if (veId == ATTR_UNKNOWN)
return;
viewElement->SetId(veId);
viewElement->SetPluginId(plugId);
viewElement->SetViewId(id);
viewElement->SetTokenContainer();
viewElements[veId] = viewElement;
}
void cViewPlugin::AddViewGrid(cViewGrid *viewGrid) {
int gId = GridId(viewGrid->Name());
if (gId == ATTR_UNKNOWN)
return;
viewGrid->SetId(gId);
viewGrid->SetPluginId(plugId);
viewGrid->SetViewId(id);
viewGrid->SetTokenContainer();
viewGrids[gId] = viewGrid;
}
void cViewPlugin::AddTab(cArea *tab) {
if (!tabView) {
tabView = new cPluginTabView(id, plugId);
tabView->SetOsd(&sdOsd);
}
tabView->AddTab(tab);
}
void cViewPlugin::AddScrollbar(cVeDmScrollbar *scrollbar) {
if (!tabView) {
tabView = new cPluginTabView(id, plugId);
tabView->SetOsd(&sdOsd);
}
int id = ViewElementId("scrollbar");
scrollbar->SetId(id);
scrollbar->SetTokenContainer();
tabView->AddScrollbar(scrollbar);
}
void cViewPlugin::AddTablabels(cVeDmTablabels *tablabels) {
if (!tabView) {
tabView = new cPluginTabView(id, plugId);
tabView->SetOsd(&sdOsd);
}
int id = ViewElementId("tablabels");
tablabels->SetId(id);
tablabels->SetTokenContainer();
tabView->AddTablabels(tablabels);
}
void cViewPlugin::PreCache(void) {
if (container.Width() > 0) {
attribs->SetContainer(container.X(), container.Y(), container.Width(), container.Height());
attribs->Cache();
}
cView::PreCache();
for (int i=0; i < numViewGrids; i++) {
if (viewGrids[i]) {
viewGrids[i]->SetContainer(0, 0, attribs->Width(), attribs->Height());
viewGrids[i]->PreCache();
}
}
for (int i=1; i < numViews; i++) {
views[i]->SetContainer(0, 0, attribs->Width(), attribs->Height());
views[i]->PreCache();
}
if (tabView) {
tabView->PreCache(0, 0, attribs->Width(), attribs->Height());
}
}
cVePlugin *cViewPlugin::GetViewElement(int veId) {
if (!viewElements[veId])
return NULL;
cVePlugin *ve = dynamic_cast<cVePlugin*>(viewElements[veId]);
return ve;
}
cViewGrid *cViewPlugin::GetViewGrid(int gId) {
return viewGrids[gId];
}
cPluginTabView *cViewPlugin::GetViewTab(void) {
return tabView;
}
void cViewPlugin::Hide(void) {
for (int i=0; i < numViewGrids; i++) {
if (viewGrids[i])
viewGrids[i]->Hide();
}
for (int i=0; i < numViewElements; i++) {
if (viewElements[i])
viewElements[i]->Hide();
}
}
void cViewPlugin::Show(void) {
for (int i=0; i < numViewGrids; i++) {
if (viewGrids[i])
viewGrids[i]->Show();
}
for (int i=0; i < numViewElements; i++) {
if (viewElements[i])
viewElements[i]->Show();
}
}
/***********************************************************
* libskindesigner api interface
***********************************************************/
bool cViewPlugin::InitOsd(void) {
return Init();
}
void cViewPlugin::CloseOsd(void) {
viewChanged = true;
newViewId = 0;
Close();
for (int i=0 ; i < numViewGrids; i++) {
if (viewGrids[i])
viewGrids[i]->Close();
}
for (int i=1 ; i < numViews; i++) {
if (views[i])
views[i]->Close();
}
}
void cViewPlugin::Deactivate(int viewId, bool hide) {
for (int i=0; i < numViewElements; i++) {
if (viewElements[i])
viewElements[i]->StopScrolling(false);
}
if (hide)
views[viewId]->Hide();
}
void cViewPlugin::Activate(int viewId) {
viewChanged = true;
newViewId = viewId;
views[viewId]->Show();
}
void cViewPlugin::SetViewElementTokens(int veId, int viewId, skindesignerapi::cTokenContainer *tk) {
cVePlugin *ve = views[viewId]->GetViewElement(veId);
if (!ve)
return;
ve->Set(tk);
}
void cViewPlugin::ClearViewElement(int veId, int viewId) {
cVePlugin *ve = views[viewId]->GetViewElement(veId);
if (!ve)
return;
ve->StopScrolling();
ve->Clear();
}
void cViewPlugin::DisplayViewElement(int veId, int viewId) {
cVePlugin *ve = views[viewId]->GetViewElement(veId);
if (!ve)
return;
if (ve->Parse())
ve->Render();
}
void cViewPlugin::SetGrid(long gId, int viewId, int viewGridId, double x, double y, double width, double height, skindesignerapi::cTokenContainer *tk){
cViewGrid *grid = views[viewId]->GetViewGrid(viewGridId);
if (!grid)
return;
grid->CheckSize(gId);
grid->PositionGrid(gId, x, y, width, height);
if (tk) {
//only set tokens new if necessary
grid->SetTokens(gId, tk);
}
}
void cViewPlugin::SetGridCurrent(long gId, int viewId, int viewGridId, bool current) {
if (gId < 0)
return;
cViewGrid *grid = views[viewId]->GetViewGrid(viewGridId);
if (!grid)
return;
grid->SetCurrentGrid(gId, current);
}
void cViewPlugin::DeleteGrid(long gId, int viewId, int viewGridId) {
cViewGrid *grid = views[viewId]->GetViewGrid(viewGridId);
if (!grid)
return;
grid->DeleteGrid(gId);
}
void cViewPlugin::DisplayGrids(int viewId, int viewGridId) {
cViewGrid *grid = views[viewId]->GetViewGrid(viewGridId);
if (!grid)
return;
grid->Render();
}
void cViewPlugin::ClearGrids(int viewId, int viewGridId) {
cViewGrid *grid = views[viewId]->GetViewGrid(viewGridId);
if (!grid)
return;
grid->ClearGrids();
}
void cViewPlugin::SetTabTokens(int viewId, skindesignerapi::cTokenContainer *tk) {
cPluginTabView *tab = views[viewId]->GetViewTab();
if (!tab)
return;
tab->SetOsd(&sdOsd);
tab->Set(tk);
}
void cViewPlugin::TabLeft(int viewId) {
cPluginTabView *tab = views[viewId]->GetViewTab();
if (!tab)
return;
tab->KeyLeft();
}
void cViewPlugin::TabRight(int viewId) {
cPluginTabView *tab = views[viewId]->GetViewTab();
if (!tab)
return;
tab->KeyRight();
}
void cViewPlugin::TabUp(int viewId) {
cPluginTabView *tab = views[viewId]->GetViewTab();
if (!tab)
return;
tab->KeyUp();
}
void cViewPlugin::TabDown(int viewId) {
cPluginTabView *tab = views[viewId]->GetViewTab();
if (!tab)
return;
tab->KeyDown();
}
void cViewPlugin::DisplayTabs(int viewId) {
cPluginTabView *tab = views[viewId]->GetViewTab();
if (!tab)
return;
tab->Render();
}
void cViewPlugin::ClearTab(int viewId) {
cPluginTabView *tab = views[viewId]->GetViewTab();
if (!tab)
return;
tab->Clear();
}
void cViewPlugin::Flush(void) {
if (viewChanged) {
viewChanged = false;
newTvFrame = views[newViewId]->GetTvFrame();
menuInit = true;
}
cView::Flush();
}
bool cViewPlugin::ChannelLogoExists(string channelId) {
return imgCache->LogoExists(channelId);
}
string cViewPlugin::GetEpgImagePath(void) {
return *config.epgImagePath;
}
/***********************************************************
* Private Functions
***********************************************************/
void cViewPlugin::SetViewElements(void) {
plgManager->InitViewElementIterator(plugId, id);
int veId = -1;
string veName = "";
while (plgManager->GetNextViewElement(veId, veName)) {
viewElementNames.insert(pair<string, int>(veName, veId));
}
}
void cViewPlugin::SetViewGrids(void) {
plgManager->InitViewGridIterator(plugId, id);
int gId = -1;
string gName = "";
while (plgManager->GetNextViewGrid(gId, gName)) {
gridNames.insert(pair<string, int>(gName, gId));
}
}
int cViewPlugin::GridId(const char *name) {
map<string, int>::iterator hit = gridNames.find(name);
if (hit != gridNames.end())
return (int)hit->second;
return ATTR_UNKNOWN;
}
/***********************************************************
* cPluginTabView
***********************************************************/
cPluginTabView::cPluginTabView(int viewId, int plugId) {
sdOsd = NULL;
init = true;
drawScrollbar = true;
scrollbar = NULL;
tablabels = NULL;
detailView = new cViewDetailAdvancedPlugin(viewId, plugId);
firstTab = true;
}
cPluginTabView::~cPluginTabView(void) {
delete scrollbar;
delete tablabels;
delete detailView;
}
void cPluginTabView::SetGlobals(cGlobals *globals) {
detailView->SetGlobals(globals);
if (scrollbar)
scrollbar->SetGlobals(globals);
if (tablabels)
tablabels->SetGlobals(globals);
}
void cPluginTabView::AddTab(cArea *tab) {
if (firstTab) {
tab->SetActiveTab(true);
firstTab = false;
}
detailView->AddArea(tab);
}
void cPluginTabView::AddScrollbar(cVeDmScrollbar *scrollbar) {
this->scrollbar = scrollbar;
}
void cPluginTabView::AddTablabels(cVeDmTablabels *tablabels) {
this->tablabels = tablabels;
}
void cPluginTabView::PreCache(int containerX, int containerY, int containerWidth, int containerHeight) {
detailView->SetOsd(sdOsd);
detailView->SetTokenContainer();
detailView->SetContainer(containerX, containerY, containerWidth, containerHeight);
detailView->Cache();
if (scrollbar) {
scrollbar->SetContainer(containerX, containerY, containerWidth, containerHeight);
scrollbar->Cache();
}
if (tablabels) {
tablabels->SetContainer(containerX, containerY, containerWidth, containerHeight);
tablabels->Cache();
}
}
void cPluginTabView::Set(skindesignerapi::cTokenContainer *tk) {
detailView->Set(tk);
}
void cPluginTabView::Render(void) {
detailView->Render();
if (drawScrollbar) {
drawScrollbar = false;
DrawScrollbar();
}
if (!init)
return;
init = false;
vector<const char*> tabs;
int activeTab = detailView->GetTabs(tabs);
if (tablabels) {
tablabels->SetTabs(tabs);
tablabels->SetActiveTab(activeTab);
if (tablabels->Parse())
tablabels->Render();
}
}
void cPluginTabView::Clear(void) {
init = true;
drawScrollbar = true;
detailView->ResetTabs();
detailView->Close();
if (tablabels)
tablabels->Close();
if (scrollbar)
scrollbar->Close();
}
void cPluginTabView::KeyLeft(void) {
if (detailView->NumTabs() > 1) {
detailView->Clear();
detailView->PrevTab();
detailView->SetDirty();
if (tablabels) {
tablabels->Clear();
tablabels->SetActiveTab(detailView->ActiveTab());
if (tablabels->Parse())
tablabels->Render();
}
sdOsd->Flush();
drawScrollbar = true;
} else {
//scroll page
if (detailView->ScrollUp(true)) {
drawScrollbar = true;
}
}
}
void cPluginTabView::KeyRight(void) {
if (detailView->NumTabs() > 1) {
detailView->Clear();
detailView->NextTab();
detailView->SetDirty();
if (tablabels) {
tablabels->Clear();
tablabels->SetActiveTab(detailView->ActiveTab());
if (tablabels->Parse())
tablabels->Render();
}
sdOsd->Flush();
drawScrollbar = true;
} else {
//scroll page
if (detailView->ScrollDown(true)) {
drawScrollbar = true;
}
}
}
void cPluginTabView::KeyUp(void) {
if (detailView->ScrollUp()) {
drawScrollbar = true;
}
}
void cPluginTabView::KeyDown(void) {
if (detailView->ScrollDown()) {
drawScrollbar = true;
}
}
void cPluginTabView::DrawScrollbar(void) {
if (!scrollbar)
return;
int barheight = 0;
int offset = 0;
bool end = true;
detailView->Scrollbar(barheight, offset, end);
scrollbar->SetDetail(barheight, offset, end);
scrollbar->Render();
}

View File

@ -1,101 +0,0 @@
#ifndef __VIEWDISPLAYPLUGIN_H
#define __VIEWDISPLAYPLUGIN_H
#include "view.h"
#include "viewdetail.h"
#include "viewelementsdisplaymenu.h"
#include "viewgrid.h"
#include "../libskindesignerapi/skindesignerapi.h"
class cPluginTabView;
/***********************************************************
* cViewPlugin
***********************************************************/
class cViewPlugin : public cView, public skindesignerapi::ISkinDisplayPlugin {
private:
int id;
int plugId;
int numViews;
cViewPlugin **views;
int numViewGrids;
cViewGrid **viewGrids;
map<string,int> gridNames;
cPluginTabView *tabView;
bool viewChanged;
int newViewId;
void SetViewElements(void);
void SetViewGrids(void);
int GridId(const char *name);
public:
cViewPlugin(int id, int plugId);
~cViewPlugin(void);
//Internal Interface
bool ReadFromXML(const char *plugName, const char *tplName, cSdOsd *osd = NULL);
bool ReadSubViews(const char *plugName);
void AddViewElement(cVePlugin *viewElement);
void AddViewGrid(cViewGrid *viewGrid);
void AddTab(cArea *tab);
void AddScrollbar(cVeDmScrollbar *scrollbar);
void AddTablabels(cVeDmTablabels *tablabels);
void SetGlobals(cGlobals *globals);
void PreCache(void);
cVePlugin *GetViewElement(int veId);
cViewGrid *GetViewGrid(int gId);
cPluginTabView *GetViewTab(void);
void Hide(void);
void Show(void);
//libskindesigner api interface
bool InitOsd(void);
void CloseOsd(void);
void Deactivate(int viewId, bool hide);
void Activate(int viewId);
void SetViewElementTokens(int veId, int viewId, skindesignerapi::cTokenContainer *tk);
void ClearViewElement(int veId, int viewId);
void DisplayViewElement(int veId, int viewId);
void SetGrid(long gId, int viewId, int viewGridId, double x, double y, double width, double height, skindesignerapi::cTokenContainer *tk);
void SetGridCurrent(long gId, int viewId, int viewGridId, bool current);
void DeleteGrid(long gId, int viewId, int viewGridId);
void DisplayGrids(int viewId, int viewGridId);
void ClearGrids(int viewId, int viewGridId);
void SetTabTokens(int viewId, skindesignerapi::cTokenContainer *tk);
void TabLeft(int viewId);
void TabRight(int viewId);
void TabUp(int viewId);
void TabDown(int viewId);
void DisplayTabs(int viewId);
void ClearTab(int viewId);
void Flush(void);
bool ChannelLogoExists(string channelId);
string GetEpgImagePath(void);
};
/***********************************************************
* cPluginTabView
***********************************************************/
class cPluginTabView {
private:
cSdOsd *sdOsd;
bool init;
bool drawScrollbar;
bool firstTab;
cVeDmScrollbar *scrollbar;
cVeDmTablabels *tablabels;
cViewDetailAdvancedPlugin *detailView;
void DrawScrollbar(void);
public:
cPluginTabView(int viewId, int plugId);
~cPluginTabView(void);
void SetGlobals(cGlobals *globals);
void SetOsd(cSdOsd *osd) { sdOsd = osd; };
void AddTab(cArea *tab);
void AddScrollbar(cVeDmScrollbar *scrollbar);
void AddTablabels(cVeDmTablabels *tablabels);
void PreCache(int containerX, int containerY, int containerWidth, int containerHeight);
void Set(skindesignerapi::cTokenContainer *tk);
void Render(void);
void Clear(void);
void KeyLeft(void);
void KeyRight(void);
void KeyUp(void);
void KeyDown(void);
};
#endif //__VIEWDISPLAYPLUGIN_H

View File

@ -1,427 +0,0 @@
#include "viewdisplayreplay.h"
/************************************************************************************
* cViewReplay
************************************************************************************/
cViewReplay::cViewReplay(void) {
veCustomTokens = NULL;
veTimeshiftTimes = NULL;
veEndTime = NULL;
veMessage = NULL;
veScraperContent = NULL;
veRecTitle = NULL;
veRecInfo = NULL;
veCurrentTime = NULL;
veTotalTime = NULL;
veProgressbar = NULL;
veCutMarks = NULL;
veProgressModeOnly = NULL;
veControlIcons = NULL;
veControlIconsModeOnly = NULL;
veJump = NULL;
veOnPause = NULL;
veOnPauseModeOnly = NULL;
ClearVariables();
viewId = eViewType::DisplayReplay;
viewName = strdup("displayreplay");
numViewElements = (int)eVeDisplayReplay::count;
viewElements = new cViewElement*[numViewElements];
for (int i=0; i < numViewElements; i++) {
viewElements[i] = NULL;
}
SetViewElements();
}
cViewReplay::~cViewReplay() {
}
void cViewReplay::SetViewElements(void) {
viewElementNames.insert(pair<string, int>("background", (int)eVeDisplayReplay::background));
viewElementNames.insert(pair<string, int>("backgroundmodeonly", (int)eVeDisplayReplay::backgroundmodeonly));
viewElementNames.insert(pair<string, int>("datetime", (int)eVeDisplayReplay::datetime));
viewElementNames.insert(pair<string, int>("time", (int)eVeDisplayReplay::time));
viewElementNames.insert(pair<string, int>("scrapercontent", (int)eVeDisplayReplay::scrapercontent));
viewElementNames.insert(pair<string, int>("currentweather", (int)eVeDisplayReplay::currentweather));
viewElementNames.insert(pair<string, int>("rectitle", (int)eVeDisplayReplay::rectitle));
viewElementNames.insert(pair<string, int>("recinfo", (int)eVeDisplayReplay::recinfo));
viewElementNames.insert(pair<string, int>("currenttime", (int)eVeDisplayReplay::currenttime));
viewElementNames.insert(pair<string, int>("timeshifttimes", (int)eVeDisplayReplay::timeshifttimes));
viewElementNames.insert(pair<string, int>("endtime", (int)eVeDisplayReplay::endtime));
viewElementNames.insert(pair<string, int>("totaltime", (int)eVeDisplayReplay::totaltime));
viewElementNames.insert(pair<string, int>("progressbar", (int)eVeDisplayReplay::progressbar));
viewElementNames.insert(pair<string, int>("cutmarks", (int)eVeDisplayReplay::cutmarks));
viewElementNames.insert(pair<string, int>("cutmarks", (int)eVeDisplayReplay::cutmarks));
viewElementNames.insert(pair<string, int>("controlicons", (int)eVeDisplayReplay::controlicons));
viewElementNames.insert(pair<string, int>("controliconsmodeonly", (int)eVeDisplayReplay::controliconsmodeonly));
viewElementNames.insert(pair<string, int>("progressmodeonly", (int)eVeDisplayReplay::progressmodeonly));
viewElementNames.insert(pair<string, int>("jump", (int)eVeDisplayReplay::jump));
viewElementNames.insert(pair<string, int>("message", (int)eVeDisplayReplay::message));
viewElementNames.insert(pair<string, int>("onpause", (int)eVeDisplayReplay::onpause));
viewElementNames.insert(pair<string, int>("onpausemodeonly", (int)eVeDisplayReplay::onpausemodeonly));
viewElementNames.insert(pair<string, int>("customtokens", (int)eVeDisplayReplay::customtokens));
}
void cViewReplay::SetViewElementObjects(void) {
for (int i = 0; i < numViewElements; i++) {
if (!viewElements[i])
continue;
if (dynamic_cast<cVeMessage*>(viewElements[i]))
{
veMessage = dynamic_cast<cVeMessage*>(viewElements[i]);
}
else if (dynamic_cast<cVeDrScraperContent*>(viewElements[i]))
{
veScraperContent = dynamic_cast<cVeDrScraperContent*>(viewElements[i]);
}
else if (dynamic_cast<cVeCustomTokens*>(viewElements[i]))
{
veCustomTokens = dynamic_cast<cVeCustomTokens*>(viewElements[i]);
}
else if (dynamic_cast<cVeDrRecTitle*>(viewElements[i]))
{
veRecTitle = dynamic_cast<cVeDrRecTitle*>(viewElements[i]);
}
else if (dynamic_cast<cVeDrRecInfo*>(viewElements[i]))
{
veRecInfo = dynamic_cast<cVeDrRecInfo*>(viewElements[i]);
}
else if (dynamic_cast<cVeDrCurrentTime*>(viewElements[i]))
{
veCurrentTime = dynamic_cast<cVeDrCurrentTime*>(viewElements[i]);
}
else if (dynamic_cast<cVeDrTotalTime*>(viewElements[i]))
{
veTotalTime = dynamic_cast<cVeDrTotalTime*>(viewElements[i]);
}
else if (dynamic_cast<cVeDrTimeshiftTimes*>(viewElements[i]))
{
veTimeshiftTimes = dynamic_cast<cVeDrTimeshiftTimes*>(viewElements[i]);
}
else if (dynamic_cast<cVeDrEndTime*>(viewElements[i]))
{
veEndTime = dynamic_cast<cVeDrEndTime*>(viewElements[i]);
}
else if (dynamic_cast<cVeDrProgressBar*>(viewElements[i]))
{
veProgressbar = dynamic_cast<cVeDrProgressBar*>(viewElements[i]);
}
else if (dynamic_cast<cVeDrCutMarks*>(viewElements[i]))
{
veCutMarks = dynamic_cast<cVeDrCutMarks*>(viewElements[i]);
}
else if (dynamic_cast<cVeDrProgressModeonly*>(viewElements[i]))
{
veProgressModeOnly = dynamic_cast<cVeDrProgressModeonly*>(viewElements[i]);
}
else if (dynamic_cast<cVeDrControlIcons*>(viewElements[i]) && (i == (int)eVeDisplayReplay::controlicons))
{
veControlIcons = dynamic_cast<cVeDrControlIcons*>(viewElements[i]);
}
else if (dynamic_cast<cVeDrControlIcons*>(viewElements[i]) && i == (int)eVeDisplayReplay::controliconsmodeonly)
{
veControlIconsModeOnly = dynamic_cast<cVeDrControlIcons*>(viewElements[i]);
}
else if (dynamic_cast<cVeDrJump*>(viewElements[i]))
{
veJump = dynamic_cast<cVeDrJump*>(viewElements[i]);
}
else if (dynamic_cast<cVeDrOnPause*>(viewElements[i]) && i == (int)eVeDisplayReplay::onpause)
{
veOnPause = dynamic_cast<cVeDrOnPause*>(viewElements[i]);
veOnPause->SetDetached();
veOnPause->UnsetWaitOnWakeup();
}
else if (dynamic_cast<cVeDrOnPause*>(viewElements[i]) && i == (int)eVeDisplayReplay::onpausemodeonly)
{
veOnPauseModeOnly = dynamic_cast<cVeDrOnPause*>(viewElements[i]);
veOnPauseModeOnly->SetDetached();
veOnPauseModeOnly->UnsetWaitOnWakeup();
}
}
}
void cViewReplay::PreCache(void) {
cView::PreCache();
SetViewelementsAnimOut();
}
void cViewReplay::ClearVariables(void) {
cView::ClearVariables();
recording = NULL;
lastEvent = NULL;
modeOnly = false;
lastFlush = 0;
lastFlushModeOnly = 0;
message = false;
timeShiftActive = NoRec;
timeShiftFramesTotal = -1;
timeShiftLength = -1;
timeShiftDuration = "";
timeshiftrest = "";
if (veCustomTokens)
veCustomTokens->Reset();
if (veTimeshiftTimes)
veTimeshiftTimes->Set(cString(""), cString(""), cString(""));
if (veEndTime)
veEndTime->Set(cString(""));
timersLoaded = false;
globalTimers.ClearTimers();
}
void cViewReplay::GetGlobalTimers(void) {
if (!timersLoaded) {
timersLoaded = true;
globalTimers.LoadTimers();
}
}
void cViewReplay::SetTimeShiftValues(int current, int total) {
timeShiftActive = NoRec;
if (!recording)
return;
#if APIVERSNUM >= 20101
int usage = recording->IsInUse();
if (usage & ruTimer)
timeShiftActive = NormalRec;
else {
GetGlobalTimers();
if (globalTimers.IsRecording(recording))
timeShiftActive = NormalRec;
}
#endif
if (!timeShiftActive)
return;
const char *recName = recording->Name();
if (recName && *recName == '@')
timeShiftActive = TimeshiftRec;
const cRecordingInfo *recInfo = recording->Info();
if (!recInfo)
return;
const cSchedule *Schedule = NULL;
if (timeShiftActive == TimeshiftRec) {
{
LOCK_SCHEDULES_READ;
Schedule = Schedules->GetSchedule(recInfo->ChannelID());
}
if (!Schedule)
return;
}
// Get event at actual recording position
const cEvent *event = (timeShiftActive == TimeshiftRec) ? Schedule->GetEventAround(time(0))
: recInfo->GetEvent();
if (!event)
return;
// End of live program
time_t liveEventStop = event->EndTime();
// Begin of timeshift recording
time_t recordingStart = time(0) - recording->LengthInSeconds();
// actual timeshiftlength in sec
timeShiftLength = liveEventStop - recordingStart;
// timeshiftlength until end of live program
timeShiftFramesTotal = total * ((double)timeShiftLength / (double)recording->LengthInSeconds());
// Get event at actual replay position (add 30sec for a better match)
int timeShiftSecondsAfter = (int)(recording->LengthInSeconds() * (1.0 - (double)current / (double)total)) + 30;
if (timeShiftActive == TimeshiftRec) {
const cEvent *eventReplay = Schedule->GetEventAround(time(0) - timeShiftSecondsAfter);
// Display title at replay position
if (veRecTitle && eventReplay != lastEvent) {
veRecTitle->Set(recording, eventReplay, timeShiftActive);
veRecTitle->Parse();
lastEvent = eventReplay;
}
}
int mins = (timeShiftLength / 60) % 60;
int hours = (timeShiftLength / 3600) % 24;
timeShiftDuration = cString::sprintf("%d:%02d", hours, mins);
mins = (timeShiftSecondsAfter / 60) % 60;
hours = (timeShiftSecondsAfter / 3600) % 24;
timeshiftrest = cString::sprintf("%d:%02d", hours, mins);
}
void cViewReplay::SetRecording(const cRecording *recording) {
this->recording = recording;
if (veRecTitle) {
veRecTitle->Set(recording);
}
if (veRecInfo) {
veRecInfo->Set(recording);
}
if (veScraperContent) {
veScraperContent->Set(recording);
}
}
void cViewReplay::SetTitle(const char *title) {
if (veRecTitle) {
veRecTitle->Set(title);
}
if (veRecInfo) {
veRecInfo->Set(NULL);
}
if (veScraperContent) {
veScraperContent->Set(NULL);
}
}
void cViewReplay::SetCurrent(const char *current) {
if (veCurrentTime)
veCurrentTime->Set(current, timeShiftActive);
Render((int)eVeDisplayReplay::currenttime);
}
void cViewReplay::SetTotal(const char *total) {
if (veTotalTime)
veTotalTime->Set(total, *timeShiftDuration, timeShiftActive);
Render((int)eVeDisplayReplay::totaltime);
}
void cViewReplay::SetTimeshiftTimes(int current, int total) {
if (!veTimeshiftTimes || !recording)
return;
time_t recordingStart = 0;
time_t playbackTime = 0;
if (timeShiftActive) {
recordingStart = time(0) - recording->LengthInSeconds();
playbackTime = time(0) - (int)(recording->LengthInSeconds() * (1.0 - (double)current / (double)total));
} else
recordingStart = recording->Start();
veTimeshiftTimes->Set(TimeString(recordingStart), TimeString(playbackTime), timeshiftrest, timeShiftActive);
Render((int)eVeDisplayReplay::timeshifttimes);
}
void cViewReplay::SetEndTime(int current, int total) {
if (!veEndTime || !recording)
return;
int totalLength = total;
int recordingLength = recording->LengthInSeconds();
if (timeShiftActive && timeShiftFramesTotal > 0) {
totalLength = timeShiftFramesTotal;
recordingLength = timeShiftLength;
}
double rest = (double)(totalLength - current) / (double)totalLength;
time_t end = time(0) + rest * recordingLength;
veEndTime->Set(TimeString(end), timeShiftActive);
Render((int)eVeDisplayReplay::endtime);
}
void cViewReplay::SetProgressbar(int current, int total) {
SetTimeShiftValues(current, total);
if (veProgressbar)
veProgressbar->Set(current, total, timeShiftActive, timeShiftFramesTotal);
Render((int)eVeDisplayReplay::progressbar);
}
void cViewReplay::SetMarks(const cMarks *marks, int current, int total) {
if (!veCutMarks)
return;
veCutMarks->Set(marks, current, total, timeShiftActive, timeShiftFramesTotal);
Render((int)eVeDisplayReplay::cutmarks);
}
void cViewReplay::SetControlIcons(bool play, bool forward, int speed) {
if (!modeOnly) {
if (veControlIcons)
veControlIcons->Set(play, forward, speed);
Render((int)eVeDisplayReplay::controlicons);
} else {
if (veControlIconsModeOnly)
veControlIconsModeOnly->Set(play, forward, speed);
Render((int)eVeDisplayReplay::controliconsmodeonly);
}
}
void cViewReplay::SetJump(const char *jump) {
if (veJump) {
if (!jump)
veJump->Clear();
else
veJump->Set(jump);
}
Render((int)eVeDisplayReplay::jump);
}
void cViewReplay::SetMessage(eMessageType type, const char *text) {
if (veMessage) {
if (text)
veMessage->Set(type, text);
else
veMessage->Clear();
}
Render((int)eVeDisplayReplay::message);
}
void cViewReplay::StartOnPause(const char *recfilename) {
cVeDrOnPause *onPause = (!modeOnly) ? veOnPause : veOnPauseModeOnly;
if (!onPause)
return;
onPause->Set(recfilename);
onPause->Parse(true);
}
void cViewReplay::ClearOnPause(void) {
cVeDrOnPause *onPause = (!modeOnly) ? veOnPause : veOnPauseModeOnly;
if (!onPause)
return;
onPause->Close();
}
void cViewReplay::DelayOnPause(void) {
if (!veOnPause)
return;
if (!veOnPause->Started())
return;
veOnPause->ResetSleep();
}
void cViewReplay::Flush(void) {
if (init) {
if (!modeOnly) {
Render((int)eVeDisplayReplay::background);
Render((int)eVeDisplayReplay::rectitle);
Render((int)eVeDisplayReplay::recinfo);
Render((int)eVeDisplayReplay::scrapercontent);
Render((int)eVeDisplayReplay::currentweather);
Render((int)eVeDisplayReplay::customtokens);
} else {
Render((int)eVeDisplayReplay::backgroundmodeonly);
}
}
time_t now = time(0);
if (!modeOnly && (now != lastFlush)) {
Render((int)eVeDisplayReplay::datetime);
Render((int)eVeDisplayReplay::time);
Render((int)eVeDisplayChannel::customtokens);
lastFlush = now;
}
if (modeOnly) {
SetProgressModeOnly();
}
cView::Flush();
}
void cViewReplay::SetProgressModeOnly(void) {
if (!veProgressModeOnly)
return;
time_t now = time(0);
if (now == lastFlushModeOnly) {
return;
}
lastFlushModeOnly = now;
cControl *control = cControl::Control();
if (!control)
return;
double fps = control->FramesPerSecond();
int current = 0;
int total = 0;
if (!control->GetIndex(current, total))
return;
veProgressModeOnly->Set(fps, current, total);
if (veProgressModeOnly->Parse())
veProgressModeOnly->Render();
}

View File

@ -1,67 +0,0 @@
#ifndef __VIEWDISPLAYREPLAY_H
#define __VIEWDISPLAYREPLAY_H
#include "view.h"
class cViewReplay : public cView {
private:
cVeMessage *veMessage;
cVeCustomTokens *veCustomTokens;
cVeDrRecTitle *veRecTitle;
cVeDrRecInfo *veRecInfo;
cVeDrScraperContent *veScraperContent;
cVeDrCurrentTime *veCurrentTime;
cVeDrTotalTime *veTotalTime;
cVeDrTimeshiftTimes *veTimeshiftTimes;
cVeDrEndTime *veEndTime;
cVeDrProgressBar *veProgressbar;
cVeDrCutMarks *veCutMarks;
cVeDrProgressModeonly *veProgressModeOnly;
cVeDrControlIcons *veControlIcons;
cVeDrControlIcons *veControlIconsModeOnly;
cVeDrJump *veJump;
cVeDrOnPause *veOnPause;
cVeDrOnPause *veOnPauseModeOnly;
const cRecording *recording;
const cEvent *lastEvent;
bool modeOnly;
time_t lastFlush;
time_t lastFlushModeOnly;
bool message;
int reclength;
eRecType_t timeShiftActive;
int timeShiftFramesTotal;
int timeShiftLength;
cString timeshiftrest;
cString timeShiftDuration;
bool timersLoaded;
cGlobalTimers globalTimers;
void GetGlobalTimers(void);
void SetViewElements(void);
void ClearVariables(void);
void SetViewElementObjects(void);
void SetProgressModeOnly(void);
public:
cViewReplay(void);
virtual ~cViewReplay(void);
void PreCache(void);
void SetModeOnly(bool modeOnly) { this->modeOnly = modeOnly; };
void SetRecording(const cRecording *recording);
void SetTimeShiftValues(int current, int total);
void SetTitle(const char *title);
void SetCurrent(const char *current);
void SetTotal(const char *total);
void SetTimeshiftTimes(int current, int total);
void SetEndTime(int current, int total);
void SetProgressbar(int current, int total);
void SetMarks(const cMarks *marks, int current, int total);
void SetControlIcons(bool play, bool forward, int speed);
void SetJump(const char *jump);
void SetMessage(eMessageType type, const char *text);
void StartOnPause(const char *recfilename);
void ClearOnPause(void);
void DelayOnPause(void);
void Flush(void);
};
#endif //__VIEWDISPLAYREPLAY_H1

View File

@ -1,121 +0,0 @@
#include "viewdisplaytracks.h"
#include "../config.h"
/************************************************************************************
* cViewTracks
************************************************************************************/
cViewTracks::cViewTracks(void) {
ClearVariables();
viewId = eViewType::DisplayTracks;
viewName = strdup("displayaudiotracks");
numViewElements = (int)eVeDisplayTracks::count;
viewElements = new cViewElement*[numViewElements];
for (int i=0; i < numViewElements; i++) {
viewElements[i] = NULL;
}
viewList = NULL;
veBackground = NULL;
veHeader = NULL;
SetViewElements();
}
cViewTracks::~cViewTracks() {
}
void cViewTracks::SetViewElements(void) {
viewElementNames.insert(pair<string, int>("background", (int)eVeDisplayTracks::background));
viewElementNames.insert(pair<string, int>("header", (int)eVeDisplayTracks::header));
}
void cViewTracks::SetViewElementObjects(void) {
if (viewElements[(int)eVeDisplayTracks::background])
veBackground = dynamic_cast<cVeDtBackground*>(viewElements[(int)eVeDisplayTracks::background]);
if (viewElements[(int)eVeDisplayTracks::header])
veHeader = dynamic_cast<cVeDtHeader*>(viewElements[(int)eVeDisplayTracks::header]);
}
void cViewTracks::ClearVariables(void) {
init = true;
change = true;
}
void cViewTracks::Close(void) {
animator->Stop();
animator->Finish();
delete animator;
animator = NULL;
for (int i=0; i < numViewElements; i++) {
if (viewElements[i]) {
viewElements[i]->Close();
}
}
if (viewList) {
viewList->Close();
}
ClearVariables();
sdOsd.DeleteOsd();
}
void cViewTracks::AddViewList(cViewList *viewList) {
this->viewList = dynamic_cast<cViewListAudioTracks*>(viewList);
}
void cViewTracks::PreCache(void) {
cView::PreCache();
if (viewList) {
viewList->SetContainer(0, 0, attribs->Width(), attribs->Height());
viewList->SetGlobals(globals);
viewList->PreCache();
}
}
void cViewTracks::SetTitle(const char *title) {
if (veHeader)
veHeader->SetTitle(title);
change = true;
}
void cViewTracks::SetNumtracks(int numTracks) {
if (veBackground)
veBackground->Set(numTracks);
if (veHeader)
veHeader->SetNumtracks(numTracks);
if (viewList)
viewList->SetNumtracks(numTracks);
}
void cViewTracks::SetAudiochannel(int audioChannel) {
if (veHeader)
veHeader->SetAudiochannel(audioChannel);
change = true;
}
void cViewTracks::SetTracks(const char * const *tracks) {
if (viewList)
viewList->SetTracks(tracks);
change = true;
}
void cViewTracks::SetCurrentTrack(int index) {
if (viewList)
viewList->SetCurrentTrack(index);
change = true;
}
void cViewTracks::Flush(void) {
if (init) {
Render((int)eVeDisplayTracks::background);
if (viewList) {
viewList->Draw();
viewList->StartAnimation(true);
}
}
if (change) {
Render((int)eVeDisplayTracks::header);
if (viewList && !init)
viewList->Draw();
change = false;
}
cView::Flush();
}

View File

@ -1,29 +0,0 @@
#ifndef __VIEWDISPLAYTRACKS_H
#define __VIEWDISPLAYTRACKS_H
#include "view.h"
class cViewTracks : public cView {
private:
cViewListAudioTracks *viewList;
cVeDtBackground *veBackground;
cVeDtHeader *veHeader;
bool change;
void SetViewElements(void);
void SetViewElementObjects(void);
void ClearVariables(void);
public:
cViewTracks(void);
virtual ~cViewTracks(void);
void Close(void);
void AddViewList(cViewList *viewList);
void PreCache(void);
void SetTitle(const char *title);
void SetNumtracks(int numTracks);
void SetTracks(const char * const *tracks);
void SetAudiochannel(int audioChannel);
void SetCurrentTrack(int index);
void Flush(void);
};
#endif //__VIEWDISPLAYTRACKS_H

View File

@ -1,51 +0,0 @@
#include "viewdisplayvolume.h"
/************************************************************************************
* cViewVolume
************************************************************************************/
cViewVolume::cViewVolume(void) {
viewId = eViewType::DisplayVolume;
viewName = strdup("displayvolume");
numViewElements = (int)eVeDisplayVolume::count;
viewElements = new cViewElement*[numViewElements];
for (int i=0; i < numViewElements; i++) {
viewElements[i] = NULL;
}
SetViewElements();
ClearVariables();
veVolume = NULL;
}
cViewVolume::~cViewVolume() {
}
void cViewVolume::SetViewElements(void) {
viewElementNames.insert(pair<string, int>("background", (int)eVeDisplayVolume::background));
viewElementNames.insert(pair<string, int>("volume", (int)eVeDisplayVolume::volume));
}
void cViewVolume::SetViewElementObjects(void) {
if (!viewElements[(int)eVeDisplayVolume::volume])
return;
veVolume = dynamic_cast<cVeVolume*>(viewElements[(int)eVeDisplayVolume::volume]);
}
void cViewVolume::ClearVariables(void) {
init = true;
}
void cViewVolume::SetVolume(int current, int total, bool mute) {
if (veVolume)
veVolume->Set(current, total, mute);
}
void cViewVolume::Flush(void) {
if (init) {
Render((int)eVeDisplayVolume::background);
}
Render((int)eVeDisplayVolume::volume);
cView::Flush();
}

View File

@ -1,19 +0,0 @@
#ifndef __VIEWDISPLAYVOLUME_H
#define __VIEWDISPLAYVOLUME_H
#include "view.h"
class cViewVolume : public cView {
private:
cVeVolume *veVolume;
void SetViewElements(void);
void SetViewElementObjects(void);
void ClearVariables(void);
public:
cViewVolume(void);
virtual ~cViewVolume(void);
void SetVolume(int current, int total, bool mute);
void Flush(void);
};
#endif //__VIEWDISPLAYVOLUME_H

View File

@ -1,760 +0,0 @@
#include "viewelement.h"
#include "../config.h"
/******************************************************************
* cViewElement
******************************************************************/
cViewElement::cViewElement(void) {
sdOsd = NULL;
id = -1;
dirty = true;
init = true;
drawn = false;
scrollingStarted = false;
blocked = false;
detached = false;
doAnimOut = false;
doStartAnim = true;
waitOnWakeup = true;
startAnimation = true;
restartAnimation = false;
globals = NULL;
tokenContainer = NULL;
attribs = new cViewElementAttribs((int)eViewElementAttribs::count);
clearAll = false;
detacher = NULL;
shifter = NULL;
fader = NULL;
}
cViewElement::cViewElement(const cViewElement &other) {
sdOsd = other.sdOsd;
id = other.id;
dirty = other.dirty;
init = other.init;
drawn = false;
scrollingStarted = false;
blocked = false;
detached = false;
doAnimOut = other.doAnimOut;
doStartAnim = other.doStartAnim;
waitOnWakeup = true;
startAnimation = true;
restartAnimation = false;
globals = other.globals;
container.Set(other.container.X(), other.container.Y(), other.container.Width(), other.container.Height());
tokenContainer = NULL;
attribs = new cViewElementAttribs(*other.attribs);
clearAll = false;
for (const cAreaNode *node = other.areaNodes.First(); node; node = other.areaNodes.Next(node)) {
if (cArea *a = dynamic_cast<cArea*>((cAreaNode*)node)) {
areaNodes.Add(new cArea(*a));
} else if (cAreaContainer *ac = dynamic_cast<cAreaContainer*>((cAreaNode*)node)) {
areaNodes.Add(new cAreaContainer(*ac));
}
}
detacher = NULL;
shifter = NULL;
fader = NULL;
}
cViewElement::~cViewElement(void) {
delete attribs;
delete detacher;
delete tokenContainer;
}
/******************************************************************
* Public Functions
******************************************************************/
cViewElement *cViewElement::CreateViewElement(const char *name, const char *viewname) {
cViewElement *e = NULL;
//common view elements
if (!strcmp(name, "background") && strcmp(viewname, "displayaudiotracks"))
e = new cViewElement();
else if (!strcmp(name, "datetime"))
e = new cVeDateTime();
else if (!strcmp(name, "time"))
e = new cVeTime();
else if (!strcmp(name, "message"))
e = new cVeMessage();
else if (!strcmp(name, "devices"))
e = new cVeDevices();
else if (!strcmp(name, "currentweather"))
e = new cVeCurrentWeather();
else if (!strcmp(name, "customtokens"))
e = new cVeCustomTokens();
//displaychannel viewelements
else if (!strcmp(name, "channelinfo"))
e = new cVeDcChannelInfo();
else if (!strcmp(name, "channelgroup"))
e = new cVeDcChannelGroup();
else if (!strcmp(name, "epginfo"))
e = new cVeDcEpgInfo();
else if (!strcmp(name, "progressbar") && !strcmp(viewname, "displaychannel"))
e = new cVeDcProgressBar();
else if (!strcmp(name, "statusinfo"))
e = new cVeDcStatusInfo();
else if (!strcmp(name, "audioinfo"))
e = new cVeDcAudioInfo();
else if (!strcmp(name, "screenresolution"))
e = new cVeDcScreenResolution();
else if (!strcmp(name, "signalquality"))
e = new cVeDcSignalQuality();
else if (!strcmp(name, "scrapercontent") && !strcmp(viewname, "displaychannel"))
e = new cVeDcScraperContent();
else if (!strcmp(name, "channelhints"))
e = new cVeDcChannelHints();
else if (!strcmp(name, "channeldetail"))
e = new cVeDcChannelDetail();
else if (!strcmp(name, "channellistback"))
e = new cViewElement();
else if (!strcmp(name, "grouplistback"))
e = new cViewElement();
else if (!strcmp(name, "groupchannellistback"))
e = new cViewElement();
else if (!strcmp(name, "channellistdetail"))
e = new cVeDcChannelListDetail();
else if (!strcmp(name, "groupchannellistdetail"))
e = new cVeDcGroupChannelListDetail();
else if (!strcmp(name, "ecminfo"))
e = new cVeDcEcmInfo();
//displaymenu viewelements
else if (!strcmp(name, "header") && strcmp(viewname, "displayaudiotracks"))
e = new cVeDmHeader();
else if (!strcmp(name, "sortmode"))
e = new cVeDmSortmode();
else if (!strcmp(name, "colorbuttons"))
e = new cVeDmColorbuttons();
else if (!strcmp(name, "scrollbar"))
e = new cVeDmScrollbar();
else if (!strcmp(name, "timers"))
e = new cVeDmTimers();
else if (!strcmp(name, "currentschedule"))
e = new cVeDmCurrentschedule();
else if (!strcmp(name, "discusage"))
e = new cVeDmDiscusage();
else if (!strcmp(name, "systemload"))
e = new cVeDmSystemload();
else if (!strcmp(name, "systemmemory"))
e = new cVeDmSystemmemory();
else if (!strcmp(name, "temperatures"))
e = new cVeDmTemperatures();
else if (!strcmp(name, "vdrstatistics"))
e = new cVeDmVdrstatistics();
else if (!strcmp(name, "vdrstatus"))
e = new cVeDmVdrstatus();
else if (!strcmp(name, "lastrecordings"))
e = new cVeDmLastrecordings();
else if (!strcmp(name, "detailheaderepg"))
e = new cVeDmDetailheaderEpg();
else if (!strcmp(name, "detailheaderrec"))
e = new cVeDmDetailheaderRec();
else if (!strcmp(name, "detailheaderplugin"))
e = new cVeDmDetailheaderPlugin();
else if (!strcmp(name, "tablabels"))
e = new cVeDmTablabels();
//displayreplay viewelements
else if (!strcmp(name, "backgroundmodeonly"))
e = new cViewElement();
else if (!strcmp(name, "rectitle"))
e = new cVeDrRecTitle();
else if (!strcmp(name, "recinfo"))
e = new cVeDrRecInfo();
else if (!strcmp(name, "currenttime"))
e = new cVeDrCurrentTime();
else if (!strcmp(name, "totaltime"))
e = new cVeDrTotalTime();
else if (!strcmp(name, "timeshifttimes"))
e = new cVeDrTimeshiftTimes();
else if (!strcmp(name, "endtime"))
e = new cVeDrEndTime();
else if (!strcmp(name, "progressbar") && !strcmp(viewname, "displayreplay"))
e = new cVeDrProgressBar();
else if (!strcmp(name, "cutmarks"))
e = new cVeDrCutMarks();
else if (!strcmp(name, "controlicons"))
e = new cVeDrControlIcons();
else if (!strcmp(name, "controliconsmodeonly"))
e = new cVeDrControlIcons();
else if (!strcmp(name, "progressmodeonly"))
e = new cVeDrProgressModeonly();
else if (!strcmp(name, "jump"))
e = new cVeDrJump();
else if (!strcmp(name, "onpause"))
e = new cVeDrOnPause();
else if (!strcmp(name, "onpausemodeonly"))
e = new cVeDrOnPause();
else if (!strcmp(name, "scrapercontent") && !strcmp(viewname, "displayreplay"))
e = new cVeDrScraperContent();
//displayvolume viewelements
else if (!strcmp(name, "volume"))
e = new cVeVolume();
//displayvolume viewelements
else if (!strcmp(name, "background") && !strcmp(viewname, "displayaudiotracks"))
e = new cVeDtBackground();
else if (!strcmp(name, "header") && !strcmp(viewname, "displayaudiotracks"))
e = new cVeDtHeader();
//default
else {
dsyslog("skindesigner: unknown view element %s", name);
e = new cViewElement();
}
return e;
}
void cViewElement::SetGlobals(cGlobals *globals) {
this->globals = globals;
attribs->SetGlobals(globals);
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
node->SetGlobals(globals);
}
}
void cViewElement::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
InheritTokenContainer();
}
bool cViewElement::Detached(void) {
return detached;
}
void cViewElement::SetContainer(int x, int y, int width, int height) {
container.SetX(x);
container.SetY(y);
container.SetWidth(width);
container.SetHeight(height);
}
void cViewElement::SetAttributes(vector<stringpair> &attributes) {
attribs->Set(attributes);
}
void cViewElement::AddArea(cAreaNode *area) {
areaNodes.Add(area);
}
void cViewElement::SetAreaX(int x) {
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
node->SetX(x);
}
}
void cViewElement::SetAreaY(int y) {
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
node->SetY(y);
}
}
void cViewElement::SetAreaWidth(int width) {
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
node->SetWidth(width);
}
}
void cViewElement::SetAreaHeight(int height) {
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
node->SetHeight(height);
}
}
void cViewElement::SetPosition(int newX, int newY, int newWidth, int newHeight) {
cRect newPos(newX, newY, newWidth, newHeight);
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
node->SetViewPort(newPos);
}
}
void cViewElement::Cache(void) {
attribs->SetContainer(container.X(), container.Y(), container.Width(), container.Height());
attribs->Cache();
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
node->SetContainer(container.X(), container.Y(), container.Width(), container.Height());
node->Cache();
}
}
bool cViewElement::Execute(void) {
return attribs->DoExecute();
}
void cViewElement::Clear(bool forceClearBackground) {
if (scrollingStarted)
StopScrolling();
tokenContainer->Clear();
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
node->StopBlinkers();
sdOsd->Lock();
node->Clear(forceClearBackground);
sdOsd->Unlock();
}
dirty = false;
drawn = false;
scrollingStarted = false;
}
void cViewElement::Hide(void) {
StopAnimation();
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
sdOsd->Lock();
node->Hide();
sdOsd->Unlock();
}
init = true;
StopScrolling();
}
void cViewElement::Show(void) {
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
sdOsd->Lock();
node->Show();
sdOsd->Unlock();
}
}
void cViewElement::WakeUp(void) {
if (!detacher || !waitOnWakeup) {
return;
}
detacher->WakeUp();
}
void cViewElement::Close(void) {
StopAnimation();
StopScrolling();
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
node->StopBlinkers();
sdOsd->Lock();
node->Close();
sdOsd->Unlock();
}
dirty = true;
init = true;
startAnimation = true;
restartAnimation = false;
drawn = false;
scrollingStarted = false;
blocked = false;
}
void cViewElement::StopBlinking(void) {
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
node->StopBlinkers();
}
}
void cViewElement::Render(void) {
if (!dirty || blocked)
return;
if (attribs->DoDebug())
Debug();
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
//Check redraw of already scrolling list element
if (drawn && scrollingStarted && node->Scrolling()) {
if (DoScroll()) {
//current list element
continue;
} else {
//not current list element anymore
scrollingStarted = false;
}
}
sdOsd->Lock();
node->Clear();
sdOsd->Unlock();
if (!node->Execute())
continue;
if (node->BackgroundArea() && drawn)
continue;
sdOsd->Lock();
node->Render();
sdOsd->Unlock();
if (DoScroll() && node->Scrolling()) {
cArea *scrollArea = node->ScrollingArea();
if (scrollArea) {
scrollingStarted = true;
cScroller *scroller = new cScroller(scrollArea);
scrollers.push_back(scroller);
cView::AddAnimation(scroller);
}
}
}
dirty = false;
drawn = true;
if (startAnimation || restartAnimation) {
startAnimation = false;
restartAnimation = false;
StartAnimation();
}
}
void cViewElement::StopScrolling(bool deletePixmaps) {
for (list<cScroller*>::iterator it = scrollers.begin(); it != scrollers.end(); it++) {
cView::RemoveAnimation(*it);
}
scrollers.clear();
}
void cViewElement::ParseDetached(void) {
Parse(true);
}
void cViewElement::RenderDetached(void) {
blocked = false;
Render();
}
bool cViewElement::Shifting(void) {
if (attribs->ShiftTime() > 0) {
return true;
}
return false;
}
bool cViewElement::Fading(void) {
if (attribs->FadeTime() > 0) {
return true;
}
return false;
}
int cViewElement::FadeTime(void) {
return attribs->FadeTime();
}
int cViewElement::ShiftTime(void) {
return attribs->ShiftTime();
}
int cViewElement::ShiftMode(void) {
int mode = attribs->ShiftMode();
if (mode < 0) mode = 0;
return mode;
}
void cViewElement::ShiftPositions(cPoint *start, cPoint *end) {
cRect shiftbox = CoveredArea();
cPoint startPoint = ShiftStart(shiftbox);
start->Set(startPoint);
end->Set(shiftbox.X(), shiftbox.Y());
}
void cViewElement::StartAnimation(void) {
shifter = NULL;
fader = NULL;
if (ShiftTime() > 0) {
shifter = new cShifter((cShiftable*)this);
if (doAnimOut)
shifter->SetPersistent();
cView::AddAnimation(shifter, doStartAnim);
} else if (FadeTime() > 0) {
fader = new cFader((cFadable*)this);
if (doAnimOut)
fader->SetPersistent();
cView::AddAnimation(fader, doStartAnim);
}
}
void cViewElement::SetTransparency(int transparency, bool force) {
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
sdOsd->Lock();
node->SetTransparency(transparency);
sdOsd->Unlock();
}
}
void cViewElement::SetPosition(cPoint &position, cPoint &reference, bool force) {
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
sdOsd->Lock();
node->SetPosition(position, reference);
sdOsd->Unlock();
}
}
cRect cViewElement::CoveredArea(void) {
cRect unionArea;
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
unionArea.Combine(node->CoveringArea());
}
return unionArea;
}
void cViewElement::Flush(void) {
sdOsd->Flush();
}
bool cViewElement::Parse(bool forced) {
if (blocked && !forced) {
return false;
}
if (!Detached() || !init) {
return true;
}
delete detacher;
bool isAnimated = (FadeTime() > 0) || (ShiftTime() > 0);
detacher = new cDetacher((cDetachable*)this, waitOnWakeup, startAnimation && isAnimated);
detacher->Start();
startAnimation = false;
init = false;
blocked = true;
return false;
}
cFunction *cViewElement::GetFunction(const char *name) {
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
if (cFunction *f = node->GetFunction(name))
return f;
}
return NULL;
}
void cViewElement::Debug(bool full) {
esyslog("skindesigner: ---> viewElement %d", id);
tokenContainer->Debug();
esyslog("skindesigner: container %d %d %dx%d", container.X(), container.Y(), container.Width(), container.Height());
attribs->Debug();
if (!full)
return;
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
node->Debug(full);
}
}
/******************************************************************
* protected Functions
******************************************************************/
void cViewElement::InheritTokenContainer(void) {
tokenContainer->CreateContainers();
attribs->SetTokenContainer(tokenContainer);
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
node->SetTokenContainer(tokenContainer);
}
}
void cViewElement::InheritTokenContainerDeep(void) {
tokenContainer->CreateContainers();
attribs->SetTokenContainerDeep(tokenContainer);
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
node->SetTokenContainerDeep(tokenContainer);
}
}
cPoint cViewElement::ShiftStart(cRect &shiftbox) {
eShiftType type = (eShiftType)attribs->ShiftType();
cPoint start;
if (type == eShiftType::none) {
start = attribs->ShiftStartpoint();
} else if (type == eShiftType::left) {
start.SetX(-shiftbox.Width());
start.SetY(shiftbox.Y());
} else if (type == eShiftType::right) {
start.SetX(cOsd::OsdWidth());
start.SetY(shiftbox.Y());
} else if (type == eShiftType::top) {
start.SetX(shiftbox.X());
start.SetY(-shiftbox.Height());
} else if (type == eShiftType::bottom) {
start.SetX(shiftbox.X());
start.SetY(cOsd::OsdHeight());
}
return start;
}
void cViewElement::StopAnimation(void) {
delete detacher;
detacher = NULL;
if (shifter)
cView::RemoveAnimation(shifter);
if (fader)
cView::RemoveAnimation(fader);
}
/******************************************************************
* helper function (did not find any other common place)
******************************************************************/
bool RecordingIsHD(const cEvent* event, const tChannelID channelID) {
// detect HD from 'info'
bool isHD = false;
int type = -1;
if (event) {
cComponents *Components = (cComponents *)event->Components();
if (Components) {
// detect HD (see also ETSI EN 300 468)
// Stream: 1 = MPEG2-Video, 2 = MPEG2 Audio, 3 = Untertitel, 4 = AC3-Audio, 5 = H.264-Video, 6 = HEAAC-Audio, 7 = DTS/DTS HD audio, 8 = SRM/CPCM data, 9 = HEVC Video, AC4 Audio
// Stream == Video(1|5): 01 = 05 = 4:3, 02 = 03 = 06 = 07 = 16:9, 04 = 08 = >16:9, 09 = 0D = HD 4:3, 0A = 0B = 0E = 0F = HD 16:9, 0C = 10 = HD >16:9
tComponent *Component;
// #1: HVEC (stream content: 9)
Component = Components->GetComponent(0, 9, 0); // recording info: "X 9 <type>"
if (Component) {
isHD = true; // HVEC is always HD, type 4|5|6|7 would be even UHD (see below dedicated detection function)
} else {
// #2: H.264 (stream content: 5)
Component = Components->GetComponent(0, 5, 0); // recording info: "X 5 <type>"
if (Component) {
type = Component->type;
} else {
// #3: MPEG2 (stream content: 1)
Component = Components->GetComponent(0, 1, 0); // recording info: "X 1 <type>"
if (Component) {
type = Component->type;
};
};
};
switch (type) {
case 0x09:
case 0x0A:
case 0x0B:
case 0x0C:
case 0x0D:
case 0x0E:
case 0x0F:
case 0x10:
isHD = true;
};
};
};
if ((isHD == false) && (type == -1) && (!(channelID == tChannelID::InvalidID))) {
// fallback to retrieve via channel (in case of EPG issues)
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByChannelID(channelID);
#else
const cChannel *channel = Channels.GetByChannelID(channelID);
#endif
if (channel) {
switch (channel->Vtype()) {
case 0x1b: // H.264
case 0x24: // H.265
isHD = true;
break;
};
};
};
return isHD;
};
bool RecordingIsUHD(const cEvent* event, const tChannelID channelID) {
// detect UHD from 'info'
bool isUHD = false;
int type = -1;
if (event) {
cComponents *Components = (cComponents *)event->Components();
if (Components) {
// detect UHD (see also ETSI EN 300 468)
// Stream: 9 = HEVC Video, AC4 Audio
// Stream == Video(9): 00|01|02|03 = HD, 04|05|06|07 = UHD
tComponent *Component;
// HVEC (stream content: 9)
Component = Components->GetComponent(0, 9, 0); // recording info: "X 9 <type>"
if (Component) {
type = Component->type;
};
switch (type) {
case 0x04:
case 0x05:
case 0x06:
case 0x07:
isUHD = true;
};
};
};
if ((isUHD == false) && (type == -1) && (!(channelID == tChannelID::InvalidID))) {
// fallback to retrieve via channel (in case of EPG issues)
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByChannelID(channelID);
#else
const cChannel *channel = Channels.GetByChannelID(channelID);
#endif
if (channel) {
switch (channel->Vtype()) {
case 0x24: // H.265
isUHD = true;
break;
};
};
};
return isUHD;
};
bool RecordingIsRadio(const cEvent* event, const double FramesPerSecond) {
// detect Radio from 'info'
bool isRadio = false;
bool hasAudio = false;
bool hasVideo = false;
cComponents *Components = (cComponents *)event->Components();
if (Components) {
// Stream: 1 = MPEG2-Video, 2 = MPEG2 Audio, 3 = Untertitel, 4 = AC3-Audio, 5 = H.264-Video, 6 = HEAAC-Audio, 7 = DTS/DTS HD audio, 8 = SRM/CPCM data, 9 = HEVC Video, AC4 Audio
tComponent *Component;
Component = Components->GetComponent(0, 2, 0); // recording info: "X 2 <type>"
if (Component) {
hasAudio = true;
};
Component = Components->GetComponent(0, 4, 0); // recording info: "X 4 <type>"
if (Component) {
hasAudio = true;
};
Component = Components->GetComponent(0, 6, 0); // recording info: "X 6 <type>"
if (Component) {
hasAudio = true;
};
Component = Components->GetComponent(0, 7, 0); // recording info: "X 7 <type>"
if (Component) {
hasAudio = true;
};
Component = Components->GetComponent(0, 1, 0); // recording info: "X 1 <type>"
if (Component) {
hasVideo = true;
};
Component = Components->GetComponent(0, 5, 0); // recording info: "X 5 <type>"
if (Component) {
hasVideo = true;
};
Component = Components->GetComponent(0, 9, 0); // recording info: "X 9 <type>"
if (Component) {
hasVideo = true;
};
};
if ((hasAudio == true) && (hasVideo == false)) {
if (FramesPerSecond < 24) { // workaround for issue of missing "X 1" on some SD channels (e.g. RTL)
isRadio = true;
};
};
return isRadio;
};

View File

@ -1,120 +0,0 @@
#ifndef __VIEWELEMENT_H
#define __VIEWELEMENT_H
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <list>
#include <vdr/tools.h>
#include "osdwrapper.h"
#include "globals.h"
#include "../libskindesignerapi/tokencontainer.h"
#include "area.h"
#include "animation.h"
/******************************************************************
* cViewElement
******************************************************************/
class cViewElement : public cDetachable, public cFadable, public cShiftable {
protected:
cSdOsd *sdOsd;
int id;
bool init;
bool drawn;
bool dirty;
bool blocked;
bool detached;
bool doAnimOut;
bool doStartAnim;
bool waitOnWakeup;
bool scrollingStarted;
bool startAnimation;
bool restartAnimation;
cGlobals *globals;
cRect container;
cViewElementAttribs *attribs;
vector<int> clearOnDisplay;
bool clearAll;
cList<cAreaNode> areaNodes;
skindesignerapi::cTokenContainer *tokenContainer;
list<cScroller*> scrollers;
cDetacher *detacher;
cShifter *shifter;
cFader *fader;
void InheritTokenContainer(void);
void InheritTokenContainerDeep(void);
virtual bool DoScroll(void) { return true; };
cPoint ShiftStart(cRect &shiftbox);
void StopAnimation(void);
public:
cViewElement(void);
cViewElement(const cViewElement &other);
virtual ~cViewElement(void);
void SetOsd(cSdOsd *osd) { sdOsd = osd; };
static cViewElement *CreateViewElement(const char *name, const char *viewname);
void SetId(int id) { this->id = id; };
void SetGlobals(cGlobals *globals);
virtual void SetTokenContainer(void);
void SetDetached(void) { detached = true; };
void SetAnimOut(void) { doAnimOut = true; };
void UnsetStartAnim(void) { doStartAnim = false; };
void UnsetWaitOnWakeup(void) { waitOnWakeup = false; };
bool Detached(void);
void SetContainer(int x, int y, int width, int height);
void SetAttributes(vector<stringpair> &attributes);
void AddArea(cAreaNode *area);
void SetAreaX(int x);
void SetAreaY(int y);
void SetAreaWidth(int width);
void SetAreaHeight(int height);
void Cache(void);
virtual void Close(void);
void StopBlinking(void);
virtual void Clear(bool forceClearBackground = false);
void Hide(void);
void Show(void);
void WakeUp(void);
bool Execute(void);
void SetDirty(void) { dirty = true; };
bool Dirty(void) { return dirty; };
void SetPosition(int newX, int newY, int newWidth, int newHeight);
virtual void Render(void);
void StopScrolling(bool deletePixmaps = true);
eOrientation Orientation(void) { return attribs->Orientation(); };
virtual int Delay(void) { return attribs->Delay(); };
const char *ClearOnDisplay(void) { return attribs->ClearOnDisplay(); };
void SetClearOnDisplay(vector<int> clearOnDisplay) { this->clearOnDisplay = clearOnDisplay; };
vector<int> GetClearOnDisplay(void) { return clearOnDisplay; };
void SetClearAll(void) { clearAll = true; };
bool DoClearAll(void) { return clearAll; };
void ParseDetached(void);
void RenderDetached(void);
bool Shifting(void);
bool Fading(void);
int FadeTime(void);
int ShiftTime(void);
int ShiftMode(void);
void ShiftPositions(cPoint *start, cPoint *end);
void StartAnimation(void);
void SetRestartAnimation(void) { restartAnimation = true; };
virtual void SetTransparency(int transparency, bool force = false);
virtual void SetPosition(cPoint &position, cPoint &reference, bool force = false);
void SetStartShifting(void) { };
void SetEndShifting(void) { };
cRect CoveredArea(void);
void Flush(void);
virtual bool Parse(bool forced = false);
cFunction *GetFunction(const char *name);
virtual void Debug(bool full = false);
};
/******************************************************************
* helper function (did not find any other common place)
******************************************************************/
bool RecordingIsHD(const cEvent* event, const tChannelID channelID);
bool RecordingIsUHD(const cEvent* event, const tChannelID channelID);
bool RecordingIsRadio(const cEvent* event, const double FramesPerSecond);
#endif //__VIEWELEMENT_H

View File

@ -1,36 +0,0 @@
#include "viewelementplugin.h"
#include "../config.h"
cVePlugin::cVePlugin(void) {
plugId = -1;
viewId = -1;
}
cVePlugin::~cVePlugin(void) {
}
void cVePlugin::Close(void) {
cViewElement::Close();
}
void cVePlugin::SetTokenContainer(void) {
skindesignerapi::cTokenContainer *tkVe = plgManager->GetTokenContainerVE(plugId, viewId, id);
if (!tkVe)
return;
tokenContainer = new skindesignerapi::cTokenContainer(*tkVe);
InheritTokenContainer();
}
void cVePlugin::Set(skindesignerapi::cTokenContainer *tk) {
tokenContainer->Clear();
tokenContainer->SetTokens(tk);
SetDirty();
}
bool cVePlugin::Parse(bool forced) {
if (!cViewElement::Parse(forced))
return false;
if (!dirty)
return false;
return true;
}

View File

@ -1,22 +0,0 @@
#ifndef __VIEWELEMENTPLUGIN_H
#define __VIEWELEMENTPLUGIN_H
#include "viewelement.h"
class cVePlugin : public cViewElement {
private:
int plugId;
int viewId;
public:
cVePlugin(void);
virtual ~cVePlugin(void);
void SetPluginId(int plugId) { this->plugId = plugId; };
void SetViewId(int viewId) { this->viewId = viewId; };
void Close(void);
void SetTokenContainer(void);
void Set(skindesignerapi::cTokenContainer *tk);
bool Parse(bool forced = false);
const char *Name(void) { return attribs->Name(); };
};
#endif //__VIEWELEMENTPLUGIN_H

View File

@ -1,560 +0,0 @@
#include "viewelementscommon.h"
#include "../config.h"
#include "../services/weatherforecast.h"
/******************************************************************
* cVeDateTime
******************************************************************/
cVeDateTime::cVeDateTime(void) {
lastMinute = -1;
}
cVeDateTime::~cVeDateTime(void) {
}
void cVeDateTime::Close(void) {
lastMinute = -1;
cViewElement::Close();
}
void cVeDateTime::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{time}", (int)eDateTimeST::time);
tokenContainer->DefineStringToken("{dayleadingzero}", (int)eDateTimeST::dayleadingzero);
tokenContainer->DefineStringToken("{dayname}", (int)eDateTimeST::dayname);
tokenContainer->DefineStringToken("{daynameshort}", (int)eDateTimeST::daynameshort);
tokenContainer->DefineStringToken("{month}", (int)eDateTimeST::month);
tokenContainer->DefineStringToken("{monthname}", (int)eDateTimeST::monthname);
tokenContainer->DefineStringToken("{monthnameshort}", (int)eDateTimeST::monthnameshort);
tokenContainer->DefineIntToken("{day}", (int)eDateTimeIT::day);
tokenContainer->DefineIntToken("{year}", (int)eDateTimeIT::year);
InheritTokenContainer();
}
bool cVeDateTime::Parse(bool forced) {
if (!cViewElement::Parse(forced))
return false;
time_t t = time(0); // get time now
struct tm * now = localtime(&t);
int min = now->tm_min;
if (!forced && min == lastMinute) {
return false;
}
lastMinute = min;
SetDirty();
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eDateTimeIT::year, now->tm_year + 1900);
tokenContainer->AddIntToken((int)eDateTimeIT::day, now->tm_mday);
char monthname[20];
char monthshort[10];
strftime(monthshort, sizeof(monthshort), "%b", now);
strftime(monthname, sizeof(monthname), "%B", now);
tokenContainer->AddStringToken((int)eDateTimeST::monthname, monthname);
tokenContainer->AddStringToken((int)eDateTimeST::monthnameshort, monthshort);
tokenContainer->AddStringToken((int)eDateTimeST::month, *cString::sprintf("%02d", now->tm_mon + 1));
tokenContainer->AddStringToken((int)eDateTimeST::dayleadingzero, *cString::sprintf("%02d", now->tm_mday));
tokenContainer->AddStringToken((int)eDateTimeST::dayname, *WeekDayNameFull(now->tm_wday));
tokenContainer->AddStringToken((int)eDateTimeST::daynameshort, *WeekDayName(now->tm_wday));
tokenContainer->AddStringToken((int)eDateTimeST::time, *TimeString(t));
return true;
}
/******************************************************************
* cVeTime
******************************************************************/
cVeTime::cVeTime(void) {
lastSecond = -1;
}
cVeTime::~cVeTime(void) {
}
void cVeTime::Close(void) {
lastSecond = -1;
cViewElement::Close();
}
void cVeTime::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineIntToken("{sec}", (int)eTimeIT::sec);
tokenContainer->DefineIntToken("{min}", (int)eTimeIT::min);
tokenContainer->DefineIntToken("{hour}", (int)eTimeIT::hour);
tokenContainer->DefineIntToken("{hmins}", (int)eTimeIT::hmins);
InheritTokenContainer();
}
bool cVeTime::Parse(bool forced) {
if (!cViewElement::Parse(forced))
return false;
time_t t = time(0); // get time now
struct tm * now = localtime(&t);
int sec = now->tm_sec;
if (!forced && sec == lastSecond) {
return false;
}
lastSecond = sec;
SetDirty();
int min = now->tm_min;
int hour = now->tm_hour;
int hourMinutes = hour%12 * 5 + min / 12;
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eTimeIT::sec, sec);
tokenContainer->AddIntToken((int)eTimeIT::min, min);
tokenContainer->AddIntToken((int)eTimeIT::hour, hour);
tokenContainer->AddIntToken((int)eTimeIT::hmins, hourMinutes);
return true;
}
/******************************************************************
* cVeMessage
******************************************************************/
cVeMessage::cVeMessage(void) {
changed = false;
text = NULL;
type = mtStatus;
}
cVeMessage::~cVeMessage(void) {
free(text);
}
void cVeMessage::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{text}", (int)eMessageST::text);
tokenContainer->DefineIntToken("{status}", (int)eMessageIT::status);
tokenContainer->DefineIntToken("{info}", (int)eMessageIT::info);
tokenContainer->DefineIntToken("{warning}", (int)eMessageIT::warning);
tokenContainer->DefineIntToken("{error}", (int)eMessageIT::error);
InheritTokenContainer();
}
void cVeMessage::Set(eMessageType type, const char *text) {
if (!text)
return;
free(this->text);
this->text = strdup(text);
this->type = type;
changed = true;
}
bool cVeMessage::Parse(bool forced) {
if (!cViewElement::Parse(forced) || !changed)
return false;
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eMessageIT::status, (type == mtStatus) ? true : false);
tokenContainer->AddIntToken((int)eMessageIT::info, (type == mtInfo) ? true : false);
tokenContainer->AddIntToken((int)eMessageIT::warning, (type == mtWarning) ? true : false);
tokenContainer->AddIntToken((int)eMessageIT::error, (type == mtError) ? true : false);
tokenContainer->AddStringToken((int)eMessageST::text, text);
SetDirty();
changed = false;
return true;
}
/******************************************************************
* cVeDevices
******************************************************************/
cVeDevices::cVeDevices(void) {
initial = true;
devicesIndex = -1;
lastSignalStrength = NULL;
lastSignalQuality = NULL;
recDevices = NULL;
lastRecDevices = NULL;
}
cVeDevices::~cVeDevices(void) {
mutexDevices.Lock();
delete[] lastSignalStrength;
lastSignalStrength = NULL;
delete[] lastSignalQuality;
lastSignalQuality = NULL;
delete[] recDevices;
recDevices = NULL;
delete[] lastRecDevices;
lastRecDevices = NULL;
mutexDevices.Unlock();
}
void cVeDevices::Init(void) {
light = (attribs->Mode() == (int)eViewElementMode::light) ? true : false;
int totalDevices = cDevice::NumDevices();
for (int i = 0; i < totalDevices; i++) {
const cDevice *device = cDevice::GetDevice(i);
if (!device || !device->NumProvidedSystems()) {
continue;
}
devices.push_back(i);
}
numDevices = devices.size();
lastSignalStrength = new int[numDevices];
lastSignalQuality = new int[numDevices];
recDevices = new bool[numDevices];
lastRecDevices = new bool[numDevices];
mutexDevices.Lock();
for (int i=0; i<numDevices; i++) {
lastSignalStrength[i] = 0;
lastSignalQuality[i] = 0;
recDevices[i] = false;
lastRecDevices[i] = false;
}
mutexDevices.Unlock();
}
void cVeDevices::Close(void) {
devices.clear();
initial = true;
numDevices = 0;
mutexDevices.Lock();
delete[] lastSignalStrength;
lastSignalStrength = NULL;
delete[] lastSignalQuality;
lastSignalQuality = NULL;
delete[] recDevices;
recDevices = NULL;
delete[] lastRecDevices;
lastRecDevices = NULL;
mutexDevices.Unlock();
cViewElement::Close();
}
void cVeDevices::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineIntToken("{numdevices}", (int)eDevicesIT::numdevices);
tokenContainer->DefineLoopToken("{devices[num]}", (int)eDevicesLT::num);
tokenContainer->DefineLoopToken("{devices[type]}", (int)eDevicesLT::type);
tokenContainer->DefineLoopToken("{devices[istuned]}", (int)eDevicesLT::istuned);
tokenContainer->DefineLoopToken("{devices[livetv]}", (int)eDevicesLT::livetv);
tokenContainer->DefineLoopToken("{devices[recording]}", (int)eDevicesLT::recording);
tokenContainer->DefineLoopToken("{devices[hascam]}", (int)eDevicesLT::hascam);
tokenContainer->DefineLoopToken("{devices[cam]}", (int)eDevicesLT::cam);
tokenContainer->DefineLoopToken("{devices[signalstrength]}", (int)eDevicesLT::signalstrength);
tokenContainer->DefineLoopToken("{devices[signalquality]}", (int)eDevicesLT::signalquality);
tokenContainer->DefineLoopToken("{devices[channelnumber]}", (int)eDevicesLT::channelnumber);
tokenContainer->DefineLoopToken("{devices[channelname]}", (int)eDevicesLT::channelname);
tokenContainer->DefineLoopToken("{devices[channellogoexists]}", (int)eDevicesLT::channellogoexists);
tokenContainer->DefineLoopToken("{devices[channelid]}", (int)eDevicesLT::channelid);
tokenContainer->DefineLoopToken("{devices[source]}", (int)eDevicesLT::source);
devicesIndex = tokenContainer->LoopIndex("devices");
InheritTokenContainer();
}
bool cVeDevices::Parse(bool forced) {
if (!cViewElement::Parse(forced))
return false;
bool changed = false;
if (initial) {
Init();
initial = false;
changed = true;
} else {
//in light modus content is static
if (light)
return false;
for (int i = 0; i < numDevices; i++) {
const cDevice *device = cDevice::GetDevice(devices[i]);
if (!device || !device->NumProvidedSystems()) {
continue;
}
int signalStrength = device->SignalStrength();
int signalQuality = device->SignalQuality();
int lastSigStr = 0;
int lastSigQual = 0;
mutexDevices.Lock();
if (lastSignalStrength && lastSignalQuality) {
lastSigStr = lastSignalStrength[i];
lastSigQual = lastSignalQuality[i];
}
mutexDevices.Unlock();
if ((signalStrength != lastSigStr) || (signalQuality != lastSigQual)) {
changed = true;
break;
}
}
}
// reset recording devices
for (int i = 0; i < numDevices; i++) {
recDevices[i] = false;
}
// check currently recording devices
// BLOCK for LOCK_TIMERS_READ scope !!
{
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_READ;
const cTimers* timers = Timers;
#else
const cTimers* timers = &Timers;
#endif
for (const cTimer *timer = timers->First(); timer; timer = timers->Next(timer)) {
if (!timer->Recording()) {
continue;
}
if (cRecordControl *RecordControl = cRecordControls::GetRecordControl(timer)) {
const cDevice *recDevice = RecordControl->Device();
if (recDevice) {
mutexDevices.Lock();
if (recDevices) {
int d = recDevice->DeviceNumber();
for (int i = 0; i < numDevices; i++) {
if (devices[i] == d) {
recDevices[i] = true;
break;
}
}
}
mutexDevices.Unlock();
}
}
}
} // LOCK_TIMERS_READ
for (int i = 0; i < numDevices; i++) {
if (recDevices[i] != lastRecDevices[i]) {
lastRecDevices[i] = recDevices[i];
changed = true;
}
}
if (!changed) {
return false;
}
//check device which currently displays live tv
int deviceLiveTV = -1;
cDevice *primaryDevice = cDevice::PrimaryDevice();
if (primaryDevice) {
if (!primaryDevice->Replaying() || primaryDevice->Transferring())
deviceLiveTV = cDevice::ActualDevice()->DeviceNumber();
else
deviceLiveTV = primaryDevice->DeviceNumber();
}
//create loop container
tokenContainer->Clear();
vector<int> loopInfo;
loopInfo.push_back(numDevices);
tokenContainer->CreateLoopTokenContainer(&loopInfo);
tokenContainer->AddIntToken((int)eDevicesIT::numdevices, numDevices);
for (int i = 0; i < numDevices; i++) {
const cDevice *device = cDevice::GetDevice(devices[i]);
if (!device || !device->NumProvidedSystems()) {
continue;
}
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::num, *cString::sprintf("%d", i + 1));
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::type, *(device->DeviceType()));
cCamSlot *camSlot = device->CamSlot();
int camNumber = -1;
if (camSlot) {
camNumber = camSlot->SlotNumber();
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::hascam, "1");
} else {
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::hascam, "0");
}
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::cam, *cString::sprintf("%d", camNumber));
int signalStrength = 0;
int signalQuality = 0;
if (!light) {
signalStrength = device->SignalStrength();
signalQuality = device->SignalQuality();
}
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::signalstrength, *cString::sprintf("%d", signalStrength));
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::signalquality, *cString::sprintf("%d", signalQuality));
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::livetv, devices[i] == deviceLiveTV ? "1" : "0");
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::recording, (recDevices && recDevices[i]) ? "1" : "0");
const cChannel *channel = device->GetCurrentlyTunedTransponder();
const cSource *source = (channel) ? Sources.Get(channel->Source()) : NULL;
if (channel && channel->Number() > 0) {
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::channelnumber, *cString::sprintf("%d", channel->Number()));
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::channelname, channel->Name());
string channelID = *(channel->GetChannelID().ToString());
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::channelid, channelID.c_str());
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::channellogoexists, imgCache->LogoExists(channelID) ? "1" : "0");
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::istuned, "1");
} else {
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::istuned, "0");
}
tokenContainer->AddLoopToken(devicesIndex, i, (int)eDevicesLT::source, source ? source->Description() : "");
mutexDevices.Lock();
if (lastSignalStrength)
lastSignalStrength[i] = signalStrength;
if (lastSignalQuality)
lastSignalQuality[i] = signalQuality;
mutexDevices.Unlock();
}
SetDirty();
return true;
}
/******************************************************************
* cVeCurrentWeather
******************************************************************/
cVeCurrentWeather::cVeCurrentWeather(void) {
}
cVeCurrentWeather::~cVeCurrentWeather(void) {
}
void cVeCurrentWeather::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{timestamp}", (int)eCurrentWeatherST::timestamp);
tokenContainer->DefineStringToken("{summary}", (int)eCurrentWeatherST::summary);
tokenContainer->DefineStringToken("{icon}", (int)eCurrentWeatherST::icon);
tokenContainer->DefineStringToken("{precipitationtype}", (int)eCurrentWeatherST::precipitationtype);
tokenContainer->DefineStringToken("{windbearingstring}", (int)eCurrentWeatherST::windbearingstring);
tokenContainer->DefineStringToken("{temperature}", (int)eCurrentWeatherST::temperature);
tokenContainer->DefineStringToken("{apparenttemperature}", (int)eCurrentWeatherST::apparenttemperature);
tokenContainer->DefineStringToken("{mintemperature}", (int)eCurrentWeatherST::mintemperature);
tokenContainer->DefineStringToken("{maxtemperature}", (int)eCurrentWeatherST::maxtemperature);
tokenContainer->DefineStringToken("{precipitationintensity}", (int)eCurrentWeatherST::precipitationintensity);
tokenContainer->DefineStringToken("{windspeed}", (int)eCurrentWeatherST::windspeed);
tokenContainer->DefineStringToken("{visibility}", (int)eCurrentWeatherST::visibility);
tokenContainer->DefineStringToken("{pressure}", (int)eCurrentWeatherST::pressure);
tokenContainer->DefineStringToken("{ozone}", (int)eCurrentWeatherST::ozone);
tokenContainer->DefineIntToken("{precipitationprobability}", (int)eCurrentWeatherIT::precipitationprobability);
tokenContainer->DefineIntToken("{humidity}", (int)eCurrentWeatherIT::humidity);
tokenContainer->DefineIntToken("{windbearing}", (int)eCurrentWeatherIT::windbearing);
tokenContainer->DefineIntToken("{cloudcover}", (int)eCurrentWeatherIT::cloudcover);
InheritTokenContainer();
}
bool cVeCurrentWeather::Parse(bool forced) {
if (!cViewElement::Parse(forced))
return false;
static cPlugin *pWeatherForecast = cPluginManager::GetPlugin("weatherforecast");
if (!pWeatherForecast)
return false;
cServiceCurrentWeather currentWeather;
if (!pWeatherForecast->Service("GetCurrentWeather", &currentWeather)) {
return false;
}
SetDirty();
tokenContainer->Clear();
tokenContainer->AddStringToken((int)eCurrentWeatherST::timestamp, currentWeather.timeStamp.c_str());
tokenContainer->AddStringToken((int)eCurrentWeatherST::temperature, currentWeather.temperature.c_str());
tokenContainer->AddStringToken((int)eCurrentWeatherST::apparenttemperature, currentWeather.apparentTemperature.c_str());
tokenContainer->AddStringToken((int)eCurrentWeatherST::mintemperature, currentWeather.minTemperature.c_str());
tokenContainer->AddStringToken((int)eCurrentWeatherST::maxtemperature, currentWeather.maxTemperature.c_str());
tokenContainer->AddStringToken((int)eCurrentWeatherST::summary, currentWeather.summary.c_str());
tokenContainer->AddStringToken((int)eCurrentWeatherST::icon, currentWeather.icon.c_str());
tokenContainer->AddStringToken((int)eCurrentWeatherST::precipitationintensity, currentWeather.precipitationIntensity.c_str());
tokenContainer->AddStringToken((int)eCurrentWeatherST::precipitationtype, currentWeather.precipitationType.c_str());
tokenContainer->AddStringToken((int)eCurrentWeatherST::windspeed, currentWeather.windSpeed.c_str());
tokenContainer->AddStringToken((int)eCurrentWeatherST::windbearingstring, currentWeather.windBearingString.c_str());
tokenContainer->AddStringToken((int)eCurrentWeatherST::visibility, currentWeather.visibility.c_str());
tokenContainer->AddStringToken((int)eCurrentWeatherST::pressure, currentWeather.pressure.c_str());
tokenContainer->AddStringToken((int)eCurrentWeatherST::ozone, currentWeather.ozone.c_str());
tokenContainer->AddIntToken((int)eCurrentWeatherIT::precipitationprobability, currentWeather.precipitationProbability);
tokenContainer->AddIntToken((int)eCurrentWeatherIT::humidity, currentWeather.humidity);
tokenContainer->AddIntToken((int)eCurrentWeatherIT::windbearing, currentWeather.windBearing);
tokenContainer->AddIntToken((int)eCurrentWeatherIT::cloudcover, currentWeather.cloudCover);
return true;
}
/******************************************************************
* cVeCustomTokens
******************************************************************/
cVeCustomTokens::cVeCustomTokens(void) {
}
cVeCustomTokens::~cVeCustomTokens(void) {
}
void cVeCustomTokens::Reset(void) {
globals->ResetCustomTokenChange();
}
void cVeCustomTokens::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
int numTokens = config.numCustomTokens;
for (int i=0; i < numTokens; i++) {
cString nameIntToken = cString::sprintf("{customint%d}", i+1);
cString nameStringToken = cString::sprintf("{customstring%d}", i+1);
tokenContainer->DefineStringToken(*nameStringToken, i);
tokenContainer->DefineIntToken(*nameIntToken, i);
}
InheritTokenContainer();
}
bool cVeCustomTokens::Parse(bool forced) {
if (!cViewElement::Parse(forced))
return false;
if (!globals->CustomTokenChange())
return false;
tokenContainer->Clear();
map <int, string> customStringTokens = globals->GetCustomStringTokens();
for (map<int, string>::iterator it = customStringTokens.begin(); it != customStringTokens.end(); it++) {
int index = it->first;
if (index > 0 && index <= config.numCustomTokens) {
tokenContainer->AddStringToken(index-1, it->second.c_str());
}
}
map <int, int> customIntTokkens = globals-> GetCustomIntTokens();
for (map<int, int>::iterator it = customIntTokkens.begin(); it != customIntTokkens.end(); it++) {
int index = it->first;
if (index > 0 && index <= config.numCustomTokens) {
tokenContainer->AddIntToken(index-1, it->second);
}
}
SetDirty();
return true;
}
/******************************************************************
* cVeVolume
******************************************************************/
cVeVolume::cVeVolume(void) {
current = 0;
total = 0;
mute = false;
changed = true;
}
cVeVolume::~cVeVolume(void) {
}
void cVeVolume::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineIntToken("{volume}", (int)eDVVolumeIT::volume);
tokenContainer->DefineIntToken("{volpercent}", (int)eDVVolumeIT::volpercent);
tokenContainer->DefineIntToken("{maxvolume}", (int)eDVVolumeIT::maxvolume);
tokenContainer->DefineIntToken("{mute}", (int)eDVVolumeIT::mute);
InheritTokenContainer();
}
void cVeVolume::Set(int current, int total, bool mute) {
this->current = current;
this->total = total;
this->mute = mute;
changed = true;
}
bool cVeVolume::Parse(bool forced) {
if (!cViewElement::Parse(forced) || !changed)
return false;
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eDVVolumeIT::volume, current);
tokenContainer->AddIntToken((int)eDVVolumeIT::maxvolume, total);
tokenContainer->AddIntToken((int)eDVVolumeIT::volpercent, (double)current *100 / (double)total);
tokenContainer->AddIntToken((int)eDVVolumeIT::mute, mute);
changed = false;
SetDirty();
return true;
}

View File

@ -1,110 +0,0 @@
#ifndef __VIEWELEMENTSCOMMON_H
#define __VIEWELEMENTSCOMMON_H
#include <vdr/menu.h>
#include "viewelement.h"
/******************************************************************
* cVeDateTime
******************************************************************/
class cVeDateTime : public cViewElement {
private:
int lastMinute;
public:
cVeDateTime(void);
virtual ~cVeDateTime(void);
void Close(void);
void SetTokenContainer(void);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeTime
******************************************************************/
class cVeTime : public cViewElement {
private:
int lastSecond;
public:
cVeTime(void);
virtual ~cVeTime(void);
void Close(void);
void SetTokenContainer(void);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeMessage
******************************************************************/
class cVeMessage : public cViewElement {
private:
bool changed;
eMessageType type;
char *text;
public:
cVeMessage(void);
virtual ~cVeMessage(void);
void SetTokenContainer(void);
void Set(eMessageType type, const char *text);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDevices
******************************************************************/
class cVeDevices : public cViewElement {
private:
bool light;
vector<int> devices;
bool initial;
int devicesIndex;
cMutex mutexDevices;
int numDevices;
int* lastSignalStrength;
int* lastSignalQuality;
bool* recDevices;
bool* lastRecDevices;
void Init(void);
public:
cVeDevices(void);
virtual ~cVeDevices(void);
void Close(void);
void SetTokenContainer(void);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeCurrentWeather
******************************************************************/
class cVeCurrentWeather : public cViewElement {
private:
public:
cVeCurrentWeather(void);
virtual ~cVeCurrentWeather(void);
void SetTokenContainer(void);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeCustomTokens
******************************************************************/
class cVeCustomTokens : public cViewElement {
private:
public:
cVeCustomTokens(void);
virtual ~cVeCustomTokens(void);
void Reset(void);
void SetTokenContainer(void);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeVolume
******************************************************************/
class cVeVolume : public cViewElement {
private:
int current;
int total;
bool mute;
bool changed;
public:
cVeVolume(void);
virtual ~cVeVolume(void);
void SetTokenContainer(void);
void Set(int current, int total, bool mute);
bool Parse(bool forced = false);
};
#endif //__VIEWELEMENTSCOMMON_H

View File

@ -1,977 +0,0 @@
#include "viewelementsdisplaychannel.h"
#include "../config.h"
#include "../extensions/helpers.h"
#include "../services/scraper2vdr.h"
#include "../services/epgtimer.h"
/******************************************************************
* cVeDcChannelInfo
******************************************************************/
cVeDcChannelInfo::cVeDcChannelInfo(void) {
}
cVeDcChannelInfo::~cVeDcChannelInfo(void) {
}
void cVeDcChannelInfo::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{channelnumber}", (int)eDCChannelInfoST::channelnumber);
tokenContainer->DefineStringToken("{channelname}", (int)eDCChannelInfoST::channelname);
tokenContainer->DefineStringToken("{channelid}", (int)eDCChannelInfoST::channelid);
tokenContainer->DefineIntToken("{channellogoexists}", (int)eDCChannelInfoIT::channellogoexists);
tokenContainer->DefineIntToken("{switching}", (int)eDCChannelInfoIT::switching);
InheritTokenContainer();
}
void cVeDcChannelInfo::Set(const cChannel *c, int number) {
cString channelNumber("");
cString channelName("");
cString channelId("");
if (c) {
channelName = c->Name() ? c->Name() : "";
channelId = c->GetChannelID().ToString();
if (!c->GroupSep()) {
channelNumber = cString::sprintf("%d%s", c->Number(), number ? "-" : "");
}
} else if (number) {
channelNumber = cString::sprintf("%d-", number);
} else {
channelName = ChannelString(NULL, 0);
}
tokenContainer->Clear();
tokenContainer->AddStringToken((int)eDCChannelInfoST::channelnumber, *channelNumber);
tokenContainer->AddStringToken((int)eDCChannelInfoST::channelname, *channelName);
tokenContainer->AddStringToken((int)eDCChannelInfoST::channelid, *channelId);
bool logoExists = imgCache->LogoExists(*channelId);
tokenContainer->AddIntToken((int)eDCChannelInfoIT::channellogoexists, logoExists);
tokenContainer->AddIntToken((int)eDCChannelInfoIT::switching, (number > 0)?true:false);
SetDirty();
}
/******************************************************************
* cVeDcChannelGroup
******************************************************************/
cVeDcChannelGroup::cVeDcChannelGroup(void) {
}
cVeDcChannelGroup::~cVeDcChannelGroup(void) {
}
void cVeDcChannelGroup::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{group}", (int)eDCChannelGroupST::group);
tokenContainer->DefineStringToken("{nextgroup}", (int)eDCChannelGroupST::nextgroup);
tokenContainer->DefineStringToken("{prevgroup}", (int)eDCChannelGroupST::prevgroup);
tokenContainer->DefineStringToken("{seppath}", (int)eDCChannelGroupST::seppath);
tokenContainer->DefineIntToken("{prevAvailable}", (int)eDCChannelGroupIT::prevAvailable);
tokenContainer->DefineIntToken("{nextAvailable}", (int)eDCChannelGroupIT::nextAvailable);
tokenContainer->DefineIntToken("{sepexists}", (int)eDCChannelGroupIT::sepexists);
InheritTokenContainer();
}
void cVeDcChannelGroup::Set(const cChannel *c) {
const char *sep = c->Name();
bool sepExists = imgCache->SeparatorLogoExists(sep);
const char *prevChannelSep = GetChannelSep(c, true);
const char *nextChannelSep = GetChannelSep(c, false);
tokenContainer->Clear();
tokenContainer->AddStringToken((int)eDCChannelGroupST::group, sep);
tokenContainer->AddStringToken((int)eDCChannelGroupST::nextgroup, nextChannelSep ? nextChannelSep : "");
tokenContainer->AddStringToken((int)eDCChannelGroupST::prevgroup, prevChannelSep ? prevChannelSep : "");
tokenContainer->AddStringToken((int)eDCChannelGroupST::seppath, sepExists ? sep : "");
tokenContainer->AddIntToken((int)eDCChannelGroupIT::prevAvailable, (prevChannelSep)?true:false);
tokenContainer->AddIntToken((int)eDCChannelGroupIT::nextAvailable, (nextChannelSep)?true:false);
tokenContainer->AddIntToken((int)eDCChannelGroupIT::sepexists, sepExists);
SetDirty();
}
const char *cVeDcChannelGroup::GetChannelSep(const cChannel *c, bool prev) {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cChannels* channels = Channels;
#else
const cChannels* channels = &Channels;
#endif
const cChannel *sep = prev ? channels->Prev(c) :
channels->Next(c);
for (; sep; (prev)?(sep = channels->Prev(sep)):(sep = channels->Next(sep))) {
if (sep->GroupSep()) {
return sep->Name();
}
}
return NULL;
}
/******************************************************************
* cVeDcEpgInfo
******************************************************************/
cVeDcEpgInfo::cVeDcEpgInfo(void) {
globalTimers = NULL;
current = NULL;
next = NULL;
}
cVeDcEpgInfo::~cVeDcEpgInfo(void) {
}
void cVeDcEpgInfo::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{currenttitle}", (int)eDCEpgInfoST::currenttitle);
tokenContainer->DefineStringToken("{currentsubtitle}", (int)eDCEpgInfoST::currentsubtitle);
tokenContainer->DefineStringToken("{currentstart}", (int)eDCEpgInfoST::currentstart);
tokenContainer->DefineStringToken("{currentstop}", (int)eDCEpgInfoST::currentstop);
tokenContainer->DefineStringToken("{nexttitle}", (int)eDCEpgInfoST::nexttitle);
tokenContainer->DefineStringToken("{nextsubtitle}", (int)eDCEpgInfoST::nextsubtitle);
tokenContainer->DefineStringToken("{nextstart}", (int)eDCEpgInfoST::nextstart);
tokenContainer->DefineStringToken("{nextstop}", (int)eDCEpgInfoST::nextstop);
tokenContainer->DefineIntToken("{currentduration}", (int)eDCEpgInfoIT::currentduration);
tokenContainer->DefineIntToken("{currentdurationhours}", (int)eDCEpgInfoIT::currentdurationhours);
tokenContainer->DefineIntToken("{currentdurationminutes}", (int)eDCEpgInfoIT::currentdurationminutes);
tokenContainer->DefineIntToken("{currentelapsed}", (int)eDCEpgInfoIT::currentelapsed);
tokenContainer->DefineIntToken("{currentremaining}", (int)eDCEpgInfoIT::currentremaining);
tokenContainer->DefineIntToken("{nextduration}", (int)eDCEpgInfoIT::nextduration);
tokenContainer->DefineIntToken("{nextdurationhours}", (int)eDCEpgInfoIT::nextdurationhours);
tokenContainer->DefineIntToken("{nextdurationminutes}", (int)eDCEpgInfoIT::nextdurationminutes);
tokenContainer->DefineIntToken("{nextrecording}", (int)eDCEpgInfoIT::nextrecording);
tokenContainer->DefineIntToken("{currentrecording}", (int)eDCEpgInfoIT::currentrecording);
tokenContainer->DefineIntToken("{hasVPS}", (int)eDCEpgInfoIT::hasVPS);
InheritTokenContainer();
}
bool cVeDcEpgInfo::Parse(bool force) {
if (!cViewElement::Parse(force))
return false;
tokenContainer->Clear();
if (current) {
tokenContainer->AddStringToken((int)eDCEpgInfoST::currenttitle, current->Title());
tokenContainer->AddStringToken((int)eDCEpgInfoST::currentsubtitle, current->ShortText());
tokenContainer->AddStringToken((int)eDCEpgInfoST::currentstart, *current->GetTimeString());
tokenContainer->AddStringToken((int)eDCEpgInfoST::currentstop, *current->GetEndTimeString());
tokenContainer->AddIntToken((int)eDCEpgInfoIT::currentduration, current->Duration() / 60);
tokenContainer->AddIntToken((int)eDCEpgInfoIT::currentdurationhours, current->Duration() / 3600);
tokenContainer->AddIntToken((int)eDCEpgInfoIT::currentdurationminutes, (current->Duration() / 60) % 60);
tokenContainer->AddIntToken((int)eDCEpgInfoIT::currentelapsed, (int)round((time(NULL) - current->StartTime())/60));
tokenContainer->AddIntToken((int)eDCEpgInfoIT::currentremaining, (int)round((current->EndTime() - time(NULL))/60));
tokenContainer->AddIntToken((int)eDCEpgInfoIT::currentrecording, EventHasTimer(current));
tokenContainer->AddIntToken((int)eDCEpgInfoIT::hasVPS, (bool)current->Vps());
}
if (next) {
tokenContainer->AddStringToken((int)eDCEpgInfoST::nexttitle, next->Title());
tokenContainer->AddStringToken((int)eDCEpgInfoST::nextsubtitle, next->ShortText());
tokenContainer->AddStringToken((int)eDCEpgInfoST::nextstart, *next->GetTimeString());
tokenContainer->AddStringToken((int)eDCEpgInfoST::nextstop, *next->GetEndTimeString());
tokenContainer->AddIntToken((int)eDCEpgInfoIT::nextduration, next->Duration() / 60);
tokenContainer->AddIntToken((int)eDCEpgInfoIT::nextdurationhours, next->Duration() / 3600);
tokenContainer->AddIntToken((int)eDCEpgInfoIT::nextdurationminutes, (next->Duration() / 60) % 60);
tokenContainer->AddIntToken((int)eDCEpgInfoIT::nextrecording, EventHasTimer(next));
tokenContainer->AddIntToken((int)eDCEpgInfoIT::hasVPS, (bool)next->Vps());
}
SetDirty();
return true;
}
void cVeDcEpgInfo::Close(void) {
current = NULL;
next = NULL;
tokenContainer->Clear();
cViewElement::Close();
}
bool cVeDcEpgInfo::EventHasTimer(const cEvent *e) {
if (!e) return false;
eTimerMatch TimerMatch = tmNone;
const cTimers *timers;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
{
LOCK_TIMERS_READ;
timers = Timers;
}
#else
timers = &Timers;
#endif
const cTimer *Timer = timers->GetMatch(e, &TimerMatch);
if (Timer && Timer->HasFlags(tfActive)) {
if (TimerMatch == tmFull)
return true;
if (TimerMatch == tmPartial) {
const char *fileName = Timer->File();
if (fileName && *fileName == '@')
return true;
}
}
bool hasTimer = false;
for (int i = 0; i < globalTimers->Size() && !hasTimer; i++)
if (const cTimer *Timer = globalTimers->At(i))
if (Timer->Channel() && (Timer->Channel()->GetChannelID() == e->ChannelID()))
if (const cEvent *timerEvent = Timer->Event())
if (e->EventID() == timerEvent->EventID())
hasTimer = true;
return hasTimer;
}
/******************************************************************
* cVeDcProgressBar
******************************************************************/
cVeDcProgressBar::cVeDcProgressBar(void) {
currentLast = -1;
startTime = -1;
duration = -1;
}
cVeDcProgressBar::~cVeDcProgressBar(void) {
}
void cVeDcProgressBar::Close(void) {
currentLast = -1;
startTime = -1;
duration = -1;
tokenContainer->Clear();
cViewElement::Close();
}
void cVeDcProgressBar::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{start}", (int)eDCProgressBarST::start);
tokenContainer->DefineStringToken("{stop}", (int)eDCProgressBarST::stop);
tokenContainer->DefineIntToken("{duration}", (int)eDCProgressBarIT::duration);
tokenContainer->DefineIntToken("{elapsed}", (int)eDCProgressBarIT::elapsed);
tokenContainer->DefineIntToken("{remaining}", (int)eDCProgressBarIT::remaining);
tokenContainer->DefineIntToken("{permashift}", (int)eDCProgressBarIT::permashift);
tokenContainer->DefineIntToken("{livebuffer}", (int)eDCProgressBarIT::livebuffer);
tokenContainer->DefineIntToken("{currentremaining}", (int)eDCProgressBarIT::currentremaining);
InheritTokenContainer();
}
void cVeDcProgressBar::Set(const cEvent *p) {
if (!p) {
startTime = -1;
endTime = -1;
duration = -1;
return;
}
startTime = p->StartTime();
endTime = p-> EndTime();
duration = p->Duration();
int current = 0;
time_t t = time(NULL);
if (t > startTime)
current = t - startTime;
currentLast = current;
SetDirty();
tokenContainer->Clear();
tokenContainer->AddStringToken((int)eDCProgressBarST::start, *p->GetTimeString());
tokenContainer->AddStringToken((int)eDCProgressBarST::stop, *p->GetEndTimeString());
tokenContainer->AddIntToken((int)eDCProgressBarIT::duration, duration);
tokenContainer->AddIntToken((int)eDCProgressBarIT::elapsed, current);
tokenContainer->AddIntToken((int)eDCProgressBarIT::remaining, duration - current);
int liveBuffer = GetLiveBuffer();
if (liveBuffer >= 0) {
tokenContainer->AddIntToken((int)eDCProgressBarIT::permashift, 1);
tokenContainer->AddIntToken((int)eDCProgressBarIT::livebuffer, liveBuffer);
} else {
tokenContainer->AddIntToken((int)eDCProgressBarIT::permashift, 0);
}
tokenContainer->AddIntToken((int)eDCProgressBarIT::currentremaining, (int)round((endTime - t) / 60));
}
bool cVeDcProgressBar::Parse(bool force) {
if (!cViewElement::Parse(force))
return false;
int current = 0;
time_t t = time(NULL);
if (t > startTime)
current = t - startTime;
if (!(current > currentLast + 3) && !force && !Dirty())
return false;
currentLast = current;
SetDirty();
if (duration <= 0) {
tokenContainer->AddIntToken((int)eDCProgressBarIT::duration, 0);
tokenContainer->AddIntToken((int)eDCProgressBarIT::elapsed, 0);
tokenContainer->AddIntToken((int)eDCProgressBarIT::remaining, 0);
} else {
tokenContainer->AddIntToken((int)eDCProgressBarIT::duration, duration);
tokenContainer->AddIntToken((int)eDCProgressBarIT::elapsed, current);
tokenContainer->AddIntToken((int)eDCProgressBarIT::remaining, duration - current);
int liveBuffer = GetLiveBuffer();
if (liveBuffer >= 0) {
tokenContainer->AddIntToken((int)eDCProgressBarIT::permashift, 1);
tokenContainer->AddIntToken((int)eDCProgressBarIT::livebuffer, liveBuffer);
} else {
tokenContainer->AddIntToken((int)eDCProgressBarIT::permashift, 0);
}
tokenContainer->AddIntToken((int)eDCProgressBarIT::currentremaining, (int)round((endTime - t) / 60));
}
return true;
}
int cVeDcProgressBar::GetLiveBuffer(void) {
static cPlugin *pPermashift = cPluginManager::GetPlugin("permashift");
if (!pPermashift) {
return -1;
}
int buffer = 0;
if (pPermashift->Service("Permashift-GetUsedBufferSecs-v1", &buffer)) {
return buffer;
}
return -1;
}
/******************************************************************
* cVeDcStatusInfo
******************************************************************/
cVeDcStatusInfo::cVeDcStatusInfo(void) {
}
cVeDcStatusInfo::~cVeDcStatusInfo(void) {
}
void cVeDcStatusInfo::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineIntToken("{isRadio}", (int)eDCStatusInfoIT::isRadio);
tokenContainer->DefineIntToken("{hasVT}", (int)eDCStatusInfoIT::hasVT);
tokenContainer->DefineIntToken("{isStereo}", (int)eDCStatusInfoIT::isStereo);
tokenContainer->DefineIntToken("{isDolby}", (int)eDCStatusInfoIT::isDolby);
tokenContainer->DefineIntToken("{isEncrypted}", (int)eDCStatusInfoIT::isEncrypted);
tokenContainer->DefineIntToken("{isRecording}", (int)eDCStatusInfoIT::isRecording);
tokenContainer->DefineIntToken("{newmails}", (int)eDCStatusInfoIT::newmails);
InheritTokenContainer();
}
void cVeDcStatusInfo::Set(const cChannel *c) {
bool isRadio = !c->Vpid() && c->Apid(0);
bool hasVT = c->Vpid() && c->Tpid();
bool isStereo = c->Apid(0);
bool isDolby = c->Dpid(0);
bool isEncrypted = c->Ca();
bool isRecording = cRecordControls::Active();
for (int i = 0; i < globalTimers->Size() && !isRecording; i++) {
if (const cTimer *Timer = globalTimers->At(i)) {
if (Timer->Recording())
isRecording = true;
else if (cEpgTimer_Interface_V1* epgTimer = dynamic_cast<cEpgTimer_Interface_V1*>((cTimer*)Timer)) {
if (epgTimer->State() == 'R')
isRecording = true;
}
}
}
tokenContainer->AddIntToken((int)eDCStatusInfoIT::isRadio, isRadio);
tokenContainer->AddIntToken((int)eDCStatusInfoIT::hasVT, hasVT);
tokenContainer->AddIntToken((int)eDCStatusInfoIT::isStereo, isStereo);
tokenContainer->AddIntToken((int)eDCStatusInfoIT::isDolby, isDolby);
tokenContainer->AddIntToken((int)eDCStatusInfoIT::isEncrypted, isEncrypted);
tokenContainer->AddIntToken((int)eDCStatusInfoIT::isRecording, isRecording);
tokenContainer->AddIntToken((int)eDCStatusInfoIT::newmails, CheckMails());
SetDirty();
}
bool cVeDcStatusInfo::CheckMails(void) {
static cPlugin *pMailbox = cPluginManager::GetPlugin("mailbox");
if (!pMailbox) {
return false;
}
bool newMail = false;
if (pMailbox->Service("MailBox-HasNewMail-1.0", &newMail)) {
return newMail;
}
return false;
}
/******************************************************************
* cVeDcAudioInfo
******************************************************************/
cVeDcAudioInfo::cVeDcAudioInfo(void) {
lastNumAudioTracks = -1;
lastAudioChannel = -1;
lastTracDesc = NULL;
lastTrackLang = NULL;
}
cVeDcAudioInfo::~cVeDcAudioInfo(void) {
}
void cVeDcAudioInfo::Close(void) {
lastNumAudioTracks = -1;
lastAudioChannel = -1;
free(lastTracDesc);
lastTracDesc = NULL;
free(lastTrackLang);
lastTrackLang = NULL;
cViewElement::Close();
}
void cVeDcAudioInfo::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{trackdesc}", (int)eDCAudioInfoST::trackdesc);
tokenContainer->DefineStringToken("{tracklang}", (int)eDCAudioInfoST::tracklang);
tokenContainer->DefineIntToken("{numaudiotracks}", (int)eDCAudioInfoIT::numaudiotracks);
tokenContainer->DefineIntToken("{audiochannel}", (int)eDCAudioInfoIT::audiochannel);
InheritTokenContainer();
}
bool cVeDcAudioInfo::Parse(bool forced) {
if (!cViewElement::Parse(forced))
return false;
int numAudioTracks = 0;
int audioChannel = -1;
const char *trackDescription = "";
const char *trackLanguage = "";
cDevice *device = cDevice::PrimaryDevice();
if (device) {
numAudioTracks = device->NumAudioTracks();
audioChannel = device->GetAudioChannel();
if (numAudioTracks > 0) {
const tTrackId *track = device->GetTrack(device->GetCurrentAudioTrack());
if (track) {
trackDescription = track->description ? track->description : "";
trackLanguage = track->language ? track->language : "";
}
}
}
if ( !Dirty() && !forced && lastNumAudioTracks == numAudioTracks
&& lastAudioChannel == audioChannel
&& lastTracDesc && !strcmp(trackDescription, lastTracDesc)
&& lastTrackLang && !strcmp(trackLanguage, lastTrackLang)) {
return false;
}
lastNumAudioTracks = numAudioTracks;
lastAudioChannel = audioChannel;
free(lastTracDesc);
lastTracDesc = strdup(trackDescription);
free(lastTrackLang);
lastTrackLang = strdup(trackLanguage);
SetDirty();
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eDCAudioInfoIT::numaudiotracks, numAudioTracks);
tokenContainer->AddIntToken((int)eDCAudioInfoIT::audiochannel, audioChannel);
tokenContainer->AddStringToken((int)eDCAudioInfoST::trackdesc, trackDescription);
tokenContainer->AddStringToken((int)eDCAudioInfoST::tracklang, trackLanguage);
return true;
}
/******************************************************************
* cVeDcScreenResolution
******************************************************************/
cVeDcScreenResolution::cVeDcScreenResolution(void) {
lastScreenWidth = -1;
lastScreenHeight = -1;
lastAspect = -1.0f;
}
cVeDcScreenResolution::~cVeDcScreenResolution(void) {
}
void cVeDcScreenResolution::Close(void) {
lastScreenWidth = -1;
lastScreenHeight = -1;
lastAspect = -1.0f;
cViewElement::Close();
}
void cVeDcScreenResolution::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{resolution}", (int)eDCScreenResolutionST::resolution);
tokenContainer->DefineStringToken("{aspect}", (int)eDCScreenResolutionST::aspect);
tokenContainer->DefineIntToken("{screenwidth}", (int)eDCScreenResolutionIT::screenwidth);
tokenContainer->DefineIntToken("{screenheight}", (int)eDCScreenResolutionIT::screenheight);
tokenContainer->DefineIntToken("{isHD}", (int)eDCScreenResolutionIT::isHD);
tokenContainer->DefineIntToken("{isUHD}", (int)eDCScreenResolutionIT::isUHD);
tokenContainer->DefineIntToken("{isWideScreen}", (int)eDCScreenResolutionIT::isWideScreen);
InheritTokenContainer();
}
bool cVeDcScreenResolution::Parse(bool forced) {
if (!cViewElement::Parse(forced))
return false;
int screenWidth = 0;
int screenHeight = 0;
double aspect = 0;
cDevice::PrimaryDevice()->GetVideoSize(screenWidth, screenHeight, aspect);
if ((lastScreenWidth == screenWidth) && (lastScreenHeight == screenHeight) && (lastAspect == aspect))
return false;
if ((screenWidth == 0) && (screenHeight == 0))
return false;
lastScreenWidth = screenWidth;
lastScreenHeight = screenHeight;
lastAspect = aspect;
SetDirty();
bool isHD = false;
bool isUHD = false;
string resName = GetScreenResolutionString(screenWidth, screenHeight, &isHD, &isUHD);
bool isWideScreen = false;
string aspectName = GetScreenAspectString(aspect, &isWideScreen);
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eDCScreenResolutionIT::screenwidth, screenWidth);
tokenContainer->AddIntToken((int)eDCScreenResolutionIT::screenheight, screenHeight);
tokenContainer->AddIntToken((int)eDCScreenResolutionIT::isHD, isHD);
tokenContainer->AddIntToken((int)eDCScreenResolutionIT::isUHD, isUHD);
tokenContainer->AddIntToken((int)eDCScreenResolutionIT::isWideScreen, isWideScreen);
tokenContainer->AddStringToken((int)eDCScreenResolutionST::resolution, resName.c_str());
tokenContainer->AddStringToken((int)eDCScreenResolutionST::aspect, aspectName.c_str());
return true;
}
/******************************************************************
* cVeDcSignalQuality
******************************************************************/
cVeDcSignalQuality::cVeDcSignalQuality(void) {
lastSignalDisplay = -1;
lastSignalStrength = -1;
lastSignalQuality = -1;
}
cVeDcSignalQuality::~cVeDcSignalQuality(void) {
}
void cVeDcSignalQuality::Close(void) {
lastSignalDisplay = -1;
lastSignalStrength = -1;
lastSignalQuality = -1;
cViewElement::Close();
}
void cVeDcSignalQuality::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineIntToken("{signalstrength}", (int)eDCSignalQualityIT::signalstrength);
tokenContainer->DefineIntToken("{signalquality}", (int)eDCSignalQualityIT::signalquality);
InheritTokenContainer();
}
bool cVeDcSignalQuality::Parse(bool forced) {
if (!cViewElement::Parse(forced))
return false;
time_t now = time(NULL);
if (now == lastSignalDisplay)
return false;
lastSignalDisplay = now;
int signalStrength = cDevice::ActualDevice()->SignalStrength();
int signalQuality = cDevice::ActualDevice()->SignalQuality();
if (signalStrength < 0) signalStrength = 0;
if (signalQuality < 0) signalQuality = 0;
if (signalStrength == 0 && signalQuality==0)
return false;
if ((lastSignalStrength == signalStrength) && (lastSignalQuality == signalQuality))
return false;
SetDirty();
lastSignalStrength = signalStrength;
lastSignalQuality = signalQuality;
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eDCSignalQualityIT::signalstrength, signalStrength);
tokenContainer->AddIntToken((int)eDCSignalQualityIT::signalquality, signalQuality);
return true;
}
/******************************************************************
* cVeDcScraperContent
******************************************************************/
cVeDcScraperContent::cVeDcScraperContent(void) {
}
cVeDcScraperContent::~cVeDcScraperContent(void) {
}
void cVeDcScraperContent::Close(void) {
tokenContainer->Clear();
cViewElement::Close();
}
void cVeDcScraperContent::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{posterpath}", (int)eScraperPosterBannerST::posterpath);
tokenContainer->DefineStringToken("{bannerpath}", (int)eScraperPosterBannerST::bannerpath);
tokenContainer->DefineStringToken("{mediapath}", (int)eScraperPosterBannerST::mediapath);
tokenContainer->DefineIntToken("{posterwidth}", (int)eScraperPosterBannerIT::posterwidth);
tokenContainer->DefineIntToken("{posterheight}", (int)eScraperPosterBannerIT::posterheight);
tokenContainer->DefineIntToken("{hasposter}", (int)eScraperPosterBannerIT::hasposter);
tokenContainer->DefineIntToken("{bannerwidth}", (int)eScraperPosterBannerIT::bannerwidth);
tokenContainer->DefineIntToken("{bannerheight}", (int)eScraperPosterBannerIT::bannerheight);
tokenContainer->DefineIntToken("{hasbanner}", (int)eScraperPosterBannerIT::hasbanner);
tokenContainer->DefineIntToken("{mediawidth}", (int)eScraperPosterBannerIT::mediawidth);
tokenContainer->DefineIntToken("{mediaheight}", (int)eScraperPosterBannerIT::mediaheight);
tokenContainer->DefineIntToken("{isbanner}", (int)eScraperPosterBannerIT::isbanner);
InheritTokenContainer();
}
void cVeDcScraperContent::Set(const cEvent *e) {
tokenContainer->Clear();
if (e)
SetPosterBanner(tokenContainer, e, NULL);
SetDirty();
}
/******************************************************************
* cVeDcScreenResolution
******************************************************************/
cVeDcEcmInfo::cVeDcEcmInfo(void) {
channelSid = -1;
lastEcmInfo.hops = -1;
lastEcmInfo.ecmtime = -1;
lastEcmInfo.caid = -1;
lastEcmInfo.pid = -1;
lastEcmInfo.prid = -1;
}
cVeDcEcmInfo::~cVeDcEcmInfo(void) {
}
void cVeDcEcmInfo::Close(void) {
channelSid = -1;
lastEcmInfo.hops = -1;
lastEcmInfo.ecmtime = -1;
lastEcmInfo.caid = -1;
lastEcmInfo.pid = -1;
lastEcmInfo.prid = -1;
cViewElement::Close();
}
void cVeDcEcmInfo::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{cardsystem}", (int)eDCEcmInfoST::cardsystem);
tokenContainer->DefineStringToken("{reader}", (int)eDCEcmInfoST::reader);
tokenContainer->DefineStringToken("{from}", (int)eDCEcmInfoST::from);
tokenContainer->DefineStringToken("{protocol}", (int)eDCEcmInfoST::protocol);
tokenContainer->DefineIntToken("{caid}", (int)eDCEcmInfoIT::caid);
tokenContainer->DefineIntToken("{pid}", (int)eDCEcmInfoIT::pid);
tokenContainer->DefineIntToken("{prid}", (int)eDCEcmInfoIT::prid);
tokenContainer->DefineIntToken("{ecmtime}", (int)eDCEcmInfoIT::ecmtime);
tokenContainer->DefineIntToken("{hops}", (int)eDCEcmInfoIT::hops);
InheritTokenContainer();
}
void cVeDcEcmInfo::Set(const cChannel *c) {
channelSid = c->Sid();
}
bool cVeDcEcmInfo::Parse(bool forced) {
if (!cViewElement::Parse(forced))
return false;
static cPlugin *pDVBApi = cPluginManager::GetPlugin("dvbapi");
if (!pDVBApi)
return false;
if (channelSid < 0)
return false;
sDVBAPIEcmInfo ecmInfo;
ecmInfo.sid = channelSid;
if (!pDVBApi->Service("GetEcmInfo", &ecmInfo)) {
return false;
}
if (ecmInfo.hops < 0 || ecmInfo.ecmtime <= 0 || ecmInfo.ecmtime > 100000)
return false;
if (CompareECMInfos(&ecmInfo))
return false;
lastEcmInfo = ecmInfo;
SetDirty();
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eDCEcmInfoIT::caid, ecmInfo.caid);
tokenContainer->AddIntToken((int)eDCEcmInfoIT::pid, ecmInfo.pid);
tokenContainer->AddIntToken((int)eDCEcmInfoIT::prid, ecmInfo.prid);
tokenContainer->AddIntToken((int)eDCEcmInfoIT::ecmtime, ecmInfo.ecmtime);
tokenContainer->AddIntToken((int)eDCEcmInfoIT::hops, ecmInfo.hops);
tokenContainer->AddStringToken((int)eDCEcmInfoST::cardsystem, *ecmInfo.cardsystem);
tokenContainer->AddStringToken((int)eDCEcmInfoST::reader, *ecmInfo.reader);
tokenContainer->AddStringToken((int)eDCEcmInfoST::from, *ecmInfo.from);
tokenContainer->AddStringToken((int)eDCEcmInfoST::protocol, *ecmInfo.protocol);
return true;
}
bool cVeDcEcmInfo::CompareECMInfos(sDVBAPIEcmInfo *ecmInfo) {
if (ecmInfo->caid != lastEcmInfo.caid)
return false;
if (ecmInfo->pid != lastEcmInfo.pid)
return false;
if (ecmInfo->prid != lastEcmInfo.prid)
return false;
if (ecmInfo->ecmtime != lastEcmInfo.ecmtime)
return false;
if (ecmInfo->hops != lastEcmInfo.hops)
return false;
return true;
}
/******************************************************************
* cVeDcChannelHints
******************************************************************/
cVeDcChannelHints::cVeDcChannelHints(void) {
hints = NULL;
numHints = 0;
current = 0;
hintsIndex = -1;
active = false;
}
cVeDcChannelHints::~cVeDcChannelHints(void) {
delete[] hints;
}
void cVeDcChannelHints::Close(void) {
cViewElement::Close();
}
void cVeDcChannelHints::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineIntToken("{numhints}", (int)eDCChannelHintsIT::numhints);
tokenContainer->DefineLoopToken("{hints[channelnumber]}", (int)eDCChannelHintsLT::channelnumber);
tokenContainer->DefineLoopToken("{hints[channelname]}", (int)eDCChannelHintsLT::channelname);
tokenContainer->DefineLoopToken("{hints[channelid]}", (int)eDCChannelHintsLT::channelid);
tokenContainer->DefineLoopToken("{hints[channellogoexists]}", (int)eDCChannelHintsLT::channellogoexists);
hintsIndex = tokenContainer->LoopIndex("hints");
InheritTokenContainer();
}
void cVeDcChannelHints::SetNumHints(int num) {
delete[] hints;
numHints = num;
hints = new const cChannel*[num];
current = 0;
active = true;
SetDirty();
}
void cVeDcChannelHints::SetHint(const cChannel *c) {
hints[current++] = c;
}
bool cVeDcChannelHints::Parse(bool forced) {
if (!cViewElement::Parse(forced))
return false;
if (!Dirty())
return false;
if (!hints)
return false;
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eDCChannelHintsIT::numhints, numHints);
vector<int> loopInfo;
loopInfo.push_back(numHints);
tokenContainer->CreateLoopTokenContainer(&loopInfo);
for (int i=0; i < numHints; i++) {
if (hints[i]) {
tokenContainer->AddLoopToken(hintsIndex, i, (int)eDCChannelHintsLT::channelnumber, *cString::sprintf("%d", hints[i]->Number()));
tokenContainer->AddLoopToken(hintsIndex, i, (int)eDCChannelHintsLT::channelname, hints[i]->Name());
cString channelID = hints[i]->GetChannelID().ToString();
tokenContainer->AddLoopToken(hintsIndex, i, (int)eDCChannelHintsLT::channelid, *channelID);
bool logoExists = imgCache->LogoExists(*channelID);
tokenContainer->AddLoopToken(hintsIndex, i, (int)eDCChannelHintsLT::channellogoexists, *cString::sprintf("%d", logoExists ? 1 : 0));
}
}
return true;
}
/******************************************************************
* cVeDcChannelDetail
******************************************************************/
cVeDcChannelDetail::cVeDcChannelDetail(void) {
channel = NULL;
}
cVeDcChannelDetail::~cVeDcChannelDetail(void) {
channel = NULL;
}
void cVeDcChannelDetail::Close(void) {
channel = NULL;
cViewElement::Close();
}
void cVeDcChannelDetail::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{channelname}", (int)eDCChannelDetailST::channelname);
tokenContainer->DefineStringToken("{currenttitle}", (int)eDCChannelDetailST::currenttitle);
tokenContainer->DefineStringToken("{currentshorttext}", (int)eDCChannelDetailST::currentshorttext);
tokenContainer->DefineStringToken("{currentdescription}", (int)eDCChannelDetailST::currentdescription);
tokenContainer->DefineStringToken("{currentstart}", (int)eDCChannelDetailST::currentstart);
tokenContainer->DefineStringToken("{currentstop}", (int)eDCChannelDetailST::currentstop);
tokenContainer->DefineStringToken("{currentdurationminutes}", (int)eDCChannelDetailST::currentdurationminutes);
tokenContainer->DefineStringToken("{nexttitle}", (int)eDCChannelDetailST::nexttitle);
tokenContainer->DefineStringToken("{nextshorttext}", (int)eDCChannelDetailST::nextshorttext);
tokenContainer->DefineStringToken("{nextdescription}", (int)eDCChannelDetailST::nextdescription);
tokenContainer->DefineStringToken("{nextstart}", (int)eDCChannelDetailST::nextstart);
tokenContainer->DefineStringToken("{nextstop}", (int)eDCChannelDetailST::nextstop);
tokenContainer->DefineStringToken("{nextdurationminutes}", (int)eDCChannelDetailST::nextdurationminutes);
tokenContainer->DefineIntToken("{channelnumber}", (int)eDCChannelDetailIT::channelnumber);
tokenContainer->DefineIntToken("{currentduration}", (int)eDCChannelDetailIT::currentduration);
tokenContainer->DefineIntToken("{currentdurationhours}", (int)eDCChannelDetailIT::currentdurationhours);
tokenContainer->DefineIntToken("{currentelapsed}", (int)eDCChannelDetailIT::currentelapsed);
tokenContainer->DefineIntToken("{currentremaining}", (int)eDCChannelDetailIT::currentremaining);
tokenContainer->DefineIntToken("{nextduration}", (int)eDCChannelDetailIT::nextduration);
tokenContainer->DefineIntToken("{nextdurationhours}", (int)eDCChannelDetailIT::nextdurationhours);
tokenContainer->DefineStringToken("{movietitle}", (int)eScraperST::movietitle);
tokenContainer->DefineStringToken("{movieoriginalTitle}", (int)eScraperST::movieoriginalTitle);
tokenContainer->DefineStringToken("{movietagline}", (int)eScraperST::movietagline);
tokenContainer->DefineStringToken("{movieoverview}", (int)eScraperST::movieoverview);
tokenContainer->DefineStringToken("{moviegenres}", (int)eScraperST::moviegenres);
tokenContainer->DefineStringToken("{moviehomepage}", (int)eScraperST::moviehomepage);
tokenContainer->DefineStringToken("{moviereleasedate}", (int)eScraperST::moviereleasedate);
tokenContainer->DefineStringToken("{moviepopularity}", (int)eScraperST::moviepopularity);
tokenContainer->DefineStringToken("{movievoteaverage}", (int)eScraperST::movievoteaverage);
tokenContainer->DefineStringToken("{posterpath}", (int)eScraperST::posterpath);
tokenContainer->DefineStringToken("{fanartpath}", (int)eScraperST::fanartpath);
tokenContainer->DefineStringToken("{moviecollectionName}", (int)eScraperST::moviecollectionName);
tokenContainer->DefineStringToken("{collectionposterpath}", (int)eScraperST::collectionposterpath);
tokenContainer->DefineStringToken("{collectionfanartpath}", (int)eScraperST::collectionfanartpath);
tokenContainer->DefineStringToken("{seriesname}", (int)eScraperST::seriesname);
tokenContainer->DefineStringToken("{seriesoverview}", (int)eScraperST::seriesoverview);
tokenContainer->DefineStringToken("{seriesfirstaired}", (int)eScraperST::seriesfirstaired);
tokenContainer->DefineStringToken("{seriesnetwork}", (int)eScraperST::seriesnetwork);
tokenContainer->DefineStringToken("{seriesgenre}", (int)eScraperST::seriesgenre);
tokenContainer->DefineStringToken("{seriesrating}", (int)eScraperST::seriesrating);
tokenContainer->DefineStringToken("{seriesstatus}", (int)eScraperST::seriesstatus);
tokenContainer->DefineStringToken("{episodetitle}", (int)eScraperST::episodetitle);
tokenContainer->DefineStringToken("{episodefirstaired}", (int)eScraperST::episodefirstaired);
tokenContainer->DefineStringToken("{episodegueststars}", (int)eScraperST::episodegueststars);
tokenContainer->DefineStringToken("{episodeoverview}", (int)eScraperST::episodeoverview);
tokenContainer->DefineStringToken("{episoderating}", (int)eScraperST::episoderating);
tokenContainer->DefineStringToken("{episodeimagepath}", (int)eScraperST::episodeimagepath);
tokenContainer->DefineStringToken("{seasonposterpath}", (int)eScraperST::seasonposterpath);
tokenContainer->DefineStringToken("{seriesposter1path}", (int)eScraperST::seriesposter1path);
tokenContainer->DefineStringToken("{seriesposter2path}", (int)eScraperST::seriesposter2path);
tokenContainer->DefineStringToken("{seriesposter3path}", (int)eScraperST::seriesposter3path);
tokenContainer->DefineStringToken("{seriesfanart1path}", (int)eScraperST::seriesfanart1path);
tokenContainer->DefineStringToken("{seriesfanart2path}", (int)eScraperST::seriesfanart2path);
tokenContainer->DefineStringToken("{seriesfanart3path}", (int)eScraperST::seriesfanart3path);
tokenContainer->DefineStringToken("{seriesbanner1path}", (int)eScraperST::seriesbanner1path);
tokenContainer->DefineStringToken("{seriesbanner2path}", (int)eScraperST::seriesbanner2path);
tokenContainer->DefineStringToken("{seriesbanner3path}", (int)eScraperST::seriesbanner3path);
tokenContainer->DefineIntToken("{ismovie}", (int)eScraperIT::ismovie);
tokenContainer->DefineIntToken("{moviebudget}", (int)eScraperIT::moviebudget);
tokenContainer->DefineIntToken("{movierevenue}", (int)eScraperIT::movierevenue);
tokenContainer->DefineIntToken("{movieadult}", (int)eScraperIT::movieadult);
tokenContainer->DefineIntToken("{movieruntime}", (int)eScraperIT::movieruntime);
tokenContainer->DefineIntToken("{isseries}", (int)eScraperIT::isseries);
tokenContainer->DefineIntToken("{posterwidth}", (int)eScraperIT::posterwidth);
tokenContainer->DefineIntToken("{posterheight}", (int)eScraperIT::posterheight);
tokenContainer->DefineIntToken("{fanartwidth}", (int)eScraperIT::fanartwidth);
tokenContainer->DefineIntToken("{fanartheight}", (int)eScraperIT::fanartheight);
tokenContainer->DefineIntToken("{movieiscollection}", (int)eScraperIT::movieiscollection);
tokenContainer->DefineIntToken("{collectionposterwidth}", (int)eScraperIT::collectionposterwidth);
tokenContainer->DefineIntToken("{collectionposterheight}", (int)eScraperIT::collectionposterheight);
tokenContainer->DefineIntToken("{collectionfanartwidth}", (int)eScraperIT::collectionfanartwidth);
tokenContainer->DefineIntToken("{collectionfanartheight}", (int)eScraperIT::collectionfanartheight);
tokenContainer->DefineIntToken("{epgpicavailable}", (int)eScraperIT::epgpicavailable);
tokenContainer->DefineIntToken("{episodenumber}", (int)eScraperIT::episodenumber);
tokenContainer->DefineIntToken("{episodeseason}", (int)eScraperIT::episodeseason);
tokenContainer->DefineIntToken("{episodeimagewidth}", (int)eScraperIT::episodeimagewidth);
tokenContainer->DefineIntToken("{episodeimageheight}", (int)eScraperIT::episodeimageheight);
tokenContainer->DefineIntToken("{seasonposterwidth}", (int)eScraperIT::seasonposterwidth);
tokenContainer->DefineIntToken("{seasonposterheight}", (int)eScraperIT::seasonposterheight);
tokenContainer->DefineIntToken("{seriesposter1width}", (int)eScraperIT::seriesposter1width);
tokenContainer->DefineIntToken("{seriesposter1height}", (int)eScraperIT::seriesposter1height);
tokenContainer->DefineIntToken("{seriesposter2width}", (int)eScraperIT::seriesposter2width);
tokenContainer->DefineIntToken("{seriesposter2height}", (int)eScraperIT::seriesposter2height);
tokenContainer->DefineIntToken("{seriesposter3width}", (int)eScraperIT::seriesposter3width);
tokenContainer->DefineIntToken("{seriesposter3height}", (int)eScraperIT::seriesposter3height);
tokenContainer->DefineIntToken("{seriesfanart1width}", (int)eScraperIT::seriesfanart1width);
tokenContainer->DefineIntToken("{seriesfanart1height}", (int)eScraperIT::seriesfanart1height);
tokenContainer->DefineIntToken("{seriesfanart2width}", (int)eScraperIT::seriesfanart2width);
tokenContainer->DefineIntToken("{seriesfanart2height}", (int)eScraperIT::seriesfanart2height);
tokenContainer->DefineIntToken("{seriesfanart3width}", (int)eScraperIT::seriesfanart3width);
tokenContainer->DefineIntToken("{seriesfanart3height}", (int)eScraperIT::seriesfanart3height);
tokenContainer->DefineIntToken("{seriesbanner1width}", (int)eScraperIT::seriesbanner1width);
tokenContainer->DefineIntToken("{seriesbanner1height}", (int)eScraperIT::seriesbanner1height);
tokenContainer->DefineIntToken("{seriesbanner2width}", (int)eScraperIT::seriesbanner2width);
tokenContainer->DefineIntToken("{seriesbanner2height}", (int)eScraperIT::seriesbanner2height);
tokenContainer->DefineIntToken("{seriesbanner3width}", (int)eScraperIT::seriesbanner3width);
tokenContainer->DefineIntToken("{seriesbanner3height}", (int)eScraperIT::seriesbanner3height);
tokenContainer->DefineLoopToken("{actors[name]}", (int)eScraperLT::name);
tokenContainer->DefineLoopToken("{actors[role]}", (int)eScraperLT::role);
tokenContainer->DefineLoopToken("{actors[thumb]}", (int)eScraperLT::thumb);
tokenContainer->DefineLoopToken("{actors[thumbwidth]}", (int)eScraperLT::thumbwidth);
tokenContainer->DefineLoopToken("{actors[thumbheight]}", (int)eScraperLT::thumbheight);
actorsIndex = tokenContainer->LoopIndex("actors");
InheritTokenContainer();
}
void cVeDcChannelDetail::Set(const cChannel *c) {
channel = c;
}
bool cVeDcChannelDetail::Parse(bool forced) {
if (!cViewElement::Parse(forced))
return false;
if (!channel)
return false;
SetDirty();
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eDCChannelDetailIT::channelnumber, channel->Number());
tokenContainer->AddStringToken((int)eDCChannelDetailST::channelname, channel->Name());
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_SCHEDULES_READ;
const cSchedules* schedules = Schedules;
#else
cSchedulesLock schedulesLock;
const cSchedules* schedules = (cSchedules*)cSchedules::Schedules(schedulesLock);
#endif
const cSchedule *schedule = schedules->GetSchedule(channel);
if (schedule) {
const cEvent *presentEvent = schedule->GetPresentEvent();
if (presentEvent) {
tokenContainer->AddStringToken((int)eDCChannelDetailST::currenttitle, presentEvent->Title());
tokenContainer->AddStringToken((int)eDCChannelDetailST::currentshorttext, presentEvent->ShortText());
tokenContainer->AddStringToken((int)eDCChannelDetailST::currentdescription, presentEvent->Description());
tokenContainer->AddStringToken((int)eDCChannelDetailST::currentstart, *presentEvent->GetTimeString());
tokenContainer->AddStringToken((int)eDCChannelDetailST::currentstop, *presentEvent->GetEndTimeString());
tokenContainer->AddIntToken((int)eDCChannelDetailIT::currentduration, presentEvent->Duration()/60);
tokenContainer->AddIntToken((int)eDCChannelDetailIT::currentelapsed, (time(0) - presentEvent->StartTime())/60);
tokenContainer->AddIntToken((int)eDCChannelDetailIT::currentremaining, presentEvent->Duration()/60 - (time(0) - presentEvent->StartTime())/60);
tokenContainer->AddIntToken((int)eDCChannelDetailIT::currentdurationhours, presentEvent->Duration() / 3600);
tokenContainer->AddStringToken((int)eDCChannelDetailST::currentdurationminutes, *cString::sprintf("%.2d", (presentEvent->Duration() / 60)%60));
vector<int> loopInfo;
bool scrapInfoAvailable = LoadFullScrapInfo(presentEvent, NULL);
int numActors = NumActors();
loopInfo.push_back(numActors);
tokenContainer->CreateLoopTokenContainer(&loopInfo);
if (scrapInfoAvailable) {
SetFullScrapInfo(tokenContainer, actorsIndex);
}
}
const cList<cEvent> *events = schedule->Events();
if (events && presentEvent) {
const cEvent *nextEvent = events->Next(presentEvent);
if (nextEvent) {
tokenContainer->AddStringToken((int)eDCChannelDetailST::nexttitle, nextEvent->Title());
tokenContainer->AddStringToken((int)eDCChannelDetailST::nextshorttext, nextEvent->ShortText());
tokenContainer->AddStringToken((int)eDCChannelDetailST::nextdescription, nextEvent->Description());
tokenContainer->AddStringToken((int)eDCChannelDetailST::nextstart, *nextEvent->GetTimeString());
tokenContainer->AddStringToken((int)eDCChannelDetailST::nextstop, *nextEvent->GetEndTimeString());
tokenContainer->AddIntToken((int)eDCChannelDetailIT::nextduration, nextEvent->Duration() / 60);
tokenContainer->AddIntToken((int)eDCChannelDetailIT::nextdurationhours, nextEvent->Duration() / 3600);
tokenContainer->AddStringToken((int)eDCChannelDetailST::nextdurationminutes, *cString::sprintf("%.2d", (nextEvent->Duration() / 60)%60));
}
}
}
return true;
}

View File

@ -1,206 +0,0 @@
#ifndef __VIEWELEMENTSDC_H
#define __VIEWELEMENTSDC_H
#include "viewelement.h"
#include "../extensions/scrapmanager.h"
#include "../extensions/globaltimers.h"
#include "../services/dvbapi.h"
/******************************************************************
* cVeDcChannelInfo
******************************************************************/
class cVeDcChannelInfo : public cViewElement {
private:
public:
cVeDcChannelInfo(void);
virtual ~cVeDcChannelInfo(void);
void SetTokenContainer(void);
void Set(const cChannel *c, int number);
};
/******************************************************************
* cVeDcChannelGroup
******************************************************************/
class cVeDcChannelGroup : public cViewElement {
private:
const char *GetChannelSep(const cChannel *c, bool prev);
public:
cVeDcChannelGroup(void);
virtual ~cVeDcChannelGroup(void);
void SetTokenContainer(void);
void Set(const cChannel *c);
};
/******************************************************************
* cVeDcEpgInfo
******************************************************************/
class cVeDcEpgInfo : public cViewElement {
private:
const cEvent *current;
const cEvent *next;
cGlobalTimers *globalTimers;
bool EventHasTimer(const cEvent *e);
public:
cVeDcEpgInfo(void);
virtual ~cVeDcEpgInfo(void);
void SetGlobalTimers(cGlobalTimers *globalTimers) { this->globalTimers = globalTimers; };
void SetTokenContainer(void);
void Set(const cEvent *p, const cEvent *f) { this->current = p; this->next = f; };
void Close(void);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDcProgressBar
******************************************************************/
class cVeDcProgressBar : public cViewElement {
private:
int currentLast;
int startTime;
int endTime;
int duration;
int GetLiveBuffer(void);
public:
cVeDcProgressBar(void);
virtual ~cVeDcProgressBar(void);
void Close(void);
void SetTokenContainer(void);
void Set(const cEvent *p);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDcStatusInfo
******************************************************************/
class cVeDcStatusInfo : public cViewElement {
private:
cGlobalTimers *globalTimers;
bool CheckMails(void);
public:
cVeDcStatusInfo(void);
virtual ~cVeDcStatusInfo(void);
void SetGlobalTimers(cGlobalTimers *globalTimers) { this->globalTimers = globalTimers; };
void SetTokenContainer(void);
void Set(const cChannel *c);
};
/******************************************************************
* cVeDcAudioInfo
******************************************************************/
class cVeDcAudioInfo : public cViewElement {
private:
int lastNumAudioTracks;
int lastAudioChannel;
char *lastTracDesc;
char *lastTrackLang;
public:
cVeDcAudioInfo(void);
virtual ~cVeDcAudioInfo(void);
void Close(void);
void SetTokenContainer(void);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDcScreenResolution
******************************************************************/
class cVeDcScreenResolution : public cViewElement {
private:
int lastScreenWidth;
int lastScreenHeight;
double lastAspect;
public:
cVeDcScreenResolution(void);
virtual ~cVeDcScreenResolution(void);
void Close(void);
void SetTokenContainer(void);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDcSignalQuality
******************************************************************/
class cVeDcSignalQuality : public cViewElement {
private:
int lastSignalDisplay;
int lastSignalStrength;
int lastSignalQuality;
public:
cVeDcSignalQuality(void);
virtual ~cVeDcSignalQuality(void);
void Close(void);
void SetTokenContainer(void);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDcScraperContent
******************************************************************/
class cVeDcScraperContent : public cViewElement, public cScrapManager {
private:
public:
cVeDcScraperContent(void);
virtual ~cVeDcScraperContent(void);
void Close(void);
void SetTokenContainer(void);
void Set(const cEvent *e);
};
/******************************************************************
* cVeDcEcmInfo
******************************************************************/
class cVeDcEcmInfo : public cViewElement {
private:
int channelSid;
sDVBAPIEcmInfo lastEcmInfo;
bool CompareECMInfos(sDVBAPIEcmInfo *ecmInfo);
public:
cVeDcEcmInfo(void);
virtual ~cVeDcEcmInfo(void);
void Close(void);
void SetTokenContainer(void);
void Set(const cChannel *c);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDcChannelHints
******************************************************************/
class cVeDcChannelHints : public cViewElement {
private:
const cChannel **hints;
int numHints;
int current;
int hintsIndex;
bool active;
public:
cVeDcChannelHints(void);
virtual ~cVeDcChannelHints(void);
void Close(void);
void SetTokenContainer(void);
void SetNumHints(int num);
void SetHint(const cChannel *c);
bool Parse(bool forced = false);
bool Active(void) { return active; };
};
/******************************************************************
* cVeDcChannelDetail
******************************************************************/
class cVeDcChannelDetail : public cViewElement, public cScrapManager {
private:
const cChannel *channel;
int actorsIndex;
public:
cVeDcChannelDetail(void);
virtual ~cVeDcChannelDetail(void);
void Close(void);
void SetTokenContainer(void);
void Set(const cChannel *c);
bool Parse(bool forced = false);
};
class cVeDcChannelListDetail : public cVeDcChannelDetail {
public:
cVeDcChannelListDetail(void) {};
virtual ~cVeDcChannelListDetail(void) {};
};
class cVeDcGroupChannelListDetail : public cVeDcChannelDetail {
public:
cVeDcGroupChannelListDetail(void) {};
virtual ~cVeDcGroupChannelListDetail(void) {};
};
#endif //__VIEWELEMENTSDC_H

File diff suppressed because it is too large Load Diff

View File

@ -1,268 +0,0 @@
#ifndef __VIEWELEMENTSDM_H
#define __VIEWELEMENTSDM_H
#include "viewelement.h"
#include "../extensions/scrapmanager.h"
/******************************************************************
* cVeDmHeader
******************************************************************/
class cVeDmHeader : public cViewElement {
private:
bool changed;
char *title;
char *channelName;
int channelNumber;
char *channelId;
bool epgSearchFav;
public:
cVeDmHeader(void);
virtual ~cVeDmHeader(void);
void SetTokenContainer(void);
void SetTitle(const char *title);
void SetChannel(const cChannel *channel);
void ClearChannel(void);
void Set(eMenuCategory menuCat);
void IsEpgSearchFav(bool isFav) { epgSearchFav = isFav;} ;
};
/******************************************************************
* cVeDmSortmode
******************************************************************/
class cVeDmSortmode : public cViewElement {
private:
eMenuSortMode sortMode;
eMenuSortMode lastSortMode;
public:
cVeDmSortmode(void);
virtual ~cVeDmSortmode(void);
void Reset(void) { lastSortMode = msmUnknown; }
void SetTokenContainer(void);
void Set(eMenuSortMode sortMode);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDmColorbuttons
******************************************************************/
class cVeDmColorbuttons : public cViewElement {
private:
bool changed;
char *red;
char *green;
char *yellow;
char *blue;
public:
cVeDmColorbuttons(void);
virtual ~cVeDmColorbuttons(void);
void SetTokenContainer(void);
void SetButtons(const char *red, const char *green, const char *yellow, const char *blue);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDmScrollbar
******************************************************************/
class cVeDmScrollbar : public cViewElement {
private:
public:
cVeDmScrollbar(void);
virtual ~cVeDmScrollbar(void);
void SetTokenContainer(void);
void SetList(int numDisplayed, int offset, int numMax);
void SetDetail(int height, int offset, bool end);
};
/******************************************************************
* cVeDmTimers
******************************************************************/
class cVeDmTimers : public cViewElement {
private:
int timerIndex;
public:
cVeDmTimers(void);
virtual ~cVeDmTimers(void);
void SetTokenContainer(void);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDmCurrentschedule
******************************************************************/
class cVeDmCurrentschedule : public cViewElement, public cScrapManager {
private:
const char *rec;
void ParseFromChannel(const cChannel *channel);
void ParseFromRecording(const cRecording *recording);
void RecName(string &path, string &name, string &folder);
public:
cVeDmCurrentschedule(void);
virtual ~cVeDmCurrentschedule(void);
void SetTokenContainer(void);
void SetRecording(const char *currentRec);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDmDiscusage
******************************************************************/
class cVeDmDiscusage : public cViewElement {
private:
public:
cVeDmDiscusage(void);
virtual ~cVeDmDiscusage(void);
void SetTokenContainer(void);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDmSystemload
******************************************************************/
class cVeDmSystemload : public cViewElement {
private:
double lastSystemLoad;
public:
cVeDmSystemload(void);
virtual ~cVeDmSystemload(void);
void Close(void);
void Reset(void) { lastSystemLoad = -1.0f; }
void SetTokenContainer(void);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDmSystemmemory
******************************************************************/
class cVeDmSystemmemory : public cViewElement {
private:
int lastMemUsage;
public:
cVeDmSystemmemory(void);
virtual ~cVeDmSystemmemory(void);
void Close(void);
void Reset(void) { lastMemUsage = -1; }
void SetTokenContainer(void);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDmTemperatures
******************************************************************/
class cVeDmTemperatures : public cViewElement {
private:
int lastCpuTemp;
int lastGpuTemp;
public:
cVeDmTemperatures(void);
virtual ~cVeDmTemperatures(void);
void Close(void);
void Reset(void) { lastCpuTemp = -1; lastGpuTemp = -1; }
void SetTokenContainer(void);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDmVdrstatistics
******************************************************************/
class cVeDmVdrstatistics : public cViewElement {
private:
string lastVdrCPU;
string lastVdrMEM;
public:
cVeDmVdrstatistics(void);
virtual ~cVeDmVdrstatistics(void);
void Close(void);
void Reset(void) { lastVdrCPU = "undefined"; lastVdrMEM = "undefined"; }
void SetTokenContainer(void);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDmVdrstatus
******************************************************************/
class cVeDmVdrstatus : public cViewElement {
public:
cVeDmVdrstatus(void);
virtual ~cVeDmVdrstatus(void);
void Close(void);
void SetTokenContainer(void);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDmLastrecordings
******************************************************************/
class cVeDmLastrecordings : public cViewElement, public cScrapManager {
private:
int recIndex;
void RecName(string &path, string &name);
public:
cVeDmLastrecordings(void);
virtual ~cVeDmLastrecordings(void);
void SetTokenContainer(void);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDmDetailheaderEpg
******************************************************************/
class cVeDmDetailheaderEpg : public cViewElement, public cScrapManager {
private:
const cEvent *event;
public:
cVeDmDetailheaderEpg(void);
virtual ~cVeDmDetailheaderEpg(void);
void SetTokenContainer(void);
void SetEvent(const cEvent *event);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDmDetailheaderRec
******************************************************************/
class cVeDmDetailheaderRec : public cViewElement, public cScrapManager {
private:
const cRecording *recording;
public:
cVeDmDetailheaderRec(void);
virtual ~cVeDmDetailheaderRec(void);
void SetTokenContainer(void);
void SetRecording(const cRecording *rec);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDmDetailheaderPlugin
******************************************************************/
class cVeDmDetailheaderPlugin : public cViewElement {
private:
int plugId;
int plugMenuId;
public:
cVeDmDetailheaderPlugin(void);
virtual ~cVeDmDetailheaderPlugin(void);
void SetPlugId(int id) { plugId = id; };
void SetPlugMenuId(int id) { plugMenuId = id; };
void SetTokenContainer(void);
void Set(skindesignerapi::cTokenContainer *tk);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDmTablabels
******************************************************************/
class cVeDmTablabels : public cViewElement {
private:
int tabIndex;
int activeTab;
vector<const char*> tabs;
public:
cVeDmTablabels(void);
virtual ~cVeDmTablabels(void);
void SetTokenContainer(void);
void SetTabs(vector<const char*> &newTabs);
void SetActiveTab(int activeTab) { SetDirty(); this->activeTab = activeTab; };
bool Parse(bool forced = false);
};
#endif //__VIEWELEMENTSDM_H

View File

@ -1,919 +0,0 @@
#include "viewelementsdisplayreplay.h"
#include "../config.h"
#include "../extensions/helpers.h"
#include "../services/scraper2vdr.h"
/******************************************************************
* cVeDrRecTitle
******************************************************************/
cVeDrRecTitle::cVeDrRecTitle(void) {
recording = NULL;
event = NULL;
title = NULL;
timeShiftActive = NoRec;
}
cVeDrRecTitle::~cVeDrRecTitle(void) {
free(title);
}
void cVeDrRecTitle::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{rectitle}", (int)eDRRecTitleST::rectitle);
tokenContainer->DefineStringToken("{recsubtitle}", (int)eDRRecTitleST::recsubtitle);
tokenContainer->DefineStringToken("{recdate}", (int)eDRRecTitleST::recdate);
tokenContainer->DefineStringToken("{rectime}", (int)eDRRecTitleST::rectime);
tokenContainer->DefineStringToken("{eventstart}", (int)eDRRecTitleST::eventstart);
tokenContainer->DefineStringToken("{eventstop}", (int)eDRRecTitleST::eventstop);
tokenContainer->DefineIntToken("{timeshift}", (int)eDRRecTitleIT::timeshift);
InheritTokenContainer();
}
void cVeDrRecTitle::Set(const cRecording *recording, const cEvent *event, eRecType_t timeShiftActive) {
this->timeShiftActive = timeShiftActive;
if (this->title) {
free(this->title);
this->title = NULL;
}
if (this->recording)
this->recording = NULL;
if (this->event)
this->event = NULL;
if (!recording)
return;
this->recording = recording;
if (event)
this->event = event;
}
void cVeDrRecTitle::Set(const char *title) {
if (this->title) {
free(this->title);
this->title = NULL;
}
if (this->recording)
this->recording = NULL;
if (this->event)
this->event = NULL;
if (!title)
return;
free(this->title);
this->title = strdup(title);
}
bool cVeDrRecTitle::Parse(bool force) {
if (!cViewElement::Parse(force))
return false;
if (!recording && !title)
return false;
tokenContainer->Clear();
if (recording) {
const char *recName = NULL;
const char *recShortText = NULL;
const cRecordingInfo *recInfo = recording->Info();
if (event) {
recName = event->Title();
recShortText = event->ShortText();
} else if (recInfo) {
recName = recInfo->Title();
recShortText = recInfo->ShortText();
}
if (!recName) {
recName = recording->Name();
recShortText = "";
}
tokenContainer->AddStringToken((int)eDRRecTitleST::rectitle, recName);
tokenContainer->AddStringToken((int)eDRRecTitleST::recsubtitle, recShortText);
tokenContainer->AddStringToken((int)eDRRecTitleST::recdate, *ShortDateString(recording->Start()));
tokenContainer->AddStringToken((int)eDRRecTitleST::rectime, *TimeString(recording->Start()));
tokenContainer->AddIntToken((int)eDRRecTitleIT::timeshift, timeShiftActive);
if (event) {
tokenContainer->AddStringToken((int)eDRRecTitleST::eventstart, *TimeString(event->StartTime()));
tokenContainer->AddStringToken((int)eDRRecTitleST::eventstop, *TimeString(event->EndTime()));
}
} else if (title) {
tokenContainer->AddStringToken((int)eDRRecTitleST::rectitle, title);
}
SetDirty();
return true;
}
/******************************************************************
* cVeDrRecInfo
******************************************************************/
cVeDrRecInfo::cVeDrRecInfo(void) {
recording = NULL;
}
cVeDrRecInfo::~cVeDrRecInfo(void) {
}
void cVeDrRecInfo::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{resolution}", (int)eDRRecInfoST::resolution);
tokenContainer->DefineStringToken("{aspect}", (int)eDRRecInfoST::aspect);
tokenContainer->DefineIntToken("{screenwidth}", (int)eDRRecInfoIT::screenwidth);
tokenContainer->DefineIntToken("{screenheight}", (int)eDRRecInfoIT::screenheight);
tokenContainer->DefineIntToken("{isHD}", (int)eDRRecInfoIT::isHD);
tokenContainer->DefineIntToken("{isUHD}", (int)eDRRecInfoIT::isUHD);
tokenContainer->DefineIntToken("{isRecording}", (int)eDRRecInfoIT::isRecording);
tokenContainer->DefineIntToken("{isInUse}", (int)eDRRecInfoIT::isInUse);
tokenContainer->DefineIntToken("{isWideScreen}", (int)eDRRecInfoIT::isWideScreen);
InheritTokenContainer();
}
void cVeDrRecInfo::Set(const cRecording *recording) {
this->recording = recording;
}
bool cVeDrRecInfo::Parse(bool force) {
if (!cViewElement::Parse(force))
return false;
if (!recording)
return false;
int screenWidth = 0;
int screenHeight = 0;
double aspect = 0;
cDevice::PrimaryDevice()->GetVideoSize(screenWidth, screenHeight, aspect);
bool isHD = false;
bool isUHD = false;
string resName = GetScreenResolutionString(screenWidth, screenHeight, &isHD, &isUHD);
bool isWideScreen = false;
string aspectName = GetScreenAspectString(aspect, &isWideScreen);
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eDRRecInfoIT::screenwidth, screenWidth);
tokenContainer->AddIntToken((int)eDRRecInfoIT::screenheight, screenHeight);
tokenContainer->AddIntToken((int)eDRRecInfoIT::isHD, isHD);
tokenContainer->AddIntToken((int)eDRRecInfoIT::isUHD, isUHD);
tokenContainer->AddIntToken((int)eDRRecInfoIT::isRecording, recording->IsInUse() & ruTimer);
tokenContainer->AddIntToken((int)eDRRecInfoIT::isInUse, recording->IsInUse());
tokenContainer->AddIntToken((int)eDRRecInfoIT::isWideScreen, isWideScreen);
tokenContainer->AddStringToken((int)eDRRecInfoST::resolution, resName.c_str());
tokenContainer->AddStringToken((int)eDRRecInfoST::aspect, aspectName.c_str());
SetDirty();
return true;
}
/******************************************************************
* cVeDrCurrentTime
******************************************************************/
cVeDrCurrentTime::cVeDrCurrentTime(void) {
changed = true;
current = NULL;
timeShiftActive = NoRec;
}
cVeDrCurrentTime::~cVeDrCurrentTime(void) {
free(current);
}
void cVeDrCurrentTime::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{reccurrent}", (int)eDRCurrentTimeST::reccurrent);
tokenContainer->DefineIntToken("{timeshift}", (int)eDRCurrentTimeIT::timeshift);
InheritTokenContainer();
}
void cVeDrCurrentTime::Set(const char *current, eRecType_t timeShiftActive) {
if (!current)
return;
free(this->current);
this->current = strdup(current);
this->timeShiftActive = timeShiftActive;
changed = true;
}
bool cVeDrCurrentTime::Parse(bool force) {
if (!cViewElement::Parse(force) || !changed)
return false;
tokenContainer->Clear();
tokenContainer->AddStringToken((int)eDRCurrentTimeST::reccurrent, current);
tokenContainer->AddIntToken((int)eDRCurrentTimeIT::timeshift, timeShiftActive);
SetDirty();
changed = false;
return true;
}
/******************************************************************
* cVeDrTotalTime
******************************************************************/
cVeDrTotalTime::cVeDrTotalTime(void) {
changed = true;
total = NULL;
timeshiftDuration = NULL;
timeShiftActive = NoRec;
}
cVeDrTotalTime::~cVeDrTotalTime(void) {
free(total);
free(timeshiftDuration);
}
void cVeDrTotalTime::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{rectotal}", (int)eDRTotalTimeST::rectotal);
tokenContainer->DefineStringToken("{timeshifttotal}", (int)eDRTotalTimeST::timeshifttotal);
tokenContainer->DefineIntToken("{timeshift}", (int)eDRTotalTimeIT::timeshift);
InheritTokenContainer();
}
void cVeDrTotalTime::Set(const char *total, const char *timeshiftDuration, eRecType_t timeShiftActive) {
if (!total)
return;
free(this->total);
this->total = strdup(total);
this->timeShiftActive = timeShiftActive;
free(this->timeshiftDuration);
this->timeshiftDuration = NULL;
if (timeshiftDuration)
this->timeshiftDuration = strdup(timeshiftDuration);
changed = true;
}
bool cVeDrTotalTime::Parse(bool force) {
if (!cViewElement::Parse(force) || !changed)
return false;
tokenContainer->Clear();
tokenContainer->AddStringToken((int)eDRTotalTimeST::rectotal, total);
tokenContainer->AddStringToken((int)eDRTotalTimeST::timeshifttotal, timeshiftDuration);
tokenContainer->AddIntToken((int)eDRTotalTimeIT::timeshift, timeShiftActive);
SetDirty();
changed = false;
return true;
}
/******************************************************************
* cVeDrTimeshiftTimes
******************************************************************/
cVeDrTimeshiftTimes::cVeDrTimeshiftTimes(void) {
changed = true;
start = "";
playbacktime = "";
timeshiftrest = "";
timeShiftActive = NoRec;
}
cVeDrTimeshiftTimes::~cVeDrTimeshiftTimes(void) {
}
void cVeDrTimeshiftTimes::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{recstart}", (int)eDRTimeshiftTimesST::recstart);
tokenContainer->DefineStringToken("{playbacktime}", (int)eDRTimeshiftTimesST::playbacktime);
tokenContainer->DefineStringToken("{timeshiftrest}", (int)eDRTimeshiftTimesST::timeshiftrest);
tokenContainer->DefineIntToken("{timeshift}", (int)eDRTimeshiftTimesIT::timeshift);
InheritTokenContainer();
}
void cVeDrTimeshiftTimes::Set(cString start, cString playbacktime, cString timeshiftrest, eRecType_t timeShiftActive) {
this->timeShiftActive = timeShiftActive;
if (strcmp(*this->start, *start) || strcmp(*this->playbacktime, *playbacktime) || strcmp(*this->timeshiftrest, *timeshiftrest)) {
this->start = start;
this->playbacktime = playbacktime;
this->timeshiftrest = timeshiftrest;
changed = true;
}
}
bool cVeDrTimeshiftTimes::Parse(bool force) {
if (!cViewElement::Parse(force) || !changed)
return false;
tokenContainer->Clear();
tokenContainer->AddStringToken((int)eDRTimeshiftTimesST::recstart, *start);
tokenContainer->AddStringToken((int)eDRTimeshiftTimesST::playbacktime, *playbacktime);
tokenContainer->AddStringToken((int)eDRTimeshiftTimesST::timeshiftrest, *timeshiftrest);
tokenContainer->AddIntToken((int)eDRTimeshiftTimesIT::timeshift, timeShiftActive);
SetDirty();
changed = false;
return true;
}
/******************************************************************
* cVeDrEndTime
******************************************************************/
cVeDrEndTime::cVeDrEndTime(void) {
changed = true;
end = "";
timeShiftActive = NoRec;
}
cVeDrEndTime::~cVeDrEndTime(void) {
}
void cVeDrEndTime::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{recend}", (int)eDREndTimeST::recend);
tokenContainer->DefineIntToken("{timeshift}", (int)eDREndTimeIT::timeshift);
InheritTokenContainer();
}
void cVeDrEndTime::Set(cString end, eRecType_t timeShiftActive) {
this->timeShiftActive = timeShiftActive;
if (strcmp(*this->end, *end)) {
this->end = end;
changed = true;
}
}
bool cVeDrEndTime::Parse(bool force) {
if (!cViewElement::Parse(force) || !changed)
return false;
tokenContainer->Clear();
tokenContainer->AddStringToken((int)eDREndTimeST::recend, *end);
tokenContainer->AddIntToken((int)eDREndTimeIT::timeshift, timeShiftActive);
SetDirty();
changed = false;
return true;
}
/******************************************************************
* cVeDrProgressBar
******************************************************************/
cVeDrProgressBar::cVeDrProgressBar(void) {
current = -1;
total = -1;
timeshiftTotal = -1;
timeShiftActive = NoRec;
changed = true;
}
cVeDrProgressBar::~cVeDrProgressBar(void) {
}
void cVeDrProgressBar::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineIntToken("{current}", (int)eDRProgressbarIT::current);
tokenContainer->DefineIntToken("{total}", (int)eDRProgressbarIT::total);
tokenContainer->DefineIntToken("{timeshift}", (int)eDRProgressbarIT::timeshift);
tokenContainer->DefineIntToken("{timeshifttotal}", (int)eDRProgressbarIT::timeshifttotal);
InheritTokenContainer();
}
void cVeDrProgressBar::Set(int current, int total, eRecType_t timeShiftActive, int timeshiftTotal) {
if (!(this->current != current || this->total != total))
return;
this->current = current;
this->total = total;
this->timeShiftActive = timeShiftActive;
this->timeshiftTotal = timeshiftTotal;
changed = true;
}
bool cVeDrProgressBar::Parse(bool force) {
if (!cViewElement::Parse(force) || !changed)
return false;
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eDRProgressbarIT::current, current);
tokenContainer->AddIntToken((int)eDRProgressbarIT::total, total);
tokenContainer->AddIntToken((int)eDRProgressbarIT::timeshift, timeShiftActive);
tokenContainer->AddIntToken((int)eDRProgressbarIT::timeshifttotal, timeshiftTotal);
SetDirty();
changed = false;
return true;
}
/******************************************************************
* cVeDrCutMarks
******************************************************************/
cVeDrCutMarks::cVeDrCutMarks(void) {
cutmarksIndex = -1;
changed = true;
marks = NULL;
current = -1;
total = -1;
numMarksLast = 0;
timeShiftActive = NoRec;
timeshiftTotal = -1;
}
cVeDrCutMarks::~cVeDrCutMarks(void) {
}
void cVeDrCutMarks::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineIntToken("{timeshift}", (int)eDRCutmarksIT::timeshift);
tokenContainer->DefineLoopToken("{marks[position]}", (int)eDRCutmarksLT::position);
tokenContainer->DefineLoopToken("{marks[endposition]}", (int)eDRCutmarksLT::endposition);
tokenContainer->DefineLoopToken("{marks[total]}", (int)eDRCutmarksLT::total);
tokenContainer->DefineLoopToken("{marks[timeshifttotal]}", (int)eDRCutmarksLT::timeshifttotal);
tokenContainer->DefineLoopToken("{marks[active]}", (int)eDRCutmarksLT::active);
tokenContainer->DefineLoopToken("{marks[startmark]}", (int)eDRCutmarksLT::startmark);
cutmarksIndex = tokenContainer->LoopIndex("marks");
InheritTokenContainer();
}
void cVeDrCutMarks::Set(const cMarks *marks, int current, int total, eRecType_t timeShiftActive, int timeshiftTotal) {
int numMarks = marks->Count();
if (!(this->current != current || this->total != total || this->marks != marks || numMarksLast != numMarks))
return;
this->marks = marks;
numMarksLast = numMarks;
this->current = current;
this->total = total;
this->timeShiftActive = timeShiftActive;
this->timeshiftTotal = timeshiftTotal;
changed = true;
}
bool cVeDrCutMarks::Parse(bool force) {
if (!cViewElement::Parse(force) || !changed)
return false;
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eDRCutmarksIT::timeshift, timeShiftActive);
int numMarks = marks->Count();
vector<int> cutmarksInfo;
cutmarksInfo.push_back(numMarks);
tokenContainer->CreateLoopTokenContainer(&cutmarksInfo);
cString tot = cString::sprintf("%d", total);
cString timeshifttot = cString::sprintf("%d",timeshiftTotal);
int i = 0;
bool isStartMark = true;
for (const cMark *m = marks->First(); m; m = marks->Next(m)) {
tokenContainer->AddLoopToken(cutmarksIndex, i, (int)eDRCutmarksLT::position, *cString::sprintf("%d", m->Position()));
tokenContainer->AddLoopToken(cutmarksIndex, i, (int)eDRCutmarksLT::total, *tot);
if (timeShiftActive) {
tokenContainer->AddLoopToken(cutmarksIndex, i, (int)eDRCutmarksLT::timeshifttotal, *timeshifttot);
}
tokenContainer->AddLoopToken(cutmarksIndex, i, (int)eDRCutmarksLT::startmark, isStartMark ? "1" : "0");
tokenContainer->AddLoopToken(cutmarksIndex, i, (int)eDRCutmarksLT::active, (m->Position() == current) ? "1" : "0");
const cMark *m2 = marks->Next(m);
if (m2) {
tokenContainer->AddLoopToken(cutmarksIndex, i, (int)eDRCutmarksLT::endposition, *cString::sprintf("%d", m2->Position()));
} else {
tokenContainer->AddLoopToken(cutmarksIndex, i, (int)eDRCutmarksLT::endposition, *tot);
}
i++;
isStartMark = !isStartMark;
}
SetDirty();
changed = false;
return true;
}
/******************************************************************
* cVeDrControlIcons
******************************************************************/
cVeDrControlIcons::cVeDrControlIcons(void) {
play = false;
forward = false;
speed = 0;
changed = true;
}
cVeDrControlIcons::~cVeDrControlIcons(void) {
}
void cVeDrControlIcons::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineIntToken("{play}", (int)eDRControlIconsIT::play);
tokenContainer->DefineIntToken("{pause}", (int)eDRControlIconsIT::pause);
tokenContainer->DefineIntToken("{forward}", (int)eDRControlIconsIT::forward);
tokenContainer->DefineIntToken("{slowforward}", (int)eDRControlIconsIT::slowforward);
tokenContainer->DefineIntToken("{forward1x}", (int)eDRControlIconsIT::forward1x);
tokenContainer->DefineIntToken("{forward2x}", (int)eDRControlIconsIT::forward2x);
tokenContainer->DefineIntToken("{forward3x}", (int)eDRControlIconsIT::forward3x);
tokenContainer->DefineIntToken("{slowforward1x}", (int)eDRControlIconsIT::slowforward1x);
tokenContainer->DefineIntToken("{slowforward2x}", (int)eDRControlIconsIT::slowforward2x);
tokenContainer->DefineIntToken("{slowforward3x}", (int)eDRControlIconsIT::slowforward3x);
tokenContainer->DefineIntToken("{rewind}", (int)eDRControlIconsIT::rewind);
tokenContainer->DefineIntToken("{slowrewind}", (int)eDRControlIconsIT::slowrewind);
tokenContainer->DefineIntToken("{rewind1x}", (int)eDRControlIconsIT::rewind1x);
tokenContainer->DefineIntToken("{rewind2x}", (int)eDRControlIconsIT::rewind2x);
tokenContainer->DefineIntToken("{rewind3x}", (int)eDRControlIconsIT::rewind3x);
tokenContainer->DefineIntToken("{slowrewind1x}", (int)eDRControlIconsIT::slowrewind1x);
tokenContainer->DefineIntToken("{slowrewind2x}", (int)eDRControlIconsIT::slowrewind2x);
tokenContainer->DefineIntToken("{slowrewind3x}", (int)eDRControlIconsIT::slowrewind3x);
InheritTokenContainer();
}
void cVeDrControlIcons::Set(bool play, bool forward, int speed) {
this->play = play;
this->forward = forward;
this->speed = speed;
changed = true;
}
bool cVeDrControlIcons::Parse(bool force) {
if (!cViewElement::Parse(force) || !changed)
return false;
bool isPlay = false;
bool isPause = false;
bool isFF = false;
bool isSlowFF = false;
bool isFF1x = false;
bool isFF2x = false;
bool isFF3x = false;
bool isSlowFF1x = false;
bool isSlowFF2x = false;
bool isSlowFF3x = false;
bool isRew = false;
bool isSlowRew = false;
bool isRew1x = false;
bool isRew2x = false;
bool isRew3x = false;
bool isSlowRew1x = false;
bool isSlowRew2x = false;
bool isSlowRew3x = false;
if (speed == -1) {
if (play) {
isPlay = true;
} else {
isPause = true;
}
} else if (forward) {
if (speed == 1) {
if (play)
isFF1x = true;
else
isSlowFF1x = true;
} else if (speed == 2) {
if (play)
isFF2x = true;
else
isSlowFF2x = true;
} else if (speed == 3) {
if (play)
isFF3x = true;
else
isSlowFF3x = true;
} else {
if (play)
isFF = true;
else
isSlowFF = true;
}
} else {
if (speed == 1) {
if (play)
isRew1x = true;
else
isSlowRew1x = true;
} else if (speed == 2) {
if (play)
isRew2x = true;
else
isSlowRew2x = true;
} else if (speed == 3) {
if (play)
isRew3x = true;
else
isSlowRew3x = true;
} else {
if (play)
isRew = true;
else
isSlowRew = true;
}
}
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eDRControlIconsIT::play, isPlay);
tokenContainer->AddIntToken((int)eDRControlIconsIT::pause, isPause);
tokenContainer->AddIntToken((int)eDRControlIconsIT::forward, isFF);
tokenContainer->AddIntToken((int)eDRControlIconsIT::slowforward, isSlowFF);
tokenContainer->AddIntToken((int)eDRControlIconsIT::forward1x, isFF1x);
tokenContainer->AddIntToken((int)eDRControlIconsIT::forward2x, isFF2x);
tokenContainer->AddIntToken((int)eDRControlIconsIT::forward3x, isFF3x);
tokenContainer->AddIntToken((int)eDRControlIconsIT::slowforward1x, isSlowFF1x);
tokenContainer->AddIntToken((int)eDRControlIconsIT::slowforward2x, isSlowFF2x);
tokenContainer->AddIntToken((int)eDRControlIconsIT::slowforward3x, isSlowFF3x);
tokenContainer->AddIntToken((int)eDRControlIconsIT::rewind, isRew);
tokenContainer->AddIntToken((int)eDRControlIconsIT::slowrewind, isSlowRew);
tokenContainer->AddIntToken((int)eDRControlIconsIT::rewind1x, isRew1x);
tokenContainer->AddIntToken((int)eDRControlIconsIT::rewind2x, isRew2x);
tokenContainer->AddIntToken((int)eDRControlIconsIT::rewind3x, isRew3x);
tokenContainer->AddIntToken((int)eDRControlIconsIT::slowrewind1x, isSlowRew1x);
tokenContainer->AddIntToken((int)eDRControlIconsIT::slowrewind2x, isSlowRew2x);
tokenContainer->AddIntToken((int)eDRControlIconsIT::slowrewind3x, isSlowRew3x);
SetDirty();
changed = false;
return true;
}
/******************************************************************
* cVeDrProgressModeonly
******************************************************************/
cVeDrProgressModeonly::cVeDrProgressModeonly(void) {
fps = 0.0f;
current = 0;
total = 0;
changed = true;
}
cVeDrProgressModeonly::~cVeDrProgressModeonly(void) {
}
void cVeDrProgressModeonly::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineIntToken("{current}", (int)eDRProgressModeonlyIT::current);
tokenContainer->DefineIntToken("{total}", (int)eDRProgressModeonlyIT::total);
tokenContainer->DefineStringToken("{timecurrent}", (int)eDRProgressModeonlyST::timecurrent);
tokenContainer->DefineStringToken("{timetotal}", (int)eDRProgressModeonlyST::timetotal);
InheritTokenContainer();
}
void cVeDrProgressModeonly::Set(double fps, int current, int total) {
if (!(this->current != current || this->total != total))
return;
this->fps = fps;
this->current = current;
this->total = total;
changed = true;
}
bool cVeDrProgressModeonly::Parse(bool force) {
if (!cViewElement::Parse(force) || !changed)
return false;
string cur = GetTimeString((double)current / fps);
string tot = GetTimeString((double)total / fps);
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eDRProgressModeonlyIT::current, current);
tokenContainer->AddIntToken((int)eDRProgressModeonlyIT::total, total);
tokenContainer->AddStringToken((int)eDRProgressModeonlyST::timecurrent, cur.c_str());
tokenContainer->AddStringToken((int)eDRProgressModeonlyST::timetotal, tot.c_str());
SetDirty();
changed = false;
return true;
}
/******************************************************************
* cVeDrJump
******************************************************************/
cVeDrJump::cVeDrJump(void) {
jump = NULL;
changed = false;
}
cVeDrJump::~cVeDrJump(void) {
free(jump);
}
void cVeDrJump::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{jump}", (int)eDRJumpST::jump);
InheritTokenContainer();
}
void cVeDrJump::Set(const char *jump) {
if (!jump)
return;
free(this->jump);
this->jump = strdup(jump);
changed = true;
}
bool cVeDrJump::Parse(bool force) {
if (!cViewElement::Parse(force) || !changed)
return false;
tokenContainer->Clear();
tokenContainer->AddStringToken((int)eDRJumpST::jump, jump);
changed = false;
SetDirty();
return true;
}
/******************************************************************
* cVeDrOnPause
******************************************************************/
cVeDrOnPause::cVeDrOnPause(void) {
started = false;
actorsIndex = -1;
recfilename = NULL;
}
cVeDrOnPause::~cVeDrOnPause(void) {
free(recfilename);
}
void cVeDrOnPause::Close(void) {
started = false;
cViewElement::Close();
}
void cVeDrOnPause::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{name}", (int)eDROnpauseST::name);
tokenContainer->DefineStringToken("{shorttext}", (int)eDROnpauseST::shorttext);
tokenContainer->DefineStringToken("{description}", (int)eDROnpauseST::description);
tokenContainer->DefineStringToken("{date}", (int)eDROnpauseST::date);
tokenContainer->DefineStringToken("{time}", (int)eDROnpauseST::time);
tokenContainer->DefineStringToken("{durationminutes}", (int)eDROnpauseST::durationminutes);
tokenContainer->DefineStringToken("{durationeventminutes}", (int)eDROnpauseST::durationeventminutes);
tokenContainer->DefineIntToken("{daynumeric}", (int)eDROnpauseIT::daynumeric);
tokenContainer->DefineIntToken("{month}", (int)eDROnpauseIT::month);
tokenContainer->DefineIntToken("{year}", (int)eDROnpauseIT::year);
tokenContainer->DefineIntToken("{duration}", (int)eDROnpauseIT::duration);
tokenContainer->DefineIntToken("{durationhours}", (int)eDROnpauseIT::durationhours);
tokenContainer->DefineIntToken("{durationevent}", (int)eDROnpauseIT::durationevent);
tokenContainer->DefineIntToken("{durationeventhours}", (int)eDROnpauseIT::durationeventhours);
tokenContainer->DefineStringToken("{movietitle}", (int)eScraperST::movietitle);
tokenContainer->DefineStringToken("{movieoriginalTitle}", (int)eScraperST::movieoriginalTitle);
tokenContainer->DefineStringToken("{movietagline}", (int)eScraperST::movietagline);
tokenContainer->DefineStringToken("{movieoverview}", (int)eScraperST::movieoverview);
tokenContainer->DefineStringToken("{moviegenres}", (int)eScraperST::moviegenres);
tokenContainer->DefineStringToken("{moviehomepage}", (int)eScraperST::moviehomepage);
tokenContainer->DefineStringToken("{moviereleasedate}", (int)eScraperST::moviereleasedate);
tokenContainer->DefineStringToken("{moviepopularity}", (int)eScraperST::moviepopularity);
tokenContainer->DefineStringToken("{movievoteaverage}", (int)eScraperST::movievoteaverage);
tokenContainer->DefineStringToken("{posterpath}", (int)eScraperST::posterpath);
tokenContainer->DefineStringToken("{fanartpath}", (int)eScraperST::fanartpath);
tokenContainer->DefineStringToken("{moviecollectionName}", (int)eScraperST::moviecollectionName);
tokenContainer->DefineStringToken("{collectionposterpath}", (int)eScraperST::collectionposterpath);
tokenContainer->DefineStringToken("{collectionfanartpath}", (int)eScraperST::collectionfanartpath);
tokenContainer->DefineStringToken("{seriesname}", (int)eScraperST::seriesname);
tokenContainer->DefineStringToken("{seriesoverview}", (int)eScraperST::seriesoverview);
tokenContainer->DefineStringToken("{seriesfirstaired}", (int)eScraperST::seriesfirstaired);
tokenContainer->DefineStringToken("{seriesnetwork}", (int)eScraperST::seriesnetwork);
tokenContainer->DefineStringToken("{seriesgenre}", (int)eScraperST::seriesgenre);
tokenContainer->DefineStringToken("{seriesrating}", (int)eScraperST::seriesrating);
tokenContainer->DefineStringToken("{seriesstatus}", (int)eScraperST::seriesstatus);
tokenContainer->DefineStringToken("{episodetitle}", (int)eScraperST::episodetitle);
tokenContainer->DefineStringToken("{episodefirstaired}", (int)eScraperST::episodefirstaired);
tokenContainer->DefineStringToken("{episodegueststars}", (int)eScraperST::episodegueststars);
tokenContainer->DefineStringToken("{episodeoverview}", (int)eScraperST::episodeoverview);
tokenContainer->DefineStringToken("{episoderating}", (int)eScraperST::episoderating);
tokenContainer->DefineStringToken("{episodeimagepath}", (int)eScraperST::episodeimagepath);
tokenContainer->DefineStringToken("{seasonposterpath}", (int)eScraperST::seasonposterpath);
tokenContainer->DefineStringToken("{seriesposter1path}", (int)eScraperST::seriesposter1path);
tokenContainer->DefineStringToken("{seriesposter2path}", (int)eScraperST::seriesposter2path);
tokenContainer->DefineStringToken("{seriesposter3path}", (int)eScraperST::seriesposter3path);
tokenContainer->DefineStringToken("{seriesfanart1path}", (int)eScraperST::seriesfanart1path);
tokenContainer->DefineStringToken("{seriesfanart2path}", (int)eScraperST::seriesfanart2path);
tokenContainer->DefineStringToken("{seriesfanart3path}", (int)eScraperST::seriesfanart3path);
tokenContainer->DefineStringToken("{seriesbanner1path}", (int)eScraperST::seriesbanner1path);
tokenContainer->DefineStringToken("{seriesbanner2path}", (int)eScraperST::seriesbanner2path);
tokenContainer->DefineStringToken("{seriesbanner3path}", (int)eScraperST::seriesbanner3path);
tokenContainer->DefineIntToken("{ismovie}", (int)eScraperIT::ismovie);
tokenContainer->DefineIntToken("{moviebudget}", (int)eScraperIT::moviebudget);
tokenContainer->DefineIntToken("{movierevenue}", (int)eScraperIT::movierevenue);
tokenContainer->DefineIntToken("{movieadult}", (int)eScraperIT::movieadult);
tokenContainer->DefineIntToken("{movieruntime}", (int)eScraperIT::movieruntime);
tokenContainer->DefineIntToken("{isseries}", (int)eScraperIT::isseries);
tokenContainer->DefineIntToken("{posterwidth}", (int)eScraperIT::posterwidth);
tokenContainer->DefineIntToken("{posterheight}", (int)eScraperIT::posterheight);
tokenContainer->DefineIntToken("{fanartwidth}", (int)eScraperIT::fanartwidth);
tokenContainer->DefineIntToken("{fanartheight}", (int)eScraperIT::fanartheight);
tokenContainer->DefineIntToken("{movieiscollection}", (int)eScraperIT::movieiscollection);
tokenContainer->DefineIntToken("{collectionposterwidth}", (int)eScraperIT::collectionposterwidth);
tokenContainer->DefineIntToken("{collectionposterheight}", (int)eScraperIT::collectionposterheight);
tokenContainer->DefineIntToken("{collectionfanartwidth}", (int)eScraperIT::collectionfanartwidth);
tokenContainer->DefineIntToken("{collectionfanartheight}", (int)eScraperIT::collectionfanartheight);
tokenContainer->DefineIntToken("{epgpicavailable}", (int)eScraperIT::epgpicavailable);
tokenContainer->DefineIntToken("{episodenumber}", (int)eScraperIT::episodenumber);
tokenContainer->DefineIntToken("{episodeseason}", (int)eScraperIT::episodeseason);
tokenContainer->DefineIntToken("{episodeimagewidth}", (int)eScraperIT::episodeimagewidth);
tokenContainer->DefineIntToken("{episodeimageheight}", (int)eScraperIT::episodeimageheight);
tokenContainer->DefineIntToken("{seasonposterwidth}", (int)eScraperIT::seasonposterwidth);
tokenContainer->DefineIntToken("{seasonposterheight}", (int)eScraperIT::seasonposterheight);
tokenContainer->DefineIntToken("{seriesposter1width}", (int)eScraperIT::seriesposter1width);
tokenContainer->DefineIntToken("{seriesposter1height}", (int)eScraperIT::seriesposter1height);
tokenContainer->DefineIntToken("{seriesposter2width}", (int)eScraperIT::seriesposter2width);
tokenContainer->DefineIntToken("{seriesposter2height}", (int)eScraperIT::seriesposter2height);
tokenContainer->DefineIntToken("{seriesposter3width}", (int)eScraperIT::seriesposter3width);
tokenContainer->DefineIntToken("{seriesposter3height}", (int)eScraperIT::seriesposter3height);
tokenContainer->DefineIntToken("{seriesfanart1width}", (int)eScraperIT::seriesfanart1width);
tokenContainer->DefineIntToken("{seriesfanart1height}", (int)eScraperIT::seriesfanart1height);
tokenContainer->DefineIntToken("{seriesfanart2width}", (int)eScraperIT::seriesfanart2width);
tokenContainer->DefineIntToken("{seriesfanart2height}", (int)eScraperIT::seriesfanart2height);
tokenContainer->DefineIntToken("{seriesfanart3width}", (int)eScraperIT::seriesfanart3width);
tokenContainer->DefineIntToken("{seriesfanart3height}", (int)eScraperIT::seriesfanart3height);
tokenContainer->DefineIntToken("{seriesbanner1width}", (int)eScraperIT::seriesbanner1width);
tokenContainer->DefineIntToken("{seriesbanner1height}", (int)eScraperIT::seriesbanner1height);
tokenContainer->DefineIntToken("{seriesbanner2width}", (int)eScraperIT::seriesbanner2width);
tokenContainer->DefineIntToken("{seriesbanner2height}", (int)eScraperIT::seriesbanner2height);
tokenContainer->DefineIntToken("{seriesbanner3width}", (int)eScraperIT::seriesbanner3width);
tokenContainer->DefineIntToken("{seriesbanner3height}", (int)eScraperIT::seriesbanner3height);
tokenContainer->DefineLoopToken("{actors[name]}", (int)eScraperLT::name);
tokenContainer->DefineLoopToken("{actors[role]}", (int)eScraperLT::role);
tokenContainer->DefineLoopToken("{actors[thumb]}", (int)eScraperLT::thumb);
tokenContainer->DefineLoopToken("{actors[thumbwidth]}", (int)eScraperLT::thumbwidth);
tokenContainer->DefineLoopToken("{actors[thumbheight]}", (int)eScraperLT::thumbheight);
actorsIndex = tokenContainer->LoopIndex("actors");
InheritTokenContainer();
}
void cVeDrOnPause::Set(const char *recfilename) {
if (!recfilename)
return;
free(this->recfilename);
this->recfilename = strdup(recfilename);
started = true;
}
bool cVeDrOnPause::Parse(bool force) {
if (!cViewElement::Parse(force))
return false;
if (!recfilename)
return false;
const cRecording *recording = new cRecording(recfilename);
if (!recording)
return false;
tokenContainer->Clear();
tokenContainer->AddStringToken((int)eDROnpauseST::name, recording->Name());
const cRecordingInfo *info = recording->Info();
if (info) {
tokenContainer->AddStringToken((int)eDROnpauseST::shorttext, info->ShortText());
tokenContainer->AddStringToken((int)eDROnpauseST::description, info->Description());
const cEvent *event = info->GetEvent();
if (event) {
string recDate = *(event->GetDateString());
string recTime = *(event->GetTimeString());
if (recDate.find("1970") != string::npos) {
time_t start = recording->Start();
recDate = *DateString(start);
recTime = *TimeString(start);
}
tokenContainer->AddStringToken((int)eDROnpauseST::date, recDate.c_str());
tokenContainer->AddStringToken((int)eDROnpauseST::time, recTime.c_str());
time_t startTime = event->StartTime();
struct tm * sStartTime = localtime(&startTime);
tokenContainer->AddIntToken((int)eDROnpauseIT::year, sStartTime->tm_year + 1900);
tokenContainer->AddIntToken((int)eDROnpauseIT::daynumeric, sStartTime->tm_mday);
tokenContainer->AddIntToken((int)eDROnpauseIT::month, sStartTime->tm_mon+1);
int duration = event->Duration() / 60;
int recDuration = recording->LengthInSeconds();
recDuration = (recDuration>0)?(recDuration / 60):0;
tokenContainer->AddIntToken((int)eDROnpauseIT::duration, recDuration);
tokenContainer->AddIntToken((int)eDROnpauseIT::durationhours, recDuration / 60);
tokenContainer->AddStringToken((int)eDROnpauseST::durationminutes, *cString::sprintf("%.2d", recDuration%60));
tokenContainer->AddIntToken((int)eDROnpauseIT::durationevent, duration);
tokenContainer->AddIntToken((int)eDROnpauseIT::durationeventhours, duration / 60);
tokenContainer->AddStringToken((int)eDROnpauseST::durationeventminutes, *cString::sprintf("%.2d", duration%60));
}
}
vector<int> loopInfo;
bool scrapInfoAvailable = LoadFullScrapInfo(NULL, recording);
int numActors = NumActors();
loopInfo.push_back(numActors);
tokenContainer->CreateLoopTokenContainer(&loopInfo);
if (scrapInfoAvailable) {
SetFullScrapInfo(tokenContainer, actorsIndex);
}
SetDirty();
delete recording;
return true;
}
void cVeDrOnPause::ResetSleep(void) {
if (!detacher)
return;
detacher->ResetSleep();
}
/******************************************************************
* cVeDrScraperContent
******************************************************************/
cVeDrScraperContent::cVeDrScraperContent(void) {
recording = NULL;
}
cVeDrScraperContent::~cVeDrScraperContent(void) {
}
void cVeDrScraperContent::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineStringToken("{posterpath}", (int)eScraperPosterBannerST::posterpath);
tokenContainer->DefineStringToken("{bannerpath}", (int)eScraperPosterBannerST::bannerpath);
tokenContainer->DefineStringToken("{mediapath}", (int)eScraperPosterBannerST::mediapath);
tokenContainer->DefineIntToken("{posterwidth}", (int)eScraperPosterBannerIT::posterwidth);
tokenContainer->DefineIntToken("{posterheight}", (int)eScraperPosterBannerIT::posterheight);
tokenContainer->DefineIntToken("{hasposter}", (int)eScraperPosterBannerIT::hasposter);
tokenContainer->DefineIntToken("{bannerwidth}", (int)eScraperPosterBannerIT::bannerwidth);
tokenContainer->DefineIntToken("{bannerheight}", (int)eScraperPosterBannerIT::bannerheight);
tokenContainer->DefineIntToken("{hasbanner}", (int)eScraperPosterBannerIT::hasbanner);
tokenContainer->DefineIntToken("{mediawidth}", (int)eScraperPosterBannerIT::mediawidth);
tokenContainer->DefineIntToken("{mediaheight}", (int)eScraperPosterBannerIT::mediaheight);
tokenContainer->DefineIntToken("{isbanner}", (int)eScraperPosterBannerIT::isbanner);
InheritTokenContainer();
}
void cVeDrScraperContent::Set(const cRecording *recording) {
this->recording = recording;
}
bool cVeDrScraperContent::Parse(bool force) {
if (!cViewElement::Parse(force))
return false;
if (!recording)
return false;
SetPosterBanner(tokenContainer, NULL, recording);
SetDirty();
return true;
}

View File

@ -1,235 +0,0 @@
#ifndef __VIEWELEMENTSDR_H
#define __VIEWELEMENTSDR_H
#include "viewelement.h"
#include "../extensions/scrapmanager.h"
// define recordingtypes
enum eRecType_t {
NoRec = 0,
NormalRec,
TimeshiftRec
};
/******************************************************************
* cVeDrRecTitle
******************************************************************/
class cVeDrRecTitle : public cViewElement {
private:
const cRecording *recording;
const cEvent *event;
char *title;
eRecType_t timeShiftActive;
public:
cVeDrRecTitle(void);
virtual ~cVeDrRecTitle(void);
void SetTokenContainer(void);
void Set(const cRecording *recording = NULL, const cEvent *event = NULL, eRecType_t timeShiftActive = NoRec);
void Set(const char *title = NULL);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDrRecInfo
******************************************************************/
class cVeDrRecInfo : public cViewElement {
private:
const cRecording *recording;
public:
cVeDrRecInfo(void);
virtual ~cVeDrRecInfo(void);
void SetTokenContainer(void);
void Set(const cRecording *recording);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDrCurrentTime
******************************************************************/
class cVeDrCurrentTime : public cViewElement {
private:
bool changed;
char *current;
eRecType_t timeShiftActive;
public:
cVeDrCurrentTime(void);
virtual ~cVeDrCurrentTime(void);
void SetTokenContainer(void);
void Set(const char *current, eRecType_t timeShiftActive = NoRec);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDrTotalTime
******************************************************************/
class cVeDrTotalTime : public cViewElement {
private:
bool changed;
char *total;
eRecType_t timeShiftActive;
char *timeshiftDuration;
public:
cVeDrTotalTime(void);
virtual ~cVeDrTotalTime(void);
void SetTokenContainer(void);
void Set(const char *total, const char *timeshiftDuration = NULL, eRecType_t timeShiftActive = NoRec);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDrTimeshiftTimes
******************************************************************/
class cVeDrTimeshiftTimes : public cViewElement {
private:
cString start;
cString playbacktime;
cString timeshiftrest;
bool changed;
eRecType_t timeShiftActive;
public:
cVeDrTimeshiftTimes(void);
virtual ~cVeDrTimeshiftTimes(void);
void SetTokenContainer(void);
void Set(cString start, cString playbacktime, cString timeshiftrest, eRecType_t timeShiftActive = NoRec);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDrEndTime
******************************************************************/
class cVeDrEndTime : public cViewElement {
private:
cString end;
eRecType_t timeShiftActive;
bool changed;
public:
cVeDrEndTime(void);
virtual ~cVeDrEndTime(void);
void SetTokenContainer(void);
void Set(cString end, eRecType_t timeShiftActive = NoRec);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDrProgressBar
******************************************************************/
class cVeDrProgressBar : public cViewElement {
private:
int current;
int total;
eRecType_t timeShiftActive;
int timeshiftTotal;
bool changed;
public:
cVeDrProgressBar(void);
virtual ~cVeDrProgressBar(void);
void SetTokenContainer(void);
void Set(int current, int total, eRecType_t timeShiftActive = NoRec, int timeshiftTotal = 0);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDrCutMarks
******************************************************************/
class cVeDrCutMarks : public cViewElement {
private:
int cutmarksIndex;
const cMarks *marks;
int current;
int total;
eRecType_t timeShiftActive;
int timeshiftTotal;
int numMarksLast;
bool changed;
public:
cVeDrCutMarks(void);
virtual ~cVeDrCutMarks(void);
void SetTokenContainer(void);
void Set(const cMarks *marks, int current, int total, eRecType_t timeShiftActive = NoRec, int timeshiftTotal = 0);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDrControlIcons
******************************************************************/
class cVeDrControlIcons : public cViewElement {
private:
bool play;
bool forward;
int speed;
bool changed;
public:
cVeDrControlIcons(void);
virtual ~cVeDrControlIcons(void);
void SetTokenContainer(void);
void Set(bool play, bool forward, int speed);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDrProgressModeonly
******************************************************************/
class cVeDrProgressModeonly : public cViewElement {
private:
double fps;
int current;
int total;
bool changed;
public:
cVeDrProgressModeonly(void);
virtual ~cVeDrProgressModeonly(void);
void SetTokenContainer(void);
void Set(double fps, int current, int total);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDrJump
******************************************************************/
class cVeDrJump : public cViewElement {
private:
char *jump;
bool changed;
public:
cVeDrJump(void);
virtual ~cVeDrJump(void);
void SetTokenContainer(void);
void Set(const char *jump);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDrOnPause
******************************************************************/
class cVeDrOnPause : public cViewElement, public cScrapManager {
private:
bool started;
int actorsIndex;
char *recfilename;
public:
cVeDrOnPause(void);
virtual ~cVeDrOnPause(void);
void Close(void);
int Delay(void) { return attribs->Delay() * 1000; };
void SetTokenContainer(void);
void Set(const char *recfilename);
bool Parse(bool forced = false);
bool Started(void) { return started; };
void ResetSleep(void);
};
/******************************************************************
* cVeDrScraperContent
******************************************************************/
class cVeDrScraperContent : public cViewElement, public cScrapManager {
private:
const cRecording *recording;
public:
cVeDrScraperContent(void);
virtual ~cVeDrScraperContent(void);
void SetTokenContainer(void);
void Set(const cRecording *recording);
bool Parse(bool forced = false);
};
#endif //__VIEWELEMENTSDR_H

View File

@ -1,84 +0,0 @@
#include "viewelementsdisplaytracks.h"
/******************************************************************
* cVeDtBackground
******************************************************************/
cVeDtBackground::cVeDtBackground(void) {
numTracks = 0;
}
cVeDtBackground::~cVeDtBackground(void) {
}
void cVeDtBackground::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineIntToken("{numtracks}", (int)eDTBackgroundIT::numtracks);
InheritTokenContainer();
}
void cVeDtBackground::Set(int numTracks) {
this->numTracks = numTracks;
}
bool cVeDtBackground::Parse(bool forced) {
if (!cViewElement::Parse(forced))
return false;
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eDTBackgroundIT::numtracks, numTracks);
SetDirty();
return true;
}
/******************************************************************
* cVeDtHeader
******************************************************************/
cVeDtHeader::cVeDtHeader(void) {
title = NULL;
audioChannel = 0;
numTracks = 0;
changed = true;
}
cVeDtHeader::~cVeDtHeader(void) {
free(title);
}
void cVeDtHeader::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineIntToken("{numtracks}", (int)eDTHeaderIT::numtracks);
tokenContainer->DefineIntToken("{isstereo}", (int)eDTHeaderIT::isstereo);
tokenContainer->DefineIntToken("{isac3}", (int)eDTHeaderIT::isac3);
tokenContainer->DefineStringToken("{title}", (int)eDTHeaderST::title);
InheritTokenContainer();
}
void cVeDtHeader::SetTitle(const char *title) {
if (!title)
return;
free(this->title);
this->title = strdup(title);
changed = true;
}
void cVeDtHeader::SetNumtracks(int numTracks) {
this->numTracks = numTracks;
changed = true;
}
void cVeDtHeader::SetAudiochannel(int audioChannel) {
this->audioChannel = audioChannel;
changed = true;
}
bool cVeDtHeader::Parse(bool forced) {
if (!cViewElement::Parse(forced) || !changed)
return false;
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eDTHeaderIT::numtracks, numTracks);
tokenContainer->AddIntToken((int)eDTHeaderIT::isstereo, (audioChannel < 0) ? false : true);
tokenContainer->AddIntToken((int)eDTHeaderIT::isac3, (audioChannel < 0) ? true : false);
tokenContainer->AddStringToken((int)eDTHeaderST::title, title);
SetDirty();
return true;
}

View File

@ -1,40 +0,0 @@
#ifndef __VIEWELEMENTSDT_H
#define __VIEWELEMENTSDT_H
#include <vdr/menu.h>
#include "viewelement.h"
/******************************************************************
* cVeDtBackground
******************************************************************/
class cVeDtBackground : public cViewElement {
private:
int numTracks;
public:
cVeDtBackground(void);
virtual ~cVeDtBackground(void);
void SetTokenContainer(void);
void Set(int numTracks);
bool Parse(bool forced = false);
};
/******************************************************************
* cVeDtHeader
******************************************************************/
class cVeDtHeader : public cViewElement {
private:
char *title;
int audioChannel;
int numTracks;
bool changed;
public:
cVeDtHeader(void);
virtual ~cVeDtHeader(void);
void SetTokenContainer(void);
void SetTitle(const char *title);
void SetNumtracks(int numTracks);
void SetAudiochannel(int audioChannel);
bool Parse(bool forced = false);
};
#endif //__VIEWELEMENTSDT_H

View File

@ -1,189 +0,0 @@
#include "viewgrid.h"
#include "../extensions/helpers.h"
cViewGrid::cViewGrid(void) {
id = -1;
plugId = -1;
viewId = -1;
globals = NULL;
attribs = new cViewElementAttribs((int)eViewElementAttribs::count);
gridTpl = NULL;
gridsize = GRIDSIZE;
grid = new cGridElement*[gridsize];
for (int i=0; i < gridsize; i++) {
grid[i] = NULL;
}
gridMin = 0;
gridMax = -1;
}
cViewGrid::~cViewGrid(void) {
delete attribs;
delete gridTpl;
}
void cViewGrid::SetGlobals(cGlobals *globals) {
this->globals = globals;
}
void cViewGrid::SetContainer(int x, int y, int width, int height) {
container.SetX(x);
container.SetY(y);
container.SetWidth(width);
container.SetHeight(height);
}
void cViewGrid::SetAttributes(vector<stringpair> &attributes) {
attribs->Set(attributes);
}
void cViewGrid::AddGridElement(cGridElement *gridElement) {
gridTpl = gridElement;
}
const char *cViewGrid::Name(void) {
return attribs->Name();
}
void cViewGrid::SetTokenContainer(void) {
if (!gridTpl)
return;
gridTpl->SetId(id);
gridTpl->SetPluginId(plugId);
gridTpl->SetViewId(viewId);
gridTpl->SetTokenContainer();
}
void cViewGrid::PreCache(void) {
attribs->SetContainer(container.X(), container.Y(), container.Width(), container.Height());
attribs->SetGlobals(globals);
attribs->Cache();
gridTpl->SetGlobals(globals);
gridTpl->SetContainer(attribs->X(), attribs->Y(), attribs->Width(), attribs->Height());
gridTpl->Cache();
}
void cViewGrid::CheckSize(int id) {
if (id < gridsize)
return;
int newgridsize = gridsize + GRIDSIZE;
while (newgridsize < id)
newgridsize += gridsize;
cGridElement **gridNew = new cGridElement*[newgridsize];
int i=0;
bool foundFirst = false;
for (; i < gridsize; i++) {
if (!foundFirst && grid[i]) {
foundFirst = true;
gridMin = i;
}
gridNew[i] = grid[i];
}
gridsize = newgridsize;
for (; i < gridsize; i++) {
gridNew[i] = NULL;
}
delete[] grid;
grid = gridNew;
}
void cViewGrid::SetTokens(int gId, skindesignerapi::cTokenContainer *tk) {
if (!grid[gId]) {
return;
}
grid[gId]->Set(tk);
}
void cViewGrid::PositionGrid(int gId, double x, double y, double width, double height) {
int gridX = attribs->X() + x * attribs->Width();
int gridY = attribs->Y() + y * attribs->Height();
int gridWidth = width * attribs->Width();
int gridHeight = height * attribs->Height();
if (!grid[gId]) {
if (gId >= gridMax)
gridMax = gId+1;
grid[gId] = CreateGrid(gridX, gridY, gridWidth, gridHeight);
} else {
if (grid[gId]->Width() == gridWidth && grid[gId]->Height() == gridHeight) {
grid[gId]->SetPosition(gridX, gridY, gridWidth, gridHeight);
} else {
cGridElement *ge = CreateGrid(gridX, gridY, gridWidth, gridHeight);
ge->Set(grid[gId]->GetTokenContainer());
grid[gId]->Close();
delete grid[gId];
grid[gId] = ge;
}
grid[gId]->SetDirty();
}
}
void cViewGrid::SetCurrentGrid(int gId, bool current) {
if (gId >= 0 && grid[gId]) {
grid[gId]->SetCurrent(current);
}
}
void cViewGrid::DeleteGrid(int gId) {
if (!grid[gId])
return;
grid[gId]->Close();
delete grid[gId];
grid[gId] = NULL;
}
void cViewGrid::ClearGrids(void) {
for (int i = 0; i < gridsize; i++) {
if (!grid[i])
continue;
grid[i]->StopBlinking();
grid[i]->Close();
delete grid[i];
grid[i] = NULL;
}
}
void cViewGrid::Render(void) {
for (int i = gridMin; i < gridMax; i++) {
if (grid[i] && grid[i]->Parse()) {
grid[i]->Render();
}
}
}
cGridElement *cViewGrid::CreateGrid(int x, int y, int width, int height) {
cGridElement *ge = new cGridElement(*gridTpl);
ge->SetAreaX(x);
ge->SetAreaY(y);
ge->SetAreaWidth(width);
ge->SetAreaHeight(height);
return ge;
}
void cViewGrid::Close(void) {
ClearGrids();
gridsize = GRIDSIZE;
delete[] grid;
grid = new cGridElement*[gridsize];
for (int i=0; i < gridsize; i++) {
grid[i] = NULL;
}
gridMin = 0;
gridMax = -1;
}
void cViewGrid::Hide(void) {
for (int i = 0; i < gridsize; i++) {
if (grid[i]) {
grid[i]->Hide();
}
}
}
void cViewGrid::Show(void) {
for (int i = 0; i < gridsize; i++) {
if (grid[i]) {
grid[i]->Show();
}
}
}

View File

@ -1,47 +0,0 @@
#ifndef __VIEWGRID_H
#define __VIEWGRID_H
#define GRIDSIZE 500
#include "gridelement.h"
class cViewGrid {
protected:
cRect container;
cGlobals *globals;
cViewElementAttribs *attribs;
cGridElement *gridTpl;
int gridsize;
cGridElement **grid;
int gridMin;
int gridMax;
int id;
int viewId;
int plugId;
cGridElement *CreateGrid(int x, int y, int width, int height);
public:
cViewGrid(void);
virtual ~cViewGrid(void);
void SetGlobals(cGlobals *globals);
void SetContainer(int x, int y, int width, int height);
void SetAttributes(vector<stringpair> &attributes);
void SetId(int id) { this->id = id; };
void SetPluginId(int plugId) { this->plugId = plugId; };
void SetViewId(int viewId) { this->viewId = viewId; };
void AddGridElement(cGridElement *gridElement);
const char *Name(void);
void SetTokenContainer(void);
void PreCache(void);
void CheckSize(int id);
void SetTokens(int gId, skindesignerapi::cTokenContainer *tk);
void PositionGrid(int gId, double x, double y, double width, double height);
void SetCurrentGrid(int gId, bool current);
void DeleteGrid(int gId);
void ClearGrids(void);
void Render(void);
void Close(void);
void Hide(void);
void Show(void);
};
#endif //__VIEWGRID_H

File diff suppressed because it is too large Load Diff

View File

@ -1,201 +0,0 @@
#ifndef __VIEWLIST_H
#define __VIEWLIST_H
#include "globals.h"
#include "../libskindesignerapi/tokencontainer.h"
#include "listelements.h"
#include "area.h"
class cViewList : public cFadable, public cShiftable {
protected:
int plugId;
int plugMenuId;
cViewListAttribs *attribs;
cRect container;
cGlobals *globals;
skindesignerapi::cTokenContainer *tokenContainer;
int numElements;
eOrientation orientation;
bool cleared;
int itemCount;
cViewElement *listElement;
cViewElement *currentElement;
cListElement **listElements;
cFader *fader;
cShifter *shifter;
virtual void Prepare(int start, int step) {};
cPoint ShiftStart(cRect &shiftbox);
void SetShiftParameters(int index, int &call);
void CheckListAnimation(int index);
public:
cViewList(void);
virtual ~cViewList(void);
void SetGlobals(cGlobals *globals);
void SetContainer(int x, int y, int width, int height);
void SetAttributes(vector<stringpair> &attributes);
void SetPlugId(int id) { plugId = id; };
void SetPlugMenuId(int id) { plugMenuId = id; };
static cViewList *CreateViewList(const char *name);
static cViewElement *CreateListElement(const char *name);
static cViewElement *CreateCurrentElement(const char *name);
void AddListElement(cViewElement *listElement);
void AddCurrentElement(cViewElement *currentElement);
virtual void PreCache(void);
int NumItems(void);
bool Execute(void);
eOrientation Orientation(void);
void Draw(eMenuCategory menuCat);
void Clear(void);
void ResetItemCount(void) { itemCount = 0; };
virtual void Close(void);
eButtonType Button(void) { return attribs->Button(); };
//Fadable
bool Detached(void) { return false; };
int Delay(void) { return 0; };
int FadeTime(void) { return attribs->FadeTime(); };
void SetTransparency(int transparency, bool force = false);
//Shiftable
int ShiftTime(void) { return attribs->ShiftTime(); };
int ShiftMode(void) { return attribs->ShiftMode(); };
void ShiftPositions(cPoint *start, cPoint *end);
void SetPosition(cPoint &position, cPoint &reference, bool force = false);
void SetStartShifting(void) { };
void SetEndShifting(void) { };
cRect CoveredArea(void);
void StartAnimation(bool animOut = false);
void Debug(void);
};
class cViewListDefault : public cViewList {
private:
cLeMenuDefault **listDefault;
int avrgFontWidth;
const cFont *listFont;
int *colX;
int *colWidths;
const char *plugName;
protected:
void Prepare(int start, int step);
public:
cViewListDefault(void);
virtual ~cViewListDefault(void);
void SetTabs(int tab1, int tab2, int tab3, int tab4, int tab5);
void SetPlugin(const char *plugName) { this->plugName = plugName; };
void Set(const char *text, int index, bool current, bool selectable);
const cFont *GetListFont(void);
int GetListWidth(void);
};
class cViewListMain : public cViewList {
private:
cLeMenuMain **listMain;
cCeMenuMain *currentMain;
protected:
void Prepare(int start, int step);
public:
cViewListMain(void);
virtual ~cViewListMain(void);
void Set(const char *text, int index, bool current, bool selectable);
const char *GetPlugin(void);
};
class cViewListSchedules : public cViewList {
private:
cLeMenuSchedules **listSchedules;
cCeMenuSchedules *currentSchedules;
bool epgSearchFav;
protected:
void Prepare(int start, int step);
public:
cViewListSchedules(void);
virtual ~cViewListSchedules(void);
void IsEpgSearchFav(bool isFav) { epgSearchFav = isFav; };
void Set(const cEvent *event, int index, bool current, bool selectable, const cChannel *channel, bool withDate, eTimerMatch timerMatch);
};
class cViewListTimers : public cViewList {
private:
cLeMenuTimers **listTimers;
cCeMenuTimers *currentTimer;
protected:
void Prepare(int start, int step);
public:
cViewListTimers(void);
virtual ~cViewListTimers(void);
void Set(const cTimer *timer, int index, bool current, bool selectable);
};
class cViewListChannels : public cViewList {
private:
cLeMenuChannels **listChannels;
cCeMenuChannels *currentChannel;
protected:
void Prepare(int start, int step);
public:
cViewListChannels(void);
virtual ~cViewListChannels(void);
void Set(const cChannel *channel, int index, bool current, bool selectable, bool withProvider);
};
class cViewListRecordings : public cViewList {
private:
cLeMenuRecordings **listRecordings;
cCeMenuRecordings *currentRecording;
protected:
void Prepare(int start, int step);
public:
cViewListRecordings(void);
virtual ~cViewListRecordings(void);
void Set(const cRecording *recording, int index, bool current, bool selectable, int level, int total, int New);
};
class cViewListPlugin : public cViewList {
private:
cLeMenuPlugin **listPlugin;
cCeMenuPlugin *currentPlugin;
protected:
void Prepare(int start, int step);
public:
cViewListPlugin(void);
virtual ~cViewListPlugin(void);
void Set(skindesignerapi::cTokenContainer *tk, int index, bool current, bool selectable);
};
class cViewListAudioTracks : public cViewList {
private:
skindesignerapi::cTokenContainer *tokenContainer;
int numTracks;
cLeAudioTracks **listAudioTracks;
public:
cViewListAudioTracks(void);
virtual ~cViewListAudioTracks(void);
void Close(void);
void PreCache(void);
void SetNumtracks(int numTracks);
void SetTracks(const char * const *tracks);
void SetCurrentTrack(int index);
void Draw(void);
};
class cViewListChannelList : public cViewList {
private:
cLeChannelList **listChannelList;
protected:
void Prepare(int start, int step);
public:
cViewListChannelList(void);
virtual ~cViewListChannelList(void);
void Set(const cChannel *channel, int index, bool current);
};
class cViewListGroupList : public cViewList {
private:
cLeGroupList **listGroupList;
protected:
void Prepare(int start, int step);
public:
cViewListGroupList(void);
virtual ~cViewListGroupList(void);
void Set(const char *group, int numChannels, int index, bool current);
};
#endif //__VIEWLIST_H

View File

@ -1,21 +1,21 @@
#include "designer.h" #include "designer.h"
#include "extensions/helpers.h" #include "libcore/helpers.h"
cSkinDesigner::cSkinDesigner(string skin, cTheme *theme) : cSkin(skin.c_str(), theme) { cSkinDesigner::cSkinDesigner(string skin) : cSkin(skin.c_str(), &::Theme) {
init = true; init = true;
initialized = false;
this->skin = skin; this->skin = skin;
backupSkin = NULL; backupSkin = NULL;
useBackupSkin = false; useBackupSkin = false;
globals = NULL; globals = NULL;
channelView = NULL; channelTemplate = NULL;
menuView = NULL; menuTemplate = NULL;
messageView = NULL; messageTemplate = NULL;
replayView = NULL; replayTemplate = NULL;
volumeView = NULL; volumeTemplate = NULL;
tracksView = NULL; audiotracksTemplate = NULL;
currentMenu = NULL; currentMenu = NULL;
dsyslog("skindesigner: skin %s started", skin.c_str()); dsyslog("skindesigner: skin %s started", skin.c_str());
@ -24,7 +24,7 @@ cSkinDesigner::cSkinDesigner(string skin, cTheme *theme) : cSkin(skin.c_str(), t
cSkinDesigner::~cSkinDesigner(void) { cSkinDesigner::~cSkinDesigner(void) {
if (globals) if (globals)
delete globals; delete globals;
DeleteViews(); DeleteTemplates();
if (backupSkin) if (backupSkin)
delete backupSkin; delete backupSkin;
} }
@ -36,9 +36,9 @@ const char *cSkinDesigner::Description(void) {
cSkinDisplayChannel *cSkinDesigner::DisplayChannel(bool WithInfo) { cSkinDisplayChannel *cSkinDesigner::DisplayChannel(bool WithInfo) {
currentMenu = NULL; currentMenu = NULL;
cSkinDisplayChannel *displayChannel = NULL; cSkinDisplayChannel *displayChannel = NULL;
Init();
if (!useBackupSkin) { if (!useBackupSkin) {
displayChannel = new cSDDisplayChannel(channelView, WithInfo); Init();
displayChannel = new cSDDisplayChannel(channelTemplate, WithInfo);
} else { } else {
displayChannel = backupSkin->DisplayChannel(WithInfo); displayChannel = backupSkin->DisplayChannel(WithInfo);
} }
@ -49,7 +49,7 @@ cSkinDisplayMenu *cSkinDesigner::DisplayMenu(void) {
if (!useBackupSkin) { if (!useBackupSkin) {
cSDDisplayMenu *displayMenu = NULL; cSDDisplayMenu *displayMenu = NULL;
Init(); Init();
displayMenu = new cSDDisplayMenu(menuView); displayMenu = new cSDDisplayMenu(menuTemplate);
currentMenu = displayMenu; currentMenu = displayMenu;
return displayMenu; return displayMenu;
} else { } else {
@ -64,7 +64,7 @@ cSkinDisplayReplay *cSkinDesigner::DisplayReplay(bool ModeOnly) {
cSkinDisplayReplay *displayReplay = NULL; cSkinDisplayReplay *displayReplay = NULL;
if (!useBackupSkin) { if (!useBackupSkin) {
Init(); Init();
displayReplay = new cSDDisplayReplay(replayView, ModeOnly); displayReplay = new cSDDisplayReplay(replayTemplate, ModeOnly);
} else { } else {
displayReplay = backupSkin->DisplayReplay(ModeOnly); displayReplay = backupSkin->DisplayReplay(ModeOnly);
} }
@ -76,7 +76,7 @@ cSkinDisplayVolume *cSkinDesigner::DisplayVolume(void) {
cSkinDisplayVolume *displayVolume = NULL; cSkinDisplayVolume *displayVolume = NULL;
if (!useBackupSkin) { if (!useBackupSkin) {
Init(); Init();
displayVolume = new cSDDisplayVolume(volumeView); displayVolume = new cSDDisplayVolume(volumeTemplate);
} else { } else {
displayVolume = backupSkin->DisplayVolume(); displayVolume = backupSkin->DisplayVolume();
} }
@ -88,7 +88,7 @@ cSkinDisplayTracks *cSkinDesigner::DisplayTracks(const char *Title, int NumTrack
cSkinDisplayTracks *displayTracks = NULL; cSkinDisplayTracks *displayTracks = NULL;
if (!useBackupSkin) { if (!useBackupSkin) {
Init(); Init();
displayTracks = new cSDDisplayTracks(tracksView, Title, NumTracks, Tracks); displayTracks = new cSDDisplayTracks(audiotracksTemplate, Title, NumTracks, Tracks);
} else { } else {
displayTracks = backupSkin->DisplayTracks(Title, NumTracks, Tracks); displayTracks = backupSkin->DisplayTracks(Title, NumTracks, Tracks);
} }
@ -100,70 +100,71 @@ cSkinDisplayMessage *cSkinDesigner::DisplayMessage(void) {
cSkinDisplayMessage *displayMessage = NULL; cSkinDisplayMessage *displayMessage = NULL;
if (!useBackupSkin) { if (!useBackupSkin) {
Init(); Init();
displayMessage = new cSDDisplayMessage(messageView); displayMessage = new cSDDisplayMessage(messageTemplate);
} else { } else {
displayMessage = backupSkin->DisplayMessage(); displayMessage = backupSkin->DisplayMessage();
} }
return displayMessage; return displayMessage;
} }
int cSkinDesigner::Reload(void) { cSkinDisplayPlugin *cSkinDesigner::DisplayPlugin(string pluginName, int viewID, int subViewID) {
currentMenu = NULL;
if (useBackupSkin)
return NULL;
Init();
map< string, map <int, cTemplate*> >::iterator hit = pluginTemplates.find(pluginName);
if (hit == pluginTemplates.end())
return NULL;
map <int, cTemplate*>::iterator hit2 = (hit->second).find(viewID);
if (hit2 == (hit->second).end())
return NULL;
return new cSkinDisplayPlugin(hit2->second, subViewID);
}
void cSkinDesigner::Reload(void) {
dsyslog("skindesigner: forcing full reload of templates"); dsyslog("skindesigner: forcing full reload of templates");
if (cOsd::IsOpen()) { if (cOsd::IsOpen()) {
esyslog("skindesigner: OSD is open, close first!"); esyslog("skindesigner: OSD is open, close first!");
return 2; return;
} }
cStopWatch watch; cStopWatch watch;
bool ok = LoadViews(); bool ok = LoadTemplates();
if (!ok) { if (!ok) {
esyslog("skindesigner: error during loading of templates - using LCARS as backup"); esyslog("skindesigner: error during loading of templates - using LCARS as backup");
if (!backupSkin) if (!backupSkin)
backupSkin = new cSkinLCARS(); backupSkin = new cSkinLCARS();
useBackupSkin = true; useBackupSkin = true;
return 1;
} else { } else {
CacheViews(); CacheTemplates();
useBackupSkin = false; useBackupSkin = false;
watch.Stop("templates reloaded and cache created"); watch.Stop("templates reloaded and cache created");
} }
return 0;
} }
void cSkinDesigner::ListAvailableFonts(void) { void cSkinDesigner::ListAvailableFonts(void) {
fontManager->ListAvailableFonts(); fontManager->ListAvailableFonts();
} }
bool cSkinDesigner::SetCustomIntToken(string option) { bool cSkinDesigner::SetCustomToken(string option) {
splitstring s(option.c_str()); splitstring s(option.c_str());
vector<string> flds = s.split('=', 0); vector<string> flds = s.split('=', 0);
if (flds.size() != 2) if (flds.size() != 2)
return false; return false;
int key = atoi(trim(flds[0]).c_str());
string key = trim(flds[0]);
string val = trim(flds[1]); string val = trim(flds[1]);
if (!globals) if (!globals)
return true; return true;
if (key > 0 && isNumber(val)) {
if (isNumber(val)) {
globals->AddCustomInt(key, atoi(val.c_str())); globals->AddCustomInt(key, atoi(val.c_str()));
} else { } else {
return false;
}
return true;
}
bool cSkinDesigner::SetCustomStringToken(string option) {
splitstring s(option.c_str());
vector<string> flds = s.split('=', 0);
if (flds.size() != 2)
return false;
int key = atoi(trim(flds[0]).c_str());
string val = trim(flds[1]);
if (!globals)
return true;
if (key > 0)
globals->AddCustomString(key, val); globals->AddCustomString(key, val);
else }
return false;
return true; return true;
} }
@ -173,24 +174,11 @@ void cSkinDesigner::ListCustomTokens(void) {
globals->ListCustomTokens(); globals->ListCustomTokens();
} }
skindesignerapi::ISkinDisplayPlugin *cSkinDesigner::GetDisplayPlugin(int plugId) {
Init();
map<int, cViewPlugin*>::iterator hit = pluginViews.find(plugId);
if (hit == pluginViews.end())
return NULL;
return hit->second;
}
/********************************************************************************* /*********************************************************************************
* PRIVATE FUNCTIONS * PRIVATE FUNCTIONS
*********************************************************************************/ *********************************************************************************/
void cSkinDesigner::Init(void) { void cSkinDesigner::Init(void) {
if ( init if (init || config.OsdSizeChanged() || config.SkinChanged() || config.OsdLanguageChanged() || config.setupCloseDoReload) {
|| config.OsdSizeChanged()
|| config.SkinChanged()
|| config.OsdLanguageChanged() ||
config.setupCloseDoReload )
{
config.setupCloseDoReload = false; config.setupCloseDoReload = false;
if (init) { if (init) {
config.SetSkin(); config.SetSkin();
@ -198,10 +186,9 @@ void cSkinDesigner::Init(void) {
config.SetOSDFonts(); config.SetOSDFonts();
} }
dsyslog("skindesigner: initializing skin %s", skin.c_str()); dsyslog("skindesigner: initializing skin %s", skin.c_str());
config.CheckDecimalPoint(); config.CheckDecimalPoint();
plgManager->Reset();
if (fontManager) if (fontManager)
delete fontManager; delete fontManager;
fontManager = new cFontManager(); fontManager = new cFontManager();
@ -211,73 +198,69 @@ void cSkinDesigner::Init(void) {
imgCache->SetPathes(); imgCache->SetPathes();
cStopWatch watch; cStopWatch watch;
bool ok = LoadViews(); bool ok = LoadTemplates();
if (!ok) { if (!ok) {
esyslog("skindesigner: error during loading of templates - using LCARS as backup"); esyslog("skindesigner: error during loading of templates - using LCARS as backup");
backupSkin = new cSkinLCARS(); backupSkin = new cSkinLCARS();
useBackupSkin = true; useBackupSkin = true;
initialized = true;
} else { } else {
CacheViews(); CacheTemplates();
watch.Stop("templates loaded and caches created"); watch.Stop("templates loaded and cache created");
} }
init = false; init = false;
initialized = true; } else if (config.OsdFontsChanged()) {
}
else if (config.OsdFontsChanged())
{
dsyslog("skindesigner: reloading fonts"); dsyslog("skindesigner: reloading fonts");
if (fontManager) if (fontManager)
delete fontManager; delete fontManager;
fontManager = new cFontManager(); fontManager = new cFontManager();
cStopWatch watch; cStopWatch watch;
bool ok = LoadViews(); bool ok = LoadTemplates();
if (!ok) { if (!ok) {
esyslog("skindesigner: error during loading of templates - using LCARS as backup"); esyslog("skindesigner: error during loading of templates - using LCARS as backup");
backupSkin = new cSkinLCARS(); backupSkin = new cSkinLCARS();
useBackupSkin = true; useBackupSkin = true;
} else { } else {
CacheViews(); CacheTemplates();
watch.Stop("templates loaded and caches created"); watch.Stop("templates loaded and cache created");
} }
} }
else if (config.PlayModeChanged())
{
dsyslog ("skindesigner: drop image cache");
if (imgCache)
delete imgCache;
imgCache = new cImageCache();
imgCache->SetPathes();
}
} }
void cSkinDesigner::DeleteViews(void) { void cSkinDesigner::DeleteTemplates(void) {
delete channelView; if (channelTemplate) {
channelView = NULL; delete channelTemplate;
channelTemplate = NULL;
delete menuView;
menuView = NULL;
delete messageView;
messageView = NULL;
delete replayView;
replayView = NULL;
delete volumeView;
volumeView = NULL;
delete tracksView;
tracksView = NULL;
for (map<int,cViewPlugin*>::iterator it = pluginViews.begin(); it != pluginViews.end(); it++) {
cViewPlugin *plugView = it->second;
delete plugView;
} }
pluginViews.clear(); if (menuTemplate) {
delete menuTemplate;
menuTemplate = NULL;
}
if (messageTemplate) {
delete messageTemplate;
messageTemplate = NULL;
}
if (replayTemplate) {
delete replayTemplate;
replayTemplate = NULL;
}
if (volumeTemplate) {
delete volumeTemplate;
volumeTemplate = NULL;
}
if (audiotracksTemplate) {
delete audiotracksTemplate;
audiotracksTemplate = NULL;
}
for (map< string, map <int, cTemplate*> >::iterator plugs = pluginTemplates.begin(); plugs !=pluginTemplates.end(); plugs++) {
map <int, cTemplate*> plugTpls = plugs->second;
for (map <int, cTemplate*>::iterator tpl = plugTpls.begin(); tpl != plugTpls.end(); tpl++) {
delete tpl->second;
}
}
pluginTemplates.clear();
} }
bool cSkinDesigner::LoadViews(void) { bool cSkinDesigner::LoadTemplates(void) {
if (globals) if (globals)
delete globals; delete globals;
globals = new cGlobals(); globals = new cGlobals();
@ -293,102 +276,142 @@ bool cSkinDesigner::LoadViews(void) {
skinSetup->AddToGlobals(globals); skinSetup->AddToGlobals(globals);
} }
DeleteViews(); DeleteTemplates();
channelView = new cViewChannel(); channelTemplate = new cTemplate(vtDisplayChannel);
ok = channelView->ReadFromXML(); channelTemplate->SetGlobals(globals);
ok = channelTemplate->ReadFromXML();
if (!ok) { if (!ok) {
esyslog("skindesigner: error reading displaychannel template, aborting"); esyslog("skindesigner: error reading displaychannel template, aborting");
DeleteViews(); DeleteTemplates();
return false; return false;
} }
channelView->SetGlobals(globals); channelTemplate->Translate();
menuView = new cViewMenu(); menuTemplate = new cTemplate(vtDisplayMenu);
ok = menuView->ReadFromXML(); menuTemplate->SetGlobals(globals);
ok = menuTemplate->ReadFromXML();
if (!ok) { if (!ok) {
esyslog("skindesigner: error reading displaymenu template, aborting"); esyslog("skindesigner: error reading displaymenu template, aborting");
DeleteViews(); DeleteTemplates();
return false; return false;
} }
menuView->SetGlobals(globals); menuTemplate->Translate();
messageView = new cViewMessage(); messageTemplate = new cTemplate(vtDisplayMessage);
ok = messageView->ReadFromXML(); messageTemplate->SetGlobals(globals);
ok = messageTemplate->ReadFromXML();
if (!ok) { if (!ok) {
esyslog("skindesigner: error reading displaymessage template, aborting"); esyslog("skindesigner: error reading displaymessage template, aborting");
DeleteViews(); DeleteTemplates();
return false; return false;
} }
messageView->SetGlobals(globals); messageTemplate->Translate();
replayView = new cViewReplay(); replayTemplate = new cTemplate(vtDisplayReplay);
ok = replayView->ReadFromXML(); replayTemplate->SetGlobals(globals);
ok = replayTemplate->ReadFromXML();
if (!ok) { if (!ok) {
esyslog("skindesigner: error reading displayreplay template, aborting"); esyslog("skindesigner: error reading displayreplay template, aborting");
DeleteViews(); DeleteTemplates();
return false; return false;
} }
replayView->SetGlobals(globals); replayTemplate->Translate();
volumeView = new cViewVolume(); volumeTemplate = new cTemplate(vtDisplayVolume);
ok = volumeView->ReadFromXML(); volumeTemplate->SetGlobals(globals);
ok = volumeTemplate->ReadFromXML();
if (!ok) { if (!ok) {
esyslog("skindesigner: error reading displayvolume template, aborting"); esyslog("skindesigner: error reading displayvolume template, aborting");
DeleteViews(); DeleteTemplates();
return false; return false;
} }
volumeView->SetGlobals(globals); volumeTemplate->Translate();
tracksView = new cViewTracks(); audiotracksTemplate = new cTemplate(vtDisplayAudioTracks);
ok = tracksView->ReadFromXML(); audiotracksTemplate->SetGlobals(globals);
ok = audiotracksTemplate->ReadFromXML();
if (!ok) { if (!ok) {
esyslog("skindesigner: error reading displayaudiotracks template, aborting"); esyslog("skindesigner: error reading displayaudiotracks template, aborting");
DeleteViews(); DeleteTemplates();
return false; return false;
} }
tracksView->SetGlobals(globals); audiotracksTemplate->Translate();
LoadPluginViews(); config.InitPluginViewIterator();
map <int,string> *plugViews = NULL;
string plugName;
while ( plugViews = config.GetPluginViews(plugName) ) {
for (map <int,string>::iterator v = plugViews->begin(); v != plugViews->end(); v++) {
int viewID = v->first;
stringstream templateName;
templateName << "plug-" << plugName << "-" << v->second.c_str();
cTemplate *plgTemplate = new cTemplate(vtDisplayPlugin, plugName, viewID);
plgTemplate->SetGlobals(globals);
ok = plgTemplate->ReadFromXML(templateName.str());
if (!ok) {
esyslog("skindesigner: error reading plugin %s template", plugName.c_str());
delete plgTemplate;
pluginTemplates.erase(plugName);
break;
}
ok = plgTemplate->SetSubViews(plugName, viewID);
if (!ok) {
delete plgTemplate;
pluginTemplates.erase(plugName);
break;
}
plgTemplate->Translate();
map< string, map <int, cTemplate*> >::iterator hit = pluginTemplates.find(plugName);
if (hit == pluginTemplates.end()) {
map <int, cTemplate*> plugTemplates;
plugTemplates.insert(pair<int, cTemplate*>(v->first, plgTemplate));
pluginTemplates.insert(pair<string, map <int, cTemplate*> >(plugName, plugTemplates));
} else {
(hit->second).insert(pair<int, cTemplate*>(v->first, plgTemplate));
}
}
}
dsyslog("skindesigner: templates successfully validated and parsed"); dsyslog("skindesigner: templates successfully validated and parsed");
return true; return true;
} }
void cSkinDesigner::LoadPluginViews(void) { void cSkinDesigner::CacheTemplates(void) {
plgManager->InitPluginViewIterator(); channelTemplate->PreCache();
string plugName = ""; menuTemplate->PreCache();
string viewTpl = ""; messageTemplate->PreCache();
int plugId = -1; replayTemplate->PreCache();
while ( plgManager->GetNextPluginView(plugName, plugId, viewTpl) ) { volumeTemplate->PreCache();
cViewPlugin *plugView = new cViewPlugin(0, plugId); audiotracksTemplate->PreCache();
bool ok = plugView->ReadFromXML(plugName.c_str(), viewTpl.c_str()); for (map< string, map <int, cTemplate*> >::iterator plugs = pluginTemplates.begin(); plugs != pluginTemplates.end(); plugs++) {
if (!ok) { for (map <int, cTemplate*>::iterator plugTplts = plugs->second.begin(); plugTplts != plugs->second.end(); plugTplts++) {
esyslog("skindesigner: error during loading templates for plugin %s", plugName.c_str()); (plugTplts->second)->PreCache();
continue;
} }
ok = plugView->ReadSubViews(plugName.c_str()); }
if (!ok) { dsyslog("skindesigner: templates cached");
esyslog("skindesigner: error during loading templates for plugin %s", plugName.c_str()); fontManager->DeleteFonts();
continue; fontManager->CacheFonts(channelTemplate);
fontManager->CacheFonts(menuTemplate);
fontManager->CacheFonts(messageTemplate);
fontManager->CacheFonts(replayTemplate);
fontManager->CacheFonts(volumeTemplate);
fontManager->CacheFonts(audiotracksTemplate);
dsyslog("skindesigner: fonts cached");
dsyslog("skindesigner: caching images...");
imgCache->Clear();
imgCache->SetPathes();
channelTemplate->CacheImages();
menuTemplate->CacheImages();
messageTemplate->CacheImages();
replayTemplate->CacheImages();
volumeTemplate->CacheImages();
audiotracksTemplate->CacheImages();
for (map< string, map <int, cTemplate*> >::iterator plugs = pluginTemplates.begin(); plugs != pluginTemplates.end(); plugs++) {
for (map <int, cTemplate*>::iterator plugTplts = plugs->second.begin(); plugTplts != plugs->second.end(); plugTplts++) {
(plugTplts->second)->CacheImages();
} }
plugView->SetGlobals(globals);
pluginViews.insert(pair<int, cViewPlugin*>(plugId, plugView));
} }
}
void cSkinDesigner::CacheViews(void) {
channelView->PreCache();
menuView->PreCache();
messageView->PreCache();
replayView->PreCache();
volumeView->PreCache();
tracksView->PreCache();
for (map<int,cViewPlugin*>::iterator it = pluginViews.begin(); it != pluginViews.end(); it++) {
cViewPlugin *plugView = it->second;
plugView->PreCache();
}
dsyslog("skindesigner: templates and images cached");
imgCache->Debug(false); imgCache->Debug(false);
} }

View File

@ -4,45 +4,39 @@
class cSkinDesigner; class cSkinDesigner;
#include "config.h" #include "config.h"
#include "coreengine/viewdisplaychannel.h" #include "libtemplate/template.h"
#include "coreengine/viewdisplaymenu.h" #include "libtemplate/xmlparser.h"
#include "coreengine/viewdisplayreplay.h"
#include "coreengine/viewdisplayvolume.h"
#include "coreengine/viewdisplaytracks.h"
#include "coreengine/viewdisplaymessage.h"
#include "coreengine/viewdisplayplugin.h"
#include "displaychannel.h" #include "displaychannel.h"
#include "displaymenu.h" #include "displaymenu.h"
#include "displayreplay.h" #include "displayreplay.h"
#include "displayvolume.h" #include "displayvolume.h"
#include "displaytracks.h" #include "displaytracks.h"
#include "displaymessage.h" #include "displaymessage.h"
#include "displayplugin.h"
#include <vdr/skinlcars.h> #include <vdr/skinlcars.h>
class cSkinDesigner : public cSkin { class cSkinDesigner : public cSkin {
private: private:
bool init; bool init;
bool initialized;
string skin; string skin;
cSkinLCARS *backupSkin; cSkinLCARS *backupSkin;
bool useBackupSkin; bool useBackupSkin;
cGlobals *globals; cGlobals *globals;
cViewChannel *channelView; cTemplate *channelTemplate;
cViewMenu *menuView; cTemplate *menuTemplate;
cViewMessage *messageView; cTemplate *messageTemplate;
cViewReplay *replayView; cTemplate *replayTemplate;
cViewVolume *volumeView; cTemplate *volumeTemplate;
cViewTracks *tracksView; cTemplate *audiotracksTemplate;
map< string, map <int, cTemplate*> > pluginTemplates;
cSDDisplayMenu *currentMenu; cSDDisplayMenu *currentMenu;
map<int, cViewPlugin* > pluginViews;
void Init(void); void Init(void);
void ReloadCaches(void); void ReloadCaches(void);
void DeleteViews(void); void DeleteTemplates(void);
bool LoadViews(void); bool LoadTemplates(void);
void LoadPluginViews(void); void CacheTemplates(void);
void CacheViews(void);
public: public:
cSkinDesigner(string skin, cTheme *theme); cSkinDesigner(string skin);
virtual ~cSkinDesigner(void); virtual ~cSkinDesigner(void);
virtual const char *Description(void); virtual const char *Description(void);
virtual cSkinDisplayChannel *DisplayChannel(bool WithInfo); virtual cSkinDisplayChannel *DisplayChannel(bool WithInfo);
@ -51,15 +45,13 @@ public:
virtual cSkinDisplayVolume *DisplayVolume(void); virtual cSkinDisplayVolume *DisplayVolume(void);
virtual cSkinDisplayTracks *DisplayTracks(const char *Title, int NumTracks, const char * const *Tracks); virtual cSkinDisplayTracks *DisplayTracks(const char *Title, int NumTracks, const char * const *Tracks);
virtual cSkinDisplayMessage *DisplayMessage(void); virtual cSkinDisplayMessage *DisplayMessage(void);
virtual cSkinDisplayPlugin *DisplayPlugin(string pluginName, int viewID, int subViewID);
void ActivateBackupSkin(void) { useBackupSkin = true; }; void ActivateBackupSkin(void) { useBackupSkin = true; };
int Reload(void); void Reload(void);
bool Initialized(void) { return initialized; };
void ListAvailableFonts(void); void ListAvailableFonts(void);
bool SetCustomIntToken(string option); bool SetCustomToken(string option);
bool SetCustomStringToken(string option);
void ListCustomTokens(void); void ListCustomTokens(void);
cSDDisplayMenu *GetDisplayMenu(void) { return currentMenu; }; cSDDisplayMenu *GetDisplayMenu(void) { return currentMenu; };
skindesignerapi::ISkinDisplayPlugin *GetDisplayPlugin(int plugId);
}; };
#endif //__SKINDESIGNER_H #endif //__SKINDESIGNER_H

View File

@ -1,100 +1,220 @@
#include "displaychannel.h" #include "displaychannel.h"
#include "libcore/timers.h"
cSDDisplayChannel::cSDDisplayChannel(cViewChannel *channelView, bool WithInfo) { cSDDisplayChannel::cSDDisplayChannel(cTemplate *channelTemplate, bool WithInfo) {
view = channelView; channelView = NULL;
ok = view->Init();
if (!ok) if (!channelTemplate) {
esyslog("skindesigner: Error initiating displaychannel view - aborting"); doOutput = false;
return;
} else {
doOutput = true;
}
groupSep = false;
present = NULL;
currentLast = 0;
channelChange = false;
initial = true;
devicesLast = cTimeMs::Now();
currentChannelSid = -1;
isEncrypted = false;
channelView = new cDisplayChannelView(channelTemplate->GetRootView());
if (!channelView->createOsd()) {
doOutput = false;
return;
}
channelView->DrawDebugGrid();
} }
cSDDisplayChannel::~cSDDisplayChannel() { cSDDisplayChannel::~cSDDisplayChannel() {
view->Close(); if (channelView)
delete channelView;
} }
void cSDDisplayChannel::SetChannel(const cChannel *Channel, int Number) { void cSDDisplayChannel::SetChannel(const cChannel *Channel, int Number) {
if (!ok) if (!doOutput)
return; return;
view->SetChannel(Channel, Number); channelChange = true;
groupSep = false;
cString ChannelNumber("");
cString ChannelName("");
cString ChannelID("");
currentChannelSid = -1;
isEncrypted = false;
if (Channel) {
ChannelName = Channel->Name() ? Channel->Name() : "";
ChannelID = Channel->GetChannelID().ToString();
currentChannelSid = Channel->Sid();
isEncrypted = Channel->Ca();
if (!Channel->GroupSep()) {
ChannelNumber = cString::sprintf("%d%s", Channel->Number(), Number ? "-" : "");
} else {
groupSep = true;
}
} else if (Number) {
ChannelNumber = cString::sprintf("%d-", Number);
} else {
ChannelName = ChannelString(NULL, 0);
}
channelView->ClearChannel();
channelView->ClearEPGInfo();
channelView->ClearStatusIcons();
channelView->ClearChannelGroups();
channelView->ClearScraperContent();
channelView->ClearAudioInfo();
channelView->ClearEncryptionInfo();
if (!groupSep) {
channelView->DrawChannel(ChannelNumber, ChannelName, ChannelID, (Number > 0)?true:false);
channelView->DrawProgressBarBack();
channelView->DrawSignalBackground();
if (Channel) {
channelView->DrawStatusIcons(Channel);
channelView->DrawAudioInfo();
}
} else {
channelView->ClearSignal();
channelView->ClearSignalBackground();
channelView->ClearProgressBar();
channelView->ClearProgressBarBack();
if (Channel)
channelView->DrawChannelGroups(Channel, ChannelName);
}
} }
void cSDDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following) { void cSDDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following) {
if (!ok) if (!doOutput)
return; return;
view->SetEvents(Present, Following);
present = Present;
channelView->ClearProgressBar();
if (!groupSep) {
channelView->ClearEPGInfo();
}
cGlobalSortedTimers SortedTimers;// local and remote timers
bool recPresent = false;
if (Present) {
if (!groupSep) {
SetProgressBar(Present);
}
eTimerMatch TimerMatch = tmNone;
const cTimer *Timer = Timers.GetMatch(Present, &TimerMatch);
if (Timer && Timer->Recording()) {
recPresent = true;
}
for (int i = 0; i < SortedTimers.Size() && !recPresent; i++)
if (const cTimer *Timer = SortedTimers[i])
if (Timer->Channel()->GetChannelID() == Present->ChannelID())
if (const cEvent *timerEvent = Timer->Event())
if (Present->EventID() == timerEvent->EventID())
recPresent = Timer->Recording();
}
bool recFollowing = false;
if (Following) {
recFollowing = Following->HasTimer();
for (int i = 0; i < SortedTimers.Size() && !recFollowing; i++)
if (const cTimer *Timer = SortedTimers[i])
if (Timer->Channel()->GetChannelID() == Following->ChannelID())
if (const cEvent *timerEvent = Timer->Event())
if (Following->EventID() == timerEvent->EventID())
recFollowing = true;
}
if (Present || Following) {
channelView->DrawEPGInfo(Present, Following, recPresent, recFollowing);
channelView->DrawScraperContent(Present);
}
} }
void cSDDisplayChannel::SetProgressBar(const cEvent *present) {
int Current = 0;
int Total = 0;
time_t t = time(NULL);
if (t > present->StartTime())
Current = t - present->StartTime();
Total = present->Duration();
if ((Current > currentLast + 3) || initial || channelChange) {
currentLast = Current;
cString start = present->GetTimeString();
cString stop = present->GetEndTimeString();
channelView->DrawProgressBar(start, stop, Current, Total);
}
}
void cSDDisplayChannel::SetMessage(eMessageType Type, const char *Text) { void cSDDisplayChannel::SetMessage(eMessageType Type, const char *Text) {
if (!ok) if (!doOutput)
return; return;
view->SetMessage(Type, Text); channelView->ClearChannel();
channelView->ClearEPGInfo();
channelView->ClearStatusIcons();
channelView->ClearScreenResolution();
channelView->ClearProgressBar();
channelView->ClearProgressBarBack();
channelView->ClearSignal();
channelView->ClearSignalBackground();
channelView->ClearScraperContent();
channelView->ClearAudioInfo();
channelView->DisplayMessage(Type, Text);
groupSep = true;
} }
#ifdef USE_ZAPCOCKPIT
void cSDDisplayChannel::SetViewType(eDisplaychannelView ViewType) {
if (!ok)
return;
view->SetViewType(ViewType);
}
int cSDDisplayChannel::MaxItems(void) {
if (!ok)
return 0;
return view->MaxItems();
}
bool cSDDisplayChannel::KeyRightOpensChannellist(void) {
if (!ok)
return true;
return view->KeyRightOpensChannellist();
}
void cSDDisplayChannel::SetChannelInfo(const cChannel *Channel) {
if (!ok)
return;
view->SetChannelInfo(Channel);
}
void cSDDisplayChannel::SetChannelList(const cChannel *Channel, int Index, bool Current) {
if (!ok)
return;
view->SetChannelList(Channel, Index, Current);
}
void cSDDisplayChannel::SetGroupList(const char *Group, int NumChannels, int Index, bool Current) {
if (!ok)
return;
view->SetGroupList(Group, NumChannels, Index, Current);
}
void cSDDisplayChannel::SetGroupChannelList(const cChannel *Channel, int Index, bool Current) {
if (!ok)
return;
}
void cSDDisplayChannel::ClearList(void) {
if (!ok)
return;
view->ClearList();
}
void cSDDisplayChannel::SetNumChannelHints(int Num) {
if (!ok)
return;
view->SetNumChannelHints(Num);
}
void cSDDisplayChannel::SetChannelHint(const cChannel *Channel) {
if (!ok)
return;
view->SetChannelHint(Channel);
}
#endif //USE_ZAPCOCKPIT
void cSDDisplayChannel::Flush(void) { void cSDDisplayChannel::Flush(void) {
if (!ok) if (!doOutput)
return; return;
view->GetTimers();
view->Flush(); if (initial) {
channelView->DrawBackground();
channelView->DrawSignalBackground();
channelView->DrawCurrentWeather();
}
if (initial || channelView->CustomTokenChange()) {
channelView->DrawCustomTokens();
}
if (initial || channelChange) {
channelView->DrawDate();
}
channelView->DrawTime();
if (present) {
SetProgressBar(present);
} else {
channelView->ClearProgressBar();
}
if (!groupSep) {
channelView->DrawScreenResolution();
channelView->DrawSignal();
channelView->DrawAudioInfo();
if (initial || cTimeMs::Now() - devicesLast > 500) {
channelView->DrawDevices(initial);
devicesLast = cTimeMs::Now();
}
if (isEncrypted) {
channelView->DrawEncryptionInfo(currentChannelSid);
}
} else {
channelView->ClearStatusIcons();
channelView->ClearScreenResolution();
channelView->ClearSignal();
channelView->ClearSignalBackground();
channelView->ClearDevices();
}
if (initial) {
channelView->DoStart();
}
initial = false;
channelChange = false;
channelView->Flush();
} }

View File

@ -1,37 +1,34 @@
#ifndef __DISPLAYCHANNEL_H #ifndef __DISPLAYCHANNEL_H
#define __DISPLAYCHANNEL_H #define __DISPLAYCHANNEL_H
#include <vdr/skins.h> #include <vdr/thread.h>
#include "config.h" #include "config.h"
#include "coreengine/definitions.h" #include "libtemplate/template.h"
#include "coreengine/viewdisplaychannel.h" #include "views/displaychannelview.h"
#ifdef USE_ZAPCOCKPIT
class cSDDisplayChannel : public cSkinDisplayChannelExtended {
#else
class cSDDisplayChannel : public cSkinDisplayChannel { class cSDDisplayChannel : public cSkinDisplayChannel {
#endif
private: private:
cViewChannel *view; cDisplayChannelView *channelView;
bool ok; bool doOutput;
bool initial;
bool groupSep;
bool channelChange;
time_t lastSignalDisplay;
int lastSignalStrength;
int lastSignalQuality;
int lastScreenWidth;
int currentLast;
uint64_t devicesLast;
const cEvent *present;
int currentChannelSid;
int isEncrypted;
void SetProgressBar(const cEvent *present);
public: public:
cSDDisplayChannel(cViewChannel *channelView, bool WithInfo); cSDDisplayChannel(cTemplate *channelTemplate, bool WithInfo);
virtual ~cSDDisplayChannel(); virtual ~cSDDisplayChannel();
virtual void SetChannel(const cChannel *Channel, int Number); virtual void SetChannel(const cChannel *Channel, int Number);
virtual void SetEvents(const cEvent *Present, const cEvent *Following); virtual void SetEvents(const cEvent *Present, const cEvent *Following);
virtual void SetMessage(eMessageType Type, const char *Text); virtual void SetMessage(eMessageType Type, const char *Text);
#ifdef USE_ZAPCOCKPIT
virtual void SetViewType(eDisplaychannelView ViewType);
virtual int MaxItems(void);
virtual bool KeyRightOpensChannellist(void);
virtual void SetChannelInfo(const cChannel *Channel);
virtual void SetChannelList(const cChannel *Channel, int Index, bool Current);
virtual void SetGroupList(const char *Group, int NumChannels, int Index, bool Current);
virtual void SetGroupChannelList(const cChannel *Channel, int Index, bool Current);
virtual void ClearList(void);
virtual void SetNumChannelHints(int Num);
virtual void SetChannelHint(const cChannel *Channel);
#endif
virtual void Flush(void); virtual void Flush(void);
}; };
#endif //__DISPLAYCHANNEL_H #endif //__DISPLAYCHANNEL_H

View File

@ -1,183 +1,339 @@
#include <vdr/player.h>
#include "displaymenu.h" #include "displaymenu.h"
#include "libcore/helpers.h"
cSDDisplayMenu::cSDDisplayMenu(cViewMenu *menuView) { cSDDisplayMenu::cSDDisplayMenu(cTemplate *menuTemplate) {
view = menuView; textAreaFont = NULL;
bool ok = false; rootView = NULL;
if (view) doOutput = true;
ok = view->Init(); state = vsInit;
if (ok) { pluginMenu = -1;
SetCurrentRecording(); pluginName = "";
} else { pluginMenuType = mtUnknown;
esyslog("skindesigner: Error initiating displaymenu view - aborting"); if (!menuTemplate) {
doOutput = false;
dsyslog("skindesigner: displayMenu no valid template - aborting");
return;
} }
rootView = new cDisplayMenuRootView(menuTemplate->GetRootView());
if (!rootView->createOsd()) {
doOutput = false;
return;
}
SetCurrentRecording();
rootView->DrawDebugGrid();
} }
cSDDisplayMenu::~cSDDisplayMenu() { cSDDisplayMenu::~cSDDisplayMenu() {
if (view) if (rootView)
view->Close(); delete rootView;
if (textAreaFont)
delete textAreaFont;
} }
void cSDDisplayMenu::Scroll(bool Up, bool Page) { void cSDDisplayMenu::Scroll(bool Up, bool Page) {
if (view) if (!doOutput)
view->KeyDetailView(Up, Page); return;
rootView->KeyInput(Up, Page);
} }
int cSDDisplayMenu::MaxItems(void) { int cSDDisplayMenu::MaxItems(void) {
if (view) if (!doOutput)
return view->NumListItems(); return 0;
return 0; int maxItems = rootView->GetMaxItems();
return maxItems;
} }
void cSDDisplayMenu::Clear(void) { void cSDDisplayMenu::Clear(void) {
if (view) if (!doOutput)
view->Clear(); return;
rootView->Clear();
} }
void cSDDisplayMenu::SetMenuCategory(eMenuCategory MenuCat) { void cSDDisplayMenu::SetMenuCategory(eMenuCategory MenuCat) {
if (view) if (!doOutput)
view->SetSubView(MenuCat); return;
rootView->SetMenu(MenuCat, (state == vsInit) ? true : false);
cSkinDisplayMenu::SetMenuCategory(MenuCat);
if (state != vsInit)
state = vsMenuInit;
} }
void cSDDisplayMenu::SetMenuSortMode(eMenuSortMode MenuSortMode) { void cSDDisplayMenu::SetMenuSortMode(eMenuSortMode MenuSortMode) {
if (view) if (!doOutput)
view->SetSortMode(MenuSortMode); return;
rootView->SetSortMode(MenuSortMode);
} }
eMenuOrientation cSDDisplayMenu::MenuOrientation(void) { void cSDDisplayMenu::SetPluginMenu(string name, int menu, int type, bool init) {
if (view) pluginName = name;
return view->MenuOrientation(); pluginMenu = menu;
return moVertical; pluginMenuType = (ePluginMenuType)type;
} rootView->SetPluginMenu(pluginName, pluginMenu, pluginMenuType);
if (!init) {
void cSDDisplayMenu::SetPluginMenu(int plugId, int menuId, int type, bool init) { rootView->SetMenu(mcPlugin, false);
if (view) }
view->SetPluginMenu(plugId, menuId);
} }
void cSDDisplayMenu::SetTitle(const char *Title) { void cSDDisplayMenu::SetTitle(const char *Title) {
if (view) if (!doOutput)
view->SetTitleHeader(Title); return;
rootView->SetTitle(Title);
} }
void cSDDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue) { void cSDDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue) {
if (view) if (!doOutput)
view->SetMenuButtons(Red, Green, Yellow, Blue); return;
rootView->SetButtonTexts(Red, Green, Yellow, Blue);
if (state != vsInit && MenuCategory() != mcMain)
state = vsMenuInit;
} }
void cSDDisplayMenu::SetMessage(eMessageType Type, const char *Text) { void cSDDisplayMenu::SetMessage(eMessageType Type, const char *Text) {
if (view) if (!doOutput)
view->SetMessage(Type, Text); return;
rootView->SetMessage(Type, Text);
rootView->DoFlush();
} }
bool cSDDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current, bool Selectable, const cChannel *Channel, bool WithDate, eTimerMatch TimerMatch, bool TimerActive) { bool cSDDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current, bool Selectable, const cChannel *Channel, bool WithDate, eTimerMatch TimerMatch) {
if (!view) if (!doOutput)
return true;
if (!rootView->SubViewAvailable())
return false; return false;
if (Index == 0) { if (config.blockFlush)
view->SetChannelHeader(Event); rootView->LockFlush();
bool isFav = false;
if (MenuCategory() == mcSchedule && Channel) {
isFav = true;
rootView->SetEpgSearchFavorite();
} }
return view->SetItemEvent(Event, Index, Current, Selectable, Channel, WithDate, TimerMatch); const cChannel *channel = Channel;
if (MenuCategory() == mcSchedule) {
if (!channel) {
channel = rootView->GetChannel();
}
if (!channel && Event) {
channel = Channels.GetByChannelID(Event->ChannelID());
}
rootView->SetChannel(channel);
}
cDisplayMenuListView *list = rootView->GetListView();
if (!list)
return false;
list->AddSchedulesMenuItem(Index, Event, channel, TimerMatch, MenuCategory(), isFav, Current, Selectable, "");
if (state == vsIdle)
state = vsMenuUpdate;
return true;
} }
bool cSDDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current, bool Selectable) { bool cSDDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current, bool Selectable) {
if (!view) if (!doOutput)
return true;
if (!rootView->SubViewAvailable())
return false; return false;
return view->SetItemTimer(Timer, Index, Current, Selectable); if (config.blockFlush)
rootView->LockFlush();
cDisplayMenuListView *list = rootView->GetListView();
if (!list)
return false;
list->AddTimersMenuItem(Index, Timer, Current, Selectable);
if (state == vsIdle)
state = vsMenuUpdate;
return true;
} }
bool cSDDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool Current, bool Selectable, bool WithProvider) { bool cSDDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool Current, bool Selectable, bool WithProvider) {
if (!view) if (!doOutput)
return true;
if (!rootView->SubViewAvailable())
return false; return false;
return view->SetItemChannel(Channel, Index, Current, Selectable, WithProvider); if (config.blockFlush)
rootView->LockFlush();
cDisplayMenuListView *list = rootView->GetListView();
if (!list)
return false;
list->AddChannelsMenuItem(Index, Channel, WithProvider, Current, Selectable);
if (state == vsIdle)
state = vsMenuUpdate;
return true;
} }
bool cSDDisplayMenu::SetItemRecording(const cRecording *Recording, int Index, bool Current, bool Selectable, int Level, int Total, int New) { bool cSDDisplayMenu::SetItemRecording(const cRecording *Recording, int Index, bool Current, bool Selectable, int Level, int Total, int New) {
if (!view) if (!doOutput)
return true;
if (!rootView->SubViewAvailable())
return false; return false;
return view->SetItemRecording(Recording, Index, Current, Selectable, Level, Total, New); if (config.blockFlush)
rootView->LockFlush();
cDisplayMenuListView *list = rootView->GetListView();
if (!list)
return false;
list->AddRecordingMenuItem(Index, Recording, Level, Total, New, Current, Selectable);
if (state == vsIdle)
state = vsMenuUpdate;
return true;
}
bool cSDDisplayMenu::SetItemPlugin(map<string,string> *stringTokens, map<string,int> *intTokens, map<string,vector<map<string,string> > > *loopTokens, int Index, bool Current, bool Selectable) {
if (!doOutput)
return true;
if (!rootView->SubViewAvailable())
return false;
if (config.blockFlush)
rootView->LockFlush();
cDisplayMenuListView *list = rootView->GetListView();
if (!list)
return false;
list->AddPluginMenuItem(stringTokens, intTokens, loopTokens, Index, Current, Selectable);
if (state == vsIdle)
state = vsMenuUpdate;
return true;
} }
void cSDDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable) { void cSDDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable) {
if (!view) if (!doOutput)
return; return;
view->SetItem(Text, Index, Current, Selectable); //esyslog("skindesigner: %s %d - %s", Current ? "----->" : "", Index, Text);
SetEditableWidth(view->GetListWidth() / 2); cDisplayMenuListView *list = rootView->GetListView();
} if (!list) {
return;
bool cSDDisplayMenu::SetItemPlugin(skindesignerapi::cTokenContainer *tk, int Index, bool Current, bool Selectable) { }
if (!view) if (config.blockFlush)
return false; rootView->LockFlush();
bool ok = view->SetItemPlugin(tk, Index, Current, Selectable); eMenuCategory cat = MenuCategory();
return ok; if (cat == mcMain && rootView->SubViewAvailable()) {
string plugName = list->AddMainMenuItem(Index, Text, Current, Selectable);
if (Current) {
rootView->SetSelectedPluginMainMenu(plugName);
}
} else if (cat == mcSetup && rootView->SubViewAvailable()) {
list->AddSetupMenuItem(Index, Text, Current, Selectable);
} else if ((cat == mcSchedule || cat == mcScheduleNow || cat == mcScheduleNext) && rootView->SubViewAvailable()) {
list->AddSchedulesMenuItem(Index, NULL, NULL, tmNone, MenuCategory(), false, Current, Selectable, Text ? Text : "");
} else {
rootView->CorrectDefaultMenu();
string *tabTexts = new string[MaxTabs];
for (int i=0; i<MaxTabs; i++) {
const char *s = GetTabbedText(Text, i);
if (s) {
if (strlen(s) == 0)
tabTexts[i] = " ";
else
tabTexts[i] = s;
} else {
tabTexts[i] = "";
}
}
list->AddDefaultMenuItem(Index, tabTexts, Current, Selectable);
SetEditableWidth( rootView->GetListViewWidth() / 2);
}
if (state == vsIdle)
state = vsMenuUpdate;
} }
void cSDDisplayMenu::SetTabs(int Tab1, int Tab2, int Tab3, int Tab4, int Tab5) { void cSDDisplayMenu::SetTabs(int Tab1, int Tab2, int Tab3, int Tab4, int Tab5) {
if (view) if (!doOutput)
view->SetTabs(Tab1, Tab2, Tab3, Tab4, Tab5); return;
rootView->SetTabs(Tab1, Tab2, Tab3, Tab4, Tab5);
} }
int cSDDisplayMenu::GetTextAreaWidth(void) const { int cSDDisplayMenu::GetTextAreaWidth(void) const {
if (view) int areaWidth = rootView->GetTextAreaWidth();
return view->GetTextAreaWidth(); return areaWidth;
return 0;
} }
const cFont *cSDDisplayMenu::GetTextAreaFont(bool FixedFont) const { const cFont *cSDDisplayMenu::GetTextAreaFont(bool FixedFont) const {
if (view) if (textAreaFont)
return view->GetTextAreaFont(); return textAreaFont;
return NULL; textAreaFont = rootView->GetTextAreaFont();
return textAreaFont;
} }
void cSDDisplayMenu::SetScrollbar(int Total, int Offset) { void cSDDisplayMenu::SetScrollbar(int Total, int Offset) {
if (view) if (!doOutput)
view->SetScrollbar(Total, Offset); return;
rootView->RenderMenuScrollBar(Total, Offset);
} }
void cSDDisplayMenu::SetEvent(const cEvent *Event) { void cSDDisplayMenu::SetEvent(const cEvent *Event) {
if (view) { if (!doOutput)
if (view->MenuCat() != mcEvent) return;
view->SetSubView(mcEvent); rootView->SetDetailedViewEvent(Event);
view->SetEvent(Event); state = vsMenuDetail;
}
} }
void cSDDisplayMenu::SetRecording(const cRecording *Recording) { void cSDDisplayMenu::SetRecording(const cRecording *Recording) {
if (view) { if (!doOutput)
if (view->MenuCat() != mcRecordingInfo) return;
view->SetSubView(mcRecordingInfo); rootView->SetDetailedViewRecording(Recording);
view->SetRecording(Recording); state = vsMenuDetail;
}
} }
void cSDDisplayMenu::SetText(const char *Text, bool FixedFont) { void cSDDisplayMenu::SetText(const char *Text, bool FixedFont) {
if (view) { if (!doOutput)
if (view->MenuCat() != mcText) return;
view->SetSubView(mcText); rootView->SetDetailedViewText(Text);
view->SetText(Text); state = vsMenuDetail;
}
} }
bool cSDDisplayMenu::SetPluginText(skindesignerapi::cTokenContainer *tk) { bool cSDDisplayMenu::SetPluginText(map<string,string> *stringTokens, map<string,int> *intTokens, map<string,vector<map<string,string> > > *loopTokens) {
bool ok = false; if (!doOutput)
if (view) return true;
ok = view->SetPluginText(tk); bool tmplOk = rootView->SetDetailedViewPlugin(stringTokens, intTokens, loopTokens);
return ok; state = vsMenuDetail;
return tmplOk;
} }
void cSDDisplayMenu::Flush(void) { void cSDDisplayMenu::Flush(void) {
if (view) if (!doOutput)
view->Flush(); return;
bool doFlush = false;
if (state == vsInit) {
rootView->Start();
rootView->RenderMenuItems();
doFlush = true;
} else if (state == vsMenuInit) {
rootView->Render();
rootView->RenderMenuItems();
doFlush = true;
} else if (state == vsMenuUpdate) {
rootView->RenderMenuItems();
doFlush = true;
} else if (state == vsMenuDetail) {
rootView->OpenFlush();
rootView->Render();
rootView->DoFlush();
rootView->RenderDetailView();
rootView->DoFlush();
}
if (rootView->RenderDynamicElements()) {
doFlush = true;
}
if (doFlush) {
if (config.blockFlush)
rootView->OpenFlush();
rootView->DoFlush();
}
state = vsIdle;
} }
void cSDDisplayMenu::SetCurrentRecording(void) { void cSDDisplayMenu::SetCurrentRecording(void) {
cControl *control = cControl::Control(); cControl *control = cControl::Control();
if (!control) { if (!control) {
view->SetCurrentRecording(NULL);
return; return;
} }
const cRecording *recording = control->GetRecording(); const cRecording *recording = control->GetRecording();
if (!recording) { if (!recording) {
view->SetCurrentRecording(NULL);
return; return;
} }
view->SetCurrentRecording(recording->FileName()); string recFileName = "";
if (recording->FileName()) {
recFileName = recording->FileName();
}
rootView->SetCurrentRecording(recFileName);
} }

View File

@ -1,40 +1,52 @@
#ifndef __DISPLAYMENU_H #ifndef __DISPLAYMENU_H
#define __DISPLAYMENU_H #define __DISPLAYMENU_H
#include "libskindesignerapi/skindesignerapi.h" #include "libskindesignerapi/skindesignerapi.h"
#include <vdr/skins.h> #include "libtemplate/template.h"
#include "coreengine/viewdisplaymenu.h" #include "views/displaymenurootview.h"
enum eViewState {
vsInit,
vsMenuInit,
vsMenuUpdate,
vsMenuDetail,
vsIdle
};
class cSDDisplayMenu : public skindesignerapi::ISDDisplayMenu { class cSDDisplayMenu : public skindesignerapi::ISDDisplayMenu {
private: private:
cViewMenu *view; cDisplayMenuRootView *rootView;
bool ok; eViewState state;
bool doOutput;
string pluginName;
int pluginMenu;
ePluginMenuType pluginMenuType;
mutable cFont *textAreaFont;
void SetCurrentRecording(void); void SetCurrentRecording(void);
protected:
int Tab(int n);
public: public:
cSDDisplayMenu(cViewMenu *menuView); cSDDisplayMenu(cTemplate *menuTemplate);
virtual ~cSDDisplayMenu(); virtual ~cSDDisplayMenu();
virtual void Scroll(bool Up, bool Page); virtual void Scroll(bool Up, bool Page);
virtual int MaxItems(void); virtual int MaxItems(void);
virtual void Clear(void); virtual void Clear(void);
virtual void SetMenuCategory(eMenuCategory MenuCat); virtual void SetMenuCategory(eMenuCategory MenuCat);
virtual void SetMenuSortMode(eMenuSortMode MenuSortMode); virtual void SetMenuSortMode(eMenuSortMode MenuSortMode);
virtual eMenuOrientation MenuOrientation(void); virtual void SetPluginMenu(string name, int menu, int type, bool init);
virtual void SetPluginMenu(int plugId, int menuId, int type, bool init);
virtual void SetTitle(const char *Title); virtual void SetTitle(const char *Title);
virtual void SetButtons(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL); 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 SetMessage(eMessageType Type, const char *Text);
virtual bool SetItemEvent(const cEvent *Event, int Index, bool Current, bool Selectable, const cChannel *Channel, bool WithDate, eTimerMatch TimerMatch, bool TimerActive); 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) { return SetItemEvent(Event, Index, Current, Selectable, Channel, WithDate, TimerMatch, true); } 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 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 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 bool SetItemRecording(const cRecording *Recording, int Index, bool Current, bool Selectable, int Level, int Total, int New);
virtual void SetItem(const char *Text, int Index, bool Current, bool Selectable); virtual bool SetItemPlugin(map<string,string> *stringTokens, map<string,int> *intTokens, map<string,vector<map<string,string> > > *loopTokens, int Index, bool Current, bool Selectable);
virtual bool SetItemPlugin(skindesignerapi::cTokenContainer *tk, int Index, bool Current, bool Selectable);
virtual void SetScrollbar(int Total, int Offset); virtual void SetScrollbar(int Total, int Offset);
virtual void SetEvent(const cEvent *Event); virtual void SetEvent(const cEvent *Event);
virtual void SetRecording(const cRecording *Recording); virtual void SetRecording(const cRecording *Recording);
virtual void SetText(const char *Text, bool FixedFont); virtual void SetText(const char *Text, bool FixedFont);
virtual bool SetPluginText(skindesignerapi::cTokenContainer *tk); virtual bool SetPluginText(map<string,string> *stringTokens, map<string,int> *intTokens, map<string,vector<map<string,string> > > *loopTokens);
virtual void Flush(void); virtual void Flush(void);
virtual void SetTabs(int Tab1, int Tab2 = 0, int Tab3 = 0, int Tab4 = 0, int Tab5 = 0); virtual void SetTabs(int Tab1, int Tab2 = 0, int Tab3 = 0, int Tab4 = 0, int Tab5 = 0);
virtual int GetTextAreaWidth(void) const; virtual int GetTextAreaWidth(void) const;

View File

@ -1,25 +1,46 @@
#include "displaymessage.h" #include "displaymessage.h"
cSDDisplayMessage::cSDDisplayMessage(cViewMessage *messageView) { cSDDisplayMessage::cSDDisplayMessage(cTemplate *messageTemplate) {
view = messageView; messageView = NULL;
ok = view->Init(); doOutput = true;
if (!ok) initial = true;
esyslog("skindesigner: Error initiating displaymessage view - aborting"); if (!messageTemplate) {
doOutput = false;
esyslog("skindesigner: displayMessage no valid template - aborting");
return;
}
messageView = new cDisplayMessageView(messageTemplate->GetRootView());
if (!messageView->createOsd()) {
doOutput = false;
return;
}
messageView->DrawDebugGrid();
messageView->DrawBackground();
} }
cSDDisplayMessage::~cSDDisplayMessage() { cSDDisplayMessage::~cSDDisplayMessage() {
view->Close(); if (messageView)
delete messageView;
} }
void cSDDisplayMessage::SetMessage(eMessageType Type, const char *Text) { void cSDDisplayMessage::SetMessage(eMessageType Type, const char *Text) {
if (!ok) if (!doOutput)
return; return;
view->SetMessage(Type, Text); messageView->ClearMessage();
if (!Text) {
return;
}
messageView->DrawMessage(Type, Text);
} }
void cSDDisplayMessage::Flush(void) { void cSDDisplayMessage::Flush(void) {
if (!ok) if (!doOutput)
return; return;
view->Flush(); if (initial) {
messageView->DoFadeIn();
initial = false;
} else {
messageView->Flush();
}
} }

View File

@ -1,18 +1,22 @@
#ifndef __DISPLAYMESSAGE_H #ifndef __DISPLAYMESSAGE_H
#define __DISPLAYMESSAGE_H #define __DISPLAYMESSAGE_H
#include <vdr/thread.h>
#include <vdr/skins.h>
#include "config.h" #include "config.h"
#include "coreengine/viewdisplaymessage.h" #include "libtemplate/template.h"
#include "views/displaymessageview.h"
class cSDDisplayMessage : public cSkinDisplayMessage { class cSDDisplayMessage : public cSkinDisplayMessage {
private: private:
cViewMessage *view; cDisplayMessageView *messageView;
bool ok; bool doOutput;
bool initial;
public: public:
cSDDisplayMessage(cViewMessage *messageView); cSDDisplayMessage(cTemplate *messageTemplate);
virtual ~cSDDisplayMessage(); virtual ~cSDDisplayMessage();
virtual void SetMessage(eMessageType Type, const char *Text); virtual void SetMessage(eMessageType Type, const char *Text);
virtual void Flush(void); virtual void Flush(void);
}; };
#endif //__DISPLAYMESSAGE_H #endif //__DISPLAYMESSAGE_H

201
displayplugin.c Normal file
View File

@ -0,0 +1,201 @@
#include "config.h"
#include "displayplugin.h"
cSkinDisplayPlugin::cSkinDisplayPlugin(cTemplate *pluginTemplate, int subViewID) {
if (!pluginTemplate) {
doOutput = false;
return;
} else {
doOutput = true;
}
initial = true;
if (subViewID > -1) {
cTemplateView *subView = pluginTemplate->GetRootView()->GetSubView((eSubView)subViewID);
if (!subView) {
doOutput = false;
return;
}
pluginView = new cDisplayPluginView(subView, false);
} else {
pluginView = new cDisplayPluginView(pluginTemplate->GetRootView(), true);
}
if (!pluginView->createOsd() && subViewID < 0) {
doOutput = false;
return;
}
pluginView->DrawDebugGrid();
}
cSkinDisplayPlugin::~cSkinDisplayPlugin(void) {
if (pluginView) {
delete pluginView;
pluginView = NULL;
}
}
void cSkinDisplayPlugin::Deactivate(bool hide) {
if (!doOutput) {
return;
}
pluginView->Deactivate(hide);
}
void cSkinDisplayPlugin::Activate(void) {
if (!doOutput) {
return;
}
pluginView->Activate();
}
void cSkinDisplayPlugin::ClearViewElement(int id) {
if (!doOutput) {
return;
}
pluginView->CleanViewElement(id);
}
void cSkinDisplayPlugin::DisplayViewElement(int id) {
if (!doOutput) {
return;
}
pluginView->DisplayViewElement(id);
}
void cSkinDisplayPlugin::SetViewElementIntTokens(map<string,int> *intTokens) {
if (pluginView)
pluginView->SetIntTokens(intTokens);
}
void cSkinDisplayPlugin::SetViewElementStringTokens(map<string,string> *stringTokens) {
if (pluginView)
pluginView->SetStringTokens(stringTokens);
}
void cSkinDisplayPlugin::SetViewElementLoopTokens(map<string,vector<map<string,string> > > *loopTokens) {
if (pluginView)
pluginView->SetLoopTokens(loopTokens);
}
void cSkinDisplayPlugin::InitGrids(int viewGridID) {
if (!doOutput) {
return;
}
pluginView->InitGrids(viewGridID);
}
void cSkinDisplayPlugin::SetGrid(int viewGridID, long gridID,
double x, double y, double width, double height,
map<string,int> *intTokens, map<string,string> *stringTokens) {
if (!doOutput) {
return;
}
pluginView->SetGrid(viewGridID, gridID, x, y, width, height, intTokens, stringTokens);
}
void cSkinDisplayPlugin::SetGridCurrent(int viewGridID, long gridID, bool current) {
if (!doOutput) {
return;
}
pluginView->SetGridCurrent(viewGridID, gridID, current);
}
void cSkinDisplayPlugin::DeleteGrid(int viewGridID, long gridID) {
if (!doOutput) {
return;
}
pluginView->DeleteGrid(viewGridID, gridID);
}
void cSkinDisplayPlugin::DisplayGrids(int viewGridID) {
if (!doOutput) {
return;
}
pluginView->DisplayGrids(viewGridID);
}
void cSkinDisplayPlugin::ClearGrids(int viewGridID) {
if (!doOutput) {
return;
}
pluginView->ClearGrids(viewGridID);
}
void cSkinDisplayPlugin::SetTabIntTokens(map<string,int> *intTokens) {
if (!doOutput) {
return;
}
pluginView->SetTabIntTokens(intTokens);
}
void cSkinDisplayPlugin::SetTabStringTokens(map<string,string> *stringTokens) {
if (!doOutput) {
return;
}
pluginView->SetTabStringTokens(stringTokens);
}
void cSkinDisplayPlugin::SetTabLoopTokens(map<string,vector<map<string,string> > > *loopTokens) {
if (!doOutput) {
return;
}
pluginView->SetTabLoopTokens(loopTokens);
}
void cSkinDisplayPlugin::SetTabs(void) {
if (!doOutput) {
return;
}
pluginView->SetTabs();
}
void cSkinDisplayPlugin::TabLeft(void) {
if (!doOutput) {
return;
}
pluginView->TabLeft();
}
void cSkinDisplayPlugin::TabRight(void) {
if (!doOutput) {
return;
}
pluginView->TabRight();
}
void cSkinDisplayPlugin::TabUp(void) {
if (!doOutput) {
return;
}
pluginView->TabUp();
}
void cSkinDisplayPlugin::TabDown(void) {
if (!doOutput) {
return;
}
pluginView->TabDown();
}
void cSkinDisplayPlugin::DisplayTabs(void) {
if (!doOutput) {
return;
}
pluginView->DisplayTab();
}
void cSkinDisplayPlugin::Flush(void) {
if (initial) {
pluginView->DoStart();
initial = false;
}
pluginView->Flush();
}
bool cSkinDisplayPlugin::ChannelLogoExists(string channelId) {
return imgCache->LogoExists(channelId);
}
string cSkinDisplayPlugin::GetEpgImagePath(void) {
return *config.epgImagePath;
}

44
displayplugin.h Normal file
View File

@ -0,0 +1,44 @@
#ifndef __DISPLAYPLUGIN_H
#define __DISPLAYPLUGIN_H
#include "libskindesignerapi/skindesignerapi.h"
#include "libtemplate/template.h"
#include "views/displaypluginview.h"
class cSkinDisplayPlugin : public skindesignerapi::ISkinDisplayPlugin {
private:
bool doOutput;
bool initial;
cDisplayPluginView *pluginView;
public:
cSkinDisplayPlugin(void) {};
cSkinDisplayPlugin(cTemplate *pluginTemplate, int subViewID);
virtual ~cSkinDisplayPlugin(void);
virtual void Deactivate(bool hide);
virtual void Activate(void);
virtual void ClearViewElement(int id);
virtual void DisplayViewElement(int id);
virtual void SetViewElementIntTokens(map<string,int> *intTokens);
virtual void SetViewElementStringTokens(map<string,string> *stringTokens);
virtual void SetViewElementLoopTokens(map<string,vector<map<string,string> > > *loopTokens);
virtual void InitGrids(int viewGridID);
virtual void SetGrid(int viewGridID, long gridID, double x, double y, double width, double height, map<string,int> *intTokens, map<string,string> *stringTokens);
virtual void SetGridCurrent(int viewGridID, long gridID, bool current);
virtual void DeleteGrid(int viewGridID, long gridID);
virtual void DisplayGrids(int viewGridID);
virtual void ClearGrids(int viewGridID);
virtual void SetTabIntTokens(map<string,int> *intTokens);
virtual void SetTabStringTokens(map<string,string> *stringTokens);
virtual void SetTabLoopTokens(map<string,vector<map<string,string> > > *loopTokens);
virtual void SetTabs(void);
virtual void TabLeft(void);
virtual void TabRight(void);
virtual void TabUp(void);
virtual void TabDown(void);
virtual void DisplayTabs(void);
virtual void Flush(void);
virtual bool ChannelLogoExists(string channelId);
virtual string GetEpgImagePath(void);
};
#endif //__DISPLAYPLUGIN_H

View File

@ -1,80 +1,140 @@
#define __STL_CONFIG_H
#include <vdr/player.h>
#include "displayreplay.h" #include "displayreplay.h"
cSDDisplayReplay::cSDDisplayReplay(cViewReplay *replayView, bool ModeOnly) { cSDDisplayReplay::cSDDisplayReplay(cTemplate *replayTemplate, bool ModeOnly) {
view = replayView; doOutput = true;
ok = view->Init(); initial = true;
if (!ok) initialModeSet = false;
esyslog("skindesigner: Error initiating displayreplay view - aborting"); modeOnly = ModeOnly;
view->SetModeOnly(ModeOnly); replayView = NULL;
if (!replayTemplate) {
doOutput = false;
esyslog("skindesigner: displayReplay no valid template - aborting");
return;
}
replayView = new cDisplayReplayView(replayTemplate->GetRootView());
if (!replayView->createOsd()) {
doOutput = false;
return;
}
replayView->DrawDebugGrid();
} }
cSDDisplayReplay::~cSDDisplayReplay() { cSDDisplayReplay::~cSDDisplayReplay() {
view->Close(); if (replayView)
delete replayView;
} }
void cSDDisplayReplay::SetRecording(const cRecording *Recording) { void cSDDisplayReplay::SetRecording(const cRecording *Recording) {
if (ok) { if (!doOutput || !Recording)
view->SetRecording(Recording); return;
if (initial) {
replayView->SetRecordingLength(Recording->LengthInSeconds());
SetTimeShiftValues(Recording);
} }
replayView->DrawTitle(Recording);
replayView->DrawRecordingInformation(Recording);
replayView->DrawScraperContent(Recording);
} }
void cSDDisplayReplay::SetTitle(const char *Title) { void cSDDisplayReplay::SetTitle(const char *Title) {
if (!ok) if (!doOutput || !Title)
return; return;
view->SetTitle(Title); replayView->DrawTitle(Title);
} }
void cSDDisplayReplay::SetMode(bool Play, bool Forward, int Speed) { void cSDDisplayReplay::SetMode(bool Play, bool Forward, int Speed) {
if (!ok) if (!doOutput)
return; return;
if (!Play && Speed < 0) { if (!Play && Speed < 0) {
string recFileName = "";
cControl *control = cControl::Control(); cControl *control = cControl::Control();
if (control) { if (control) {
const cRecording *recording = control->GetRecording(); const cRecording *recording = control->GetRecording();
if (recording && recording->FileName()) { if (recording && recording->FileName())
view->StartOnPause(recording->FileName()); recFileName = recording->FileName();
}
} }
replayView->DrawOnPause(recFileName, modeOnly);
} else { } else {
view->ClearOnPause(); replayView->ClearOnPause();
} }
replayView->DrawControlIcons(Play, Forward, Speed, modeOnly);
view->SetControlIcons(Play, Forward, Speed); initialModeSet = true;
} }
void cSDDisplayReplay::SetProgress(int Current, int Total) { void cSDDisplayReplay::SetProgress(int Current, int Total) {
if (ok) { if (!doOutput)
view->SetProgressbar(Current, Total); return;
if (marks) replayView->DelayOnPause();
view->SetMarks(marks, Current, Total); replayView->DrawProgressBar(Current, Total);
view->SetTimeshiftTimes(Current, Total); replayView->DrawMarks(marks, Current, Total);
view->SetEndTime(Current, Total); replayView->DrawEndTime(Current, Total);
view->DelayOnPause();
}
} }
void cSDDisplayReplay::SetCurrent(const char *Current) { void cSDDisplayReplay::SetCurrent(const char *Current) {
if (ok) if (!doOutput)
view->SetCurrent(Current); return;
replayView->DrawCurrent(Current);
} }
void cSDDisplayReplay::SetTotal(const char *Total) { void cSDDisplayReplay::SetTotal(const char *Total) {
if (ok) if (!doOutput)
view->SetTotal(Total); return;
replayView->DrawTotal(Total);
} }
void cSDDisplayReplay::SetJump(const char *Jump) { void cSDDisplayReplay::SetJump(const char *Jump) {
if (ok) if (!doOutput)
view->SetJump(Jump); return;
replayView->DrawJump(Jump);
} }
void cSDDisplayReplay::SetMessage(eMessageType Type, const char *Text) { void cSDDisplayReplay::SetMessage(eMessageType Type, const char *Text) {
if (ok) if (!doOutput)
view->SetMessage(Type, Text); return;
replayView->DrawMessage(Type, Text);
} }
void cSDDisplayReplay::Flush(void) { void cSDDisplayReplay::Flush(void) {
if (!ok) if (!doOutput)
return; return;
view->Flush(); if (!modeOnly) {
replayView->DrawDate();
replayView->DrawTime();
}
if (initial && initialModeSet) {
replayView->DrawBackground(modeOnly);
replayView->DrawCustomTokens();
replayView->DoFadeIn();
initial = false;
} else {
if (replayView->CustomTokenChange())
replayView->DrawCustomTokens();
replayView->Flush();
}
}
void cSDDisplayReplay::SetTimeShiftValues(const cRecording *recording) {
bool isTimeShift = false;
#if APIVERSNUM >= 20101
int usage = recording->IsInUse();
if (usage & ruTimer)
isTimeShift = true;
#endif
if (!isTimeShift)
return;
const cRecordingInfo *recInfo = recording->Info();
if (!recInfo)
return;
const cEvent *event = recInfo->GetEvent();
if (!event)
return;
double fps = recording->FramesPerSecond();
time_t liveEventStop = event->EndTime();
time_t recordingStart = time(0) - recording->LengthInSeconds();
int framesTotal = (liveEventStop - recordingStart)*fps;
int recLength = liveEventStop - recordingStart;
replayView->SetTimeShift(framesTotal, recLength);
} }

View File

@ -2,15 +2,21 @@
#define __DISPLAYREPLAY_H #define __DISPLAYREPLAY_H
#include <vdr/skins.h> #include <vdr/skins.h>
#include <vdr/thread.h>
#include "config.h" #include "config.h"
#include "coreengine/viewdisplayreplay.h" #include "libtemplate/template.h"
#include "views/displayreplayview.h"
class cSDDisplayReplay : public cSkinDisplayReplay { class cSDDisplayReplay : public cSkinDisplayReplay {
private: private:
bool ok; cDisplayReplayView *replayView;
cViewReplay *view; bool initial;
bool initialModeSet;
bool doOutput;
bool modeOnly;
void SetTimeShiftValues(const cRecording *recording);
public: public:
cSDDisplayReplay(cViewReplay *replayView, bool ModeOnly); cSDDisplayReplay(cTemplate *replayTemplate, bool ModeOnly);
virtual ~cSDDisplayReplay(); virtual ~cSDDisplayReplay();
virtual void SetRecording(const cRecording *Recording); virtual void SetRecording(const cRecording *Recording);
virtual void SetTitle(const char *Title); virtual void SetTitle(const char *Title);
@ -23,4 +29,4 @@ public:
virtual void Flush(void); virtual void Flush(void);
}; };
#endif //__DISPLAYREPLAY_H #endif //__DISPLAYREPLAY_H

View File

@ -1,31 +1,59 @@
#include "displaytracks.h" #include "displaytracks.h"
cSDDisplayTracks::cSDDisplayTracks(cViewTracks *tracksView, const char *Title, int NumTracks, const char * const *Tracks) {
view = tracksView; cSDDisplayTracks::cSDDisplayTracks(cTemplate *audiotracksTemplate, const char *Title, int NumTracks, const char * const *Tracks) {
ok = view->Init(); initial = true;
if (!ok) numTracks = NumTracks;
esyslog("skindesigner: Error initiating displaytracks view - aborting"); tracksView = NULL;
view->SetTitle(Title); doOutput = true;
view->SetNumtracks(NumTracks); currentTrack = 0;
view->SetTracks(Tracks); menuTitle = Title;
if (!audiotracksTemplate) {
esyslog("skindesigner: displayTracks no valid template - aborting");
doOutput = false;
return;
}
tracksView = new cDisplayAudiotracksView(NumTracks, audiotracksTemplate->GetRootView());
if (!tracksView->createOsd()) {
doOutput = false;
return;
}
tracksView->DrawDebugGrid();
tracksView->DrawBackground();
cDisplayMenuListView *list = tracksView->GetListView();
if (list) {
for (int i = 0; i < NumTracks; i++) {
list->AddTracksMenuItem(i, Tracks[i], (i==currentTrack)?true:false, true);
}
}
} }
cSDDisplayTracks::~cSDDisplayTracks() { cSDDisplayTracks::~cSDDisplayTracks() {
view->Close(); if (tracksView)
delete tracksView;
} }
void cSDDisplayTracks::SetTrack(int Index, const char * const *Tracks) { void cSDDisplayTracks::SetTrack(int Index, const char * const *Tracks) {
if (ok) cDisplayMenuListView *list = tracksView->GetListView();
view->SetCurrentTrack(Index); if (list) {
list->AddTracksMenuItem(currentTrack, Tracks[currentTrack], false, true);
list->AddTracksMenuItem(Index, Tracks[Index], true, true);
currentTrack = Index;
}
} }
void cSDDisplayTracks::SetAudioChannel(int AudioChannel) { void cSDDisplayTracks::SetAudioChannel(int AudioChannel) {
if (ok) tracksView->DrawHeader(menuTitle, AudioChannel);
view->SetAudiochannel(AudioChannel);
} }
void cSDDisplayTracks::Flush(void) { void cSDDisplayTracks::Flush(void) {
if (!ok) if (!doOutput)
return; return;
view->Flush(); if (initial) {
tracksView->DoFadeIn();
}
initial = false;
tracksView->RenderMenuItems();
tracksView->Flush();
} }

View File

@ -2,15 +2,21 @@
#define __DISPLAYTRACKS_H #define __DISPLAYTRACKS_H
#include <vdr/skins.h> #include <vdr/skins.h>
#include <vdr/thread.h>
#include "config.h" #include "config.h"
#include "coreengine/viewdisplaytracks.h" #include "libtemplate/template.h"
#include "views/displayaudiotracksview.h"
class cSDDisplayTracks : public cSkinDisplayTracks { class cSDDisplayTracks : public cSkinDisplayTracks {
private: private:
cViewTracks *view; cDisplayAudiotracksView *tracksView;
bool ok; bool initial;
int numTracks;
bool doOutput;
int currentTrack;
const char *menuTitle;
public: public:
cSDDisplayTracks(cViewTracks *tracksView, const char *Title, int NumTracks, const char * const *Tracks); cSDDisplayTracks(cTemplate *audiotracksTemplate, const char *Title, int NumTracks, const char * const *Tracks);
virtual ~cSDDisplayTracks(); virtual ~cSDDisplayTracks();
virtual void SetTrack(int Index, const char * const *Tracks); virtual void SetTrack(int Index, const char * const *Tracks);
virtual void SetAudioChannel(int AudioChannel); virtual void SetAudioChannel(int AudioChannel);
@ -18,4 +24,4 @@ public:
}; };
#endif //__DISPLAYTRACKS_H #endif //__DISPLAYTRACKS_H

View File

@ -1,26 +1,44 @@
#include "displayvolume.h" #include "displayvolume.h"
#include "config.h" #include "config.h"
#include "libcore/helpers.h"
cSDDisplayVolume::cSDDisplayVolume(cViewVolume *volumeView) { cSDDisplayVolume::cSDDisplayVolume(cTemplate *volumeTemplate) {
view = volumeView; volumeView = NULL;
ok = view->Init(); doOutput = true;
if (!ok) initial = true;
esyslog("skindesigner: Error initiating displayvolume view - aborting"); if (!volumeTemplate) {
doOutput = false;
esyslog("skindesigner: displayVolume no valid template - aborting");
return;
}
volumeView = new cDisplayVolumeView(volumeTemplate->GetRootView());
if (!volumeView->createOsd()) {
doOutput = false;
} else {
volumeView->DrawDebugGrid();
volumeView->DrawBackground();
}
} }
cSDDisplayVolume::~cSDDisplayVolume() { cSDDisplayVolume::~cSDDisplayVolume() {
view->Close(); if (volumeView)
delete volumeView;
} }
void cSDDisplayVolume::SetVolume(int Current, int Total, bool Mute) { void cSDDisplayVolume::SetVolume(int Current, int Total, bool Mute) {
if (!ok) if (!doOutput)
return; return;
view->SetVolume(Current, Total, Mute); volumeView->DrawVolume(Current, Total, Mute);
} }
void cSDDisplayVolume::Flush(void) { void cSDDisplayVolume::Flush(void) {
if (!ok) if (!doOutput)
return; return;
view->Flush(); if (initial) {
volumeView->DoFadeIn();
initial = false;
} else {
volumeView->Flush();
}
} }

View File

@ -1,18 +1,21 @@
#ifndef __DISPLAYVOLUME_H #ifndef __DISPLAYVOLUME_H
#define __DISPLAYVOLUME_H #define __DISPLAYVOLUME_H
#include <vdr/skins.h>
#include "config.h" #include "config.h"
#include "coreengine/viewdisplayvolume.h" #include "libtemplate/template.h"
#include "views/displayvolumeview.h"
class cSDDisplayVolume : public cSkinDisplayVolume { class cSDDisplayVolume : public cSkinDisplayVolume {
private: private:
cViewVolume *view; cDisplayVolumeView *volumeView;
bool ok; bool doOutput;
bool initial;
public: public:
cSDDisplayVolume(cViewVolume *volumeView); cSDDisplayVolume(cTemplate *volumeTemplate);
virtual ~cSDDisplayVolume(); virtual ~cSDDisplayVolume();
virtual void SetVolume(int Current, int Total, bool Mute); virtual void SetVolume(int Current, int Total, bool Mute);
virtual void Flush(void); virtual void Flush(void);
}; };
#endif //__DISPLAYVOLUME_H #endif //__DISPLAYVOLUME_H

View File

@ -40,15 +40,9 @@
width CDATA #REQUIRED width CDATA #REQUIRED
height CDATA #REQUIRED height CDATA #REQUIRED
align (left|top|center|bottom|right) #IMPLIED align (left|top|center|bottom|right) #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
menuitemwidth CDATA #IMPLIED menuitemwidth CDATA #IMPLIED
numlistelements CDATA #REQUIRED numlistelements CDATA #REQUIRED
orientation CDATA #REQUIRED orientation (horizontal|vertical) #REQUIRED
> >
<!ELEMENT listelement (areacontainer|area|areascroll)*> <!ELEMENT listelement (areacontainer|area|areascroll)*>

View File

@ -4,10 +4,7 @@
<!ELEMENT displaychannel (background | channelinfo | epginfo | progressbar | progressbarback | <!ELEMENT displaychannel (background | channelinfo | epginfo | progressbar | progressbarback |
statusinfo | audioinfo | ecminfo | screenresolution | channelgroup | statusinfo | audioinfo | ecminfo | screenresolution | channelgroup |
signalquality | signalqualityback | devices | currentweather | signalquality | signalqualityback | devices | currentweather | scrapercontent |
scrapercontent | channelhints | channeldetail | channellistdetail |
channellistback | channellist | grouplistback | grouplist |
groupchannellistback | groupchannellist | groupchannellistdetail |
datetime | time | message | customtokens)* > datetime | time | message | customtokens)* >
<!ATTLIST displaychannel <!ATTLIST displaychannel
x CDATA #REQUIRED x CDATA #REQUIRED
@ -29,162 +26,79 @@
<!ELEMENT background (areacontainer|area|areascroll)*> <!ELEMENT background (areacontainer|area|areascroll)*>
<!ATTLIST background <!ATTLIST background
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT channelinfo (areacontainer|area|areascroll)*> <!ELEMENT channelinfo (areacontainer|area|areascroll)*>
<!ATTLIST channelinfo <!ATTLIST channelinfo
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT epginfo (areacontainer|area|areascroll)*> <!ELEMENT epginfo (areacontainer|area|areascroll)*>
<!ATTLIST epginfo <!ATTLIST epginfo
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT progressbar (areacontainer|area|areascroll)*> <!ELEMENT progressbar (areacontainer|area|areascroll)*>
<!ATTLIST progressbar <!ATTLIST progressbar
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT progressbarback (areacontainer|area|areascroll)*> <!ELEMENT progressbarback (areacontainer|area|areascroll)*>
<!ATTLIST progressbarback <!ATTLIST progressbarback
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT statusinfo (areacontainer|area|areascroll)*> <!ELEMENT statusinfo (areacontainer|area|areascroll)*>
<!ATTLIST statusinfo <!ATTLIST statusinfo
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT audioinfo (areacontainer|area|areascroll)*> <!ELEMENT audioinfo (areacontainer|area|areascroll)*>
<!ATTLIST audioinfo <!ATTLIST audioinfo
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT ecminfo (areacontainer|area|areascroll)*> <!ELEMENT ecminfo (areacontainer|area|areascroll)*>
<!ATTLIST ecminfo <!ATTLIST ecminfo
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT screenresolution (areacontainer|area|areascroll)*> <!ELEMENT screenresolution (areacontainer|area|areascroll)*>
<!ATTLIST screenresolution <!ATTLIST screenresolution
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT channelgroup (areacontainer|area|areascroll)*> <!ELEMENT channelgroup (areacontainer|area|areascroll)*>
<!ATTLIST channelgroup <!ATTLIST channelgroup
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT signalquality (areacontainer|area|areascroll)*> <!ELEMENT signalquality (areacontainer|area|areascroll)*>
<!ATTLIST signalquality <!ATTLIST signalquality
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT signalqualityback (areacontainer|area|areascroll)*> <!ELEMENT signalqualityback (areacontainer|area|areascroll)*>
<!ATTLIST signalqualityback <!ATTLIST signalqualityback
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT devices (areacontainer|area|areascroll)*> <!ELEMENT devices (areacontainer|area|areascroll)*>
<!ATTLIST devices <!ATTLIST devices
detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
@ -199,6 +113,7 @@
<!ELEMENT currentweather (areacontainer|area|areascroll)*> <!ELEMENT currentweather (areacontainer|area|areascroll)*>
<!ATTLIST currentweather <!ATTLIST currentweather
detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
@ -212,163 +127,7 @@
<!ELEMENT scrapercontent (areacontainer|area|areascroll)*> <!ELEMENT scrapercontent (areacontainer|area|areascroll)*>
<!ATTLIST scrapercontent <!ATTLIST scrapercontent
delay CDATA #IMPLIED detached CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED
condition CDATA #IMPLIED
>
<!ELEMENT channelhints (areacontainer|area|areascroll)*>
<!ATTLIST channelhints
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED
condition CDATA #IMPLIED
>
<!ELEMENT channeldetail (areacontainer|area|areascroll)*>
<!ATTLIST channeldetail
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED
condition CDATA #IMPLIED
clearondisplay CDATA #IMPLIED
>
<!ELEMENT channellistback (areacontainer|area|areascroll)*>
<!ATTLIST channellistback
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED
condition CDATA #IMPLIED
clearondisplay CDATA #IMPLIED
>
<!ELEMENT grouplistback (areacontainer|area|areascroll)*>
<!ATTLIST grouplistback
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED
condition CDATA #IMPLIED
clearondisplay CDATA #IMPLIED
>
<!ELEMENT groupchannellistback (areacontainer|area|areascroll)*>
<!ATTLIST groupchannellistback
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED
condition CDATA #IMPLIED
>
<!ELEMENT channellist (listelement)>
<!ATTLIST channellist
x CDATA #REQUIRED
y CDATA #REQUIRED
width CDATA #REQUIRED
height CDATA #REQUIRED
align (left|top|center|bottom|right) #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
numlistelements CDATA #REQUIRED
orientation CDATA #REQUIRED
condition CDATA #IMPLIED
button CDATA #IMPLIED
>
<!ELEMENT grouplist (listelement)>
<!ATTLIST grouplist
x CDATA #REQUIRED
y CDATA #REQUIRED
width CDATA #REQUIRED
height CDATA #REQUIRED
align (left|top|center|bottom|right) #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
numlistelements CDATA #REQUIRED
orientation CDATA #REQUIRED
condition CDATA #IMPLIED
button CDATA #IMPLIED
>
<!ELEMENT groupchannellist (listelement)>
<!ATTLIST groupchannellist
x CDATA #REQUIRED
y CDATA #REQUIRED
width CDATA #REQUIRED
height CDATA #REQUIRED
align (left|top|center|bottom|right) #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
numlistelements CDATA #REQUIRED
orientation CDATA #REQUIRED
condition CDATA #IMPLIED
>
<!ELEMENT listelement (areacontainer|area|areascroll)*>
<!ATTLIST listelement
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
debug CDATA #IMPLIED
>
<!ELEMENT channellistdetail (areacontainer|area|areascroll)*>
<!ATTLIST channellistdetail
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED
condition CDATA #IMPLIED
>
<!ELEMENT groupchannellistdetail (areacontainer|area|areascroll)*>
<!ATTLIST groupchannellistdetail
delay CDATA #IMPLIED delay CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
@ -382,6 +141,7 @@
<!ELEMENT datetime (areacontainer|area|areascroll)*> <!ELEMENT datetime (areacontainer|area|areascroll)*>
<!ATTLIST datetime <!ATTLIST datetime
detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
@ -395,6 +155,7 @@
<!ELEMENT time (areacontainer|area|areascroll)*> <!ELEMENT time (areacontainer|area|areascroll)*>
<!ATTLIST time <!ATTLIST time
detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
@ -414,6 +175,8 @@
<!ELEMENT customtokens (areacontainer|area|areascroll)*> <!ELEMENT customtokens (areacontainer|area|areascroll)*>
<!ATTLIST customtokens <!ATTLIST customtokens
detached CDATA #IMPLIED
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
shiftmode CDATA #IMPLIED shiftmode CDATA #IMPLIED

View File

@ -2,7 +2,7 @@
<!ENTITY % functions SYSTEM "functions.dtd"> <!ENTITY % functions SYSTEM "functions.dtd">
<!ELEMENT displaymenu (background,header,datetime,time*,vdrstatus*,message,sortmode*,colorbuttons,scrollbar*, <!ELEMENT displaymenu (background,header,datetime,time*,message,sortmode*,colorbuttons,
menudefault,menumain*,menusetup*,menuschedules*, menudefault,menumain*,menusetup*,menuschedules*,
menutimers*,menuchannels*,menurecordings*, menutimers*,menuchannels*,menurecordings*,
menudetailedepg,menudetailedrecording, menudetailedepg,menudetailedrecording,
@ -13,31 +13,18 @@
width CDATA #REQUIRED width CDATA #REQUIRED
height CDATA #REQUIRED height CDATA #REQUIRED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debuggrid CDATA #IMPLIED debuggrid CDATA #IMPLIED
> >
<!ELEMENT background (areacontainer|area|areascroll)*> <!ELEMENT background (areacontainer|area|areascroll)*>
<!ATTLIST background <!ATTLIST background
orientation CDATA #IMPLIED
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT header (areacontainer|area|areascroll)*> <!ELEMENT header (areacontainer|area|areascroll)*>
<!ATTLIST header <!ATTLIST header
orientation CDATA #IMPLIED detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
@ -51,7 +38,7 @@
<!ELEMENT datetime (areacontainer|area|areascroll)*> <!ELEMENT datetime (areacontainer|area|areascroll)*>
<!ATTLIST datetime <!ATTLIST datetime
orientation CDATA #IMPLIED detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
@ -65,7 +52,7 @@
<!ELEMENT time (areacontainer|area|areascroll)*> <!ELEMENT time (areacontainer|area|areascroll)*>
<!ATTLIST time <!ATTLIST time
orientation CDATA #IMPLIED detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
@ -79,7 +66,7 @@
<!ELEMENT message (areacontainer|area|areascroll)*> <!ELEMENT message (areacontainer|area|areascroll)*>
<!ATTLIST message <!ATTLIST message
orientation CDATA #IMPLIED detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
@ -93,36 +80,20 @@
<!ELEMENT sortmode (areacontainer|area|areascroll)*> <!ELEMENT sortmode (areacontainer|area|areascroll)*>
<!ATTLIST sortmode <!ATTLIST sortmode
orientation CDATA #IMPLIED
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT colorbuttons (areacontainer|area|areascroll)*> <!ELEMENT colorbuttons (areacontainer|area|areascroll)*>
<!ATTLIST colorbuttons <!ATTLIST colorbuttons
orientation CDATA #IMPLIED
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT timers (areacontainer|area|areascroll)*> <!ELEMENT timers (areacontainer|area|areascroll)*>
<!ATTLIST timers <!ATTLIST timers
detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED shifttype CDATA #IMPLIED
@ -135,8 +106,8 @@
<!ELEMENT discusage (areacontainer|area|areascroll)*> <!ELEMENT discusage (areacontainer|area|areascroll)*>
<!ATTLIST discusage <!ATTLIST discusage
detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED shifttype CDATA #IMPLIED
@ -149,8 +120,8 @@
<!ELEMENT devices (areacontainer|area|areascroll)*> <!ELEMENT devices (areacontainer|area|areascroll)*>
<!ATTLIST devices <!ATTLIST devices
detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED shifttype CDATA #IMPLIED
@ -164,8 +135,8 @@
<!ELEMENT systemload (areacontainer|area|areascroll)*> <!ELEMENT systemload (areacontainer|area|areascroll)*>
<!ATTLIST systemload <!ATTLIST systemload
detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED shifttype CDATA #IMPLIED
@ -178,8 +149,8 @@
<!ELEMENT systemmemory (areacontainer|area|areascroll)*> <!ELEMENT systemmemory (areacontainer|area|areascroll)*>
<!ATTLIST systemmemory <!ATTLIST systemmemory
detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED shifttype CDATA #IMPLIED
@ -192,8 +163,8 @@
<!ELEMENT temperatures (areacontainer|area|areascroll)*> <!ELEMENT temperatures (areacontainer|area|areascroll)*>
<!ATTLIST temperatures <!ATTLIST temperatures
detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED shifttype CDATA #IMPLIED
@ -206,22 +177,8 @@
<!ELEMENT vdrstatistics (areacontainer|area|areascroll)*> <!ELEMENT vdrstatistics (areacontainer|area|areascroll)*>
<!ATTLIST vdrstatistics <!ATTLIST vdrstatistics
detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED
condition CDATA #IMPLIED
>
<!ELEMENT vdrstatus (areacontainer|area|areascroll)*>
<!ATTLIST vdrstatus
delay CDATA #IMPLIED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED shifttype CDATA #IMPLIED
@ -234,8 +191,8 @@
<!ELEMENT currentschedule (areacontainer|area|areascroll)*> <!ELEMENT currentschedule (areacontainer|area|areascroll)*>
<!ATTLIST currentschedule <!ATTLIST currentschedule
detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED shifttype CDATA #IMPLIED
@ -248,8 +205,8 @@
<!ELEMENT currentweather (areacontainer|area|areascroll)*> <!ELEMENT currentweather (areacontainer|area|areascroll)*>
<!ATTLIST currentweather <!ATTLIST currentweather
detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED shifttype CDATA #IMPLIED
@ -262,8 +219,8 @@
<!ELEMENT lastrecordings (areacontainer|area|areascroll)*> <!ELEMENT lastrecordings (areacontainer|area|areascroll)*>
<!ATTLIST lastrecordings <!ATTLIST lastrecordings
detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED shifttype CDATA #IMPLIED
@ -276,8 +233,8 @@
<!ELEMENT customtokens (areacontainer|area|areascroll)*> <!ELEMENT customtokens (areacontainer|area|areascroll)*>
<!ATTLIST customtokens <!ATTLIST customtokens
detached CDATA #IMPLIED
delay CDATA #IMPLIED delay CDATA #IMPLIED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED shifttype CDATA #IMPLIED
@ -290,14 +247,6 @@
<!ELEMENT scrollbar (areacontainer|area|areascroll)*> <!ELEMENT scrollbar (areacontainer|area|areascroll)*>
<!ATTLIST scrollbar <!ATTLIST scrollbar
delay CDATA #IMPLIED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
@ -320,7 +269,6 @@
y CDATA #REQUIRED y CDATA #REQUIRED
width CDATA #REQUIRED width CDATA #REQUIRED
height CDATA #REQUIRED height CDATA #REQUIRED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
scaletvx CDATA #IMPLIED scaletvx CDATA #IMPLIED
scaletvy CDATA #IMPLIED scaletvy CDATA #IMPLIED
@ -330,14 +278,13 @@
> >
<!ELEMENT menumain (background | header | datetime | time | colorbuttons | scrollbar | sortmode | timers | <!ELEMENT menumain (background | header | datetime | time | colorbuttons | scrollbar | sortmode | timers |
discusage | devices | systemload | systemmemory | vdrstatistics | vdrstatus | temperatures | currentschedule | discusage | devices | systemload | systemmemory | vdrstatistics | temperatures | currentschedule |
currentweather | lastrecordings | customtokens | menuitems)*> currentweather | lastrecordings | customtokens | menuitems)*>
<!ATTLIST menumain <!ATTLIST menumain
x CDATA #REQUIRED x CDATA #REQUIRED
y CDATA #REQUIRED y CDATA #REQUIRED
width CDATA #REQUIRED width CDATA #REQUIRED
height CDATA #REQUIRED height CDATA #REQUIRED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
scaletvx CDATA #IMPLIED scaletvx CDATA #IMPLIED
scaletvy CDATA #IMPLIED scaletvy CDATA #IMPLIED
@ -352,7 +299,6 @@
y CDATA #REQUIRED y CDATA #REQUIRED
width CDATA #REQUIRED width CDATA #REQUIRED
height CDATA #REQUIRED height CDATA #REQUIRED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
scaletvx CDATA #IMPLIED scaletvx CDATA #IMPLIED
scaletvy CDATA #IMPLIED scaletvy CDATA #IMPLIED
@ -367,7 +313,6 @@
y CDATA #REQUIRED y CDATA #REQUIRED
width CDATA #REQUIRED width CDATA #REQUIRED
height CDATA #REQUIRED height CDATA #REQUIRED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
scaletvx CDATA #IMPLIED scaletvx CDATA #IMPLIED
scaletvy CDATA #IMPLIED scaletvy CDATA #IMPLIED
@ -382,7 +327,6 @@
y CDATA #REQUIRED y CDATA #REQUIRED
width CDATA #REQUIRED width CDATA #REQUIRED
height CDATA #REQUIRED height CDATA #REQUIRED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
scaletvx CDATA #IMPLIED scaletvx CDATA #IMPLIED
scaletvy CDATA #IMPLIED scaletvy CDATA #IMPLIED
@ -397,7 +341,6 @@
y CDATA #REQUIRED y CDATA #REQUIRED
width CDATA #REQUIRED width CDATA #REQUIRED
height CDATA #REQUIRED height CDATA #REQUIRED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
scaletvx CDATA #IMPLIED scaletvx CDATA #IMPLIED
scaletvy CDATA #IMPLIED scaletvy CDATA #IMPLIED
@ -412,7 +355,6 @@
y CDATA #REQUIRED y CDATA #REQUIRED
width CDATA #REQUIRED width CDATA #REQUIRED
height CDATA #REQUIRED height CDATA #REQUIRED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
scaletvx CDATA #IMPLIED scaletvx CDATA #IMPLIED
scaletvy CDATA #IMPLIED scaletvy CDATA #IMPLIED
@ -476,29 +418,20 @@
menuitemwidth CDATA #IMPLIED menuitemwidth CDATA #IMPLIED
determinatefont CDATA #IMPLIED determinatefont CDATA #IMPLIED
numlistelements CDATA #REQUIRED numlistelements CDATA #REQUIRED
orientation CDATA #REQUIRED orientation (horizontal|vertical) #REQUIRED
condition CDATA #IMPLIED
> >
<!ELEMENT listelement (areacontainer|area|areascroll)*> <!ELEMENT listelement (areacontainer|area|areascroll)*>
<!ATTLIST listelement <!ATTLIST listelement
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
> >
<!ELEMENT currentelement (areacontainer|area|areascroll)*> <!ELEMENT currentelement (areacontainer|area|areascroll)*>
<!ATTLIST currentelement <!ATTLIST currentelement
delay CDATA #IMPLIED delay CDATA #REQUIRED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
debug CDATA #IMPLIED
> >
<!ELEMENT tab (loop|fill|drawtext|drawtextbox|drawimage|drawrectangle|drawellipse)*> <!ELEMENT tab (loop|fill|drawtext|drawtextbox|drawimage|drawrectangle|drawellipse)*>
@ -515,4 +448,4 @@
debug (true|false) #IMPLIED debug (true|false) #IMPLIED
> >
%functions; %functions;

View File

@ -13,98 +13,51 @@
scaletvy CDATA #IMPLIED scaletvy CDATA #IMPLIED
scaletvwidth CDATA #IMPLIED scaletvwidth CDATA #IMPLIED
scaletvheight CDATA #IMPLIED scaletvheight CDATA #IMPLIED
orientation CDATA #IMPLIED
debuggrid CDATA #IMPLIED debuggrid CDATA #IMPLIED
> >
<!ELEMENT background (areacontainer|area|areascroll)*> <!ELEMENT background (areacontainer|area|areascroll)*>
<!ATTLIST background <!ATTLIST background
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT header (areacontainer|area|areascroll)*> <!ELEMENT header (areacontainer|area|areascroll)*>
<!ATTLIST header <!ATTLIST header
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT datetime (areacontainer|area|areascroll)*> <!ELEMENT datetime (areacontainer|area|areascroll)*>
<!ATTLIST datetime <!ATTLIST datetime
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT message (areacontainer|area|areascroll)*> <!ELEMENT message (areacontainer|area|areascroll)*>
<!ATTLIST message <!ATTLIST message
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT colorbuttons (areacontainer|area|areascroll)*> <!ELEMENT colorbuttons (areacontainer|area|areascroll)*>
<!ATTLIST colorbuttons <!ATTLIST colorbuttons
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT scrollbar (areacontainer|area|areascroll)*> <!ELEMENT scrollbar (areacontainer|area|areascroll)*>
<!ATTLIST scrollbar <!ATTLIST scrollbar
orientation CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT detailheader (areacontainer|area|areascroll)*> <!ELEMENT detailheader (areacontainer|area|areascroll)*>
<!ATTLIST detailheader <!ATTLIST detailheader
orientation CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT tablabels (areacontainer|area|areascroll)*> <!ELEMENT tablabels (areacontainer|area|areascroll)*>
<!ATTLIST tablabels <!ATTLIST tablabels
condition CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
> >
<!ELEMENT menuitems (listelement,currentelement?)> <!ELEMENT menuitems (listelement,currentelement?)>
<!ATTLIST menuitems <!ATTLIST menuitems
condition CDATA #IMPLIED
x CDATA #REQUIRED x CDATA #REQUIRED
y CDATA #REQUIRED y CDATA #REQUIRED
width CDATA #REQUIRED width CDATA #REQUIRED
@ -112,26 +65,18 @@
align (left|top|center|bottom|right) #IMPLIED align (left|top|center|bottom|right) #IMPLIED
menuitemwidth CDATA #IMPLIED menuitemwidth CDATA #IMPLIED
numlistelements CDATA #REQUIRED numlistelements CDATA #REQUIRED
orientation CDATA #REQUIRED orientation (horizontal|vertical) #REQUIRED
> >
<!ELEMENT listelement (areacontainer|area|areascroll)*> <!ELEMENT listelement (areacontainer|area|areascroll)*>
<!ATTLIST listelement <!ATTLIST listelement
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
> >
<!ELEMENT currentelement (areacontainer|area|areascroll)*> <!ELEMENT currentelement (areacontainer|area|areascroll)*>
<!ATTLIST currentelement <!ATTLIST currentelement
condition CDATA #IMPLIED delay CDATA #REQUIRED
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
> >

View File

@ -3,9 +3,9 @@
<!ENTITY % functions SYSTEM "functions.dtd"> <!ENTITY % functions SYSTEM "functions.dtd">
<!ELEMENT displayreplay (background | backgroundmodeonly |datetime | time | <!ELEMENT displayreplay (background | backgroundmodeonly |datetime | time |
scrapercontent | currentweather | rectitle | recinfo | currenttime | scrapercontent | rectitle | recinfo | currenttime |
totaltime | timeshifttimes | endtime | progressbar | cutmarks | controlicons | totaltime | endtime | progressbar | cutmarks | controlicons |
controliconsmodeonly | progressmodeonly | jump | message | onpause | controliconsmodeonly | jump | message | onpause |
onpausemodeonly | customtokens)*> onpausemodeonly | customtokens)*>
<!ATTLIST displayreplay <!ATTLIST displayreplay
x CDATA #REQUIRED x CDATA #REQUIRED
@ -27,69 +27,29 @@
<!ELEMENT background (areacontainer|area|areascroll)*> <!ELEMENT background (areacontainer|area|areascroll)*>
<!ATTLIST background <!ATTLIST background
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
> >
<!ELEMENT backgroundmodeonly (areacontainer|area|areascroll)*> <!ELEMENT backgroundmodeonly (areacontainer|area|areascroll)*>
<!ATTLIST backgroundmodeonly <!ATTLIST backgroundmodeonly
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
> >
<!ELEMENT datetime (areacontainer|area|areascroll)*> <!ELEMENT datetime (areacontainer|area|areascroll)*>
<!ATTLIST datetime <!ATTLIST datetime
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT time (areacontainer|area|areascroll)*> <!ELEMENT time (areacontainer|area|areascroll)*>
<!ATTLIST time <!ATTLIST time
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT scrapercontent (areacontainer|area|areascroll)*> <!ELEMENT scrapercontent (areacontainer|area|areascroll)*>
<!ATTLIST scrapercontent <!ATTLIST scrapercontent
delay CDATA #IMPLIED detached CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED
condition CDATA #IMPLIED
>
<!ELEMENT currentweather (areacontainer|area|areascroll)*>
<!ATTLIST currentweather
delay CDATA #IMPLIED delay CDATA #IMPLIED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED shifttime CDATA #IMPLIED
@ -103,156 +63,60 @@
<!ELEMENT rectitle (areacontainer|area|areascroll)*> <!ELEMENT rectitle (areacontainer|area|areascroll)*>
<!ATTLIST rectitle <!ATTLIST rectitle
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT recinfo (areacontainer|area|areascroll)*> <!ELEMENT recinfo (areacontainer|area|areascroll)*>
<!ATTLIST recinfo <!ATTLIST recinfo
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT currenttime (areacontainer|area|areascroll)*> <!ELEMENT currenttime (areacontainer|area|areascroll)*>
<!ATTLIST currenttime <!ATTLIST currenttime
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT totaltime (areacontainer|area|areascroll)*> <!ELEMENT totaltime (areacontainer|area|areascroll)*>
<!ATTLIST totaltime <!ATTLIST totaltime
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED
condition CDATA #IMPLIED
>
<!ELEMENT timeshifttimes (areacontainer|area|areascroll)*>
<!ATTLIST timeshifttimes
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT endtime (areacontainer|area|areascroll)*> <!ELEMENT endtime (areacontainer|area|areascroll)*>
<!ATTLIST endtime <!ATTLIST endtime
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT progressbar (areacontainer|area|areascroll)*> <!ELEMENT progressbar (areacontainer|area|areascroll)*>
<!ATTLIST progressbar <!ATTLIST progressbar
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT cutmarks (areacontainer|area|areascroll)*> <!ELEMENT cutmarks (areacontainer|area|areascroll)*>
<!ATTLIST cutmarks <!ATTLIST cutmarks
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT controlicons (areacontainer|area|areascroll)*> <!ELEMENT controlicons (areacontainer|area|areascroll)*>
<!ATTLIST controlicons <!ATTLIST controlicons
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT controliconsmodeonly (areacontainer|area|areascroll)*> <!ELEMENT controliconsmodeonly (areacontainer|area|areascroll)*>
<!ATTLIST controliconsmodeonly <!ATTLIST controliconsmodeonly
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED
condition CDATA #IMPLIED
>
<!ELEMENT progressmodeonly (areacontainer|area|areascroll)*>
<!ATTLIST progressmodeonly
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT jump (areacontainer|area|areascroll)*> <!ELEMENT jump (areacontainer|area|areascroll)*>
<!ATTLIST jump <!ATTLIST jump
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
@ -268,11 +132,6 @@
debug CDATA #IMPLIED debug CDATA #IMPLIED
delay CDATA #REQUIRED delay CDATA #REQUIRED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
@ -281,25 +140,13 @@
debug CDATA #IMPLIED debug CDATA #IMPLIED
delay CDATA #REQUIRED delay CDATA #REQUIRED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT customtokens (areacontainer|area|areascroll)*> <!ELEMENT customtokens (areacontainer|area|areascroll)*>
<!ATTLIST customtokens <!ATTLIST customtokens
delay CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
%functions; %functions;

View File

@ -18,7 +18,6 @@
transparency CDATA #IMPLIED transparency CDATA #IMPLIED
condition CDATA #IMPLIED condition CDATA #IMPLIED
background (true|false) #IMPLIED background (true|false) #IMPLIED
indicator (true|false) #IMPLIED
debug (true|false) #IMPLIED debug (true|false) #IMPLIED
> >
@ -51,8 +50,8 @@
<!ELEMENT loop (drawtext|drawtextbox|drawtextvertical|drawimage|drawrectangle|drawellipse|drawslope)+> <!ELEMENT loop (drawtext|drawtextbox|drawtextvertical|drawimage|drawrectangle|drawellipse|drawslope)+>
<!ATTLIST loop <!ATTLIST loop
x CDATA #IMPLIED x CDATA #REQUIRED
y CDATA #IMPLIED y CDATA #REQUIRED
width CDATA #IMPLIED width CDATA #IMPLIED
height CDATA #IMPLIED height CDATA #IMPLIED
columnwidth CDATA #IMPLIED columnwidth CDATA #IMPLIED
@ -61,7 +60,6 @@
orientation (horizontal|vertical|absolute) #REQUIRED orientation (horizontal|vertical|absolute) #REQUIRED
overflow (linewrap|cut) #IMPLIED overflow (linewrap|cut) #IMPLIED
maxitems CDATA #IMPLIED maxitems CDATA #IMPLIED
valign (top|bottom) #IMPLIED
debug (true|false) #IMPLIED debug (true|false) #IMPLIED
> >
@ -92,12 +90,11 @@
<!ELEMENT drawtextbox EMPTY> <!ELEMENT drawtextbox EMPTY>
<!ATTLIST drawtextbox <!ATTLIST drawtextbox
x CDATA #IMPLIED x CDATA #REQUIRED
y CDATA #IMPLIED y CDATA #REQUIRED
width CDATA #REQUIRED width CDATA #REQUIRED
height CDATA #IMPLIED height CDATA #IMPLIED
align (left|center|right) #IMPLIED align (left|center|right) #IMPLIED
valign (top|center|bottom) #IMPLIED
maxlines CDATA #IMPLIED maxlines CDATA #IMPLIED
floatwidth CDATA #IMPLIED floatwidth CDATA #IMPLIED
floatheight CDATA #IMPLIED floatheight CDATA #IMPLIED
@ -132,8 +129,8 @@
<!ELEMENT drawrectangle EMPTY> <!ELEMENT drawrectangle EMPTY>
<!ATTLIST drawrectangle <!ATTLIST drawrectangle
x CDATA #IMPLIED x CDATA #REQUIRED
y CDATA #IMPLIED y CDATA #REQUIRED
width CDATA #IMPLIED width CDATA #IMPLIED
height CDATA #IMPLIED height CDATA #IMPLIED
align (left|center|right) #IMPLIED align (left|center|right) #IMPLIED

View File

@ -13,12 +13,10 @@
<!ELEMENT parameter (#PCDATA)> <!ELEMENT parameter (#PCDATA)>
<!ATTLIST parameter <!ATTLIST parameter
name NMTOKEN #REQUIRED name NMTOKEN #REQUIRED
type (int|bool|string|separator) #REQUIRED type (int|bool) #REQUIRED
min NMTOKEN #IMPLIED min NMTOKEN #IMPLIED
max NMTOKEN #IMPLIED max NMTOKEN #IMPLIED
displaytext CDATA #REQUIRED displaytext CDATA #REQUIRED
helptext CDATA #IMPLIED
options CDATA #IMPLIED
> >
<!ELEMENT token (trans)+> <!ELEMENT token (trans)+>

View File

@ -1,257 +0,0 @@
#include "globaltimers.h"
#include "../services/epgsearch.h"
#include "../services/remotetimers.h"
#include "../services/epgtimer.h"
static int CompareTimers(const void *a, const void *b) {
return (*(const cTimer **)a)->Compare(**(const cTimer **)b);
}
bool cGlobalTimers::initial = true;
cRemoteTimerRefresh *cGlobalTimers::remoteTimerRefresh = NULL;
cGlobalTimers::cGlobalTimers(void) : cVector<const cTimer*>(0) {
pEpg2Vdr = cPluginManager::GetPlugin("epg2vdr");
pRemoteTimers = cPluginManager::GetPlugin("remotetimers");
pEpgSearch = cPluginManager::GetPlugin("epgsearch");
localTimer = NULL;
isEpg2VdrTimers = false;
}
cGlobalTimers::~cGlobalTimers(void) {
if (localTimer) {
delete[] localTimer;
}
ClearTimers();
}
void cGlobalTimers::LoadTimers(void) {
isEpg2VdrTimers = false;
bool epg2vdrOk = false;
if (pEpg2Vdr) {
epg2vdrOk = SetEpg2VdrTimers();
}
if (!epg2vdrOk) {
SetLocalTimers();
if (pRemoteTimers) {
SetRemoteTimers(initial);
}
}
initial = false;
}
void cGlobalTimers::SortTimers(void) {
Sort(CompareTimers);
}
void cGlobalTimers::MarkLocalTimers(void) {
if (isEpg2VdrTimers)
return;
if (localTimer) {
delete[] localTimer;
localTimer = NULL;
}
const cTimers* timers;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
{
LOCK_TIMERS_READ;
timers = Timers;
}
#else
timers = &Timers;
#endif
int numTimers = Size();
if (numTimers > 0) {
localTimer = new bool[numTimers];
for (int i=0; i < numTimers; i++) {
if (!pRemoteTimers) {
localTimer[i] = true;
} else {
localTimer[i] = false;
for (const cTimer *Timer = timers->First(); Timer; Timer = timers->Next(Timer)) {
if (Timer == At(i)) {
localTimer[i] = true;
break;
}
}
}
}
}
}
void cGlobalTimers::SetLocalTimers(void) {
const cTimers* timers;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
{
LOCK_TIMERS_READ;
timers = Timers;
}
#else
timers = &Timers;
#endif
for (const cTimer *Timer = timers->First(); Timer; Timer = timers->Next(Timer)) {
if (Timer && Timer->HasFlags(tfActive))
Append(Timer);
}
}
void cGlobalTimers::SetRemoteTimers(bool initial) {
if (initial) {
cString errorMsg;
pRemoteTimers->Service("RemoteTimers::RefreshTimers-v1.0", &errorMsg);
}
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_SCHEDULES_READ;
const cSchedules* schedules = Schedules;
#else
cSchedulesLock schedulesLock;
const cSchedules* schedules = (cSchedules*)cSchedules::Schedules(schedulesLock);
#endif
cTimer* remoteTimer = NULL;
while (pRemoteTimers->Service("RemoteTimers::ForEach-v1.0", &remoteTimer) && remoteTimer != NULL) {
remoteTimer->SetEventFromSchedule(schedules); // make sure the event is current
if (remoteTimer->HasFlags(tfActive))
Append(remoteTimer);
}
}
bool cGlobalTimers::SetEpg2VdrTimers(void) {
bool ok = false;
cEpgTimer_Service_V1 data;
if (pEpg2Vdr->Service(EPG2VDR_TIMER_SERVICE, &data)) {
for (std::list<cEpgTimer_Interface_V1*>::iterator it = data.epgTimers.begin(); it != data.epgTimers.end(); ++it) {
ok = true;
isEpg2VdrTimers = true;
if ((*it)->HasFlags(tfActive)) {
Append(*it);
}
}
}
return ok;
}
int cGlobalTimers::NumTimerConfilicts(void) {
int numConflicts = 0;
if (pEpgSearch) {
Epgsearch_lastconflictinfo_v1_0 *serviceData = new Epgsearch_lastconflictinfo_v1_0;
if (serviceData) {
serviceData->nextConflict = 0;
serviceData->relevantConflicts = 0;
serviceData->totalConflicts = 0;
pEpgSearch->Service("Epgsearch-lastconflictinfo-v1.0", serviceData);
if (serviceData->relevantConflicts > 0) {
numConflicts = serviceData->relevantConflicts;
}
delete serviceData;
}
}
return numConflicts;
}
bool cGlobalTimers::IsRemoteTimer(int i) {
if (isEpg2VdrTimers) {
cEpgTimer_Interface_V1* epgTimer;
if (epgTimer = dynamic_cast<cEpgTimer_Interface_V1*>((cTimer*)At(i)))
return !epgTimer->isLocal();
else
return false;
}
if (!localTimer)
return true;
if (i >= Size())
return true;
return !(localTimer[i]);
}
const char* cGlobalTimers::RemoteHost(int i) {
if (isEpg2VdrTimers) {
cEpgTimer_Interface_V1* epgTimer;
if (epgTimer = dynamic_cast<cEpgTimer_Interface_V1*>((cTimer*)At(i)))
return epgTimer->VdrName();
}
return "";
}
bool cGlobalTimers::IsRecording(const cRecording *rec) {
if (!rec || !rec->Name())
return false;
std::string recName = rec->Name();
time_t recstart = rec->Start();
int size = Size();
for (int i=0; i<size; i++) {
const cTimer *t = At(i);
const char *timerFile = t->File();
if (!t->Matches() || !timerFile)
continue;
if (recName.find(timerFile) != std::string::npos) {
time_t timerstart = t->StartTime();
if (recstart == timerstart)
return true;
}
}
return false;
}
void cGlobalTimers::ClearTimers(void) {
if (isEpg2VdrTimers) {
int size = Size();
for (int i=0; i<size; i++) {
delete At(i);
}
}
Clear();
}
void cGlobalTimers::StartRefreshThread(void) {
if (remoteTimerRefresh == NULL) {
remoteTimerRefresh = new cRemoteTimerRefresh();
}
}
void cGlobalTimers::StopRefreshThread(void) {
if (!remoteTimerRefresh)
return;
delete remoteTimerRefresh;
remoteTimerRefresh = NULL;
initial = true;
}
/*************************************************************************
* cRemoteTimerRefresh
*************************************************************************/
cRemoteTimerRefresh::cRemoteTimerRefresh(): cThread("skindesigner: RemoteTimers::RefreshTimers") {
pRemoteTimers = cPluginManager::GetPlugin("remotetimers");
if (pRemoteTimers)
Start();
}
cRemoteTimerRefresh::~cRemoteTimerRefresh(void) {
Cancel(-1);
while (Active())
cCondWait::SleepMs(10);
}
void cRemoteTimerRefresh::Action(void) {
#define REFESH_INTERVALL_MS 30000
int sleepSlice = 1000;
int slept = 0;
while (Running()) {
while (Running() && slept < REFESH_INTERVALL_MS) {
cCondWait::SleepMs(sleepSlice);
slept += sleepSlice;
}
slept = 0;
// make sure that no timer is currently being edited
if (!cOsd::IsOpen() && Running()) {
cString errorMsg;
pRemoteTimers->Service("RemoteTimers::RefreshTimers-v1.0", &errorMsg);
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_TIMERS_WRITE;
Timers->SetModified();
#else
Timers.SetModified();
#endif
}
}
}

View File

@ -1,45 +0,0 @@
#ifndef __GLOBALTIMERS_H
#define __GLOBALTIMERS_H
#include <vdr/timers.h>
#include <vdr/plugin.h>
class cRemoteTimerRefresh;
class cGlobalTimers : public cVector<const cTimer *> {
private:
static bool initial;
static cRemoteTimerRefresh *remoteTimerRefresh;
bool *localTimer;
cPlugin *pEpg2Vdr;
cPlugin *pRemoteTimers;
cPlugin *pEpgSearch;
bool isEpg2VdrTimers;
void SetLocalTimers(void);
void SetRemoteTimers(bool initial);
bool SetEpg2VdrTimers(void);
public:
cGlobalTimers(void);
virtual ~cGlobalTimers(void);
void LoadTimers(void);
void SortTimers(void);
void MarkLocalTimers(void);
int NumTimerConfilicts(void);
bool IsRemoteTimer(int i);
const char* RemoteHost(int i);
bool IsRecording(const cRecording *rec);
void ClearTimers(void);
static void StartRefreshThread(void);
static void StopRefreshThread(void);
};
class cRemoteTimerRefresh: public cThread {
private:
cPlugin* pRemoteTimers;
protected:
virtual void Action(void);
public:
cRemoteTimerRefresh(void);
virtual ~cRemoteTimerRefresh(void);
};
#endif //__GLOBALTIMERS_H

View File

@ -1,301 +0,0 @@
#include "pluginmanager.h"
cSDPluginManager::cSDPluginManager(void) {
lastId = 0;
subviewsfound = false;
}
cSDPluginManager::~cSDPluginManager(void) {
}
void cSDPluginManager::Reset(void) {
subViewMapping.clear();
}
void cSDPluginManager::RegisterBasicPlugin(skindesignerapi::cPluginStructure *plugStructure) {
dsyslog("skindesigner: plugin %s uses libskindesigner API Version %s",
plugStructure->name.c_str(),
plugStructure->libskindesignerAPIVersion.c_str());
plugStructure->id = lastId;
registeredPlugins.insert(pair<int,string>(lastId, plugStructure->name));
lastId++;
map< int, skindesignerapi::sPlugMenu > menusNew;
for (map< int, skindesignerapi::sPlugMenu >::iterator it = plugStructure->menus.begin(); it != plugStructure->menus.end(); it++) {
int key = it->first;
skindesignerapi::sPlugMenu menu = it->second;
skindesignerapi::sPlugMenu menuNew;
menuNew.type = menu.type;
menuNew.tplname = menu.tplname;
menuNew.tokenContainer = new skindesignerapi::cTokenContainer(*menu.tokenContainer);
menusNew.insert(pair<int, skindesignerapi::sPlugMenu>(key, menuNew));
}
pluginMenus.insert(pair< int, map < int, skindesignerapi::sPlugMenu > >(plugStructure->id, menusNew));
if (plugStructure->menus.size() > 0)
dsyslog("skindesigner: plugin %s has registered %ld menus", plugStructure->name.c_str(), plugStructure->menus.size());
}
int cSDPluginManager::GetNumPluginMenus(void) {
int numMenusTotal = 0;
for (map < int, map < int, skindesignerapi::sPlugMenu > >::iterator it = pluginMenus.begin(); it != pluginMenus.end(); it++) {
numMenusTotal += (it->second).size();
}
return numMenusTotal;
}
void cSDPluginManager::InitPluginMenuIterator(void) {
plugMenuIt = pluginMenus.begin();
}
map <int,skindesignerapi::sPlugMenu> *cSDPluginManager::GetPluginMenus(string &name, int &id) {
if (plugMenuIt == pluginMenus.end())
return NULL;
id = plugMenuIt->first;
map<int,string>::iterator hit = registeredPlugins.find(id);
if (hit != registeredPlugins.end())
name = hit->second;
map <int,skindesignerapi::sPlugMenu> *templates = &plugMenuIt->second;
plugMenuIt++;
return templates;
}
skindesignerapi::cTokenContainer *cSDPluginManager::GetTokenContainer(int plugId, int plugMenuId) {
map <int, map<int, skindesignerapi::sPlugMenu> >::iterator hit = pluginMenus.find(plugId);
if (hit == pluginMenus.end())
return NULL;
map<int, skindesignerapi::sPlugMenu>::iterator hit2 = (hit->second).find(plugMenuId);
if (hit2 == (hit->second).end())
return NULL;
skindesignerapi::cTokenContainer *tk = hit2->second.tokenContainer;
return tk;
}
void cSDPluginManager::AddSubviewMapping(int plugId, int plugMenuId, int subViewId) {
map <int, map<int,int> >::iterator hit = subViewMapping.find(plugId);
if (hit == subViewMapping.end()) {
map<int,int> menus;
menus.insert(pair<int,int>(plugMenuId, subViewId));
subViewMapping.insert(pair<int, map<int,int> >(plugId, menus));
} else {
(hit->second).insert(pair<int,int>(plugMenuId, subViewId));
}
}
int cSDPluginManager::GetSubviewId(int plugId, int plugMenuId) {
map <int, map<int,int> >::iterator hit = subViewMapping.find(plugId);
if (hit == subViewMapping.end())
return -1;
map<int,int>::iterator hit2 = (hit->second).find(plugMenuId);
if (hit2 == (hit->second).end())
return -1;
return hit2->second;
}
void cSDPluginManager::RegisterAdvancedPlugin(skindesignerapi::cPluginStructure *plugStructure) {
dsyslog("skindesigner: plugin %s uses libskindesigner API Version %s",
plugStructure->name.c_str(),
plugStructure->libskindesignerAPIVersion.c_str());
plugStructure->id = lastId;
registeredPlugins.insert(pair<int,string>(lastId, plugStructure->name));
lastId++;
rootviews.insert(pair<int,string>(plugStructure->id, plugStructure->rootview));
subviews.insert(pair<int,map<int,string> >(plugStructure->id, plugStructure->subviews));
multimap< int, skindesignerapi::sPlugViewElement > viewelementsNew;
for (map< int, skindesignerapi::sPlugViewElement >::iterator it = plugStructure->viewelements.begin(); it != plugStructure->viewelements.end(); it++) {
int key = it->first;
skindesignerapi::sPlugViewElement ve = it->second;
skindesignerapi::sPlugViewElement veNew;
veNew.id = ve.id;
veNew.viewId = ve.viewId;
veNew.name = ve.name;
veNew.tokenContainer = new skindesignerapi::cTokenContainer(*ve.tokenContainer);
viewelementsNew.insert(pair<int, skindesignerapi::sPlugViewElement>(key, veNew));
}
viewelements.insert(pair< int, multimap < int, skindesignerapi::sPlugViewElement > >(plugStructure->id, viewelementsNew));
multimap< int, skindesignerapi::sPlugViewGrid > viewgridsNew;
for (map< int, skindesignerapi::sPlugViewGrid >::iterator it = plugStructure->viewgrids.begin(); it != plugStructure->viewgrids.end(); it++) {
int key = it->first;
skindesignerapi::sPlugViewGrid vg = it->second;
skindesignerapi::sPlugViewGrid vgNew;
vgNew.id = vg.id;
vgNew.viewId = vg.viewId;
vgNew.name = vg.name;
vgNew.tokenContainer = new skindesignerapi::cTokenContainer(*vg.tokenContainer);
viewgridsNew.insert(pair<int, skindesignerapi::sPlugViewGrid>(key, vgNew));
}
viewgrids.insert(pair< int, multimap < int, skindesignerapi::sPlugViewGrid > >(plugStructure->id, viewgridsNew));
map< int, skindesignerapi::cTokenContainer* > viewtabsNew;
for (map<int,skindesignerapi::cTokenContainer*>::iterator it = plugStructure->viewtabs.begin(); it != plugStructure->viewtabs.end(); it++) {
int id = it->first;
skindesignerapi::cTokenContainer *tk = it->second;
viewtabsNew.insert(pair<int,skindesignerapi::cTokenContainer*>(id, new skindesignerapi::cTokenContainer(*tk)));
}
viewtabs.insert(pair< int, map<int,skindesignerapi::cTokenContainer*> >(plugStructure->id, viewtabsNew));
if (plugStructure->rootview.size() > 0)
dsyslog("skindesigner: plugin %s has registered %ld views with %ld viewelements and %ld viewgrids",
plugStructure->name.c_str(),
1 + plugStructure->subviews.size(),
plugStructure->viewelements.size(),
plugStructure->viewgrids.size());
}
void cSDPluginManager::InitPluginViewIterator(void) {
rootViewsIt = rootviews.begin();
}
bool cSDPluginManager::GetNextPluginView(string &plugName, int &plugId, string &tplName) {
if (rootViewsIt == rootviews.end())
return false;
plugId = rootViewsIt->first;
tplName = rootViewsIt->second;
map<int,string>::iterator hit = registeredPlugins.find(plugId);
if (hit != registeredPlugins.end())
plugName = hit->second;
rootViewsIt++;
return true;
}
int cSDPluginManager::GetNumSubviews(int plugId) {
map< int, map< int, string > >::iterator hit = subviews.find(plugId);
if (hit == subviews.end())
return 0;
return (hit->second).size();
}
void cSDPluginManager::InitPluginSubviewIterator(int plugId) {
map< int, map< int, string > >::iterator hit = subviews.find(plugId);
if (hit == subviews.end()) {
subviewsfound = false;
return;
}
subviewsCurrent = hit->second;
subviewsfound = true;
svIt = subviewsCurrent.begin();
}
bool cSDPluginManager::GetNextSubView(int &id, string &tplname) {
if (!subviewsfound)
return false;
if( svIt == subviewsCurrent.end() ) {
return false;
}
id = svIt->first;
tplname = svIt->second;
svIt++;
return true;
}
int cSDPluginManager::GetNumViewElements(int plugId, int viewId) {
map< int, multimap< int, skindesignerapi::sPlugViewElement > >::iterator hit = viewelements.find(plugId);
if (hit == viewelements.end())
return 0;
multimap<int, skindesignerapi::sPlugViewElement> *plugVEs = &hit->second;
pair<multimap<int, skindesignerapi::sPlugViewElement>::iterator, multimap<int, skindesignerapi::sPlugViewElement>::iterator> range;
range = plugVEs->equal_range(viewId);
int numVEs = 0;
for (multimap<int, skindesignerapi::sPlugViewElement>::iterator it=range.first; it!=range.second; ++it) {
numVEs++;
}
return numVEs;
}
void cSDPluginManager::InitViewElementIterator(int plugId, int viewId) {
map< int, multimap< int, skindesignerapi::sPlugViewElement > >::iterator hit = viewelements.find(plugId);
if (hit == viewelements.end())
return;
multimap<int, skindesignerapi::sPlugViewElement> *plugVEs = &hit->second;
veRange = plugVEs->equal_range(viewId);
veIt = veRange.first;
}
bool cSDPluginManager::GetNextViewElement(int &veId, string &veName) {
if (veIt == veRange.second)
return false;
skindesignerapi::sPlugViewElement *ve = &veIt->second;
veId = ve->id;
veName = ve->name;
veIt++;
return true;
}
skindesignerapi::cTokenContainer *cSDPluginManager::GetTokenContainerVE(int plugId, int viewId, int veId) {
map< int, multimap< int, skindesignerapi::sPlugViewElement > >::iterator hit = viewelements.find(plugId);
if (hit == viewelements.end())
return NULL;
multimap<int, skindesignerapi::sPlugViewElement> *plugVEs = &hit->second;
for (multimap<int, skindesignerapi::sPlugViewElement>::iterator it = plugVEs->begin(); it != plugVEs->end(); it++) {
int view = it->first;
if (view != viewId)
continue;
skindesignerapi::sPlugViewElement *ve = &it->second;
if (ve->id == veId)
return ve->tokenContainer;
}
return NULL;
}
int cSDPluginManager::GetNumViewGrids(int plugId, int viewId) {
map< int, multimap< int, skindesignerapi::sPlugViewGrid > >::iterator hit = viewgrids.find(plugId);
if (hit == viewgrids.end())
return 0;
multimap<int, skindesignerapi::sPlugViewGrid> *plugVGs = &hit->second;
pair<multimap<int, skindesignerapi::sPlugViewGrid>::iterator, multimap<int, skindesignerapi::sPlugViewGrid>::iterator> range;
range = plugVGs->equal_range(viewId);
int numVGs = 0;
for (multimap<int, skindesignerapi::sPlugViewGrid>::iterator it=range.first; it!=range.second; ++it) {
numVGs++;
}
return numVGs;
}
void cSDPluginManager::InitViewGridIterator(int plugId, int viewId) {
map< int, multimap< int, skindesignerapi::sPlugViewGrid > >::iterator hit = viewgrids.find(plugId);
if (hit == viewgrids.end())
return;
multimap<int, skindesignerapi::sPlugViewGrid> *plugGEs = &hit->second;
gRange = plugGEs->equal_range(viewId);
gIt = gRange.first;
}
bool cSDPluginManager::GetNextViewGrid(int &gId, string &gName) {
if (gIt == gRange.second)
return false;
skindesignerapi::sPlugViewGrid *ge = &gIt->second;
gId = ge->id;
gName = ge->name;
gIt++;
return true;
}
skindesignerapi::cTokenContainer *cSDPluginManager::GetTokenContainerGE(int plugId, int viewId, int gId) {
map< int, multimap< int, skindesignerapi::sPlugViewGrid > >::iterator hit = viewgrids.find(plugId);
if (hit == viewgrids.end())
return NULL;
multimap<int, skindesignerapi::sPlugViewGrid> *plugGEs = &hit->second;
for (multimap<int, skindesignerapi::sPlugViewGrid>::iterator it = plugGEs->begin(); it != plugGEs->end(); it++) {
int view = it->first;
if (view != viewId)
continue;
skindesignerapi::sPlugViewGrid *g = &it->second;
if (g->id == gId)
return g->tokenContainer;
}
return NULL;
}
skindesignerapi::cTokenContainer *cSDPluginManager::GetTokenContainerTab(int plugId, int viewId) {
map< int, map< int, skindesignerapi::cTokenContainer* > >::iterator hit = viewtabs.find(plugId);
if (hit == viewtabs.end())
return NULL;
map< int, skindesignerapi::cTokenContainer* > *tabs = &hit->second;
map< int, skindesignerapi::cTokenContainer* >::iterator hit2 = tabs->find(viewId);
if (hit2 == tabs->end())
return NULL;
return (hit2->second);
}

View File

@ -1,71 +0,0 @@
#ifndef __PLUGINMANAGER_H
#define __PLUGINMANAGER_H
#include <string>
#include <map>
#include "../libskindesignerapi/skindesignerapi.h"
using namespace std;
class cSDPluginManager {
private:
int lastId;
//plugin id --> plugin name
map < int, string > registeredPlugins;
//Basic Plugin Interface
//plugin id --> plugin definition
map < int, map < int, skindesignerapi::sPlugMenu > > pluginMenus;
map < int, map < int, skindesignerapi::sPlugMenu > >::iterator plugMenuIt;
//plugin id - menuId --> subviewid
map < int, map<int, int> > subViewMapping;
//Advanced Plugin Interface
//plugin id --> rootview templatename definition
map< int, string > rootviews;
map< int, string >::iterator rootViewsIt;
//plugin id --> subviewid /templatename definition
map< int, map< int, string > > subviews;
map< int, string> subviewsCurrent;
map< int, string>::iterator svIt;
bool subviewsfound;
//plugin id --> view id --> viewelement definition
map< int, multimap< int, skindesignerapi::sPlugViewElement > > viewelements;
pair<multimap<int, skindesignerapi::sPlugViewElement>::iterator, multimap<int, skindesignerapi::sPlugViewElement>::iterator> veRange;
multimap<int, skindesignerapi::sPlugViewElement>::iterator veIt;
//plugin id --> view id --> viewgrid definition
map< int, multimap< int, skindesignerapi::sPlugViewGrid > > viewgrids;
pair<multimap<int, skindesignerapi::sPlugViewGrid>::iterator, multimap<int, skindesignerapi::sPlugViewGrid>::iterator> gRange;
multimap<int, skindesignerapi::sPlugViewGrid>::iterator gIt;
//plugin id --> view id --> tokencontainer of detailedview definition
map< int, map< int, skindesignerapi::cTokenContainer* > > viewtabs;
public:
cSDPluginManager(void);
~cSDPluginManager(void);
void Reset(void);
//Basic Plugin Interface
void RegisterBasicPlugin(skindesignerapi::cPluginStructure *plugStructure);
int GetNumPluginMenus(void);
void InitPluginMenuIterator(void);
map <int,skindesignerapi::sPlugMenu> *GetPluginMenus(string &name, int &id);
skindesignerapi::cTokenContainer *GetTokenContainer(int plugId, int plugMenuId);
void AddSubviewMapping(int plugId, int plugMenuId, int subViewId);
int GetSubviewId(int plugId, int plugMenuId);
//Advanced Plugin Interface
void RegisterAdvancedPlugin(skindesignerapi::cPluginStructure *plugStructure);
void InitPluginViewIterator(void);
bool GetNextPluginView(string &plugName, int &plugId, string &tplName);
int GetNumSubviews(int plugId);
void InitPluginSubviewIterator(int plugId);
bool GetNextSubView(int &id, string &tplname);
int GetNumViewElements(int plugId, int viewId);
void InitViewElementIterator(int plugId, int viewId);
bool GetNextViewElement(int &veId, string &veName);
skindesignerapi::cTokenContainer *GetTokenContainerVE(int plugId, int viewId, int veId);
int GetNumViewGrids(int plugId, int viewId);
void InitViewGridIterator(int plugId, int viewId);
bool GetNextViewGrid(int &gId, string &gName);
skindesignerapi::cTokenContainer *GetTokenContainerGE(int plugId, int viewId, int gId);
skindesignerapi::cTokenContainer *GetTokenContainerTab(int plugId, int viewId);
};
#endif //__PLUGINMANAGER_H

View File

@ -1,407 +0,0 @@
#include "scrapmanager.h"
#include "../coreengine/definitions.h"
#include "helpers.h"
cPlugin *cScrapManager::pScraper = NULL;
cScrapManager::cScrapManager(void) {
if (!pScraper) {
pScraper = GetScraperPlugin();
}
movie = NULL;
series = NULL;
}
cScrapManager::~cScrapManager(void) {
delete movie;
delete series;
}
bool cScrapManager::LoadFullScrapInfo(const cEvent *event, const cRecording *recording) {
if (!pScraper) {
return false;
}
delete movie;
movie = NULL;
delete series;
series = NULL;
ScraperGetEventType getType;
getType.event = event;
getType.recording = recording;
if (!pScraper->Service("GetEventType", &getType)) {
return false;
}
if (getType.type == tMovie) {
movie = new cMovie();
movie->movieId = getType.movieId;
pScraper->Service("GetMovie", movie);
return true;
} else if (getType.type == tSeries) {
series = new cSeries();
series->seriesId = getType.seriesId;
series->episodeId = getType.episodeId;
pScraper->Service("GetSeries", series);
return true;
}
return false;
}
void cScrapManager::SetFullScrapInfo(skindesignerapi::cTokenContainer *tk, int actorsIndex) {
if (series) {
tk->AddIntToken((int)eScraperIT::ismovie, 0);
tk->AddIntToken((int)eScraperIT::isseries, 1);
SetSeries(tk, actorsIndex);
} else if (movie) {
tk->AddIntToken((int)eScraperIT::ismovie, 1);
tk->AddIntToken((int)eScraperIT::isseries, 0);
SetMovie(tk, actorsIndex);
} else {
tk->AddIntToken((int)eScraperIT::ismovie, 0);
tk->AddIntToken((int)eScraperIT::isseries, 0);
}
}
int cScrapManager::NumActors(void) {
if (series) {
return series->actors.size();
} else if (movie) {
return movie->actors.size();
}
return 0;
}
void cScrapManager::SetHeaderScrapInfo(skindesignerapi::cTokenContainer *tk) {
if (series) {
tk->AddIntToken((int)eScraperHeaderIT::ismovie, 0);
tk->AddIntToken((int)eScraperHeaderIT::isseries, 1);
vector<cTvMedia>::iterator poster = series->posters.begin();
if (poster != series->posters.end()) {
tk->AddIntToken((int)eScraperHeaderIT::posteravailable, true);
tk->AddIntToken((int)eScraperHeaderIT::posterwidth, (*poster).width);
tk->AddIntToken((int)eScraperHeaderIT::posterheight, (*poster).height);
tk->AddStringToken((int)eScraperHeaderST::posterpath, (*poster).path.c_str());
}
vector<cTvMedia>::iterator banner = series->banners.begin();
if (banner != series->banners.end()) {
tk->AddIntToken((int)eScraperHeaderIT::banneravailable, true);
tk->AddIntToken((int)eScraperHeaderIT::bannerwidth, (*banner).width);
tk->AddIntToken((int)eScraperHeaderIT::bannerheight, (*banner).height);
tk->AddStringToken((int)eScraperHeaderST::bannerpath, (*banner).path.c_str());
}
} else if (movie) {
tk->AddIntToken((int)eScraperHeaderIT::ismovie, 1);
tk->AddIntToken((int)eScraperHeaderIT::isseries, 0);
tk->AddIntToken((int)eScraperHeaderIT::posteravailable, true);
tk->AddIntToken((int)eScraperHeaderIT::banneravailable, false);
tk->AddIntToken((int)eScraperHeaderIT::posterwidth, movie->poster.width);
tk->AddIntToken((int)eScraperHeaderIT::posterheight, movie->poster.height);
tk->AddStringToken((int)eScraperHeaderST::posterpath, movie->poster.path.c_str());
} else {
tk->AddIntToken((int)eScraperHeaderIT::ismovie, 0);
tk->AddIntToken((int)eScraperHeaderIT::isseries, 0);
}
}
void cScrapManager::SetScraperPosterBanner(skindesignerapi::cTokenContainer *tk) {
if (movie) {
tk->AddIntToken((int)eCeMenuSchedulesIT::hasposter, 1);
tk->AddStringToken((int)eCeMenuSchedulesST::posterpath, movie->poster.path.c_str());
tk->AddIntToken((int)eCeMenuSchedulesIT::posterwidth, movie->poster.width);
tk->AddIntToken((int)eCeMenuSchedulesIT::posterheight, movie->poster.height);
} else if (series) {
vector<cTvMedia>::iterator poster = series->posters.begin();
if (poster != series->posters.end()) {
tk->AddIntToken((int)eCeMenuSchedulesIT::hasposter, 1);
tk->AddIntToken((int)eCeMenuSchedulesIT::posterwidth, (*poster).width);
tk->AddIntToken((int)eCeMenuSchedulesIT::posterheight, (*poster).height);
tk->AddStringToken((int)eCeMenuSchedulesST::posterpath, (*poster).path.c_str());
}
vector<cTvMedia>::iterator banner = series->banners.begin();
if (banner != series->banners.end()) {
tk->AddIntToken((int)eCeMenuSchedulesIT::hasbanner, 1);
tk->AddIntToken((int)eCeMenuSchedulesIT::bannerwidth, (*banner).width);
tk->AddIntToken((int)eCeMenuSchedulesIT::bannerheight, (*banner).height);
tk->AddStringToken((int)eCeMenuSchedulesST::bannerpath, (*banner).path.c_str());
}
}
}
void cScrapManager::SetScraperPosterBannerChannel(skindesignerapi::cTokenContainer *tk) {
if (movie) {
tk->AddIntToken((int)eCeMenuChannelsIT::hasposter, 1);
tk->AddStringToken((int)eCeMenuChannelsST::posterpath, movie->poster.path.c_str());
tk->AddIntToken((int)eCeMenuChannelsIT::posterwidth, movie->poster.width);
tk->AddIntToken((int)eCeMenuChannelsIT::posterheight, movie->poster.height);
} else if (series) {
vector<cTvMedia>::iterator poster = series->posters.begin();
if (poster != series->posters.end()) {
tk->AddIntToken((int)eCeMenuChannelsIT::hasposter, 1);
tk->AddIntToken((int)eCeMenuChannelsIT::posterwidth, (*poster).width);
tk->AddIntToken((int)eCeMenuChannelsIT::posterheight, (*poster).height);
tk->AddStringToken((int)eCeMenuChannelsST::posterpath, (*poster).path.c_str());
}
vector<cTvMedia>::iterator banner = series->banners.begin();
if (banner != series->banners.end()) {
tk->AddIntToken((int)eCeMenuChannelsIT::hasbanner, 1);
tk->AddIntToken((int)eCeMenuChannelsIT::bannerwidth, (*banner).width);
tk->AddIntToken((int)eCeMenuChannelsIT::bannerheight, (*banner).height);
tk->AddStringToken((int)eCeMenuChannelsST::bannerpath, (*banner).path.c_str());
}
}
}
void cScrapManager::SetScraperPosterBannerTimer(skindesignerapi::cTokenContainer *tk) {
if (movie) {
tk->AddIntToken((int)eCeMenuTimersIT::hasposter, 1);
tk->AddStringToken((int)eCeMenuTimersST::posterpath, movie->poster.path.c_str());
tk->AddIntToken((int)eCeMenuTimersIT::posterwidth, movie->poster.width);
tk->AddIntToken((int)eCeMenuTimersIT::posterheight, movie->poster.height);
} else if (series) {
vector<cTvMedia>::iterator poster = series->posters.begin();
if (poster != series->posters.end()) {
tk->AddIntToken((int)eCeMenuTimersIT::hasposter, 1);
tk->AddIntToken((int)eCeMenuTimersIT::posterwidth, (*poster).width);
tk->AddIntToken((int)eCeMenuTimersIT::posterheight, (*poster).height);
tk->AddStringToken((int)eCeMenuTimersST::posterpath, (*poster).path.c_str());
}
vector<cTvMedia>::iterator banner = series->banners.begin();
if (banner != series->banners.end()) {
tk->AddIntToken((int)eCeMenuTimersIT::hasbanner, 1);
tk->AddIntToken((int)eCeMenuTimersIT::bannerwidth, (*banner).width);
tk->AddIntToken((int)eCeMenuTimersIT::bannerheight, (*banner).height);
tk->AddStringToken((int)eCeMenuTimersST::bannerpath, (*banner).path.c_str());
}
}
}
void cScrapManager::SetScraperRecordingPoster(skindesignerapi::cTokenContainer *tk, const cRecording *recording, bool isListElement) {
if (!pScraper) {
return;
}
ScraperGetPosterThumb call;
call.event = NULL;
call.recording = recording;
if (pScraper->Service("GetPosterThumb", &call)) {
if (isListElement) {
tk->AddIntToken((int)eLeMenuRecordingsIT::hasposterthumbnail, FileExists(call.poster.path));
tk->AddIntToken((int)eLeMenuRecordingsIT::thumbnailwidth, call.poster.width);
tk->AddIntToken((int)eLeMenuRecordingsIT::thumbnailheight, call.poster.height);
tk->AddStringToken((int)eLeMenuRecordingsST::thumbnailpath, call.poster.path.c_str());
} else {
tk->AddIntToken((int)eCeMenuRecordingsIT::hasposterthumbnail, FileExists(call.poster.path));
tk->AddIntToken((int)eCeMenuRecordingsIT::thumbnailwidth, call.poster.width);
tk->AddIntToken((int)eCeMenuRecordingsIT::thumbnailheight, call.poster.height);
tk->AddStringToken((int)eCeMenuRecordingsST::thumbnailpath, call.poster.path.c_str());
}
}
ScraperGetPoster call2;
call2.event = NULL;
call2.recording = recording;
if (pScraper->Service("GetPoster", &call2)) {
if (isListElement) {
tk->AddIntToken((int)eLeMenuRecordingsIT::hasposter, FileExists(call2.poster.path));
tk->AddIntToken((int)eLeMenuRecordingsIT::posterwidth, call2.poster.width);
tk->AddIntToken((int)eLeMenuRecordingsIT::posterheight, call2.poster.height);
tk->AddStringToken((int)eLeMenuRecordingsST::posterpath, call2.poster.path.c_str());
} else {
tk->AddIntToken((int)eCeMenuRecordingsIT::hasposter, FileExists(call2.poster.path));
tk->AddIntToken((int)eCeMenuRecordingsIT::posterwidth, call2.poster.width);
tk->AddIntToken((int)eCeMenuRecordingsIT::posterheight, call2.poster.height);
tk->AddStringToken((int)eCeMenuRecordingsST::posterpath, call2.poster.path.c_str());
}
}
}
cPlugin *cScrapManager::GetScraperPlugin(void) {
static cPlugin *pScraper = cPluginManager::GetPlugin("scraper2vdr");
if( !pScraper ) // if it doesn't exit, try tvscraper
pScraper = cPluginManager::GetPlugin("tvscraper");
return pScraper;
}
void cScrapManager::SetMovie(skindesignerapi::cTokenContainer *tk, int actorsIndex) {
tk->AddStringToken((int)eScraperST::movietitle, movie->title.c_str());
tk->AddStringToken((int)eScraperST::movieoriginalTitle, movie->originalTitle.c_str());
tk->AddStringToken((int)eScraperST::movietagline, movie->tagline.c_str());
tk->AddStringToken((int)eScraperST::movieoverview, movie->overview.c_str());
tk->AddStringToken((int)eScraperST::moviegenres, movie->genres.c_str());
tk->AddStringToken((int)eScraperST::moviehomepage, movie->homepage.c_str());
tk->AddStringToken((int)eScraperST::moviereleasedate, movie->releaseDate.c_str());
tk->AddStringToken((int)eScraperST::moviepopularity, *cString::sprintf("%f", movie->popularity));
tk->AddStringToken((int)eScraperST::movievoteaverage, *cString::sprintf("%f", movie->voteAverage));
tk->AddStringToken((int)eScraperST::posterpath, movie->poster.path.c_str());
tk->AddStringToken((int)eScraperST::fanartpath, movie->fanart.path.c_str());
tk->AddStringToken((int)eScraperST::collectionposterpath, movie->collectionPoster.path.c_str());
tk->AddStringToken((int)eScraperST::collectionfanartpath, movie->collectionFanart.path.c_str());
tk->AddIntToken((int)eScraperIT::movieadult, movie->adult);
tk->AddIntToken((int)eScraperIT::moviebudget, movie->budget);
tk->AddIntToken((int)eScraperIT::movierevenue, movie->revenue);
tk->AddIntToken((int)eScraperIT::movieruntime, movie->runtime);
tk->AddIntToken((int)eScraperIT::posterwidth, movie->poster.width);
tk->AddIntToken((int)eScraperIT::posterheight, movie->poster.height);
tk->AddIntToken((int)eScraperIT::fanartwidth, movie->fanart.width);
tk->AddIntToken((int)eScraperIT::fanartheight, movie->fanart.height);
tk->AddIntToken((int)eScraperIT::collectionposterwidth, movie->collectionPoster.width);
tk->AddIntToken((int)eScraperIT::collectionposterheight, movie->collectionPoster.height);
tk->AddIntToken((int)eScraperIT::collectionfanartwidth, movie->collectionFanart.width);
tk->AddIntToken((int)eScraperIT::collectionfanartheight, movie->collectionFanart.height);
if (movie->collectionPoster.path.size() > 0)
tk->AddIntToken((int)eScraperIT::movieiscollection, 1);
int i=0;
for (vector<cActor>::iterator act = movie->actors.begin(); act != movie->actors.end(); act++) {
tk->AddLoopToken(actorsIndex, i, (int)eScraperLT::name, (*act).name.c_str());
tk->AddLoopToken(actorsIndex, i, (int)eScraperLT::role, (*act).role.c_str());
tk->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumb, (*act).actorThumb.path.c_str());
tk->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumbwidth, *cString::sprintf("%d", (*act).actorThumb.width));
tk->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumbheight, *cString::sprintf("%d", (*act).actorThumb.height));
i++;
}
}
void cScrapManager::SetSeries(skindesignerapi::cTokenContainer *tk, int actorsIndex) {
//Series Basics
tk->AddStringToken((int)eScraperST::seriesname, series->name.c_str());
tk->AddStringToken((int)eScraperST::seriesoverview, series->overview.c_str());
tk->AddStringToken((int)eScraperST::seriesfirstaired, series->firstAired.c_str());
tk->AddStringToken((int)eScraperST::seriesnetwork, series->network.c_str());
tk->AddStringToken((int)eScraperST::seriesgenre, series->genre.c_str());
tk->AddStringToken((int)eScraperST::seriesrating, *cString::sprintf("%f", series->rating));
tk->AddStringToken((int)eScraperST::seriesstatus, series->status.c_str());
//Episode Information
tk->AddIntToken((int)eScraperIT::episodenumber, series->episode.number);
tk->AddIntToken((int)eScraperIT::episodeseason, series->episode.season);
tk->AddStringToken((int)eScraperST::episodetitle, series->episode.name.c_str());
tk->AddStringToken((int)eScraperST::episodefirstaired, series->episode.firstAired.c_str());
tk->AddStringToken((int)eScraperST::episodegueststars, series->episode.guestStars.c_str());
tk->AddStringToken((int)eScraperST::episodeoverview, series->episode.overview.c_str());
tk->AddStringToken((int)eScraperST::episoderating, *cString::sprintf("%f", series->episode.rating));
tk->AddIntToken((int)eScraperIT::episodeimagewidth, series->episode.episodeImage.width);
tk->AddIntToken((int)eScraperIT::episodeimageheight, series->episode.episodeImage.height);
tk->AddStringToken((int)eScraperST::episodeimagepath, series->episode.episodeImage.path.c_str());
//Seasonposter
tk->AddIntToken((int)eScraperIT::seasonposterwidth, series->seasonPoster.width);
tk->AddIntToken((int)eScraperIT::seasonposterheight, series->seasonPoster.height);
tk->AddStringToken((int)eScraperST::seasonposterpath, series->seasonPoster.path.c_str());
//Posters
int indexInt = (int)eScraperIT::seriesposter1width;
int indexStr = (int)eScraperST::seriesposter1path;
for(vector<cTvMedia>::iterator poster = series->posters.begin(); poster != series->posters.end(); poster++) {
tk->AddIntToken(indexInt, (*poster).width);
tk->AddIntToken(indexInt+1, (*poster).height);
tk->AddStringToken(indexStr, (*poster).path.c_str());
indexInt += 2;
indexStr++;
}
//Banners
indexInt = (int)eScraperIT::seriesbanner1width;
indexStr = (int)eScraperST::seriesbanner1path;
for(vector<cTvMedia>::iterator banner = series->banners.begin(); banner != series->banners.end(); banner++) {
tk->AddIntToken(indexInt, (*banner).width);
tk->AddIntToken(indexInt+1, (*banner).height);
tk->AddStringToken(indexStr, (*banner).path.c_str());
indexInt += 2;
indexStr++;
}
//Fanarts
indexInt = (int)eScraperIT::seriesfanart1width;
indexStr = (int)eScraperST::seriesfanart1path;
for(vector<cTvMedia>::iterator fanart = series->fanarts.begin(); fanart != series->fanarts.end(); fanart++) {
tk->AddIntToken(indexInt, (*fanart).width);
tk->AddIntToken(indexInt+1, (*fanart).height);
tk->AddStringToken(indexStr, (*fanart).path.c_str());
indexInt += 2;
indexStr++;
}
//Actors
int i=0;
for (vector<cActor>::iterator act = series->actors.begin(); act != series->actors.end(); act++) {
tk->AddLoopToken(actorsIndex, i, (int)eScraperLT::name, (*act).name.c_str());
tk->AddLoopToken(actorsIndex, i, (int)eScraperLT::role, (*act).role.c_str());
tk->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumb, (*act).actorThumb.path.c_str());
tk->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumbwidth, *cString::sprintf("%d", (*act).actorThumb.width));
tk->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumbheight, *cString::sprintf("%d", (*act).actorThumb.height));
i++;
}
}
void cScrapManager::RecPoster(const cRecording *rec, int &posterWidth, int &posterHeight, string &path, bool &hasPoster) {
if (!pScraper) {
return;
}
ScraperGetPoster callPoster;
callPoster.event = NULL;
callPoster.recording = rec;
if (pScraper->Service("GetPoster", &callPoster)) {
posterWidth = callPoster.poster.width;
posterHeight = callPoster.poster.height;
path = callPoster.poster.path;
if (path.size() > 0)
hasPoster = true;
}
}
void cScrapManager::SetPosterBanner(skindesignerapi::cTokenContainer *tk, const cEvent *event, const cRecording *recording) {
if (!pScraper) {
return;
}
int mediaWidth = 0;
int mediaHeight = 0;
string mediaPath = "";
bool isBanner = false;
int posterWidth = 0;
int posterHeight = 0;
string posterPath = "";
bool hasPoster = false;
int bannerWidth = 0;
int bannerHeight = 0;
string bannerPath = "";
bool hasBanner = false;
ScraperGetPosterBannerV2 call;
call.event = event;
call.recording = recording;
if (pScraper->Service("GetPosterBannerV2", &call)) {
if ((call.type == tSeries) && call.banner.path.size() > 0) {
mediaWidth = call.banner.width;
mediaHeight = call.banner.height;
mediaPath = call.banner.path;
isBanner = true;
bannerWidth = mediaWidth;
bannerHeight = mediaHeight;
bannerPath = mediaPath;
hasBanner = true;
ScraperGetPoster callPoster;
callPoster.event = event;
callPoster.recording = recording;
if (pScraper->Service("GetPoster", &callPoster)) {
posterWidth = callPoster.poster.width;
posterHeight = callPoster.poster.height;
posterPath = callPoster.poster.path;
hasPoster = true;
}
} else if (call.type == tMovie && call.poster.path.size() > 0 && call.poster.height > 0) {
mediaWidth = call.poster.width;
mediaHeight = call.poster.height;
mediaPath = call.poster.path;
posterWidth = call.poster.width;
posterHeight = call.poster.height;
posterPath = call.poster.path;
hasPoster = true;
}
}
tk->AddIntToken((int)eScraperPosterBannerIT::mediawidth, mediaWidth);
tk->AddIntToken((int)eScraperPosterBannerIT::mediaheight, mediaHeight);
tk->AddIntToken((int)eScraperPosterBannerIT::isbanner, isBanner);
tk->AddStringToken((int)eScraperPosterBannerST::mediapath, mediaPath.c_str());
tk->AddIntToken((int)eScraperPosterBannerIT::posterwidth, posterWidth);
tk->AddIntToken((int)eScraperPosterBannerIT::posterheight, posterHeight);
tk->AddStringToken((int)eScraperPosterBannerST::posterpath, posterPath.c_str());
tk->AddIntToken((int)eScraperPosterBannerIT::hasposter, hasPoster);
tk->AddIntToken((int)eScraperPosterBannerIT::bannerwidth, bannerWidth);
tk->AddIntToken((int)eScraperPosterBannerIT::bannerheight, bannerHeight);
tk->AddStringToken((int)eScraperPosterBannerST::bannerpath, bannerPath.c_str());
tk->AddIntToken((int)eScraperPosterBannerIT::hasbanner, hasBanner);
}

View File

@ -1,30 +0,0 @@
#ifndef __SCRAPMANAGER_H
#define __SCRAPMANAGER_H
#include "../services/scraper2vdr.h"
#include "../libskindesignerapi/tokencontainer.h"
class cScrapManager {
private:
static cPlugin *pScraper;
cMovie *movie;
cSeries *series;
cPlugin *GetScraperPlugin(void);
void SetMovie(skindesignerapi::cTokenContainer *tk, int actorsIndex);
void SetSeries(skindesignerapi::cTokenContainer *tk, int actorsIndex);
protected:
bool LoadFullScrapInfo(const cEvent *event, const cRecording *recording);
void SetFullScrapInfo(skindesignerapi::cTokenContainer *tk, int actorsIndex);
int NumActors(void);
void SetHeaderScrapInfo(skindesignerapi::cTokenContainer *tk);
void SetScraperPosterBanner(skindesignerapi::cTokenContainer *tk);
void SetScraperPosterBannerChannel(skindesignerapi::cTokenContainer *tk);
void SetScraperPosterBannerTimer(skindesignerapi::cTokenContainer *tk);
void SetScraperRecordingPoster(skindesignerapi::cTokenContainer *tk, const cRecording *recording, bool isListElement);
void RecPoster(const cRecording *rec, int &posterWidth, int &posterHeight, string &path, bool &hasPoster);
void SetPosterBanner(skindesignerapi::cTokenContainer *tk, const cEvent *event, const cRecording *recording);
public:
cScrapManager(void);
virtual ~cScrapManager(void);
};
#endif //__SCRAPMANAGER_H

View File

@ -1,4 +1,5 @@
#include "cairoimage.h" #include "cairoimage.h"
#include "../libtemplate/templatefunction.h"
cCairoImage::cCairoImage(void) { cCairoImage::cCairoImage(void) {
surface = NULL; surface = NULL;
@ -34,7 +35,7 @@ void cCairoImage::DrawTextVertical(string text, tColor color, string font, int s
int x = size; int x = size;
int y = imgHeight; int y = imgHeight;
double rotate = 3*M_PI/2; double rotate = 3*M_PI/2;
if (direction == (int)eDirection::topdown) { if (direction == diTopDown) {
rotate = M_PI/2; rotate = M_PI/2;
x = size*0.3; x = size*0.3;
y = 0; y = 0;

View File

@ -5,7 +5,6 @@
#include <vdr/osd.h> #include <vdr/osd.h>
#include <string> #include <string>
#include <sstream> #include <sstream>
#include "../coreengine/definitions.h"
using namespace std; using namespace std;

View File

@ -19,7 +19,7 @@ bool cExtRecInfo::Parse(void) {
} }
StripXmlTag(mediaInfoXml, resWidth, "res_width"); StripXmlTag(mediaInfoXml, resWidth, "res_width");
StripXmlTag(mediaInfoXml, resHeight, "res_height"); StripXmlTag(mediaInfoXml, resHeight, "res_height");
resString = GetScreenResolutionString(resWidth, resHeight, &isHD, &isUHD); resString = GetScreenResolutionString(resWidth, resHeight, &isHD);
StripXmlTag(mediaInfoXml, aspectratio, "aspectratio"); StripXmlTag(mediaInfoXml, aspectratio, "aspectratio");
isWideScreen = !aspectratio.compare("16:9"); isWideScreen = !aspectratio.compare("16:9");
StripXmlTag(mediaInfoXml, codec, "codec"); StripXmlTag(mediaInfoXml, codec, "codec");

View File

@ -23,7 +23,6 @@ public:
int resHeight; int resHeight;
string resString; string resString;
bool isHD; bool isHD;
bool isUHD;
string aspectratio; string aspectratio;
bool isWideScreen; bool isWideScreen;
string codec; string codec;
@ -34,4 +33,4 @@ public:
vector< tAudioTrack > tracks; vector< tAudioTrack > tracks;
}; };
#endif // __EXTRECINFO_H #endif // __EXTRECINFO_H

View File

@ -7,13 +7,38 @@ using namespace std;
cMutex cFontManager::mutex; cMutex cFontManager::mutex;
cFontManager::cFontManager(void) { cFontManager::cFontManager() {
} }
cFontManager::~cFontManager(void) { cFontManager::~cFontManager() {
DeleteFonts(); DeleteFonts();
} }
void cFontManager::CacheFonts(cTemplate *tpl) {
cMutexLock MutexLock(&mutex);
vector< pair<string, int> > usedFonts = tpl->GetUsedFonts();
cStringList availableFonts;
cFont::GetAvailableFontNames(&availableFonts);
for (vector< pair<string, int> >::iterator ft = usedFonts.begin(); ft != usedFonts.end(); ft++) {
string fontName = ft->first;
int fontSize = ft->second;
if (fontSize < 1) {
continue;
}
int fontAvailable = availableFonts.Find(fontName.c_str());
if (fontAvailable == -1) {
esyslog("skindesigner: font %s not available, skipping", fontName.c_str());
continue;
}
InsertFont(fontName, fontSize);
}
}
void cFontManager::Debug(void) { void cFontManager::Debug(void) {
dsyslog("skindesigner: fontmanager fonts available:"); dsyslog("skindesigner: fontmanager fonts available:");
for (map < string, map< int, cFont* > >::iterator fts = fonts.begin(); fts != fonts.end(); fts++) { for (map < string, map< int, cFont* > >::iterator fts = fonts.begin(); fts != fonts.end(); fts++) {

View File

@ -6,6 +6,8 @@
#include <vector> #include <vector>
#include <vdr/skins.h> #include <vdr/skins.h>
#include "../libtemplate/template.h"
using namespace std; using namespace std;
class cFontManager { class cFontManager {
@ -18,10 +20,11 @@ private:
cFont *GetFont(string name, int size); cFont *GetFont(string name, int size);
int GetFontHeight(const char *name, int height, int charWidth = 0); int GetFontHeight(const char *name, int height, int charWidth = 0);
public: public:
cFontManager(void); cFontManager();
~cFontManager(void); ~cFontManager();
void Lock(void) { mutex.Lock(); }; void Lock(void) { mutex.Lock(); };
void Unlock(void) { mutex.Unlock(); }; void Unlock(void) { mutex.Unlock(); };
void CacheFonts(cTemplate *tpl);
void DeleteFonts(void); void DeleteFonts(void);
int Width(string fontName, int fontSize, const char *text); int Width(string fontName, int fontSize, const char *text);
int Height(string fontName, int fontSize); int Height(string fontName, int fontSize);

View File

@ -51,6 +51,35 @@ int Minimum(int a, int b, int c, int d, int e, int f) {
return min; return min;
} }
string CutText(string &text, int width, string fontName, int fontSize) {
if (width <= fontManager->Font(fontName, fontSize)->Size())
return text.c_str();
fontManager->Lock();
cTextWrapper twText;
twText.Set(text.c_str(), fontManager->Font(fontName, fontSize), width);
fontManager->Unlock();
string cuttedTextNative = twText.GetLine(0);
stringstream sstrText;
sstrText << cuttedTextNative << "...";
string cuttedText = sstrText.str();
int actWidth = fontManager->Width(fontName, fontSize, cuttedText.c_str());
if (actWidth > width) {
int overlap = actWidth - width;
int charWidth = fontManager->Width(fontName, fontSize, ".");
if (charWidth == 0)
charWidth = 1;
int cutChars = overlap / charWidth;
if (cutChars > 0) {
cuttedTextNative = cuttedTextNative.substr(0, cuttedTextNative.length() - cutChars);
stringstream sstrText2;
sstrText2 << cuttedTextNative << "...";
cuttedText = sstrText2.str();
}
}
return cuttedText;
}
string StrToLowerCase(string str) { string StrToLowerCase(string str) {
string lowerCase = str; string lowerCase = str;
const int length = lowerCase.length(); const int length = lowerCase.length();
@ -78,7 +107,7 @@ bool FileExists(const string &fullpath) {
return true; return true;
} }
if (config.debugImageLoading) { if (config.debugImageLoading) {
dsyslog("skindesigner: did not find %s", fullpath.c_str()); dsyslog("skindesigner: did not found %s", fullpath.c_str());
} }
return false; return false;
} }
@ -91,7 +120,7 @@ bool FileExists(const string &path, const string &name, const string &ext) {
return true; return true;
} }
if (config.debugImageLoading) { if (config.debugImageLoading) {
dsyslog("skindesigner: did not find %s", fileName.str().c_str()); dsyslog("skindesigner: did not found %s", fileName.str().c_str());
} }
return false; return false;
} }
@ -184,57 +213,27 @@ void cStopWatch::Stop(const char* message) {
dsyslog("skindesigner: %s - needed %d ms", message, (int)(cTimeMs::Now() - start)); dsyslog("skindesigner: %s - needed %d ms", message, (int)(cTimeMs::Now() - start));
} }
string GetTimeString(int seconds) {
time_t sec(seconds);
tm *p = gmtime(&sec);
int hours = p->tm_hour;
int mins = p->tm_min;
int secs = p->tm_sec;
if (hours > 0) {
return *cString::sprintf("%d:%02d:%02d", hours, mins, secs);
}
return *cString::sprintf("%02d:%02d", mins, secs);;
}
//View Helpers //View Helpers
string GetScreenResolutionString(int width, int height, bool *isHD, bool *isUHD) { string GetScreenResolutionString(int width, int height, bool *isHD) {
// TODO: try to get more information from information sources about interlace/progressive
// cDevice::PrimaryDevice()->GetVideoSize is NOT providing enough information
*isHD = false; // default
*isUHD = false; // default
string name = ""; string name = "";
switch (height) { switch (width) {
case 4320: // 7680 x 4320 = 8K UHD case 1920:
name = "uhd4320p"; case 1440:
*isHD = true; name = "hd1080i";
*isUHD = true;
break;
case 2160: // 3840 x 2160 = 4K UHD
name = "uhd2160p";
*isHD = true;
*isUHD = true;
break;
case 1440: // 2560 x 1440 = QHD
name = "hd1440p";
*isHD = true; *isHD = true;
break; break;
case 1080: case 1280:
name = "hd1080i"; // 'i' is default, 'p' can't be detected currently if (height == 720)
name = "hd720p";
else
name = "hd1080i";
*isHD = true; *isHD = true;
break; break;
case 720: case 720:
name = "hd720p"; // 'i' is not defined in standards name = "sd576i";
*isHD = true;
break;
case 576:
name = "sd576i"; // assumed 'i'
break;
case 480:
name = "sd480i"; // assumed 'i'
break; break;
default: default:
name = "unknown"; name = "sd576i";
break; break;
} }
return name; return name;

View File

@ -1,8 +1,6 @@
#ifndef __HELPERS_H #ifndef __HELPERS_H
#define __HELPERS_H #define __HELPERS_H
#include <string>
#include <algorithm>
#include <vdr/osd.h> #include <vdr/osd.h>
#include <vdr/plugin.h> #include <vdr/plugin.h>
#include "../config.h" #include "../config.h"
@ -11,6 +9,7 @@ cPlugin *GetScraperPlugin(void);
cSize ScaleToFit(int widthMax, int heightMax, int widthOriginal, int heightOriginal); cSize ScaleToFit(int widthMax, int heightMax, int widthOriginal, int heightOriginal);
int Minimum(int a, int b, int c, int d, int e, int f); int Minimum(int a, int b, int c, int d, int e, int f);
std::string CutText(string &text, int width, string fontName, int fontSize);
std::string StrToLowerCase(string str); std::string StrToLowerCase(string str);
bool isNumber(const string& s); bool isNumber(const string& s);
bool IsToken(const string& token); bool IsToken(const string& token);
@ -42,9 +41,7 @@ public:
void Stop(const char* message); void Stop(const char* message);
}; };
string GetTimeString(int seconds); string GetScreenResolutionString(int width, int height, bool *isHD);
string GetScreenResolutionString(int width, int height, bool *isHD, bool *isUHD);
string GetScreenAspectString(double aspect, bool *isWideScreen); string GetScreenAspectString(double aspect, bool *isWideScreen);
#endif // __HELPERS_H #endif // __HELPERS_H

View File

@ -56,20 +56,10 @@ void cImageCache::CacheLogo(int width, int height) {
return; return;
if (width == 0 || height == 0) if (width == 0 || height == 0)
return; return;
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cChannels* channels = Channels;
#else
const cChannels* channels = &Channels;
#endif
int logosCached = 0; int logosCached = 0;
if (config.numLogosMax && config.numLogosMax < (int)channelLogoCache.size()) for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
return;
for (const cChannel *channel = channels->First(); channel; channel = channels->Next(channel)) {
if (logosCached >= config.numLogosPerSizeInitial) if (logosCached >= config.numLogosPerSizeInitial)
break; break;
if (channel->GroupSep()) { if (channel->GroupSep()) {
@ -87,8 +77,6 @@ void cImageCache::CacheLogo(int width, int height) {
cImage *image = CreateImage(width, height); cImage *image = CreateImage(width, height);
channelLogoCache.insert(pair<string, cImage*>(logoName.str(), image)); channelLogoCache.insert(pair<string, cImage*>(logoName.str(), image));
} }
if (config.numLogosMax && config.numLogosMax < (int)channelLogoCache.size())
return;
} }
} }
@ -104,13 +92,7 @@ cImage *cImageCache::GetLogo(string channelID, int width, int height) {
return (cImage*)hit->second; return (cImage*)hit->second;
} else { } else {
tChannelID chanID = tChannelID::FromString(channelID.c_str()); tChannelID chanID = tChannelID::FromString(channelID.c_str());
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) const cChannel *channel = Channels.GetByChannelID(chanID);
LOCK_CHANNELS_READ;
const cChannels* channels = Channels;
#else
cChannels* channels = &Channels;
#endif
const cChannel *channel = channels->GetByChannelID(chanID);
if (!channel) if (!channel)
return NULL; return NULL;
bool success = LoadLogo(channel); bool success = LoadLogo(channel);
@ -164,13 +146,7 @@ cImage *cImageCache::GetSeparatorLogo(string name, int width, int height) {
bool cImageCache::LogoExists(string channelID) { bool cImageCache::LogoExists(string channelID) {
tChannelID chanID = tChannelID::FromString(channelID.c_str()); tChannelID chanID = tChannelID::FromString(channelID.c_str());
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) const cChannel *channel = Channels.GetByChannelID(chanID);
LOCK_CHANNELS_READ;
const cChannels* channels = Channels;
#else
cChannels* channels = &Channels;
#endif
const cChannel *channel = channels->GetByChannelID(chanID);
if (!channel) if (!channel)
return false; return false;
string logoLower = StrToLowerCase(channel->Name()); string logoLower = StrToLowerCase(channel->Name());
@ -196,34 +172,24 @@ void cImageCache::CacheIcon(eImageType type, string name, int width, int height)
GetIcon(type, name, width, height); GetIcon(type, name, width, height);
} }
cCachedImage *cImageCache::GetIcon(eImageType type, string name, int width, int height) { cImage *cImageCache::GetIcon(eImageType type, string name, int width, int height) {
if (width < 1 || width > 1920 || height < 1 || height > 1080) if (width < 1 || width > 1920 || height < 1 || height > 1080)
return NULL; return NULL;
cMutexLock MutexLock(&mutex); cMutexLock MutexLock(&mutex);
stringstream iconName; stringstream iconName;
iconName << name << "_" << width << "x" << height; iconName << name << "_" << width << "x" << height;
map<string, cCachedImage*>::iterator hit = iconCache.find(iconName.str()); map<string, cImage*>::iterator hit = iconCache.find(iconName.str());
if (hit != iconCache.end()) { if (hit != iconCache.end()) {
return (cCachedImage*)hit->second; return (cImage*)hit->second;
} else { } else {
bool success = LoadIcon(type, name); bool success = LoadIcon(type, name);
if (!success) if (!success)
return NULL; return NULL;
cImage *image = CreateImage(width, height, true); cImage *image = CreateImage(width, height, true);
cCachedImage *cachedImg = new cCachedImage(); iconCache.insert(pair<string, cImage*>(iconName.str(), image));
cachedImg->size = image->Width() * image->Height() * sizeof(tColor);
int handle = cOsdProvider::StoreImage(*image);
if (handle) {
cachedImg->handle = handle;
delete image;
} else {
cachedImg->image = image;
}
iconCache.insert(pair<string, cCachedImage*>(iconName.str(), cachedImg));
hit = iconCache.find(iconName.str()); hit = iconCache.find(iconName.str());
if (hit != iconCache.end()) { if (hit != iconCache.end()) {
return (cCachedImage*)hit->second; return (cImage*)hit->second;
} }
} }
return NULL; return NULL;
@ -346,11 +312,6 @@ bool cImageCache::MenuIconExists(string name) {
if (FileExists(*iconSkinPath, name, "png")) { if (FileExists(*iconSkinPath, name, "png")) {
return true; return true;
} }
//finally check svg templates
cString iconTemplatePath = cString::sprintf("%smenuicons/", svgTemplatePath.c_str());
if (FileExists(*iconTemplatePath, name, "svg")) {
return true;
}
return false; return false;
} }
@ -360,33 +321,24 @@ void cImageCache::CacheSkinpart(string name, int width, int height) {
GetSkinpart(name, width, height); GetSkinpart(name, width, height);
} }
cCachedImage *cImageCache::GetSkinpart(string name, int width, int height) { cImage *cImageCache::GetSkinpart(string name, int width, int height) {
if (width < 1 || width > 1920 || height < 1 || height > 1080) if (width < 1 || width > 1920 || height < 1 || height > 1080)
return NULL; return NULL;
cMutexLock MutexLock(&mutex); cMutexLock MutexLock(&mutex);
stringstream iconName; stringstream iconName;
iconName << name << "_" << width << "x" << height; iconName << name << "_" << width << "x" << height;
map<string, cCachedImage*>::iterator hit = skinPartsCache.find(iconName.str()); map<string, cImage*>::iterator hit = skinPartsCache.find(iconName.str());
if (hit != skinPartsCache.end()) { if (hit != skinPartsCache.end()) {
return (cCachedImage*)hit->second; return (cImage*)hit->second;
} else { } else {
bool success = LoadSkinpart(name); bool success = LoadSkinpart(name);
if (!success) if (!success)
return NULL; return NULL;
cImage *image = CreateImage(width, height, false); cImage *image = CreateImage(width, height, false);
cCachedImage *cachedImg = new cCachedImage(); skinPartsCache.insert(pair<string, cImage*>(iconName.str(), image));
cachedImg->size = image->Width() * image->Height() * sizeof(tColor);
int handle = cOsdProvider::StoreImage(*image);
if (handle) {
cachedImg->handle = handle;
delete image;
} else {
cachedImg->image = image;
}
skinPartsCache.insert(pair<string, cCachedImage*>(iconName.str(), cachedImg));
hit = skinPartsCache.find(iconName.str()); hit = skinPartsCache.find(iconName.str());
if (hit != skinPartsCache.end()) { if (hit != skinPartsCache.end()) {
return (cCachedImage*)hit->second; return (cImage*)hit->second;
} }
} }
return NULL; return NULL;
@ -416,9 +368,9 @@ cImage *cImageCache::GetVerticalText(string text, tColor color, string font, int
bool cImageCache::LoadIcon(eImageType type, string name) { bool cImageCache::LoadIcon(eImageType type, string name) {
cString subdir(""); cString subdir("");
if (type == eImageType::menuicon) if (type == itMenuIcon)
subdir = "menuicons"; subdir = "menuicons";
else if (type == eImageType::icon) else if (type == itIcon)
subdir = "icons"; subdir = "icons";
//first check in theme specific icon path //first check in theme specific icon path
@ -438,7 +390,7 @@ bool cImageCache::LoadIcon(eImageType type, string name) {
return LoadImage(*subIconSkinPath, name, "png"); return LoadImage(*subIconSkinPath, name, "png");
//and finally check if a svg template exists //and finally check if a svg template exists
cSVGTemplate svgTemplate(name, *subdir, svgTemplatePath); cSVGTemplate svgTemplate(name, svgTemplatePath);
if (!svgTemplate.Exists()) if (!svgTemplate.Exists())
return false; return false;
svgTemplate.ReadTemplate(); svgTemplate.ReadTemplate();
@ -489,7 +441,7 @@ bool cImageCache::LoadSkinpart(string name) {
return LoadImage(skinPartsPathSkin.c_str(), name, "png"); return LoadImage(skinPartsPathSkin.c_str(), name, "png");
//check if a svg template exists //check if a svg template exists
cSVGTemplate svgTemplate(name, "skinparts", svgTemplatePath); cSVGTemplate svgTemplate(name, svgTemplatePath);
if (!svgTemplate.Exists()) if (!svgTemplate.Exists())
return false; return false;
svgTemplate.ReadTemplate(); svgTemplate.ReadTemplate();
@ -500,8 +452,8 @@ bool cImageCache::LoadSkinpart(string name) {
} }
void cImageCache::Clear(void) { void cImageCache::Clear(void) {
for(map<string, cCachedImage*>::const_iterator it = iconCache.begin(); it != iconCache.end(); it++) { for(map<string, cImage*>::const_iterator it = iconCache.begin(); it != iconCache.end(); it++) {
cCachedImage *img = (cCachedImage*)it->second; cImage *img = (cImage*)it->second;
delete img; delete img;
} }
iconCache.clear(); iconCache.clear();
@ -512,8 +464,8 @@ void cImageCache::Clear(void) {
} }
channelLogoCache.clear(); channelLogoCache.clear();
for(map<string, cCachedImage*>::const_iterator it = skinPartsCache.begin(); it != skinPartsCache.end(); it++) { for(map<string, cImage*>::const_iterator it = skinPartsCache.begin(); it != skinPartsCache.end(); it++) {
cCachedImage *img = (cCachedImage*)it->second; cImage *img = (cImage*)it->second;
delete img; delete img;
} }
skinPartsCache.clear(); skinPartsCache.clear();
@ -526,78 +478,60 @@ void cImageCache::Clear(void) {
} }
void cImageCache::Debug(bool full) { void cImageCache::Debug(bool full) {
float sizeIconCacheInternal = 0; int sizeIconCache = 0;
float sizeIconCacheExternal = 0;
int numIcons = 0; int numIcons = 0;
GetIconCacheSize(numIcons, sizeIconCacheInternal, sizeIconCacheExternal); GetIconCacheSize(numIcons, sizeIconCache);
dsyslog("skindesigner: cached %d icons - size internal mem %.2fMB, high level mem %.2fMB", numIcons, sizeIconCacheInternal, sizeIconCacheExternal); dsyslog("skindesigner: cached %d icons - size %d byte", numIcons, sizeIconCache);
if (full) { if (full) {
for(std::map<std::string, cCachedImage*>::const_iterator it = iconCache.begin(); it != iconCache.end(); it++) { for(std::map<std::string, cImage*>::const_iterator it = iconCache.begin(); it != iconCache.end(); it++) {
string name = it->first; string name = it->first;
cCachedImage *img = (cCachedImage*)it->second; dsyslog("skindesigner: cached icon %s", name.c_str());
dsyslog("skindesigner: cached icon %s, handle %d", name.c_str(), img->handle);
} }
} }
float sizeLogoCache = 0; int sizeLogoCache = 0;
int numLogos = 0; int numLogos = 0;
GetLogoCacheSize(numLogos, sizeLogoCache); GetLogoCacheSize(numLogos, sizeLogoCache);
dsyslog("skindesigner: cached %d logos - size %.2fMB internal mem", numLogos, sizeLogoCache); dsyslog("skindesigner: cached %d logos - size %d byte", numLogos, sizeLogoCache);
if (full) { if (full) {
for(std::map<std::string, cImage*>::const_iterator it = channelLogoCache.begin(); it != channelLogoCache.end(); it++) { for(std::map<std::string, cImage*>::const_iterator it = channelLogoCache.begin(); it != channelLogoCache.end(); it++) {
string name = it->first; string name = it->first;
dsyslog("skindesigner: cached logo %s", name.c_str()); dsyslog("skindesigner: cached logo %s", name.c_str());
} }
} }
float sizeSkinpartCacheInternal = 0;
float sizeSkinpartCacheExternal = 0; int sizeSkinpartCache = 0;
int numSkinparts = 0; int numSkinparts = 0;
GetSkinpartsCacheSize(numSkinparts, sizeSkinpartCacheInternal, sizeSkinpartCacheExternal); GetSkinpartsCacheSize(numSkinparts, sizeSkinpartCache);
dsyslog("skindesigner: cached %d skinparts - size internal mem %.2fMB, high level mem %.2fMB", numSkinparts, sizeSkinpartCacheInternal, sizeSkinpartCacheExternal); dsyslog("skindesigner: cached %d skinparts - size %d byte", numSkinparts, sizeSkinpartCache);
if (full) { if (full) {
for(std::map<std::string, cCachedImage*>::const_iterator it = skinPartsCache.begin(); it != skinPartsCache.end(); it++) { for(std::map<std::string, cImage*>::const_iterator it = skinPartsCache.begin(); it != skinPartsCache.end(); it++) {
string name = it->first; string name = it->first;
dsyslog("skindesigner: cached skinpart %s", name.c_str()); dsyslog("skindesigner: cached skinpart %s", name.c_str());
} }
} }
} }
void cImageCache::GetIconCacheSize(int &num, float &sizeInternal, float &sizeExternal) { void cImageCache::GetIconCacheSize(int &num, int &size) {
num = iconCache.size(); num = iconCache.size();
int sizeByteInternal = 0; for (map<string, cImage*>::iterator icon = iconCache.begin(); icon != iconCache.end(); icon++) {
int sizeByteExternal = 0; cImage* img = icon->second;
for (map<string, cCachedImage*>::iterator icon = iconCache.begin(); icon != iconCache.end(); icon++) { size += img->Width() * img->Height() * sizeof(tColor);
cCachedImage* img = icon->second;
if (img->image)
sizeByteInternal += img->size;
else
sizeByteExternal += img->size;
} }
sizeInternal = sizeByteInternal / 1024.0f / 1024.0f;
sizeExternal = sizeByteExternal / 1024.0f / 1024.0f;
} }
void cImageCache::GetLogoCacheSize(int &num, float &size) { void cImageCache::GetLogoCacheSize(int &num, int &size) {
num = channelLogoCache.size(); num = channelLogoCache.size();
int sizeByte = 0;
for (map<string, cImage*>::iterator logo = channelLogoCache.begin(); logo != channelLogoCache.end(); logo++) { for (map<string, cImage*>::iterator logo = channelLogoCache.begin(); logo != channelLogoCache.end(); logo++) {
cImage* img = logo->second; cImage* img = logo->second;
sizeByte += img->Width() * img->Height() * sizeof(tColor); size += img->Width() * img->Height() * sizeof(tColor);
} }
size = sizeByte / 1024.0f;
} }
void cImageCache::GetSkinpartsCacheSize(int &num, float &sizeInternal, float &sizeExternal) { void cImageCache::GetSkinpartsCacheSize(int &num, int &size) {
num = skinPartsCache.size(); num = skinPartsCache.size();
int sizeByteInternal = 0; for (map<string, cImage*>::iterator skinpart = skinPartsCache.begin(); skinpart != skinPartsCache.end(); skinpart++) {
int sizeByteExternal = 0; cImage* img = skinpart->second;
for (map<string, cCachedImage*>::iterator skinpart = skinPartsCache.begin(); skinpart != skinPartsCache.end(); skinpart++) { size += img->Width() * img->Height() * sizeof(tColor);
cCachedImage* img = skinpart->second; }
if (img->image)
sizeByteInternal += img->size;
else
sizeByteExternal += img->size;
}
sizeInternal = sizeByteInternal / 1024.0f / 1024.0f;
sizeExternal = sizeByteExternal / 1024.0f / 1024.0f;
} }

Some files were not shown because too many files have changed in this diff Show More