Added feature to jump to a specific channel with number keys

This commit is contained in:
louis 2013-12-23 09:12:19 +01:00
parent 0a1e793513
commit b8754b03ee
25 changed files with 312 additions and 102 deletions

View File

@ -89,3 +89,4 @@ Version 1.1.0
- fixed channel switching with blue key if detailed epg view is opened and
if "close tvguide on channel switch" is configured
- fixed wrong font for clock in horizontal view
- Added feature to jump to a specific channel with number keys

View File

@ -59,7 +59,7 @@ endif
### The object files (add further files here):
OBJS = $(PLUGIN).o channelcolumn.o channelgroup.o channelgroups.o config.o detailview.o dummygrid.o epggrid.o fontmanager.o footer.o geometrymanager.o grid.o headergrid.o imagecache.o imageloader.o imagemagickwrapper.o imagescaler.o osdmanager.o recmanager.o recmenu.o recmenuitem.o recmenumanager.o recmenus.o setup.o statusheader.o styledpixmap.o switchtimer.o timeline.o timer.o tools.o tvguideosd.o
OBJS = $(PLUGIN).o channelcolumn.o channelgroup.o channelgroups.o channeljump.o config.o detailview.o dummygrid.o epggrid.o fontmanager.o footer.o geometrymanager.o grid.o headergrid.o imagecache.o imageloader.o imagemagickwrapper.o imagescaler.o osdmanager.o recmanager.o recmenu.o recmenuitem.o recmenumanager.o recmenus.o setup.o statusheader.o styledpixmap.o switchtimer.o timeline.o timer.o tools.o tvguideosd.o
### The main target:

View File

