summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkamel5 <kamel5 (at) gmx (dot) net>2018-05-17 13:25:12 +0200
committerkamel5 <kamel5 (at) gmx (dot) net>2018-05-17 13:25:12 +0200
commit8da4c598fe257bd58397c1e0cec9e89e33f18c44 (patch)
treea9bc510111dc822de173146b44e4690a917da2bc
parent54c209e39da2e5b631afc033373b8e8139fcac1d (diff)
downloadskin-lcarsng-8da4c598fe257bd58397c1e0cec9e89e33f18c44.tar.gz
skin-lcarsng-8da4c598fe257bd58397c1e0cec9e89e33f18c44.tar.bz2
More changes in view next 2 timer in channelview
-rw-r--r--displaychannel.c36
-rw-r--r--displaychannel.h2
2 files changed, 24 insertions, 14 deletions
diff --git a/displaychannel.c b/displaychannel.c
index 64c811e..1055cda 100644
--- a/displaychannel.c
+++ b/displaychannel.c
@@ -65,6 +65,7 @@ cLCARSNGDisplayChannel::cLCARSNGDisplayChannel(bool WithInfo):cThread("LCARS Dis
xc04 = xc02 + d / 4;
xc05 = xc02 + d;
xc06 = xc05 + Gap;
+ xc06a = xc06 + d1;
xc15 = cOsd::OsdWidth();
xc14 = xc15 - lineHeight;
xc13 = xc14 - Gap;
@@ -276,23 +277,32 @@ void cLCARSNGDisplayChannel::DrawEventRec(const cEvent *Present, const cEvent *F
void cLCARSNGDisplayChannel::DrawTimer(void)
{
- osd->DrawText(xc06l, yc05, "Timer", Theme.Color(clrEventShortText), frameColor, cFont::GetFont(fontSml), xc06m - xc06l - Gap - 1, lineHeight, taRight | taBorder);
+ osd->DrawText(xc06l + Gap, yc05, "Timer", Theme.Color(clrEventShortText), frameColor, cFont::GetFont(fontOsd), xc06m - xc06l - 1, lineHeight, taLeft | taBorder);
LOCK_TIMERS_READ;
cSortedTimers SortedTimers(Timers);
- for (int i = 0; i < 2; i++) {
+ int i = 0;
+ int j = 0;
+ while (i < 2) {
int y = yc05 + i * lineHeight;
- if (const cTimer *Timer = SortedTimers[i]) {
- cString Date;
- if (Timer->Recording())
- Date = cString::sprintf("-%s", *TimeString(Timer->StopTime()));
- else
- Date = DayDateTime(Timer->StartTime());
- const cChannel *Channel = Timer->Channel();
- const cEvent *Event = Timer->Event();
- if (Channel) {
- osd->DrawText(xc01, y, cString::sprintf("%d", Channel->Number()), Theme.Color(clrEventShortText), frameColor, cFont::GetFont(fontSml), xc02 - xc01 - 1, lineHeight, taRight | taBorder);
+ if (const cTimer *Timer = SortedTimers[i + j]) {
+ time_t Now = time(NULL);
+ if (!(Timer->HasFlags(tfActive)) || (Timer->StopTime() < Now))
+ j++;
+ else {
+ cString Date;
+ if (Timer->Recording())
+ Date = cString::sprintf("- %s", *TimeString(Timer->StopTime()));
+ else
+ Date = DayDateTime(Timer->StartTime());
+ const cChannel *Channel = Timer->Channel();
+ const cEvent *Event = Timer->Event();
+ if (Channel) {
+ osd->DrawText(xc01, y, cString::sprintf("%d", Channel->Number()), Theme.Color(clrEventShortText), frameColor, cFont::GetFont(fontSml), xc02 - xc01 - Gap - 1, lineHeight, taRight | taBorder);
+ }
+ osd->DrawText(xc04, y, cString::sprintf("%s", *Date), Theme.Color(clrEventShortText), Theme.Color(clrBackground), cFont::GetFont(fontSml), xc06a - xc04 - Gap - 1, lineHeight, taRight | taBorder);
+ osd->DrawText(xc06a, y, cString::sprintf("%s", Event->Title()), Theme.Color(clrEventShortText), Theme.Color(clrBackground), cFont::GetFont(fontSml), xc06l - xc06a - Gap - 1, lineHeight, taLeft | taBorder);
+ i++;
}
- osd->DrawText(xc04, y, cString::sprintf("%s %s", *Date, Event->Title()), Theme.Color(clrEventShortText), Theme.Color(clrBackground), cFont::GetFont(fontSml), xc06l - Gap - xc04 - 1, lineHeight, taLeft | taBorder);
}
}
}
diff --git a/displaychannel.h b/displaychannel.h
index a1d99f2..a26ae73 100644
--- a/displaychannel.h
+++ b/displaychannel.h
@@ -26,7 +26,7 @@
class cLCARSNGDisplayChannel : public cSkinDisplayChannel, cThread {
private:
cOsd *osd;
- int xc00, xc00m, xc01, xc02, xc02m, xc03, xc04, xc05, xc06l, xc06m, xc06n, xc06, xc07, xc08, xc09, xc10, xc10m, xc10n, xc11, xc12, xc13, xc14, xc15;
+ int xc00, xc00m, xc01, xc02, xc02m, xc03, xc04, xc05, xc06, xc06a, xc06l, xc06m, xc06n, xc07, xc08, xc09, xc10, xc10m, xc10n, xc11, xc12, xc13, xc14, xc15;
int yc0B, yc0A, yc00, yc00m, yc01, yc02, yc03, yc04, yc05, yc06, yc07, yc08, yc09, yc10, yc11, yc12;
int xs; // starting column for signal display
bool withInfo;