diff options
author | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2014-03-15 13:52:14 +0100 |
---|---|---|
committer | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2014-03-15 13:52:14 +0100 |
commit | 0cd8136a9a58501332ed808c7d92bd1ffcd57c01 (patch) | |
tree | 143d421d37ca4f22238155789de8e34751a2a50a /displaymenu.c | |
parent | 26ea9ceb9851ba99029bd9fdf2ed33ce9585870b (diff) | |
download | skin-flatplus-0cd8136a9a58501332ed808c7d92bd1ffcd57c01.tar.gz skin-flatplus-0cd8136a9a58501332ed808c7d92bd1ffcd57c01.tar.bz2 |
add pre load cache, menu entr to show amount of cached images, fix topbar channel logo in program menu
Diffstat (limited to 'displaymenu.c')
-rw-r--r-- | displaymenu.c | 75 |
1 files changed, 48 insertions, 27 deletions
diff --git a/displaymenu.c b/displaymenu.c index 3c7d2eec..c5951410 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -10,6 +10,7 @@ #include "symbols/1080/Cclock.xpm" #include "symbols/1080/Cclocksml.xpm" #include "symbols/1080/Cvpssml.xpm" +#include "flat.h" cBitmap cFlatDisplayMenu::bmCNew(Cnew_xpm); cBitmap cFlatDisplayMenu::bmCArrowTurn(Carrowturn_xpm); @@ -1170,36 +1171,11 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current int w = 0; if( !Channel ) { - int CurrentChannelNr = cDevice::CurrentChannel(); - cChannel *ChannelLogo = Channels.GetByNumber(CurrentChannelNr); - - cImage *img; - img = imgLoader.LoadLogo(ChannelLogo->Name(), 999, topBarHeight - marginItem*2); - if( img ) { - TopBarSetMenuLogo( ChannelLogo->Name() ); - } else { - bool isRadioChannel = ( (!ChannelLogo->Vpid()) && (ChannelLogo->Apid(0)) ) ? true : false; - - if( isRadioChannel ) { - img = imgLoader.LoadIcon("radio", 999, topBarHeight - marginItem*2); - if( img ) { - TopBarSetMenuLogo( ChannelLogo->Name() ); - } - } else if( ChannelLogo->GroupSep() ) { - img = imgLoader.LoadIcon("changroup", 999, topBarHeight - marginItem*2); - if( img ) { - TopBarSetMenuIcon( ChannelLogo->Name() ); - } - } else { - img = imgLoader.LoadIcon("tv", 999, topBarHeight - marginItem*2); - if( img ) { - TopBarSetMenuLogo( ChannelLogo->Name() ); - } - } - } + TopBarSetMenuLogo( ItemEventLastChannelName ); } if( Channel ) { + ItemEventLastChannelName = Channel->Name(); cString ws = cString::sprintf("%d", Channels.MaxNumber()); w = font->Width(ws); if( !Channel->GroupSep() ) { @@ -2444,3 +2420,48 @@ const char * cFlatDisplayMenu::GetRecordingName(const cRecording *Recording, int return recNamePart.c_str(); } + +void cFlatDisplayMenu::PreLoadImages(void) { + // menu icons + cString Path = cString::sprintf("%s%s/menuIcons", *Config.iconPath, Setup.OSDTheme); + cReadDir d(Path); + struct dirent *e; + while ((e = d.Next()) != NULL) { + cString FileName = cString::sprintf("menuIcons/%s", GetFilenameWithoutext(e->d_name)); + imgLoader.LoadIcon(*FileName, fontHeight - marginItem*2, fontHeight - marginItem*2); + } + + imgLoader.LoadIcon("menuIcons/blank", fontHeight - marginItem*2, fontHeight - marginItem*2); + + int imageHeight = fontHeight; + imgLoader.LoadIcon("logo_background", imageHeight, imageHeight); + imgLoader.LoadIcon("radio", imageHeight, imageHeight); + imgLoader.LoadIcon("changroup", imageHeight, imageHeight); + imgLoader.LoadIcon("tv", imageHeight, imageHeight); + imgLoader.LoadIcon("timerInactive", imageHeight, imageHeight); + imgLoader.LoadIcon("timerRecording", imageHeight, imageHeight); + imgLoader.LoadIcon("timerActive", imageHeight, imageHeight); + + int index = 0; + cImage *img = NULL; + for(cChannel *Channel = Channels.First(); Channel && index < LOGO_PRE_CACHE; Channel = Channels.Next(Channel)) + { + img = imgLoader.LoadLogo(Channel->Name(), fontHeight - marginItem*2, fontHeight - marginItem*2); + if( img ) + index++; + } + + imgLoader.LoadIcon("radio", 999, topBarHeight - marginItem*2); + imgLoader.LoadIcon("changroup", 999, topBarHeight - marginItem*2); + imgLoader.LoadIcon("tv", 999, topBarHeight - marginItem*2); + + imgLoader.LoadIcon("timer_full", imageHeight, imageHeight); + imgLoader.LoadIcon("timer_partial", imageHeight, imageHeight); + imgLoader.LoadIcon("vps", imageHeight, imageHeight); + + imgLoader.LoadIcon("recording_new", fontHeight, fontHeight); + imgLoader.LoadIcon("recording_new", fontSmlHeight, fontSmlHeight); + imgLoader.LoadIcon("recording_cutted", fontHeight, fontHeight); + imgLoader.LoadIcon("recording", fontHeight, fontHeight); + imgLoader.LoadIcon("folder", fontHeight, fontHeight); +} |