diff options
Diffstat (limited to 'channelepg.c')
-rw-r--r-- | channelepg.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/channelepg.c b/channelepg.c index 2b3e07a..0fcd253 100644 --- a/channelepg.c +++ b/channelepg.c @@ -1,10 +1,10 @@ #include "channelepg.h" #include "dummygrid.h" -cChannelEpg::cChannelEpg(int num, const cChannel *channel, cMyTime *myTime) { +cChannelEpg::cChannelEpg(int num, const cChannel *channel, cTimeManager *timeManager) { this->channel = channel; this->num = num; - this->myTime = myTime; + this->timeManager = timeManager; #if VDRVERSNUM < 20301 hasTimer = channel->HasTimer(); #endif @@ -51,17 +51,17 @@ bool cChannelEpg::readGrids() { const cSchedule *Schedule = NULL; Schedule = schedules->GetSchedule(channel); if (!Schedule) { - addDummyGrid(myTime->GetStart(), myTime->GetEnd(), NULL, false); + addDummyGrid(timeManager->GetStart(), timeManager->GetEnd(), NULL, false); return true; } bool eventFound = false; bool dummyAtStart = false; - const cEvent *startEvent = Schedule->GetEventAround(myTime->GetStart()); + const cEvent *startEvent = Schedule->GetEventAround(timeManager->GetStart()); if (startEvent != NULL) { eventFound = true; } else { for (int i=1; i<6; i++) { - startEvent = Schedule->GetEventAround(myTime->GetStart()+i*5*60); + startEvent = Schedule->GetEventAround(timeManager->GetStart()+i*5*60); if (startEvent) { eventFound = true; dummyAtStart = true; @@ -72,20 +72,20 @@ bool cChannelEpg::readGrids() { if (eventFound) { bool col = true; if (dummyAtStart) { - addDummyGrid(myTime->GetStart(), startEvent->StartTime(), NULL, col); + addDummyGrid(timeManager->GetStart(), startEvent->StartTime(), NULL, col); col = !col; } bool dummyNeeded = true; bool toFarInFuture = false; - time_t endLast = myTime->GetStart(); + time_t endLast = timeManager->GetStart(); const cEvent *event = startEvent; const cEvent *eventLast = NULL; for (; event; event = Schedule->Events()->Next(event)) { if (endLast < event->StartTime()) { //gap, dummy needed time_t endTime = event->StartTime(); - if (endTime > myTime->GetEnd()) { - endTime = myTime->GetEnd(); + if (endTime > timeManager->GetEnd()) { + endTime = timeManager->GetEnd(); toFarInFuture = true; } addDummyGrid(endLast, endTime, NULL, col); @@ -97,18 +97,18 @@ bool cChannelEpg::readGrids() { addEpgGrid(event, NULL, col); col = !col; endLast = event->EndTime(); - if (event->EndTime() > myTime->GetEnd()) { + if (event->EndTime() > timeManager->GetEnd()) { dummyNeeded = false; break; } eventLast = event; } if (dummyNeeded) { - addDummyGrid(eventLast->EndTime(), myTime->GetEnd(), NULL, col); + addDummyGrid(eventLast->EndTime(), timeManager->GetEnd(), NULL, col); } return true; } else { - addDummyGrid(myTime->GetStart(), myTime->GetEnd(), NULL, false); + addDummyGrid(timeManager->GetStart(), timeManager->GetEnd(), NULL, false); return true; } return false; @@ -131,7 +131,7 @@ int cChannelEpg::getY() { } cGrid * cChannelEpg::getActive() { - cMyTime t; + cTimeManager t; t.Now(); for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) { if (grid->Match(t.Get())) @@ -196,7 +196,7 @@ void cChannelEpg::AddNewGridsAtStart() { if (firstGrid == NULL) return; //if first event is long enough, nothing to do. - if (firstGrid->StartTime() <= myTime->GetStart()) { + if (firstGrid->StartTime() <= timeManager->GetStart()) { return; } //if not, i have to add new ones to the list @@ -213,8 +213,8 @@ void cChannelEpg::AddNewGridsAtStart() { Schedule = schedules->GetSchedule(channel); if (!Schedule) { if (firstGrid->isDummy()) { - firstGrid->SetStartTime(myTime->GetStart()); - firstGrid->SetEndTime(myTime->GetEnd()); + firstGrid->SetStartTime(timeManager->GetStart()); + firstGrid->SetEndTime(timeManager->GetEnd()); } return; } @@ -223,13 +223,13 @@ void cChannelEpg::AddNewGridsAtStart() { for (const cEvent *event = Schedule->GetEventAround(firstGrid->StartTime()-60); event; event = Schedule->Events()->Prev(event)) { if (!event) break; - if (event->EndTime() < myTime->GetStart()) { + if (event->EndTime() < timeManager->GetStart()) { break; } cGrid *grid = addEpgGrid(event, firstGrid, col); col = !col; firstGrid = grid; - if (event->StartTime() <= myTime->GetStart()) { + if (event->StartTime() <= timeManager->GetStart()) { dummyNeeded = false; break; } @@ -237,11 +237,11 @@ void cChannelEpg::AddNewGridsAtStart() { if (dummyNeeded) { firstGrid = grids.First(); if (firstGrid->isDummy()) { - firstGrid->SetStartTime(myTime->GetStart()); - if (firstGrid->EndTime() >= myTime->GetEnd()) - firstGrid->SetEndTime(myTime->GetEnd()); + firstGrid->SetStartTime(timeManager->GetStart()); + if (firstGrid->EndTime() >= timeManager->GetEnd()) + firstGrid->SetEndTime(timeManager->GetEnd()); } else { - addDummyGrid(myTime->GetStart(), firstGrid->StartTime(), firstGrid, col); + addDummyGrid(timeManager->GetStart(), firstGrid->StartTime(), firstGrid, col); } } } @@ -252,7 +252,7 @@ void cChannelEpg::AddNewGridsAtEnd() { if (lastGrid == NULL) return; //if last event is long enough, nothing to do. - if (lastGrid->EndTime() >= myTime->GetEnd()) { + if (lastGrid->EndTime() >= timeManager->GetEnd()) { return; } //if not, i have to add new ones to the list @@ -269,8 +269,8 @@ void cChannelEpg::AddNewGridsAtEnd() { Schedule = schedules->GetSchedule(channel); if (!Schedule) { if (lastGrid->isDummy()) { - lastGrid->SetStartTime(myTime->GetStart()); - lastGrid->SetEndTime(myTime->GetEnd()); + lastGrid->SetStartTime(timeManager->GetStart()); + lastGrid->SetEndTime(timeManager->GetEnd()); } return; } @@ -279,12 +279,12 @@ void cChannelEpg::AddNewGridsAtEnd() { for (const cEvent *event = Schedule->GetEventAround(lastGrid->EndTime()+60); event; event = Schedule->Events()->Next(event)) { if (!event) break; - if (event->StartTime() > myTime->GetEnd()) { + if (event->StartTime() > timeManager->GetEnd()) { break; } addEpgGrid(event, NULL, col); col = !col; - if (event->EndTime() > myTime->GetEnd()) { + if (event->EndTime() > timeManager->GetEnd()) { dummyNeeded = false; break; } @@ -292,11 +292,11 @@ void cChannelEpg::AddNewGridsAtEnd() { if (dummyNeeded) { lastGrid = grids.Last(); if (lastGrid->isDummy()) { - lastGrid->SetEndTime(myTime->GetEnd()); - if (lastGrid->StartTime() <= myTime->GetStart()) - lastGrid->SetStartTime(myTime->GetStart()); + lastGrid->SetEndTime(timeManager->GetEnd()); + if (lastGrid->StartTime() <= timeManager->GetStart()) + lastGrid->SetStartTime(timeManager->GetStart()); } else { - addDummyGrid(lastGrid->EndTime(), myTime->GetEnd(), NULL, col); + addDummyGrid(lastGrid->EndTime(), timeManager->GetEnd(), NULL, col); } } } @@ -307,17 +307,17 @@ void cChannelEpg::ClearOutdatedStart() { firstGrid = grids.First(); if (!firstGrid) break; - if (firstGrid->EndTime() <= myTime->GetStart()) { + if (firstGrid->EndTime() <= timeManager->GetStart()) { grids.Del(firstGrid); firstGrid = NULL; } else { if (firstGrid->isDummy()) { - firstGrid->SetStartTime(myTime->GetStart()); + firstGrid->SetStartTime(timeManager->GetStart()); cGrid *next = getNext(firstGrid); if (next) { firstGrid->SetEndTime(next->StartTime()); } else { - firstGrid->SetEndTime(myTime->GetEnd()); + firstGrid->SetEndTime(timeManager->GetEnd()); } } break; @@ -331,17 +331,17 @@ void cChannelEpg::ClearOutdatedEnd() { lastGrid = grids.Last(); if (!lastGrid) break; - if (lastGrid->StartTime() >= myTime->GetEnd()) { + if (lastGrid->StartTime() >= timeManager->GetEnd()) { grids.Del(lastGrid); lastGrid = NULL; } else { if (lastGrid->isDummy()) { - lastGrid->SetEndTime(myTime->GetEnd()); + lastGrid->SetEndTime(timeManager->GetEnd()); cGrid *prev = getPrev(lastGrid); if (prev) { lastGrid->SetStartTime(prev->EndTime()); } else { - lastGrid->SetStartTime(myTime->GetStart()); + lastGrid->SetStartTime(timeManager->GetStart()); } } break; @@ -393,7 +393,7 @@ void cChannelEpg::dumpGrids() { esyslog("tvguide: ------Channel %s %d: %d entires ---------", channel->Name(), num, grids.Count()); int i=1; for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) { - esyslog("tvguide: grid %d: start: %s, stop: %s", i, *cMyTime::printTime(grid->StartTime()), *cMyTime::printTime(grid->EndTime())); + esyslog("tvguide: grid %d: start: %s, stop: %s", i, *cTimeManager::printTime(grid->StartTime()), *cTimeManager::printTime(grid->EndTime())); i++; } } |