@ -130,6 +130,12 @@ void cChannelGroups::CreateGroupGrid(const char *name, int number, int start, in
groupGrids.Add(groupGrid);
}
int cChannelGroups::GetLastValidChannel(void) {
if (channelGroups.size() > 0)
return channelGroups[channelGroups.size()-1].StopChannel();
return 0;
}
void cChannelGroups::DumpGroups(void) {
for (std::vector<cChannelGroup>::iterator group = channelGroups.begin(); group!=channelGroups.end(); ++group) {
group->Dump();

View File

@ -23,6 +23,7 @@ public:
bool IsInLastGroup(const cChannel *channel);
void DrawChannelGroups(const cChannel *start, const cChannel *stop);
void CreateGroupGrid(const char *name, int number, int start, int end);
int GetLastValidChannel(void);
void DumpGroups(void);
};

90
channeljump.c Normal file
View File

@ -0,0 +1,90 @@
#include <vdr/channels.h>
#include "config.h"
#include "geometrymanager.h"
#include "osdmanager.h"
#include "fontmanager.h"
#include "channelgroups.h"
#include "channeljump.h"
cChannelJump::cChannelJump(cChannelGroups *channelGroups) {
this->channelGroups = channelGroups;
pixmapText = NULL;
channel = 0;
if (!tvguideConfig.hideLastGroup) {
maxChannels = Channels.MaxNumber();
} else {
maxChannels = channelGroups->GetLastValidChannel();
}
timeout = Setup.ChannelEntryTimeout;
startTime = cTimeMs::Now();
SetPixmaps();
Draw();
}
cChannelJump::~cChannelJump(void) {
osdManager.releasePixmap(pixmapBack);
osdManager.releasePixmap(pixmapText);
}
void cChannelJump::SetPixmaps(void) {
int x = (geoManager.osdWidth - geoManager.channelJumpWidth)/2;
int y = (geoManager.osdHeight - geoManager.channelJumpHeight)/2;
pixmapBack = osdManager.requestPixmap(4, cRect(x, y, geoManager.channelJumpWidth, geoManager.channelJumpHeight));
pixmap = osdManager.requestPixmap(5, cRect(x, y, geoManager.channelJumpWidth, geoManager.channelJumpHeight));
pixmapText = osdManager.requestPixmap(6, cRect(x, y, geoManager.channelJumpWidth, geoManager.channelJumpHeight));
}
void cChannelJump::Draw(void) {
if (tvguideConfig.style == eStyleGraphical) {
drawBackgroundGraphical(bgChannelJump);
} else {
pixmap->Fill(theme.Color(clrBackground));
drawBorder();
}
pixmapBack->Fill(clrTransparent);
pixmapBack->DrawRectangle(cRect(5, Height()/2, Width()-10, Height()-3), theme.Color(clrBackground));
}
void cChannelJump::DrawText(void) {
pixmapText->Fill(clrTransparent);
cString header = cString::sprintf("%s:", tr("Channel"));
const cFont *font = fontManager.FontMessageBox;
const cFont *fontHeader = fontManager.FontMessageBoxLarge;
int xHeader = (Width() - fontHeader->Width(*header)) / 2;
int yHeader = (Height()/2 - fontHeader->Height()) / 2;
pixmapText->DrawText(cPoint(xHeader, yHeader), *header, theme.Color(clrFont), clrTransparent, fontHeader);
cString strChannel = BuildChannelString();
int xChannel = (Width() - font->Width(*strChannel)) / 2;
int yChannel = Height()/2 + (Height()/2 - font->Height()) / 2;
pixmapText->DrawText(cPoint(xChannel, yChannel), *strChannel, theme.Color(clrFont), clrTransparent, font);
}
void cChannelJump::Set(int num) {
startTime = cTimeMs::Now();
if (channel == 0) {
channel = num;
return;
}
int newChannel = channel * 10 + num;
if (newChannel <= maxChannels)
channel = newChannel;
}
cString cChannelJump::BuildChannelString(void) {
if (channel*10 <= maxChannels)
return cString::sprintf("%d-", channel);
else
return cString::sprintf("%d", channel);
}
bool cChannelJump::TimeOut(void) {
if ((cTimeMs::Now() - startTime) > timeout)
return true;
return false;
}

29
channeljump.h Normal file
View File

@ -0,0 +1,29 @@
#ifndef __TVGUIDE_CHANNELJUMP_H
#define __TVGUIDE_CHANNELJUMP_H
#include "styledpixmap.h"
// --- cChannelJump -------------------------------------------------------------
class cChannelJump : public cStyledPixmap {
private:
int channel;
cChannelGroups *channelGroups;
int maxChannels;
int startTime;
int timeout;
cPixmap *pixmapBack;
cPixmap *pixmapText;
void SetPixmaps(void);
void Draw(void);
cString BuildChannelString(void);
public:
cChannelJump(cChannelGroups *channelGroups);
virtual ~cChannelJump(void);
void Set(int num);
void DrawText(void);
bool TimeOut(void);
int GetChannel(void) { return channel; };
};
#endif //__TVGUIDE_CHANNELJUMP_H

View File

@ -31,6 +31,7 @@ cTvguideConfig::cTvguideConfig() {
jumpChannels = 0;
blueKeyMode = 0;
closeOnSwitch = 1;
numkeyMode = 0;
useRemoteTimers = 0;
hideLastGroup = 0;
hideChannelLogos = 0;
@ -233,6 +234,7 @@ bool cTvguideConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "hugeStepHours") == 0) hugeStepHours = atoi(Value);
else if (strcmp(Name, "channelJumpMode") == 0) channelJumpMode = atoi(Value);
else if (strcmp(Name, "blueKeyMode") == 0) blueKeyMode = atoi(Value);
else if (strcmp(Name, "numkeyMode") == 0) numkeyMode = atoi(Value);
else if (strcmp(Name, "closeOnSwitch") == 0) closeOnSwitch = atoi(Value);
else if (strcmp(Name, "useRemoteTimers") == 0) useRemoteTimers = atoi(Value);
else if (strcmp(Name, "hideLastGroup") == 0) hideLastGroup = atoi(Value);

View File

@ -65,6 +65,7 @@ class cTvguideConfig {
int jumpChannels;
int blueKeyMode;
int closeOnSwitch;
int numkeyMode;
int useRemoteTimers;
int hideLastGroup;
int hideChannelLogos;
@ -161,7 +162,7 @@ class cTvguideConfig {
THEME_CLR(theme, clrStyle, CLR_STYLE_BLENDING_DEFAULT);
THEME_CLR(theme, clrBackgroundOSD, 0xB012273f);
THEME_CLR(theme, clrBackground, 0xB012273f);
THEME_CLR(theme, clrBackground, 0xFF12273f);
THEME_CLR(theme, clrGrid1, 0x00000000);
THEME_CLR(theme, clrGrid1Blending, 0x00000000);
THEME_CLR(theme, clrGrid2, 0x00000000);

View File

@ -66,5 +66,9 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
epgViewHeaderHeight = tvguideConfig.epgViewHeaderPercent * osdHeight / 100;
borderRecMenus = 10;
channelJumpWidth = osdWidth * 30 / 100;
channelJumpHeight = osdHeight * 20 / 100;
return true;
}

View File

@ -45,6 +45,9 @@ public:
int epgViewHeaderHeight;
//Recording Menus
int borderRecMenus;
//Channel Jump
int channelJumpWidth;
int channelJumpHeight;
};
#endif //__TVGUIDE_GEOMETRYMANAGER_H

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

