10 Commits

Author SHA1 Message Date
kamel5
8db88c2556 Version 1.2.16 2020-01-10 11:11:55 +01:00
kamel5
509b64d78f RecMenu "Timer Timeline" displays now sorted active timer 2020-01-10 11:05:28 +01:00
kamel5
15b7074b4e Separate "displayTime" for horizontal and vertical view 2020-01-09 14:30:05 +01:00
kamel5
3fee6ab13f Optimize display "REC" sign in epgview 2020-01-09 14:29:47 +01:00
kamel5
ffd3e2c79f Refactor CutText in horizontal epgview 2020-01-09 14:29:30 +01:00
kamel5
c77f74321f Refactor Timeline 2020-01-06 15:14:45 +01:00
kamel5
efe06b8e98 Fixed a possible deadlook in cEPGView::cEPGView 2020-01-06 15:14:45 +01:00
kamel5
6540e21444 Optimize TimeJump 2020-01-06 15:14:45 +01:00
kamel5
2e4a43133e Fixed a error in DeleteTimerConflictMenu 2020-01-06 15:14:45 +01:00
kamel5
bcf2ce757c Fixed a timer changed message 2020-01-06 15:14:42 +01:00
25 changed files with 240 additions and 217 deletions

14
HISTORY
View File

@@ -236,3 +236,17 @@ Version 1.2.14
Version 1.2.15 Version 1.2.15
- Workaround for HWAccelerated OSD - Workaround for HWAccelerated OSD
Version 1.2.16
- Fixed a timer changed message
- Extend keys kFastRew, kFastFwd, kPrev, kNext for TimeJump
(if you use the numeric keys for "Jump to specific channel",
you can now use the keys kFastRew, kFastFwd, kPrev, kNext for TimeJump.
Note: if you use the permashift-plugin then the key kFastRew doesnt work for TimeJump)
- Fixed a possible deadlook in cEPGView::cEPGView
- Refactor Timeline
- Refactor CutText in horizontal epgview
- Optimize display "REC" sign in epgview
- Separate "displayTime" for horizontal and vertical view
- RecMenu "Timer Timeline" displays now sorted active timer

View File

@@ -10,8 +10,8 @@ cTVGuideConfig::cTVGuideConfig() {
showTimeInGrid = 1; showTimeInGrid = 1;
channelCols = 5; channelCols = 5;
channelRows = 10; channelRows = 10;
displayTime = 160; displayTime = 180;
displayHorizontalTime = 160; displayHorizontalTime = 180;
displayStatusHeader = 1; displayStatusHeader = 1;
displayChannelGroups = 1; displayChannelGroups = 1;
displayTimeBase = 1; displayTimeBase = 1;
@@ -28,7 +28,9 @@ cTVGuideConfig::cTVGuideConfig() {
footerHeightPercent = 7; footerHeightPercent = 7;
stepMinutes = 30; stepMinutes = 30;
bigStepHours = 3; bigStepHours = 3;
bigStepHoursHorizontal = 3;
hugeStepHours = 24; hugeStepHours = 24;
hugeStepHoursHorizontal = 24;
channelJumpMode = eNumJump; channelJumpMode = eNumJump;
jumpChannels = 0; jumpChannels = 0;
blueKeyMode = 2; blueKeyMode = 2;
@@ -269,7 +271,9 @@ bool cTVGuideConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "logoWidthRatio") == 0) logoWidthRatio = atoi(Value); else if (strcmp(Name, "logoWidthRatio") == 0) logoWidthRatio = atoi(Value);
else if (strcmp(Name, "logoHeightRatio") == 0) logoHeightRatio = atoi(Value); else if (strcmp(Name, "logoHeightRatio") == 0) logoHeightRatio = atoi(Value);
else if (strcmp(Name, "bigStepHours") == 0) bigStepHours = atoi(Value); else if (strcmp(Name, "bigStepHours") == 0) bigStepHours = atoi(Value);
else if (strcmp(Name, "bigStepHoursHorizontal") == 0) bigStepHoursHorizontal = atoi(Value);
else if (strcmp(Name, "hugeStepHours") == 0) hugeStepHours = atoi(Value); else if (strcmp(Name, "hugeStepHours") == 0) hugeStepHours = atoi(Value);
else if (strcmp(Name, "hugeStepHoursHorizontal") == 0) hugeStepHoursHorizontal = atoi(Value);
else if (strcmp(Name, "channelJumpMode") == 0) channelJumpMode = atoi(Value); else if (strcmp(Name, "channelJumpMode") == 0) channelJumpMode = atoi(Value);
else if (strcmp(Name, "blueKeyMode") == 0) blueKeyMode = atoi(Value); else if (strcmp(Name, "blueKeyMode") == 0) blueKeyMode = atoi(Value);
else if (strcmp(Name, "numkeyMode") == 0) numkeyMode = atoi(Value); else if (strcmp(Name, "numkeyMode") == 0) numkeyMode = atoi(Value);

View File

