diff options
Diffstat (limited to 'timerconflict.c')
-rw-r--r-- | timerconflict.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/timerconflict.c b/timerconflict.c index 1920a9c..2aaef7a 100644 --- a/timerconflict.c +++ b/timerconflict.c @@ -16,12 +16,11 @@ cTVGuideTimerConflict::cTVGuideTimerConflict(void) { } cTVGuideTimerConflict::~cTVGuideTimerConflict(void) { - } bool cTVGuideTimerConflict::timerInvolved(int involvedID) { int numConflicts = timerIDs.size(); - for (int i=0; i<numConflicts; i++) { + for (int i = 0; i < numConflicts; i++) { if (timerIDs[i] == involvedID) return true; } @@ -44,13 +43,12 @@ cTVGuideTimerConflicts::~cTVGuideTimerConflicts(void) { } void cTVGuideTimerConflicts::AddConflict(std::string epgSearchConflictLine) { - /* TIMERCONFLICT FORMAT: + /* TIMERCONFLICT FORMAT: The result list looks like this for example when we have 2 timer conflicts at one time: 1190232780:152|30|50#152#45:45|10|50#152#45 '1190232780' is the time of the conflict in seconds since 1970-01-01. It's followed by list of timers that have a conflict at this time: - '152|30|50#1 int editTimer(cTimer *timer, bool active, int prio, int start, int stop); - 52#45' is the description of the first conflicting timer. Here: + '152|30|50#152#45' is the description of the first conflicting timer. Here: '152' is VDR's timer id of this timer as returned from VDR's LSTT command '30' is the percentage of recording that would be done (0...100) '50#152#45' is the list of concurrent timers at this conflict @@ -90,7 +88,7 @@ void cTVGuideTimerConflicts::CalculateConflicts(void) { const cTimers* timers = &Timers; #endif for (int j=0; j < numTimers; j++) { - const cTimer *timer = timers->Get(conflicts[i]->timerIDs[j]); + const cTimer *timer = timers->GetById(conflicts[i]->timerIDs[j] + 1); if (timer) { if (!unionSet) { unionSet = new cTimeInterval(timer->StartTime(), timer->StopTime()); @@ -109,7 +107,7 @@ void cTVGuideTimerConflicts::CalculateConflicts(void) { cTimeInterval *intersect = NULL; for (int j=0; j < numTimers; j++) { - const cTimer *timer = timers->Get(conflicts[i]->timerIDs[j]); + const cTimer *timer = timers->GetById(conflicts[i]->timerIDs[j] + 1); if (timer) { if (!intersect) { intersect = new cTimeInterval(timer->StartTime(), timer->StopTime()); @@ -152,7 +150,7 @@ int cTVGuideTimerConflicts::GetCurrentConflictTimerID(int timerIndex) { int cTVGuideTimerConflicts::GetCorrespondingConflict(int timerID) { int conflictIndex = -1; if (numConflicts > 0) { - for (int i=0; i<numConflicts; i++) { + for (int i = 0; i < numConflicts; i++) { if (conflicts[i]->timerInvolved(timerID)) { conflictIndex = i; break; @@ -172,7 +170,7 @@ cTVGuideTimerConflict *cTVGuideTimerConflicts::GetConflict(int conflictIndex) { std::vector<cTVGuideTimerConflict*> cTVGuideTimerConflicts::GetConflictsBetween(time_t start, time_t stop) { std::vector<cTVGuideTimerConflict*> conflictsFound; - for (int i=0; i < numConflicts; i++) { + for (int i = 0; i < numConflicts; i++) { if ((conflicts[i]->timeStart > start) && (conflicts[i]->timeStart < stop)|| (conflicts[i]->timeStop > start) && (conflicts[i]->timeStop < stop)) conflictsFound.push_back(conflicts[i]); |