View File

@ -9,6 +9,18 @@
cImageCache::cImageCache() : cImageMagickWrapper() {
tempStaticLogo = NULL;
groupsHead = NULL;
groupsBottom = NULL;
groupsLeft = NULL;
groupsRight = NULL;
imgLeft = NULL;
imgLeftActive = NULL;
imgRight = NULL;
imgRightActive = NULL;
imgHead = NULL;
imgHeadActive = NULL;
imgBottom = NULL;
imgBottomActive = NULL;
}
cImageCache::~cImageCache() {
@ -110,6 +122,11 @@ void cImageCache::CreateOsdIconCache(void) {
success = LoadIcon("osdElements/epgview_header");
if (success)
InsertIntoOsdElementCache(oeEpgHeader, geoManager.osdWidth, geoManager.epgViewHeaderHeight);
//Channel Jump
success = LoadIcon("osdElements/channel_jump");
if (success)
InsertIntoOsdElementCache(oeChannelJump, geoManager.channelJumpWidth, geoManager.channelJumpHeight);
}
void cImageCache::PrepareGridIconCache(void) {

View File

@ -29,6 +29,7 @@ enum eOsdElementType {
oeDateViewer,
oeClock,
oeEpgHeader,
oeChannelJump,
};
class cImageCache : public cImageMagickWrapper {

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-12-22 10:44+0100\n"
"POT-Creation-Date: 2013-12-23 09:03+0100\n"
"PO-Revision-Date: 2013-09-21 17:49+0200\n"
"Last-Translator: My friend <Sampep> Thanks David <Gabychan> <gbonich@gmail.com>\n"
"Language-Team: \n"
@ -18,6 +18,9 @@ msgstr ""
msgid "Main Program"
msgstr "Programa principal"
msgid "Channel"
msgstr "Canal"
msgid "RERUNS OF THIS SHOW"
msgstr "REEMISSIONS"
@ -183,9 +186,6 @@ msgstr "Cancel·la"
msgid "Create Series Timer based on"
msgstr "Programa enregistrament de Sèries segons"
msgid "Channel"
msgstr "Canal"
msgid "Series Timer start time"
msgstr "Inici temporitzador Sèries"
@ -405,6 +405,12 @@ msgstr "Blau: Canvi de canal, OK: EPG detallat"
msgid "Blue: Detailed EPG, Ok: Channel Switch"
msgstr "Blau: EPG detallat, OK: Canvi de canal"
msgid "Timely Jump"
msgstr ""
msgid "Jump to specific channel"
msgstr ""
msgid "never"
msgstr "mai"
@ -438,6 +444,9 @@ msgstr "Botons Blau i OK"
msgid "Close TVGuide after channel switch"
msgstr "Tanca GuiaTV després del canvi de canal"
msgid "Functionality of numeric Keys"
msgstr ""
msgid "Hide last Channel Group"
msgstr "Amaga el darrer grup de canals"
@ -635,6 +644,3 @@ msgstr ""
msgid "Channel Groups Cache"
msgstr ""
#~ msgid "Height of Footer"
#~ msgstr "Alçada del Peu"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-12-17 18:24+0100\n"
"POT-Creation-Date: 2013-12-23 09:03+0100\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: Horst\n"
"Language-Team: \n"
@ -15,6 +15,9 @@ msgstr ""
msgid "Main Program"
msgstr "Hauptprogramm"
msgid "Channel"
msgstr "Kanal"
msgid "RERUNS OF THIS SHOW"
msgstr "Wiederholungen dieser Sendung"
@ -180,9 +183,6 @@ msgstr "Abbrechen"
msgid "Create Series Timer based on"
msgstr "Serientimer anlegen basierend auf"
msgid "Channel"
msgstr "Kanal"
msgid "Series Timer start time"
msgstr "Serientimer Start Zeit"
@ -402,6 +402,12 @@ msgstr "Blau: Umschalten, OK: Detailiertes EPG"
msgid "Blue: Detailed EPG, Ok: Channel Switch"
msgstr "Blau: Detailiertes EPG, OK: Umschalten"
msgid "Timely Jump"
msgstr "Zeitsprung"
msgid "Jump to specific channel"
msgstr "Sprung zu deinem bestimmten Kanal"
msgid "never"
msgstr "nie"
@ -435,6 +441,9 @@ msgstr "Tasten Blau und OK"
msgid "Close TVGuide after channel switch"
msgstr "TVGuide nach Umschalten schließen"
msgid "Functionality of numeric Keys"
msgstr "Funktion der Nummerntasten"
msgid "Hide last Channel Group"
msgstr "Letzte Kanalgruppe verstecken"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 1.0.0\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-12-22 10:44+0100\n"
"POT-Creation-Date: 2013-12-23 09:03+0100\n"
"PO-Revision-Date: 2013-09-25 17:49+0400\n"
"Last-Translator: AmiD, ilya\n"
"Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n"
@ -15,6 +15,9 @@ msgstr ""
msgid "Main Program"
msgstr "Основная программа"
msgid "Channel"
msgstr "Канал"
msgid "RERUNS OF THIS SHOW"
msgstr "ПОВТОРЫ ЭТОЙ ПЕРЕДАЧИ"
@ -180,9 +183,6 @@ msgstr "Отменить"
msgid "Create Series Timer based on"
msgstr "Настроить циклический таймер"
msgid "Channel"
msgstr "Канал"
msgid "Series Timer start time"
msgstr "Время с"
@ -402,6 +402,12 @@ msgstr "Синяя: Переключить канал, OK: Подробный EP
msgid "Blue: Detailed EPG, Ok: Channel Switch"
msgstr "Синяя: Подробный EPG, OK: Переключить канал"
msgid "Timely Jump"
msgstr ""
msgid "Jump to specific channel"
msgstr ""
msgid "never"
msgstr "никогда"
@ -435,6 +441,9 @@ msgstr "Синяя кнопка и OK"
msgid "Close TVGuide after channel switch"
msgstr "Закрывать TVGuide при переключении канала"
msgid "Functionality of numeric Keys"
msgstr ""
msgid "Hide last Channel Group"
msgstr "Скрывать последнюю группу каналов"
@ -632,6 +641,3 @@ msgstr ""
msgid "Channel Groups Cache"
msgstr ""
#~ msgid "Height of Footer"
#~ msgstr "Высота нижней панели (кнопкок)"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 1.1.0\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-12-22 10:44+0100\n"
"POT-Creation-Date: 2013-12-23 09:03+0100\n"
"PO-Revision-Date: 2013-09-15 00:12+0100\n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: \n"
@ -15,6 +15,9 @@ msgstr ""
msgid "Main Program"
msgstr "Hlavný program"
msgid "Channel"
msgstr "Kanál"
msgid "RERUNS OF THIS SHOW"
msgstr "Repríza tohto programu"
@ -180,9 +183,6 @@ msgstr "Zru
msgid "Create Series Timer based on"
msgstr "Vytvorenie plánu na základe série"
msgid "Channel"
msgstr "Kanál"
msgid "Series Timer start time"
msgstr "Sériový plán zaèína"
@ -402,6 +402,12 @@ msgstr "Modr
msgid "Blue: Detailed EPG, Ok: Channel Switch"
msgstr "Modré: podrobné EPG, OK: prepnú» kanál"
msgid "Timely Jump"
msgstr ""
msgid "Jump to specific channel"
msgstr ""
msgid "never"
msgstr "nikdy"
@ -435,6 +441,9 @@ msgstr "Tla
msgid "Close TVGuide after channel switch"
msgstr "Zavrie» TVGuide po prepnutí kanálu"
msgid "Functionality of numeric Keys"
msgstr ""
msgid "Hide last Channel Group"
msgstr "Skry» poslednú skupinu kanálov"
@ -632,6 +641,3 @@ msgstr ""
msgid "Channel Groups Cache"
msgstr ""
#~ msgid "Height of Footer"
#~ msgstr "Vý¹ka zápätia"

View File

@ -78,6 +78,7 @@ void cTvguideSetup::Store(void) {
SetupStore("hugeStepHours", tvguideConfig.hugeStepHours);
SetupStore("channelJumpMode", tvguideConfig.channelJumpMode);
SetupStore("blueKeyMode", tvguideConfig.blueKeyMode);
SetupStore("numkeyMode", tvguideConfig.numkeyMode);
SetupStore("useRemoteTimers", tvguideConfig.useRemoteTimers);
SetupStore("closeOnSwitch", tvguideConfig.closeOnSwitch);
SetupStore("hideLastGroup", tvguideConfig.hideLastGroup);
@ -164,6 +165,8 @@ cMenuSetupGeneral::cMenuSetupGeneral(cTvguideConfig* data) : cMenuSetupSubMenu(
jumpMode[1] = tr("previous / next channel group");
blueMode[0] = tr("Blue: Channel Switch, Ok: Detailed EPG");
blueMode[1] = tr("Blue: Detailed EPG, Ok: Channel Switch");
numMode[0] = tr("Timely Jump");
numMode[1] = tr("Jump to specific channel");
useSubtitleRerunTexts[0] = tr("never");
useSubtitleRerunTexts[1] = tr("if exists");
useSubtitleRerunTexts[2] = tr("always");
@ -185,6 +188,7 @@ void cMenuSetupGeneral::Set(void) {
Add(new cMenuEditStraItem(tr("Channel Jump Mode (Keys Green / Yellow)"), &tmpTvguideConfig->channelJumpMode, 2, jumpMode));
Add(new cMenuEditStraItem(tr("Keys Blue and OK"), &tmpTvguideConfig->blueKeyMode, 2, blueMode));
Add(new cMenuEditBoolItem(tr("Close TVGuide after channel switch"), &tmpTvguideConfig->closeOnSwitch));
Add(new cMenuEditStraItem(tr("Functionality of numeric Keys"), &tmpTvguideConfig->numkeyMode, 2, numMode));
Add(new cMenuEditBoolItem(tr("Hide last Channel Group"), &tmpTvguideConfig->hideLastGroup));
Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpTvguideConfig->displayTime, 120, 320));
Add(new cMenuEditIntItem(tr("Big Step (Keys 1 / 3) in hours"), &tmpTvguideConfig->bigStepHours, 1, 12));

View File

@ -35,6 +35,7 @@ class cMenuSetupGeneral : public cMenuSetupSubMenu {
const char * timeFormatItems[2];
const char * jumpMode[2];
const char * blueMode[2];
const char * numMode[2];
const char *useSubtitleRerunTexts[3];
void Set(void);
public:

View File

@ -59,6 +59,8 @@ void cStyledPixmap::drawBackgroundGraphical(eBackgroundType type, bool active) {
pixmap->Fill(clrTransparent);
}
return;
} else if (type == bgChannelJump) {
back = imgCache.GetOsdElement(oeChannelJump);
}
if (back) {
pixmap->DrawImage(cPoint(0,0), *back);

View File

@ -16,6 +16,7 @@ enum eBackgroundType {
bgEpgHeader,
bgButton,
bgRecMenuBack,
bgChannelJump,
};
// --- cStyledPixmap -------------------------------------------------------------

View File

@ -1,6 +1,6 @@
Description = Default
clrStyle = 66666666
clrBackground = B012273f
clrBackground = FF12273f
clrBackgroundOSD = B012273f
clrGrid1 = 00000000
clrGrid1Blending = 00000000

View File

@ -16,6 +16,7 @@ cTvGuideOsd::cTvGuideOsd(void) {
activeGrid = NULL;
timeLine = NULL;
recMenuManager = NULL;
channelJumper = NULL;
}
cTvGuideOsd::~cTvGuideOsd() {
@ -30,6 +31,8 @@ cTvGuideOsd::~cTvGuideOsd() {
delete channelGroups;
delete footer;
delete recMenuManager;
if (channelJumper)
delete channelJumper;
osdManager.deleteOsd();
}
@ -502,6 +505,7 @@ eOSState cTvGuideOsd::ChannelSwitch() {
if (detailView) {
delete detailView;
detailView = NULL;
detailViewActive = false;
}
return osEnd;
}
@ -522,53 +526,57 @@ void cTvGuideOsd::DetailedEPG() {
}
}
void cTvGuideOsd::processKey1() {
void cTvGuideOsd::processNumKey(int numKey) {
esyslog("tvguide: %d pressed", numKey);
if (tvguideConfig.numkeyMode == 0) {
//timely jumps with 1,3,4,6,7,9
TimeJump(numKey);
} else {
//jump to specific channel
ChannelJump(numKey);
}
}
void cTvGuideOsd::TimeJump(int mode) {
switch (mode) {
case 1: {
bool tooFarInPast = myTime->DelStep(tvguideConfig.bigStepHours*60);
if (tooFarInPast)
return;
drawGridsTimeJump();
timeLine->drawDateViewer();
timeLine->drawClock();
timeLine->setTimeline();
osdManager.flush();
}
void cTvGuideOsd::processKey3() {
}
break;
case 3: {
myTime->AddStep(tvguideConfig.bigStepHours*60);
drawGridsTimeJump();
timeLine->drawDateViewer();
timeLine->drawClock();
timeLine->setTimeline();
osdManager.flush();
}
void cTvGuideOsd::processKey4() {
}
break;
case 4: {
bool tooFarInPast = myTime->DelStep(tvguideConfig.hugeStepHours*60);
if (tooFarInPast)
return;
drawGridsTimeJump();
timeLine->drawDateViewer();
timeLine->drawClock();
timeLine->setTimeline();
osdManager.flush();
}
void cTvGuideOsd::processKey6() {
}
break;
case 6: {
myTime->AddStep(tvguideConfig.hugeStepHours*60);
drawGridsTimeJump();
timeLine->drawDateViewer();
timeLine->drawClock();
timeLine->setTimeline();
osdManager.flush();
}
void cTvGuideOsd::processKey7() {
cMyTime *primeChecker = new cMyTime();
primeChecker->Now();
time_t prevPrime = primeChecker->getPrevPrimetime(myTime->GetStart());
if (primeChecker->tooFarInPast(prevPrime))
}
break;
case 7: {
cMyTime primeChecker;
primeChecker.Now();
time_t prevPrime = primeChecker.getPrevPrimetime(myTime->GetStart());
if (primeChecker.tooFarInPast(prevPrime))
return;
myTime->SetTime(prevPrime);
}
break;
case 9: {
cMyTime primeChecker;
time_t nextPrime = primeChecker.getNextPrimetime(myTime->GetStart());
myTime->SetTime(nextPrime);
}
break;
default:
return;
}
drawGridsTimeJump();
timeLine->drawDateViewer();
timeLine->drawClock();
@ -576,17 +584,33 @@ void cTvGuideOsd::processKey7() {
osdManager.flush();
}
void cTvGuideOsd::processKey9() {
cMyTime *primeChecker = new cMyTime();
time_t nextPrime = primeChecker->getNextPrimetime(myTime->GetStart());
myTime->SetTime(nextPrime);
drawGridsTimeJump();
timeLine->drawDateViewer();
timeLine->drawClock();
timeLine->setTimeline();
void cTvGuideOsd::ChannelJump(int num) {
if (!channelJumper) {
channelJumper = new cChannelJump(channelGroups);
}
channelJumper->Set(num);
channelJumper->DrawText();
osdManager.flush();
}
void cTvGuideOsd::CheckTimeout(void) {
if (!channelJumper)
return;
if (channelJumper->TimeOut()) {
int newChannelNum = channelJumper->GetChannel();
delete channelJumper;
channelJumper = NULL;
const cChannel *newChannel = Channels.GetByNumber(newChannelNum);
if (newChannel) {
readChannels(newChannel);
if (columns.Count() > 0) {
drawGridsChannelJump();
}
}
osdManager.flush();
}
}
void cTvGuideOsd::SetTimers() {
for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) {
column->SetTimers();
@ -636,12 +660,8 @@ eOSState cTvGuideOsd::ProcessKey(eKeys Key) {
case kBlue: state = processKeyBlue(); break;
case kOk: state = processKeyOk(); break;
case kBack: state=osEnd; break;
case k1: processKey1(); break;
case k3: processKey3(); break;
case k4: processKey4(); break;
case k6: processKey6(); break;
case k7: processKey7(); break;
case k9: processKey9(); break;
case k0 ... k9: processNumKey(Key - k0); break;
case kNone: if (channelJumper) CheckTimeout(); break;
default: break;
}
}

View File

@ -10,6 +10,7 @@
#include "channelgroups.h"
#include "footer.h"
#include "recmenumanager.h"
#include "channeljump.h"
// --- cTvGuideOsd -------------------------------------------------------------
@ -24,6 +25,7 @@ private:
cChannelGroups *channelGroups;
cFooter *footer;
cRecMenuManager *recMenuManager;
cChannelJump *channelJumper;
bool detailViewActive;
void drawOsd();
void readChannels(const cChannel *channelStart);
@ -38,12 +40,10 @@ private:
void processKeyYellow();
eOSState processKeyBlue();
eOSState processKeyOk();
void processKey1();
void processKey3();
void processKey4();
void processKey6();
void processKey7();
void processKey9();
void processNumKey(int numKey);
void TimeJump(int mode);
void ChannelJump(int num);
void CheckTimeout(void);
void setNextActiveGrid(cGrid *next);
void channelForward();
void channelBack();