@@ -8,7 +8,7 @@
#include "fontmanager.h" #include "fontmanager.h"
#include "imagecache.h" #include "imagecache.h"
enum { enum eTimeFormat {
e12Hours, e12Hours,
e24Hours e24Hours
}; };
@@ -76,7 +76,9 @@ class cTVGuideConfig {
int footerHeightPercent; int footerHeightPercent;
int stepMinutes; int stepMinutes;
int bigStepHours; int bigStepHours;
int bigStepHoursHorizontal;
int hugeStepHours; int hugeStepHours;
int hugeStepHoursHorizontal;
int channelJumpMode; int channelJumpMode;
int jumpChannels; int jumpChannels;
int blueKeyMode; int blueKeyMode;

View File

@@ -131,12 +131,7 @@ void cEpgGrid::drawText() {
} }
} }
} else if (config.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
if (Width() / geoManager.minutePixel < 10) { cString strTitle = CutText(event->Title(), viewportHeight - borderWidth, fontManager.FontGridHorizontal).c_str();
int titleY = (geoManager.rowHeight - fontManager.FontGridHorizontal->Height()) / 2;
pixmap->DrawText(cPoint(borderWidth - 2, titleY), "...", colorText, colorTextBack, fontManager.FontGridHorizontal);
return;
}
cString strTitle = CutText(event->Title(), viewportHeight, fontManager.FontGridHorizontal).c_str();
int titleY = 0; int titleY = 0;
if (config.showTimeInGrid) { // mit Zeitangabe im Grid if (config.showTimeInGrid) { // mit Zeitangabe im Grid
pixmap->DrawText(cPoint(borderWidth, borderWidth), *timeString, colorText, colorTextBack, fontManager.FontGridHorizontalSmall); pixmap->DrawText(cPoint(borderWidth, borderWidth), *timeString, colorText, colorTextBack, fontManager.FontGridHorizontalSmall);
@@ -174,13 +169,17 @@ void cEpgGrid::drawText() {
void cEpgGrid::drawIcon(cString iconText, tColor color) { void cEpgGrid::drawIcon(cString iconText, tColor color) {
const cFont *font = (config.displayMode == eVertical) const cFont *font = (config.displayMode == eVertical) ? fontManager.FontGrid : fontManager.FontGridHorizontalSmall;
?fontManager.FontGrid int textWidth = font->Width(*iconText) + 2 * borderWidth;
:fontManager.FontGridHorizontalSmall; int textHeight = font->Height() + 10;
int textWidth = font->Width(*iconText)+2*borderWidth; if ((config.displayMode == eHorizontal) && ((Width() - 2 * textWidth) < 0))
int textHeight = font->Height()+10; pixmap->DrawEllipse( cRect(Width() - textHeight / 2 - borderWidth, Height() - textHeight - borderWidth, textHeight / 2, textHeight / 2), color);
pixmap->DrawRectangle( cRect(Width() - textWidth - borderWidth, Height() - textHeight - borderWidth, textWidth, textHeight), color); else if ((config.displayMode == eVertical) && ((Height() - 2 * textHeight) < 0))
pixmap->DrawText(cPoint(Width() - textWidth, Height() - textHeight - borderWidth/2), *iconText, theme.Color(clrFont), color, font); pixmap->DrawEllipse( cRect(Width() - textHeight / 2 - borderWidth, borderWidth, textHeight / 2, textHeight / 2), color);
else {
pixmap->DrawEllipse( cRect(Width() - textWidth - borderWidth, Height() - textHeight - borderWidth, textWidth, textHeight), color);
pixmap->DrawText(cPoint(Width() - textWidth, Height() - textHeight - borderWidth / 2), *iconText, theme.Color(clrFont), clrTransparent, font);
}
} }
cString cEpgGrid::getTimeString(void) { cString cEpgGrid::getTimeString(void) {

View File

@@ -35,7 +35,7 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
if (config.displayMode == eVertical) { if (config.displayMode == eVertical) {
colWidth = (osdWidth - timeLineWidth) / config.channelCols; colWidth = (osdWidth - timeLineWidth) / config.channelCols;
rowHeight = 0; rowHeight = 0;
minutePixel = (osdHeight - statusHeaderHeight - channelGroupsHeight - channelHeaderHeight - footerHeight) / config.displayTime; minutePixel = (double)(osdHeight - statusHeaderHeight - channelGroupsHeight - channelHeaderHeight - footerHeight) / (double)config.displayTime;
channelLogoWidth = colWidth; channelLogoWidth = colWidth;
channelLogoHeight = channelHeaderHeight; channelLogoHeight = channelHeaderHeight;
logoWidth = channelLogoWidth / 2 - 15; logoWidth = channelLogoWidth / 2 - 15;
@@ -49,7 +49,7 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
} else if (config.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
colWidth = 0; colWidth = 0;
rowHeight = (osdHeight - statusHeaderHeight - timeLineHeight - footerHeight) / config.channelRows; rowHeight = (osdHeight - statusHeaderHeight - timeLineHeight - footerHeight) / config.channelRows;
minutePixel = (osdWidth - channelHeaderWidth - channelGroupsWidth) / config.displayHorizontalTime; minutePixel = (double)(osdWidth - channelHeaderWidth - channelGroupsWidth) / (double)config.displayHorizontalTime;
channelLogoWidth = channelHeaderWidth; channelLogoWidth = channelHeaderWidth;
channelLogoHeight = rowHeight; channelLogoHeight = rowHeight;
logoWidth = channelLogoHeight * config.logoWidthRatio / config.logoHeightRatio; logoWidth = channelLogoHeight * config.logoWidthRatio / config.logoHeightRatio;

View File

@@ -24,7 +24,7 @@ public:
//Content //Content
int colWidth; int colWidth;
int rowHeight; int rowHeight;
int minutePixel; double minutePixel;
int channelLogoWidth; int channelLogoWidth;
int channelLogoHeight; int channelLogoHeight;
//Timeline //Timeline

View File

@@ -3,7 +3,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n" "Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2019-11-03 12:37+0100\n" "POT-Creation-Date: 2020-01-06 14:31+0100\n"
"PO-Revision-Date: 2013-09-21 17:49+0200\n" "PO-Revision-Date: 2013-09-21 17:49+0200\n"
"Last-Translator: My friend <Sampep> Thanks David <Gabychan> <gbonich@gmail.com>\n" "Last-Translator: My friend <Sampep> Thanks David <Gabychan> <gbonich@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
@@ -138,6 +138,9 @@ msgstr "Cerca a les gravacions"
msgid "Set Folder for" msgid "Set Folder for"
msgstr "Programa carpeta per" msgstr "Programa carpeta per"
msgid "Timer changed"
msgstr ""
msgid "Timer created" msgid "Timer created"
msgstr "Temporitzador creat" msgstr "Temporitzador creat"

View File

@@ -3,7 +3,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n" "Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2019-11-03 12:37+0100\n" "POT-Creation-Date: 2020-01-06 14:31+0100\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n" "PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: Horst\n" "Last-Translator: Horst\n"
"Language-Team: \n" "Language-Team: \n"
@@ -135,6 +135,9 @@ msgstr "In Aufnahmen suchen"
msgid "Set Folder for" msgid "Set Folder for"
msgstr "Verzeichnis festlegen für" msgstr "Verzeichnis festlegen für"
msgid "Timer changed"
msgstr "Timer geändert"
msgid "Timer created" msgid "Timer created"
msgstr "Timer angelegt" msgstr "Timer angelegt"

View File

@@ -3,7 +3,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n" "Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2019-11-03 12:37+0100\n" "POT-Creation-Date: 2020-01-06 14:31+0100\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n" "PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: fiveten_59\n" "Last-Translator: fiveten_59\n"
"Language-Team: \n" "Language-Team: \n"
@@ -135,6 +135,9 @@ msgstr "Cerca nelle registrazioni"
msgid "Set Folder for" msgid "Set Folder for"
msgstr "Crea cartella per" msgstr "Crea cartella per"
msgid "Timer changed"
msgstr ""
msgid "Timer created" msgid "Timer created"
msgstr "Timer creato" msgstr "Timer creato"

View File

@@ -3,7 +3,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-tvguide 1.0.0\n" "Project-Id-Version: vdr-tvguide 1.0.0\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2019-11-03 12:37+0100\n" "POT-Creation-Date: 2020-01-06 14:31+0100\n"
"PO-Revision-Date: 2013-09-25 17:49+0400\n" "PO-Revision-Date: 2013-09-25 17:49+0400\n"
"Last-Translator: AmiD, ilya\n" "Last-Translator: AmiD, ilya\n"
"Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n" "Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n"
@@ -135,6 +135,9 @@ msgstr "Искать в записях"
msgid "Set Folder for" msgid "Set Folder for"
msgstr "Укажите каталог для" msgstr "Укажите каталог для"
msgid "Timer changed"
msgstr ""
msgid "Timer created" msgid "Timer created"
msgstr "Таймер создан" msgstr "Таймер создан"

View File

@@ -3,7 +3,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-tvguide 1.1.0\n" "Project-Id-Version: vdr-tvguide 1.1.0\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2019-11-03 12:37+0100\n" "POT-Creation-Date: 2020-01-06 14:31+0100\n"
"PO-Revision-Date: 2013-09-15 00:12+0100\n" "PO-Revision-Date: 2013-09-15 00:12+0100\n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n" "Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
@@ -135,6 +135,9 @@ msgstr "Vyh
msgid "Set Folder for" msgid "Set Folder for"
msgstr "Nastavi<76> adres<65>r pre" msgstr "Nastavi<76> adres<65>r pre"
msgid "Timer changed"
msgstr ""
msgid "Timer created" msgid "Timer created"
msgstr "Pl<50>n vytvoren<65>" msgstr "Pl<50>n vytvoren<65>"

View File

@@ -175,21 +175,6 @@ void cRecManager::SetTimerPath(cTimer *timer, const cEvent *event, std::string p
timer->SetFile(*newFileName); timer->SetFile(*newFileName);
} }
void cRecManager::DeleteTimer(int timerID) {
const cTimer *t;
#if VDRVERSNUM >= 20301
{
LOCK_TIMERS_READ;
t = Timers->Get(timerID);
}
#else
t = Timers.Get(timerID);
#endif
if (!t)
return;
DeleteTimer(t);
}
void cRecManager::DeleteTimer(const cEvent *event) { void cRecManager::DeleteTimer(const cEvent *event) {
if (!event) if (!event)
return; return;

View File

@@ -34,7 +34,6 @@ public:
cTimer *createRemoteTimer(const cEvent *event, std::string path); cTimer *createRemoteTimer(const cEvent *event, std::string path);
void SetTimerPath(cTimer *timer, const cEvent *event, std::string path); void SetTimerPath(cTimer *timer, const cEvent *event, std::string path);
void DeleteTimer(const cTimer *timer); void DeleteTimer(const cTimer *timer);
void DeleteTimer(int timerID);
void DeleteTimer(const cEvent *event); void DeleteTimer(const cEvent *event);
void DeleteLocalTimer(const cEvent *event); void DeleteLocalTimer(const cEvent *event);
void DeleteRemoteTimer(const cEvent *event); void DeleteRemoteTimer(const cEvent *event);

View File

@@ -103,7 +103,7 @@ std::string cRecMenuAskFolder::GetFolder(void) {
} }
// --- cRecMenuConfirmTimer --------------------------------------------------------- // --- cRecMenuConfirmTimer ---------------------------------------------------------
cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event) { cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event, bool timerChanged) {
SetWidthPercent(50); SetWidthPercent(50);
#if VDRVERSNUM >= 20301 #if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ; LOCK_CHANNELS_READ;
@@ -111,7 +111,6 @@ cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event) {
#else #else
const cString channelName = Channels.GetByChannelID(event->ChannelID())->Name(); const cString channelName = Channels.GetByChannelID(event->ChannelID())->Name();
#endif #endif
cString message;
bool eventHasTimer = false; bool eventHasTimer = false;
if (config.useRemoteTimers && pRemoteTimers) { if (config.useRemoteTimers && pRemoteTimers) {
RemoteTimers_GetMatch_v1_0 rtMatch; RemoteTimers_GetMatch_v1_0 rtMatch;
@@ -123,11 +122,9 @@ cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event) {
} else { } else {
eventHasTimer = event->HasTimer(); eventHasTimer = event->HasTimer();
} }
if (eventHasTimer) { const cString message = (eventHasTimer) ? (timerChanged) ? tr("Timer changed")
message = tr("Timer created"); : tr("Timer created")
} else { : tr("Timer NOT created");
message = tr("Timer NOT created");
}
cString text = cString::sprintf("%s\n%s\n%s %s - %s\n%s", cString text = cString::sprintf("%s\n%s\n%s %s - %s\n%s",
*message, *message,
*channelName, *channelName,
@@ -1434,14 +1431,19 @@ void cRecMenuTimeline::GetTimersForDay(void) {
timersToday.clear(); timersToday.clear();
#if VDRVERSNUM >= 20301 #if VDRVERSNUM >= 20301
LOCK_TIMERS_READ; LOCK_TIMERS_READ;
// const cTimers* timers = Timers; const cTimers* timers = Timers;
for (const cTimer *t = Timers->First(); t; t = Timers->Next(t)) {
#else #else
for (const cTimer *t = Timers.First(); t; t = Timers.Next(t)) { const cTimers* timers = &Timers;
#endif #endif
cSortedTimers SortedTimers(timers);
int i = 0;
while (i < SortedTimers.Size()) {
const cTimer *t = SortedTimers[i];
if (((t->StartTime() > timeStart) && (t->StartTime() <= timeStop)) || ((t->StopTime() > timeStart) && (t->StopTime() <= timeStop))) { if (((t->StartTime() > timeStart) && (t->StartTime() <= timeStop)) || ((t->StopTime() > timeStart) && (t->StopTime() <= timeStop))) {
timersToday.push_back(t); if (t->HasFlags(tfActive))
timersToday.push_back(t);
} }
i++;
} }
numTimersToday = timersToday.size(); numTimersToday = timersToday.size();
} }

View File

@@ -47,7 +47,7 @@ public:
// --- cRecMenuConfirmTimer --------------------------------------------------------- // --- cRecMenuConfirmTimer ---------------------------------------------------------
class cRecMenuConfirmTimer: public cRecMenu { class cRecMenuConfirmTimer: public cRecMenu {
public: public:
cRecMenuConfirmTimer(const cEvent *event); cRecMenuConfirmTimer(const cEvent *event, bool timerChanged = false);
virtual ~cRecMenuConfirmTimer(void) {}; virtual ~cRecMenuConfirmTimer(void) {};
}; };

View File

@@ -234,7 +234,7 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
LOCK_TIMERS_READ; LOCK_TIMERS_READ;
const cTimer *t = Timers->Get(timerID); const cTimer *t = Timers->Get(timerID);
#else #else
cTimer *t = Timers.Get(timerID); const cTimer *t = Timers.Get(timerID);
#endif #endif
if (t) { if (t) {
const cEvent *ev = t->Event(); const cEvent *ev = t->Event();
@@ -251,10 +251,19 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
timerIndex = menu->GetTimerConflictIndex(); timerIndex = menu->GetTimerConflictIndex();
} else break; } else break;
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex); int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
recManager->DeleteTimer(timerID); const cTimers* timers;
#if VDRVERSNUM >= 20301
{
LOCK_TIMERS_READ;
timers = Timers;
}
#else
timers = &Timers;
#endif
recManager->DeleteTimer(timers->Get(timerID)->Event());
delete activeMenu; delete activeMenu;
if (!DisplayTimerConflict(timerID)) { if (!DisplayTimerConflict(timerID)) {
activeMenu = new cRecMenuConfirmTimer(event); activeMenu = new cRecMenuConfirmTimer(timers->Get(timerID)->Event());
activeMenu->Display(); activeMenu->Display();
} }
break; } break; }
@@ -290,7 +299,7 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
recManager->SaveTimer(originalTimer, timerModified); recManager->SaveTimer(originalTimer, timerModified);
delete activeMenu; delete activeMenu;
if (!DisplayTimerConflict(originalTimer)) { if (!DisplayTimerConflict(originalTimer)) {
activeMenu = new cRecMenuConfirmTimer(event); activeMenu = new cRecMenuConfirmTimer(originalTimer->Event(), true);
activeMenu->Display(); activeMenu->Display();
} }
break; } break; }

11
setup.c
View File

@@ -80,7 +80,9 @@ void cTvguideSetup::Store(void) {
SetupStore("displayTime", config.displayTime); SetupStore("displayTime", config.displayTime);
SetupStore("displayHorizontalTime", config.displayHorizontalTime); SetupStore("displayHorizontalTime", config.displayHorizontalTime);
SetupStore("bigStepHours", config.bigStepHours); SetupStore("bigStepHours", config.bigStepHours);
SetupStore("bigStepHoursHorizontal", config.bigStepHoursHorizontal);
SetupStore("hugeStepHours", config.hugeStepHours); SetupStore("hugeStepHours", config.hugeStepHours);
SetupStore("hugeStepHoursHorizontal", config.hugeStepHoursHorizontal);
SetupStore("channelJumpMode", config.channelJumpMode); SetupStore("channelJumpMode", config.channelJumpMode);
SetupStore("blueKeyMode", config.blueKeyMode); SetupStore("blueKeyMode", config.blueKeyMode);
SetupStore("numkeyMode", config.numkeyMode); SetupStore("numkeyMode", config.numkeyMode);
@@ -224,8 +226,13 @@ void cMenuSetupGeneral::Set(void) {
Add(new cMenuEditBoolItem(tr("Close TVGuide after channel switch"), &tmpConfig->closeOnSwitch)); Add(new cMenuEditBoolItem(tr("Close TVGuide after channel switch"), &tmpConfig->closeOnSwitch));
Add(new cMenuEditStraItem(tr("Functionality of numeric Keys"), &tmpConfig->numkeyMode, 2, numMode)); Add(new cMenuEditStraItem(tr("Functionality of numeric Keys"), &tmpConfig->numkeyMode, 2, numMode));
Add(new cMenuEditBoolItem(tr("Hide last Channel Group"), &tmpConfig->hideLastGroup)); Add(new cMenuEditBoolItem(tr("Hide last Channel Group"), &tmpConfig->hideLastGroup));
Add(new cMenuEditIntItem(tr("Big Step (Keys 1 / 3) in hours"), &tmpConfig->bigStepHours, 1, 12)); if (tmpConfig->displayMode == eVertical) {
Add(new cMenuEditIntItem(tr("Huge Step (Keys 4 / 6) in hours"), &tmpConfig->hugeStepHours, 13, 48)); Add(new cMenuEditIntItem(tr("Big Step (Keys 1 / 3) in hours"), &tmpConfig->bigStepHours, 1, 12));
Add(new cMenuEditIntItem(tr("Huge Step (Keys 4 / 6) in hours"), &tmpConfig->hugeStepHours, 13, 48));
} else if (tmpConfig->displayMode == eHorizontal) {
Add(new cMenuEditIntItem(tr("Big Step (Keys 1 / 3) in hours"), &tmpConfig->bigStepHoursHorizontal, 1, 12));
Add(new cMenuEditIntItem(tr("Huge Step (Keys 4 / 6) in hours"), &tmpConfig->hugeStepHoursHorizontal, 13, 48));
}
Add(new cMenuEditStraItem(tr("Time Format (12h/24h)"), &tmpConfig->timeFormat, 2, timeFormatItems)); Add(new cMenuEditStraItem(tr("Time Format (12h/24h)"), &tmpConfig->timeFormat, 2, timeFormatItems));
Add(new cMenuEditIntItem(tr("EPG Window Text Scrolling Speed"), &tmpConfig->detailedViewScrollStep, 1, 30)); Add(new cMenuEditIntItem(tr("EPG Window Text Scrolling Speed"), &tmpConfig->detailedViewScrollStep, 1, 30));
Add(new cMenuEditBoolItem(tr("Display Reruns in detailed EPG View"), &tmpConfig->displayRerunsDetailEPGView)); Add(new cMenuEditBoolItem(tr("Display Reruns in detailed EPG View"), &tmpConfig->displayRerunsDetailEPGView));

View File

@@ -5,33 +5,28 @@ cTimeLine::cTimeLine(cTimeManager *timeManager) {
this->timeManager = timeManager; this->timeManager = timeManager;
lastClock = ""; lastClock = "";
timeBase = NULL; timeBase = NULL;
int x11, x21, y11, y21, x12, x22, y12, y22;
if (config.displayMode == eVertical) { if (config.displayMode == eVertical) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0, x11 = 0;
geoManager.statusHeaderHeight + geoManager.clockHeight, x21 = geoManager.dateVieverWidth;
geoManager.dateVieverWidth, y11 = geoManager.statusHeaderHeight + geoManager.clockHeight;
geoManager.dateVieverHeight))); y21 = geoManager.dateVieverHeight;
timeline = osdManager.requestPixmap(2, cRect(0, x12 = 0;
geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight, x22 = geoManager.timeLineWidth;
geoManager.timeLineWidth, y12 = geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight;
geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight) y22 = geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight;
, cRect(0,
0,
geoManager.timeLineWidth,
1440 * geoManager.minutePixel));
} else if (config.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(geoManager.clockWidth, x11 = geoManager.clockWidth;
geoManager.statusHeaderHeight, x21 = geoManager.dateVieverWidth;
geoManager.dateVieverWidth, y11 = geoManager.statusHeaderHeight;
geoManager.dateVieverHeight))); y21 = geoManager.dateVieverHeight;
timeline = osdManager.requestPixmap(2, cRect(geoManager.channelHeaderWidth + geoManager.channelGroupsWidth, x12 = geoManager.channelHeaderWidth + geoManager.channelGroupsWidth;
geoManager.statusHeaderHeight, x22 = geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth;
geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth, y12 = geoManager.statusHeaderHeight;
geoManager.timeLineHeight) y22 = geoManager.timeLineHeight;
, cRect(0,
0,
1440 * geoManager.minutePixel,
geoManager.timeLineHeight));
} }
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(x11, y11, x21, y21)));
timeline = osdManager.requestPixmap(2, cRect(x12, y12, x22, y22));
clock = new cStyledPixmap(osdManager.requestPixmap(3, cRect(0, clock = new cStyledPixmap(osdManager.requestPixmap(3, cRect(0,
geoManager.statusHeaderHeight, geoManager.statusHeaderHeight,
geoManager.clockWidth, geoManager.clockWidth,
@@ -43,10 +38,11 @@ cTimeLine::~cTimeLine(void) {
delete clock; delete clock;
osdManager.releasePixmap(timeBase); osdManager.releasePixmap(timeBase);
osdManager.releasePixmap(timeline); osdManager.releasePixmap(timeline);
delete dateViewer; if (dateViewer)
delete dateViewer;
} }
void cTimeLine::drawDateViewer() { void cTimeLine::DrawDateViewer(void) {
cString weekDay = timeManager->GetWeekday(); cString weekDay = timeManager->GetWeekday();
cString date = timeManager->GetDate(); cString date = timeManager->GetDate();
if (config.style != eStyleGraphical) { if (config.style != eStyleGraphical) {
@@ -80,8 +76,8 @@ void cTimeLine::drawDateViewer() {
} }
} }
void cTimeLine::drawTimeline() { void cTimeLine::DrawTimeline(void) {
timeline->SetTile(true); // timeline->SetTile(true);
timeline->Fill(clrTransparent); timeline->Fill(clrTransparent);
tColor colorFont, colorBackground; tColor colorFont, colorBackground;
@@ -93,8 +89,8 @@ void cTimeLine::drawTimeline() {
img1 = imgCache.GetOsdElement(oeTimeline1); img1 = imgCache.GetOsdElement(oeTimeline1);
img2 = imgCache.GetOsdElement(oeTimeline2); img2 = imgCache.GetOsdElement(oeTimeline2);
} else { } else {
img1 = createBackgroundImage(imgWidth, imgHeight, theme.Color(clrTimeline1), theme.Color(clrTimeline1Blending)); img1 = CreateBackgroundImage(imgWidth, imgHeight, theme.Color(clrTimeline1), theme.Color(clrTimeline1Blending));
img2 = createBackgroundImage(imgWidth, imgHeight, theme.Color(clrTimeline2), theme.Color(clrTimeline2Blending)); img2 = CreateBackgroundImage(imgWidth, imgHeight, theme.Color(clrTimeline2), theme.Color(clrTimeline2Blending));
} }
const cImage *img = NULL; const cImage *img = NULL;
if (!img1 || !img2) if (!img1 || !img2)
@@ -102,8 +98,19 @@ void cTimeLine::drawTimeline() {
int textWidth, posX, posY; int textWidth, posX, posY;
char timetext[10]; char timetext[10];
for (int i=0; i<48; i++) { int halfHours;
if (i%2==0) { if (config.displayMode == eVertical)
halfHours = config.displayTime / 30 + 1;
else
halfHours = config.displayHorizontalTime / 30 + 1;
time_t tStart = timeManager->GetStart();
tm *t = localtime ( &tStart );
int x = 2 * t->tm_hour + ((t->tm_min == 0) ? 0 : 1);
for (int j = x; j < (x + halfHours); j++) {
int i = (j >= 48) ? (j - 48) : j;
if (i % 2 == 0) {
img = img1; img = img1;
colorFont = theme.Color(clrTimeline2); colorFont = theme.Color(clrTimeline2);
colorBackground = (config.style == eStyleFlat)?theme.Color(clrTimeline1):clrTransparent; colorBackground = (config.style == eStyleFlat)?theme.Color(clrTimeline1):clrTransparent;
@@ -111,11 +118,11 @@ void cTimeLine::drawTimeline() {
if (i == 0) if (i == 0)
sprintf(timetext, "12:00 PM"); sprintf(timetext, "12:00 PM");
else if (i/2 < 13) else if (i/2 < 13)
sprintf(timetext, "%d:00 AM", i/2); sprintf(timetext, "%d:00 AM", i / 2);
else else
sprintf(timetext, "%d:00 PM", i/2-12); sprintf(timetext, "%d:00 PM", i / 2 - 12);
} else { } else {
sprintf(timetext, "%d:00", i/2); sprintf(timetext, "%d:00", i / 2);
} }
} else { } else {
img = img2; img = img2;
@@ -125,38 +132,38 @@ void cTimeLine::drawTimeline() {
if (i == 1) if (i == 1)
sprintf(timetext, "12:30 PM"); sprintf(timetext, "12:30 PM");
else if (i/2 < 13) else if (i/2 < 13)
sprintf(timetext, "%d:30 AM", i/2); sprintf(timetext, "%d:30 AM", i / 2);
else else
sprintf(timetext, "%d:30 PM", i/2-12); sprintf(timetext, "%d:30 PM", i / 2 - 12);
} else { } else {
sprintf(timetext, "%d:30", i/2); sprintf(timetext, "%d:30", i / 2);
} }
} }
if (config.displayMode == eVertical) { if (config.displayMode == eVertical) {
posY = i*geoManager.minutePixel*30; posY = (j - x) * geoManager.minutePixel * 30;
timeline->DrawImage(cPoint(0, posY), *img); timeline->DrawImage(cPoint(0, posY), *img);
if (config.style != eStyleGraphical) { if (config.style != eStyleGraphical) {
decorateTile(0, posY, imgWidth+2, imgHeight); DecorateTile(0, posY, imgWidth + 2, imgHeight);
} }
textWidth = fontManager.FontTimeLineTime->Width(timetext); textWidth = fontManager.FontTimeLineTime->Width(timetext);
timeline->DrawText(cPoint((geoManager.timeLineWidth-textWidth)/2, posY + 5), timetext, colorFont, colorBackground, fontManager.FontTimeLineTime); timeline->DrawText(cPoint((geoManager.timeLineWidth-textWidth) / 2, posY + 5), timetext, colorFont, colorBackground, fontManager.FontTimeLineTime);
} else if (config.displayMode == eHorizontal) { } else if (config.displayMode == eHorizontal) {
posX = i*geoManager.minutePixel*30; posX = (j - x) * geoManager.minutePixel * 30;
timeline->DrawImage(cPoint(posX, 0), *img); timeline->DrawImage(cPoint(posX, 0), *img);
if (config.style != eStyleGraphical) { if (config.style != eStyleGraphical) {
decorateTile(posX, 0, imgWidth, imgHeight+2); DecorateTile(posX, 0, imgWidth, imgHeight + 2);
} }
timeline->DrawText(cPoint(posX + 15, (dateViewer->Height() - fontManager.FontTimeLineTimeHorizontal->Height())/2), timetext, colorFont, colorBackground, fontManager.FontTimeLineTimeHorizontal); timeline->DrawText(cPoint(posX + 15, (dateViewer->Height() - fontManager.FontTimeLineTimeHorizontal->Height()) / 2), timetext, colorFont, colorBackground, fontManager.FontTimeLineTimeHorizontal);
} }
} }
setTimeline(); DrawTimeIndicator();
if (config.style != eStyleGraphical) { if (config.style != eStyleGraphical) {
delete img1; delete img1;
delete img2; delete img2;
} }
} }
void cTimeLine::decorateTile(int posX, int posY, int tileWidth, int tileHeight) { void cTimeLine::DecorateTile(int posX, int posY, int tileWidth, int tileHeight) {
timeline->DrawRectangle(cRect(posX,posY,tileWidth,2), clrTransparent); //top timeline->DrawRectangle(cRect(posX,posY,tileWidth,2), clrTransparent); //top
timeline->DrawRectangle(cRect(posX,posY,2,tileHeight), clrTransparent); //left timeline->DrawRectangle(cRect(posX,posY,2,tileHeight), clrTransparent); //left
timeline->DrawRectangle(cRect(posX,posY + tileHeight-2,tileWidth,2), clrTransparent); //bottom timeline->DrawRectangle(cRect(posX,posY + tileHeight-2,tileWidth,2), clrTransparent); //bottom
@@ -169,11 +176,11 @@ void cTimeLine::decorateTile(int posX, int posY, int tileWidth, int tileHeight)
if (config.roundedCorners) { if (config.roundedCorners) {
int borderRadius = 12; int borderRadius = 12;
drawRoundedCorners(posX, posY, tileWidth, tileHeight, borderRadius); DrawRoundedCorners(posX, posY, tileWidth, tileHeight, borderRadius);
} }
} }
void cTimeLine::drawRoundedCorners(int posX, int posY, int width, int height, int radius) { void cTimeLine::DrawRoundedCorners(int posX, int posY, int width, int height, int radius) {
timeline->DrawEllipse(cRect(posX+2,posY+2,radius,radius), theme.Color(clrBorder), -2); timeline->DrawEllipse(cRect(posX+2,posY+2,radius,radius), theme.Color(clrBorder), -2);
timeline->DrawEllipse(cRect(posX+1,posY+1,radius,radius), clrTransparent, -2); timeline->DrawEllipse(cRect(posX+1,posY+1,radius,radius), clrTransparent, -2);
@@ -189,14 +196,16 @@ void cTimeLine::drawRoundedCorners(int posX, int posY, int width, int height, in
} }
} }
void cTimeLine::drawCurrentTimeBase(void) { void cTimeLine::DrawTimeIndicator(void) {
if (!config.displayTimeBase)
return;
if (!timeManager->NowVisible()) { if (!timeManager->NowVisible()) {
if (timeBase) if (timeBase)
timeBase->Fill(clrTransparent); timeBase->Fill(clrTransparent);
return; return;
} }
int deltaTime = (time(0) - timeManager->GetStart()) / 60 * geoManager.minutePixel;
osdManager.releasePixmap(timeBase); osdManager.releasePixmap(timeBase);
int deltaTime = (timeManager->GetNow() - timeManager->GetStart()) / 60 * geoManager.minutePixel;
int x1, x2, y1, y2; int x1, x2, y1, y2;
if (config.displayMode == eVertical) { if (config.displayMode == eVertical) {
x1 = 0; x1 = 0;
@@ -214,7 +223,7 @@ void cTimeLine::drawCurrentTimeBase(void) {
timeBase->DrawRectangle(cRect(0, 0, timeBase->ViewPort().Width(), timeBase->ViewPort().Height()), theme.Color(clrTimeBase)); timeBase->DrawRectangle(cRect(0, 0, timeBase->ViewPort().Width(), timeBase->ViewPort().Height()), theme.Color(clrTimeBase));
} }
cImage *cTimeLine::createBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend) { cImage *cTimeLine::CreateBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend) {
cImage *image = NULL; cImage *image = NULL;
if (config.style == eStyleBlendingDefault) { if (config.style == eStyleBlendingDefault) {
image = new cImage(cSize(width, height)); image = new cImage(cSize(width, height));
@@ -243,22 +252,7 @@ cImage *cTimeLine::createBackgroundImage(int width, int height, tColor clrBgr, t
return image; return image;
} }
void cTimeLine::setTimeline() { bool cTimeLine::DrawClock(void) {
int offset = timeManager->GetTimelineOffset();
int xNew, yNew;
if (config.displayMode == eVertical) {
xNew = 0;
yNew = -offset*geoManager.minutePixel;
} else if (config.displayMode == eHorizontal) {
xNew = -offset*geoManager.minutePixel;
yNew = 0;
}
timeline->SetDrawPortPoint(cPoint(xNew, yNew));
if (config.displayTimeBase)
drawCurrentTimeBase();
}
bool cTimeLine::drawClock() {
cString currentTime = timeManager->GetCurrentTime(); cString currentTime = timeManager->GetCurrentTime();
if (strcmp(currentTime, lastClock)) { if (strcmp(currentTime, lastClock)) {
clock->Fill(clrTransparent); clock->Fill(clrTransparent);
@@ -275,6 +269,7 @@ bool cTimeLine::drawClock() {
} }
clock->DrawText(cPoint((geoManager.clockWidth - clockTextWidth) / 2, (geoManager.clockHeight - textHeight) / 2), *currentTime, theme.Color(clrFont), colorFontBack, font); clock->DrawText(cPoint((geoManager.clockWidth - clockTextWidth) / 2, (geoManager.clockHeight - textHeight) / 2), *currentTime, theme.Color(clrFont), colorFontBack, font);
lastClock = currentTime; lastClock = currentTime;
DrawTimeIndicator();
return true; return true;
} }
return false; return false;

View File

@@ -14,17 +14,16 @@ private:
cStyledPixmap *clock; cStyledPixmap *clock;
cPixmap *timeBase; cPixmap *timeBase;
cString lastClock; cString lastClock;
void decorateTile(int posX, int posY, int tileWidth, int tileHeight); void DecorateTile(int posX, int posY, int tileWidth, int tileHeight);
void drawRoundedCorners(int posX, int posY, int width, int height, int radius); void DrawRoundedCorners(int posX, int posY, int width, int height, int radius);
cImage *createBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend); cImage *CreateBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend);
public: public:
cTimeLine(cTimeManager *timeManager); cTimeLine(cTimeManager *timeManager);
virtual ~cTimeLine(void); virtual ~cTimeLine(void);
void setTimeline(void); void DrawDateViewer(void);
void drawDateViewer(void); void DrawTimeline(void);
void drawTimeline(void); void DrawTimeIndicator(void);
void drawCurrentTimeBase(void); bool DrawClock(void);
bool drawClock();
}; };
#endif //__TVGUIDE_TIMELINE_H #endif //__TVGUIDE_TIMELINE_H

View File

@@ -3,6 +3,14 @@
#include "config.h" #include "config.h"
#include "timemanager.h" #include "timemanager.h"
cTimeManager::cTimeManager(void) {
if (config.displayMode == eVertical) {
displaySeconds = (geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight) / geoManager.minutePixel * 60;
} else if (config.displayMode == eHorizontal) {
displaySeconds = (geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth) / geoManager.minutePixel * 60;
}
}
cTimeManager::~cTimeManager(void) { cTimeManager::~cTimeManager(void) {
} }
@@ -18,40 +26,32 @@ void cTimeManager::Now() {
t = time(0); t = time(0);
tStart = t; tStart = t;
tStart = GetRounded(); tStart = GetRounded();
if (config.displayMode == eVertical) { tEnd = tStart + displaySeconds;
tEnd = tStart + (geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight)/geoManager.minutePixel*60;
} else if (config.displayMode == eHorizontal) {
tEnd = tStart + (geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth)/geoManager.minutePixel*60;
}
} }
void cTimeManager::AddStep(int step) { void cTimeManager::AddStep(int step) {
tStart += step*60; tStart += step * 60;
tEnd += step*60; tEnd = tStart + displaySeconds;
} }
bool cTimeManager::DelStep(int step) { void cTimeManager::DelStep(int step) {
if ((tStart - step*60)+30*60 < t) { if ((tStart - step * 60) + 30 * 60 < t) {
return true; Now();
} else {
tStart -= step * 60;
tEnd = tStart + displaySeconds;
} }
tStart -= step*60;
tEnd -= step*60;
return false;
} }
void cTimeManager::SetTime(time_t newTime) { void cTimeManager::SetTime(time_t newTime) {
tStart = newTime; tStart = newTime;
if (config.displayMode == eVertical) { tEnd = tStart + displaySeconds;
tEnd = tStart + (geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight)/geoManager.minutePixel*60;
} else if (config.displayMode == eHorizontal) {
tEnd = tStart + (geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth)/geoManager.minutePixel*60;
}
} }
time_t cTimeManager::getPrevPrimetime(time_t current) { time_t cTimeManager::getPrevPrimetime(time_t current) {
tm *st = localtime(&current); tm *st = localtime(&current);
if (st->tm_hour < 21) { if (st->tm_hour < 21) {
current -= 24 * 60* 60; current -= 24 * 60 * 60;
st = localtime(&current); st = localtime(&current);
} }
st->tm_hour = 20; st->tm_hour = 20;
@@ -63,7 +63,7 @@ time_t cTimeManager::getPrevPrimetime(time_t current) {
time_t cTimeManager::getNextPrimetime(time_t current){ time_t cTimeManager::getNextPrimetime(time_t current){
tm *st = localtime(&current); tm *st = localtime(&current);
if (st->tm_hour > 19) { if (st->tm_hour > 19) {
current += 24 * 60* 60; current += 24 * 60 * 60;
st = localtime(&current); st = localtime(&current);
} }
st->tm_hour = 20; st->tm_hour = 20;

View File

@@ -2,6 +2,7 @@
#define __TVGUIDE_TIMEMANAGER_H #define __TVGUIDE_TIMEMANAGER_H
#include <vdr/tools.h> #include <vdr/tools.h>
#include "config.h"
// --- cTimeManager ------------------------------------------------------------- // --- cTimeManager -------------------------------------------------------------
@@ -10,14 +11,16 @@ class cTimeManager {
time_t t; time_t t;
time_t tStart; time_t tStart;
time_t tEnd; time_t tEnd;
int displaySeconds;
eTimeFormat timeFormat;
public: public:
cTimeManager(){}; cTimeManager();
virtual ~cTimeManager(void); virtual ~cTimeManager(void);
static cString printTime(time_t displayTime); static cString printTime(time_t displayTime);
void Now(); void Now();
time_t GetNow() { return t; }; time_t GetNow() { return t; };
void AddStep(int step); void AddStep(int step);
bool DelStep(int step); void DelStep(int step);
void SetTime(time_t newTime); void SetTime(time_t newTime);
time_t Get() {return t;}; time_t Get() {return t;};
time_t GetStart() {return tStart;}; time_t GetStart() {return tStart;};
@@ -31,6 +34,7 @@ class cTimeManager {
int GetTimelineOffset(); int GetTimelineOffset();
time_t GetRounded(); time_t GetRounded();
bool NowVisible(void); bool NowVisible(void);
int GetDisplaySeconds(void) { return displaySeconds; };
void debug(); void debug();
}; };

36
tools.c
View File

@@ -24,31 +24,23 @@ cPlugin *GetScraperPlugin(void) {
* CUTTEXT * CUTTEXT
****************************************************************************************/ ****************************************************************************************/
std::string CutText(std::string text, int width, const cFont *font) { std::string CutText(std::string text, int width, const cFont *font) {
if (width <= font->Size()) int actWidth = font->Width(text.c_str());
if (actWidth <= width) {
return text.c_str(); return text.c_str();
if (font->Width(text.c_str()) < width) } else {
return text.c_str(); int i = std::max((actWidth - width) / font->Size(), 1);
cTextWrapper twText; do {
twText.Set(text.c_str(), font, width); text = text.substr(0, text.length() - i);
std::string cuttedTextNative = twText.GetLine(0); std::stringstream sstrText;
std::stringstream sstrText; sstrText << text << "....";
sstrText << cuttedTextNative << "..."; actWidth = font->Width(sstrText.str().c_str());
std::string cuttedText = sstrText.str(); i = 1;
int actWidth = font->Width(cuttedText.c_str());
if (actWidth > width) {
int overlap = actWidth - width;
int charWidth = font->Width(".");
if (charWidth == 0)
charWidth = 1;
int cutChars = overlap / charWidth;
if (cutChars > 0) {
cuttedTextNative = cuttedTextNative.substr(0, cuttedTextNative.length() - cutChars);
std::stringstream sstrText2;
sstrText2 << cuttedTextNative << "...";
cuttedText = sstrText2.str();
} }
while ((actWidth > width) && (text.length() > 0));
std::stringstream sstrText2;
sstrText2 << text << "...";
return sstrText2.str();
} }
return cuttedText;
} }
/**************************************************************************************** /****************************************************************************************

View File

@@ -27,7 +27,7 @@
#error "VDR-2.0.0 API version or greater is required!" #error "VDR-2.0.0 API version or greater is required!"
#endif #endif
static const char *VERSION = "1.2.15"; static const char *VERSION = "1.2.16";
static const char *DESCRIPTION = tr("A fancy 2d EPG Viewer"); static const char *DESCRIPTION = tr("A fancy 2d EPG Viewer");
static const char *MAINMENUENTRY = "Tvguide"; static const char *MAINMENUENTRY = "Tvguide";

View File

@@ -112,9 +112,9 @@ void cTvGuideOsd::drawOsd() {
statusHeader->ScaleVideo(); statusHeader->ScaleVideo();
} }
timeLine = new cTimeLine(timeManager); timeLine = new cTimeLine(timeManager);
timeLine->drawDateViewer(); timeLine->DrawDateViewer();
timeLine->drawTimeline(); timeLine->DrawTimeline();
timeLine->drawClock(); timeLine->DrawClock();
channelGroups = new cChannelGroups(); channelGroups = new cChannelGroups();
channelGroups->ReadChannelGroups(); channelGroups->ReadChannelGroups();
footer = new cFooter(channelGroups); footer = new cFooter(channelGroups);
@@ -374,12 +374,12 @@ void cTvGuideOsd::ScrollForward() {
timeManager->AddStep(config.stepMinutes); timeManager->AddStep(config.stepMinutes);
if (config.useHWAccel) { if (config.useHWAccel) {
drawGridsTimeJump(true); drawGridsTimeJump(true);
timeLine->drawDateViewer(); timeLine->DrawDateViewer();
timeLine->drawClock(); timeLine->DrawClock();
timeLine->setTimeline(); timeLine->DrawTimeline();
} else { } else {
timeLine->drawDateViewer(); timeLine->DrawDateViewer();
timeLine->setTimeline(); timeLine->DrawTimeline();
for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) { for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) {
column->AddNewGridsAtEnd(); column->AddNewGridsAtEnd();
column->ClearOutdatedStart(); column->ClearOutdatedStart();
@@ -410,17 +410,15 @@ void cTvGuideOsd::timeBack() {
} }
void cTvGuideOsd::ScrollBack() { void cTvGuideOsd::ScrollBack() {
bool tooFarInPast = timeManager->DelStep(config.stepMinutes); timeManager->DelStep(config.stepMinutes);
if (tooFarInPast)
return;
if (config.useHWAccel) { if (config.useHWAccel) {
drawGridsTimeJump(); drawGridsTimeJump();
timeLine->drawDateViewer(); timeLine->DrawDateViewer();
timeLine->drawClock(); timeLine->DrawClock();
timeLine->setTimeline(); timeLine->DrawTimeline();
} else { } else {
timeLine->drawDateViewer(); timeLine->DrawDateViewer();
timeLine->setTimeline(); timeLine->DrawTimeline();
for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) { for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) {
column->AddNewGridsAtStart(); column->AddNewGridsAtStart();
column->ClearOutdatedEnd(); column->ClearOutdatedEnd();
@@ -640,24 +638,20 @@ void cTvGuideOsd::processNumKey(int numKey) {
void cTvGuideOsd::TimeJump(int mode) { void cTvGuideOsd::TimeJump(int mode) {
switch (mode) { switch (mode) {
case 1: { case 1: {
bool tooFarInPast = timeManager->DelStep(config.bigStepHours*60); timeManager->DelStep(((config.displayMode == eVertical) ? config.bigStepHours : config.bigStepHoursHorizontal) * 60);
if (tooFarInPast) }
return;
}
break; break;
case 3: { case 3: {
timeManager->AddStep(config.bigStepHours*60); timeManager->AddStep(((config.displayMode == eVertical) ? config.bigStepHours : config.bigStepHoursHorizontal) * 60);
} }
break; break;
case 4: { case 4: {
bool tooFarInPast = timeManager->DelStep(config.hugeStepHours*60); timeManager->DelStep(((config.displayMode == eVertical) ? config.hugeStepHours : config.hugeStepHoursHorizontal) * 60);
if (tooFarInPast) }
return;
}
break; break;
case 6: { case 6: {
timeManager->AddStep(config.hugeStepHours*60); timeManager->AddStep(((config.displayMode == eVertical) ? config.hugeStepHours : config.hugeStepHoursHorizontal) * 60);
} }
break; break;
case 7: { case 7: {
cTimeManager primeChecker; cTimeManager primeChecker;
@@ -666,21 +660,21 @@ void cTvGuideOsd::TimeJump(int mode) {
if (primeChecker.tooFarInPast(prevPrime)) if (primeChecker.tooFarInPast(prevPrime))
return; return;
timeManager->SetTime(prevPrime); timeManager->SetTime(prevPrime);
} }
break; break;
case 9: { case 9: {
cTimeManager primeChecker; cTimeManager primeChecker;
time_t nextPrime = primeChecker.getNextPrimetime(timeManager->GetStart()); time_t nextPrime = primeChecker.getNextPrimetime(timeManager->GetStart());
timeManager->SetTime(nextPrime); timeManager->SetTime(nextPrime);
} }
break; break;
default: default:
return; return;
} }
drawGridsTimeJump(); drawGridsTimeJump();
timeLine->drawDateViewer(); timeLine->DrawDateViewer();
timeLine->drawClock(); timeLine->DrawClock();
timeLine->setTimeline(); timeLine->DrawTimeline();
osdManager.flush(); osdManager.flush();
} }
@@ -783,15 +777,18 @@ eOSState cTvGuideOsd::ProcessKey(eKeys Key) {
case kYellow: processKeyYellow(); break; case kYellow: processKeyYellow(); break;
case kBlue: state = processKeyBlue(&alreadyUnlocked); break; case kBlue: state = processKeyBlue(&alreadyUnlocked); break;
case kOk: state = processKeyOk(&alreadyUnlocked); break; case kOk: state = processKeyOk(&alreadyUnlocked); break;
case kBack: state=osEnd; break; case kBack: state = osEnd; break;
case k0 ... k9: processNumKey(Key - k0); break; case k0 ... k9: processNumKey(Key - k0); break;
case kFastRew: TimeJump(1); break; // Doesnt work, if used from timeshiftmode
case kFastFwd: TimeJump(3); break;
case kPrev: TimeJump(4); break;
case kNext: TimeJump(6); break;
case kNone: if (channelJumper) CheckTimeout(); break; case kNone: if (channelJumper) CheckTimeout(); break;
default: break; default: break;
} }
if (timeLine->drawClock()) { if (timeLine->DrawClock()) {
timeLine->drawCurrentTimeBase();
osdManager.flush(); osdManager.flush();
} }
} }
if (!alreadyUnlocked) { if (!alreadyUnlocked) {
cPixmap::Unlock(); cPixmap::Unlock();

4
view.c
View File

@@ -116,7 +116,7 @@ void cView::DrawHeader(void) {
int yDateTime = border / 2; int yDateTime = border / 2;
int yTitle = (headerHeight - fontHeaderLarge->Height()) / 2; int yTitle = (headerHeight - fontHeaderLarge->Height()) / 2;
int ySubtitle = headerHeight - fontHeader->Height() - border / 3; int ySubtitle = headerHeight - fontHeader->Height() - border / 3;
int textWidthMax = headerWidth - xText; int textWidthMax = headerWidth - xText - border / 2;
pixmapHeader->DrawText(cPoint(xText, yDateTime), CutText(dateTime, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader); pixmapHeader->DrawText(cPoint(xText, yDateTime), CutText(dateTime, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader);
pixmapHeader->DrawText(cPoint(xText, yTitle), CutText(title, textWidthMax, fontHeaderLarge).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeaderLarge); pixmapHeader->DrawText(cPoint(xText, yTitle), CutText(title, textWidthMax, fontHeaderLarge).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeaderLarge);
pixmapHeader->DrawText(cPoint(xText, ySubtitle), CutText(subTitle, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader); pixmapHeader->DrawText(cPoint(xText, ySubtitle), CutText(subTitle, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader);
@@ -522,7 +522,7 @@ cEPGView::cEPGView(void) : cView() {
} }
cEPGView::~cEPGView(void) { cEPGView::~cEPGView(void) {
Cancel(-1); Cancel(2);
while (Active()) while (Active())
cCondWait::SleepMs(10); cCondWait::SleepMs(10);
} }