diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2021-01-26 14:31:48 +0100 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2021-01-26 14:31:48 +0100 |
commit | 083fa9f8f13c4a83f982a4f72b292d3ad53fd4e3 (patch) | |
tree | 9e97f6e5f2fa3713e58c7958003305c6ba9dd332 | |
parent | 9effc8a17d52c3fe2bea5d66d6aa9d5ffcc0dfc8 (diff) | |
download | vdr-plugin-tvguideng-083fa9f8f13c4a83f982a4f72b292d3ad53fd4e3.tar.gz vdr-plugin-tvguideng-083fa9f8f13c4a83f982a4f72b292d3ad53fd4e3.tar.bz2 |
Add token eSchedulesGridIT::timerisactive
-rw-r--r-- | channelepg.c | 5 | ||||
-rw-r--r-- | channelepg.h | 2 | ||||
-rw-r--r-- | definitions.h | 1 | ||||
-rw-r--r-- | epgelement.c | 7 | ||||
-rw-r--r-- | gridelement.h | 4 | ||||
-rw-r--r-- | tvguidengosd.c | 1 |
6 files changed, 15 insertions, 5 deletions
diff --git a/channelepg.c b/channelepg.c index b5af13c..2f41294 100644 --- a/channelepg.c +++ b/channelepg.c @@ -334,10 +334,10 @@ void cChannelEpg::SetTimers(void) { SetSwitchTimer(); for (cGridElement *grid = grids.First(); grid; grid = grids.Next(grid)) { bool gridHadTimer = grid->HasTimer(); + bool timerWasActive = grid->TimerIsActive(); grid->SetTimer(); - if (gridHadTimer != grid->HasTimer()) { + if (gridHadTimer != grid->HasTimer() || timerWasActive != grid->TimerIsActive()) grid->Dirty(); - } bool gridHadSwitchTimer = grid->HasSwitchTimer(); grid->SetSwitchTimer(); if (gridHadSwitchTimer != grid->HasSwitchTimer()) @@ -402,6 +402,7 @@ void cChannelEpg::DrawGrids(skindesignerapi::cViewGrid *epgGrid) { epgGrid->AddIntToken((int)eSchedulesGridIT::color, grid->Id() % 2); epgGrid->AddIntToken((int)eSchedulesGridIT::dummy, grid->IsDummy()); epgGrid->AddIntToken((int)eSchedulesGridIT::timer, grid->HasTimer()); + epgGrid->AddIntToken((int)eSchedulesGridIT::timerisactive, grid->TimerIsActive()); epgGrid->AddIntToken((int)eSchedulesGridIT::switchtimer, grid->HasSwitchTimer()); epgGrid->AddStringToken((int)eSchedulesGridST::title, grid->Title()); epgGrid->AddStringToken((int)eSchedulesGridST::shorttext, grid->ShortText()); diff --git a/channelepg.h b/channelepg.h index 177b104..5321881 100644 --- a/channelepg.h +++ b/channelepg.h @@ -24,6 +24,7 @@ private: cList<cGridElement> grids; set<long> deletedElements; bool hasTimer; + bool timerIsActive; bool hasSwitchTimer; cGridElement *AddEpgGrid(const cEvent *event, cGridElement *after = NULL); void AddDummyGrid(time_t start, time_t end, cGridElement *after = NULL); @@ -47,6 +48,7 @@ public: void SetTimers(void); void SetTimer(void); bool HasTimer(void) { return hasTimer; }; + bool TimerIsActive(void) { return timerIsActive; }; void SetSwitchTimer() {hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);}; bool HasSwitchTimer() { return hasSwitchTimer; }; void ClearGrids(void); diff --git a/definitions.h b/definitions.h index 06518e3..0a895bb 100644 --- a/definitions.h +++ b/definitions.h @@ -182,6 +182,7 @@ enum class eSchedulesGridIT { color = 0, dummy, timer, + timerisactive, switchtimer, count }; diff --git a/epgelement.c b/epgelement.c index 8990d60..d0fa0c4 100644 --- a/epgelement.c +++ b/epgelement.c @@ -5,6 +5,7 @@ cEpgElement::cEpgElement(const cEvent *event, cChannelEpg *owner) : cGridElement(owner) { this->event = event; hasTimer = false; + timerIsActive = false; SetTimer(); hasSwitchTimer = false; SetSwitchTimer(); @@ -25,9 +26,11 @@ void cEpgElement::SetTimer() { } else { eTimerMatch TimerMatch = tmNone; LOCK_TIMERS_READ; - const cTimers *timers = Timers; - if (timers->GetMatch(event, &TimerMatch) && (TimerMatch == tmFull)) + const cTimer *timer = Timers->GetMatch(event, &TimerMatch); + if (TimerMatch == tmFull) { hasTimer = true; + timerIsActive = timer->HasFlags(tfActive); + } #else } else if (owner->HasTimer()) { hasTimer = event->HasTimer(); diff --git a/gridelement.h b/gridelement.h index aa7ccc3..839e31e 100644 --- a/gridelement.h +++ b/gridelement.h @@ -13,6 +13,7 @@ protected: bool init; bool active; bool hasTimer; + bool timerIsActive; bool hasSwitchTimer; cChannelEpg *owner; bool Intersects(cGridElement *neighbor); @@ -37,6 +38,7 @@ public: long Id(void) { return id; }; bool Active(void) { return active; }; bool HasTimer(void) {return hasTimer;}; + bool TimerIsActive(void) { return timerIsActive; }; bool HasSwitchTimer(void) {return hasSwitchTimer;}; bool IsFirst(void); bool IsDummy(void) { return dummy; }; @@ -48,4 +50,4 @@ public: virtual void Debug(void) {}; }; -#endif //__TVGUIDE_GRID_H
\ No newline at end of file +#endif //__TVGUIDE_GRID_H diff --git a/tvguidengosd.c b/tvguidengosd.c index 2c41f92..f638faa 100644 --- a/tvguidengosd.c +++ b/tvguidengosd.c @@ -674,6 +674,7 @@ void cTVGuideOSD::DefineTokens(eViewGridsRoot vg, skindesignerapi::cTokenContain tk->DefineIntToken("{color}", (int)eSchedulesGridIT::color); tk->DefineIntToken("{dummy}", (int)eSchedulesGridIT::dummy); tk->DefineIntToken("{timer}", (int)eSchedulesGridIT::timer); + tk->DefineIntToken("{timerisactive}", (int)eSchedulesGridIT::timerisactive); tk->DefineIntToken("{switchtimer}", (int)eSchedulesGridIT::switchtimer); tk->DefineStringToken("{title}", (int)eSchedulesGridST::title); tk->DefineStringToken("{shorttext}", (int)eSchedulesGridST::shorttext); |