mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 13:01:48 +00:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
240cbe87e0 | ||
|
ee68d2eb2f | ||
|
eb3a4113be | ||
|
7ec89bf12b | ||
|
f653594c4a | ||
|
8129d116fb | ||
|
874f5cd9d5 |
9
HISTORY
9
HISTORY
@@ -256,3 +256,12 @@ Version 1.2.17
|
||||
- Final fix for utf8 CutText
|
||||
- Fixed a remote timer problem
|
||||
- Add episode to manual timer
|
||||
|
||||
Version 1.3.0
|
||||
|
||||
- last version with <VDR-2.3.1 compatibility
|
||||
- Fixed a possible seqfault in DisplayTimerConflict
|
||||
- Show numTimersToday in timeline
|
||||
- Fixed stopIndex in cRecMenu::JumpBegin
|
||||
- Fixed horizontal alignment in timeline
|
||||
- Fixed messages in DisplayTimerConflict
|
||||
|
@@ -130,7 +130,7 @@ cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) {
|
||||
isyslog("timer %s added (active)", *timer->ToDescr());
|
||||
#endif
|
||||
}
|
||||
return timer;
|
||||
return timers->GetTimer(timer);
|
||||
}
|
||||
|
||||
cTimer *cRecManager::createRemoteTimer(const cEvent *event, std::string path) {
|
||||
@@ -280,10 +280,11 @@ void cRecManager::SaveTimer(const cTimer *t, cTimer *newTimerSettings) {
|
||||
esyslog(tr("tvguide: RemoteTimerModifications failed"));
|
||||
}
|
||||
}
|
||||
cTimer *timer = timers->GetTimer(t);
|
||||
#else
|
||||
cTimers* timers = &Timers;
|
||||
cTimer *timer = timers->GetTimer((cTimer *)t);
|
||||
#endif
|
||||
cTimer *timer = timers->GetTimer(t);
|
||||
if (!timer) {
|
||||
return;
|
||||
}
|
||||
@@ -317,11 +318,7 @@ void cRecManager::SaveTimer(const cTimer *t, cTimer *newTimerSettings) {
|
||||
rt.timer = NULL;
|
||||
RefreshRemoteTimers();
|
||||
} else {
|
||||
#if VDRVERSNUM >= 20301
|
||||
timers->SetModified();
|
||||
#else
|
||||
timers.SetModified();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -441,7 +441,7 @@ void cRecMenu::JumpBegin(void) {
|
||||
CreatePixmap();
|
||||
Arrange(false);
|
||||
startIndex = 0;
|
||||
stopIndex = numItems - 1;
|
||||
stopIndex = currentItem;
|
||||
cRecMenuItem *first = menuItems.front();
|
||||
first->setActive();
|
||||
first->setBackground();
|
||||
@@ -589,10 +589,14 @@ void cRecMenu::UpdateActiveMenuItem(void) {
|
||||
|
||||
|
||||
void cRecMenu::DrawScrollBar(void) {
|
||||
if (!pixmapScrollBar)
|
||||
return;
|
||||
pixmapScrollBar->Fill(theme.Color(clrBorder));
|
||||
pixmapScrollBar->DrawRectangle(cRect(2,2,pixmapScrollBar->ViewPort().Width()-4, pixmapScrollBar->ViewPort().Height() - 4), theme.Color(clrBackground));
|
||||
|
||||
int totalNumItems = GetTotalNumMenuItems();
|
||||
if (!totalNumItems)
|
||||
return;
|
||||
if (imgScrollBar == NULL) {
|
||||
int scrollBarImgHeight = (pixmapScrollBar->ViewPort().Height() - 8) * numItems / totalNumItems;
|
||||
imgScrollBar = createScrollbar(pixmapScrollBar->ViewPort().Width()-8, scrollBarImgHeight, theme.Color(clrHighlight), theme.Color(clrHighlightBlending));
|
||||
|
@@ -1548,6 +1548,7 @@ cRecMenuItemTimer::cRecMenuItemTimer(const cTimer *timer,
|
||||
this->overlapStop = overlapStop;
|
||||
this->active = active;
|
||||
height = 3 * font->Height();
|
||||
pixmapStatus = NULL;
|
||||
pixmapIcons = NULL;
|
||||
}
|
||||
|
||||
@@ -1585,6 +1586,8 @@ void cRecMenuItemTimer::Show(void) {
|
||||
}
|
||||
|
||||
void cRecMenuItemTimer::Draw(void) {
|
||||
if (!timer)
|
||||
return;
|
||||
const cChannel *channel = timer->Channel();
|
||||
int channelTransponder = 0;
|
||||
cString channelName = "";
|
||||
@@ -1740,8 +1743,13 @@ cRecMenuItemTimerConflictHeader::~cRecMenuItemTimerConflictHeader(void) {
|
||||
}
|
||||
|
||||
void cRecMenuItemTimerConflictHeader::SetPixmaps(void) {
|
||||
pixmap = osdManager.requestPixmap(4, cRect(x, y, width, height));
|
||||
pixmapStatus = osdManager.requestPixmap(5, cRect(x, y, width, height));
|
||||
if (!pixmap) {
|
||||
pixmap = osdManager.requestPixmap(4, cRect(x, y, width, height));
|
||||
pixmapStatus = osdManager.requestPixmap(5, cRect(x, y, width, height));
|
||||
} else {
|
||||
pixmap->SetViewPort(cRect(x, y, width, height));
|
||||
pixmapStatus->SetViewPort(cRect(x, y, width, height));
|
||||
}
|
||||
pixmapStatus->Fill(clrTransparent);
|
||||
}
|
||||
|
||||
@@ -2304,13 +2312,14 @@ void cRecMenuItemRecording::Show(void) {
|
||||
}
|
||||
|
||||
// --- cRecMenuItemTimelineHeader -------------------------------------------------------
|
||||
cRecMenuItemTimelineHeader::cRecMenuItemTimelineHeader(time_t day, std::vector<cTVGuideTimerConflict*> conflictsToday) {
|
||||
cRecMenuItemTimelineHeader::cRecMenuItemTimelineHeader(time_t day, int numTimersToday, std::vector<cTVGuideTimerConflict*> conflictsToday) {
|
||||
conflicts = conflictsToday;
|
||||
pixmapTimeline = NULL;
|
||||
pixmapTimerInfo = NULL;
|
||||
pixmapTimerConflicts = NULL;
|
||||
timer = NULL;
|
||||
this->day = day;
|
||||
this->numTimersToday = numTimersToday;
|
||||
selectable = false;
|
||||
active = false;
|
||||
height = 5 * font->Height();
|
||||
@@ -2359,7 +2368,7 @@ void cRecMenuItemTimelineHeader::Draw(void) {
|
||||
}
|
||||
DrawTimerConflicts();
|
||||
pixmap->Fill(clrTransparent);
|
||||
cString headerText = tr("Timers for");
|
||||
cString headerText = cString::sprintf("%i %s", numTimersToday, tr("Timers for"));
|
||||
cString dateText = DateString(day);
|
||||
cString header = cString::sprintf("%s: %s", *headerText, *dateText);
|
||||
int xText = (width - fontLarge->Width(*header)) / 2;
|
||||
@@ -2421,7 +2430,7 @@ void cRecMenuItemTimelineHeader::DrawTimeline(void) {
|
||||
pixmapTimeline->Fill(clrTransparent);
|
||||
width5Mins = (float)width * 5.0 / 24.0 / 60.0;
|
||||
int widthHour = 12 * width5Mins;
|
||||
x0 = (width - 24*widthHour)/2;
|
||||
x0 = (width - (24 * widthHour)) / 2;
|
||||
int barHeight = fontSmall->Height();
|
||||
int y = height - barHeight;
|
||||
tColor col1 = theme.Color(clrTimeline1);
|
||||
@@ -2526,7 +2535,8 @@ void cRecMenuItemTimelineTimer::SetPixmaps(void) {
|
||||
|
||||
}
|
||||
width5Mins = (float)width * 5.0 / 24.0 / 60.0;
|
||||
x0 = (width - 24*12*width5Mins)/2;
|
||||
int widthHour = 12 * width5Mins;
|
||||
x0 = (width - (24 * widthHour)) / 2;
|
||||
}
|
||||
|
||||
void cRecMenuItemTimelineTimer::Draw(void) {
|
||||
|
@@ -573,19 +573,21 @@ private:
|
||||
cPixmap *pixmapTimeline;
|
||||
cPixmap *pixmapTimerInfo;
|
||||
cPixmap *pixmapTimerConflicts;
|
||||
int width5Mins;
|
||||
float width5Mins;
|
||||
int x0;
|
||||
int numTimersToday;
|
||||
bool timelineDrawn;
|
||||
void DrawTimeline(void);
|
||||
void DrawTimerConflicts(void);
|
||||
void DrawCurrentTimer(void);
|
||||
public:
|
||||
cRecMenuItemTimelineHeader(time_t day, std::vector<cTVGuideTimerConflict*> conflictsToday);
|
||||
cRecMenuItemTimelineHeader(time_t day, int numTimersToday, std::vector<cTVGuideTimerConflict*> conflictsToday);
|
||||
virtual ~cRecMenuItemTimelineHeader(void);
|
||||
void SetDay(time_t day) { this->day = day; };
|
||||
void SetPixmaps(void);
|
||||
void SetCurrentTimer(const cTimer *timer) { this->timer = timer; };
|
||||
void UnsetCurrentTimer(void) { timer = NULL; };
|
||||
void SetNumTimersToday(int numTimersToday) { this->numTimersToday = numTimersToday; };
|
||||
void RefreshTimerDisplay(void);
|
||||
void Hide(void);
|
||||
void Show(void);
|
||||
@@ -601,7 +603,7 @@ private:
|
||||
cPixmap *pixmapTimerConflicts;
|
||||
cRecMenuItemTimelineHeader *header;
|
||||
int x0;
|
||||
int width5Mins;
|
||||
float width5Mins;
|
||||
time_t start;
|
||||
time_t stop;
|
||||
void DrawBackground(void);
|
||||
|
60
recmenus.c
60
recmenus.c
@@ -194,8 +194,9 @@ cRecMenuAskDeleteTimer::cRecMenuAskDeleteTimer(const cEvent *event) {
|
||||
|
||||
// --- cRecMenuTimerConflicts ---------------------------------------------------------
|
||||
cRecMenuTimerConflicts::cRecMenuTimerConflicts(cTVGuideTimerConflicts *conflicts) {
|
||||
int numConflicts = conflicts->NumConflicts();
|
||||
|
||||
SetWidthPercent(50);
|
||||
|
||||
int numConflicts = (conflicts) ? conflicts->NumConflicts() : 0;
|
||||
cString text;
|
||||
if (numConflicts == 1) {
|
||||
text = cString::sprintf("%s %s %s", tr("One"), tr("Timer Conflict"), tr("detected"));
|
||||
@@ -230,19 +231,21 @@ int cRecMenuTimerConflicts::GetTimerConflict(void) {
|
||||
}
|
||||
|
||||
// --- cRecMenuTimerConflict ---------------------------------------------------------
|
||||
cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict) {
|
||||
cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict, eRecMenuState nextAction) {
|
||||
SetWidthPercent(95);
|
||||
this->conflict = conflict;
|
||||
SetHeader(new cRecMenuItemTimerConflictHeader(conflict->timeStart,
|
||||
conflict->timeStop,
|
||||
conflict->overlapStart,
|
||||
totalNumMenuItems = (int)conflict->timerIDs.size();
|
||||
|
||||
SetHeader(new cRecMenuItemTimerConflictHeader(conflict->timeStart,
|
||||
conflict->timeStop,
|
||||
conflict->overlapStart,
|
||||
conflict->overlapStop));
|
||||
SetFooter(new cRecMenuItemButton(tr("Ignore Conflict"), rmsIgnoreTimerConflict, false, true));
|
||||
SetFooter(new cRecMenuItemButton(tr("Ignore Conflict"), nextAction, false, true));
|
||||
int i=0;
|
||||
for(std::vector<int>::iterator it = conflict->timerIDs.begin(); it != conflict->timerIDs.end(); it++) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimer *timer = Timers->Get(*it);
|
||||
const cTimer *timer = Timers->GetById(*it + 1);
|
||||
#else
|
||||
const cTimer *timer = Timers.Get(*it);
|
||||
#endif
|
||||
@@ -268,7 +271,7 @@ cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict) {
|
||||
}
|
||||
|
||||
cRecMenuItem *cRecMenuTimerConflict::GetMenuItem(int number) {
|
||||
if ((number >= 0) && (number < (int)conflict->timerIDs.size())) {
|
||||
if ((number >= 0) && (number < totalNumMenuItems)) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimer *timer = Timers->Get(conflict->timerIDs[number]);
|
||||
@@ -290,8 +293,8 @@ cRecMenuItem *cRecMenuTimerConflict::GetMenuItem(int number) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int cRecMenuTimerConflict::GetTotalNumMenuItems(void) {
|
||||
return conflict->timerIDs.size();
|
||||
int cRecMenuTimerConflict::GetTotalNumMenuItems(void) {
|
||||
return totalNumMenuItems;
|
||||
}
|
||||
|
||||
int cRecMenuTimerConflict::GetTimerConflictIndex(void) {
|
||||
@@ -1410,8 +1413,8 @@ cRecMenuTimeline::cRecMenuTimeline(cTVGuideTimerConflicts *timerConflicts) {
|
||||
SetStartStop();
|
||||
conflictsToday = timerConflicts->GetConflictsBetween(timeStart, timeStop);
|
||||
GetTimersForDay();
|
||||
SetWidthPercent(95);
|
||||
header = new cRecMenuItemTimelineHeader(timeStart, conflictsToday);
|
||||
SetWidthPercent(90);
|
||||
header = new cRecMenuItemTimelineHeader(timeStart, numTimersToday, conflictsToday);
|
||||
SetHeader(header);
|
||||
cRecMenuItem *footer = new cRecMenuItemButton(tr("Close"), rmsClose, false, true);
|
||||
SetFooter(footer);
|
||||
@@ -1432,9 +1435,6 @@ void cRecMenuTimeline::GetTimersForDay(void) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimers* timers = Timers;
|
||||
#else
|
||||
const cTimers* timers = &Timers;
|
||||
#endif
|
||||
cSortedTimers SortedTimers(timers);
|
||||
int i = 0;
|
||||
while (i < SortedTimers.Size()) {
|
||||
@@ -1445,17 +1445,29 @@ void cRecMenuTimeline::GetTimersForDay(void) {
|
||||
}
|
||||
i++;
|
||||
}
|
||||
#else
|
||||
for (const cTimer *t = Timers.First(); t; t = Timers.Next(t)) {
|
||||
if (((t->StartTime() > timeStart) && (t->StartTime() <= timeStop)) || ((t->StopTime() > timeStart) && (t->StopTime() <= timeStop))) {
|
||||
timersToday.push_back(t);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
numTimersToday = timersToday.size();
|
||||
}
|
||||
|
||||
void cRecMenuTimeline::SetTimers(void) {
|
||||
ClearMenu();
|
||||
GetTimersForDay();
|
||||
conflictsToday = timerConflicts->GetConflictsBetween(timeStart, timeStop);
|
||||
header->UnsetCurrentTimer();
|
||||
header->SetDay(timeStart);
|
||||
header->RefreshTimerDisplay();
|
||||
header->SetNumTimersToday(numTimersToday);
|
||||
if (numTimersToday == 0) {
|
||||
AddMenuItem(new cRecMenuItemTimelineTimer(NULL, 0, 0, conflictsToday, header, false));
|
||||
header->UnsetCurrentTimer();
|
||||
footer->setActive();
|
||||
} else {
|
||||
for (int i=0; i<numTimersToday; i++) {
|
||||
for (int i = 0; i<numTimersToday; i++) {
|
||||
cRecMenuItemTimelineTimer *item = new cRecMenuItemTimelineTimer(timersToday[i], timeStart, timeStop, conflictsToday, header, false);
|
||||
if (i==0)
|
||||
item->setActive();
|
||||
@@ -1474,12 +1486,6 @@ void cRecMenuTimeline::PrevDay(void) {
|
||||
return;
|
||||
timeStart -= 3600*24;
|
||||
timeStop -= 3600*24;
|
||||
conflictsToday = timerConflicts->GetConflictsBetween(timeStart, timeStop);
|
||||
SetWidthPercent(95);
|
||||
header->SetDay(timeStart);
|
||||
header->UnsetCurrentTimer();
|
||||
header->RefreshTimerDisplay();
|
||||
GetTimersForDay();
|
||||
SetTimers();
|
||||
Display();
|
||||
}
|
||||
@@ -1487,12 +1493,6 @@ void cRecMenuTimeline::PrevDay(void) {
|
||||
void cRecMenuTimeline::NextDay(void) {
|
||||
timeStart += 3600*24;
|
||||
timeStop += 3600*24;
|
||||
conflictsToday = timerConflicts->GetConflictsBetween(timeStart, timeStop);
|
||||
SetWidthPercent(95);
|
||||
header->SetDay(timeStart);
|
||||
header->UnsetCurrentTimer();
|
||||
header->RefreshTimerDisplay();
|
||||
GetTimersForDay();
|
||||
SetTimers();
|
||||
Display();
|
||||
}
|
||||
|
@@ -77,11 +77,12 @@ public:
|
||||
class cRecMenuTimerConflict: public cRecMenu {
|
||||
private:
|
||||
cTVGuideTimerConflict *conflict;
|
||||
int totalNumMenuItems;
|
||||
public:
|
||||
cRecMenuTimerConflict(cTVGuideTimerConflict *conflict);
|
||||
cRecMenuTimerConflict(cTVGuideTimerConflict *conflict, eRecMenuState nextAction = rmsClose);
|
||||
virtual ~cRecMenuTimerConflict(void) {};
|
||||
cRecMenuItem *GetMenuItem(int number);
|
||||
int GetTotalNumMenuItems(void);
|
||||
virtual ~cRecMenuTimerConflict(void) {};
|
||||
int GetTimerConflictIndex(void);
|
||||
};
|
||||
|
||||
|
@@ -93,16 +93,18 @@ void cRecMenuView::DisplaySearchTimerList(void) {
|
||||
}
|
||||
|
||||
bool cRecMenuView::DisplayTimerConflict(const cTimer *timer) {
|
||||
int timerID = 0;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
for (const cTimer *t = Timers->First(); t; t = Timers->Next(t)) {
|
||||
if (t == timer)
|
||||
return DisplayTimerConflict(timer->Id() - 1);
|
||||
#else
|
||||
int timerID = 0;
|
||||
for (const cTimer *t = Timers.First(); t; t = Timers.Next(t)) {
|
||||
#endif
|
||||
if (t == timer)
|
||||
return DisplayTimerConflict(timerID);
|
||||
timerID++;
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -119,7 +121,7 @@ bool cRecMenuView::DisplayTimerConflict(int timerID) {
|
||||
cTVGuideTimerConflict *conflict = timerConflicts->GetCurrentConflict();
|
||||
if (!conflict)
|
||||
return false;
|
||||
activeMenu = new cRecMenuTimerConflict(conflict);
|
||||
activeMenu = new cRecMenuTimerConflict(conflict, rmsIgnoreTimerConflict);
|
||||
activeMenu->Display();
|
||||
return true;
|
||||
}
|
||||
@@ -229,10 +231,10 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
|
||||
if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) {
|
||||
timerIndex = menu->GetTimerConflictIndex();
|
||||
} else break;
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex) + 1;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimer *t = Timers->Get(timerID);
|
||||
const cTimer *t = Timers->GetById(timerID);
|
||||
#else
|
||||
const cTimer *t = Timers.Get(timerID);
|
||||
#endif
|
||||
@@ -250,20 +252,24 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
|
||||
if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) {
|
||||
timerIndex = menu->GetTimerConflictIndex();
|
||||
} else break;
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
|
||||
const cTimers* timers;
|
||||
const cEvent *event;
|
||||
#if VDRVERSNUM >= 20301
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex) + 1;
|
||||
{
|
||||
LOCK_TIMERS_READ;
|
||||
timers = Timers;
|
||||
}
|
||||
event = timers->GetById(timerID)->Event();
|
||||
#else
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
|
||||
timers = &Timers;
|
||||
event = timers->Get(timerID)->Event();
|
||||
#endif
|
||||
recManager->DeleteTimer(timers->Get(timerID)->Event());
|
||||
recManager->DeleteTimer(event); // (timerID);
|
||||
delete activeMenu;
|
||||
if (!DisplayTimerConflict(timerID)) {
|
||||
activeMenu = new cRecMenuConfirmTimer(timers->Get(timerID)->Event());
|
||||
activeMenu = new cRecMenuConfirmDeleteTimer(event);
|
||||
activeMenu->Display();
|
||||
}
|
||||
break; }
|
||||
@@ -274,10 +280,10 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
|
||||
if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) {
|
||||
timerIndex = menu->GetTimerConflictIndex();
|
||||
} else break;
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex) + 1;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimer *timer = Timers->Get(timerID);
|
||||
const cTimer *timer = Timers->GetById(timerID);
|
||||
#else
|
||||
const cTimer *timer = Timers.Get(timerID);
|
||||
#endif
|
||||
@@ -648,7 +654,7 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
|
||||
} else break;
|
||||
timerConflicts->SetCurrentConflict(timerConflict);
|
||||
delete activeMenu;
|
||||
activeMenu = new cRecMenuTimerConflict(timerConflicts->GetCurrentConflict());
|
||||
activeMenu = new cRecMenuTimerConflict(timerConflicts->GetCurrentConflict(), rmsTimerConflicts);
|
||||
activeMenu->Display();
|
||||
break; }
|
||||
case rmsSearchRerunsTimerConflictMenu: {
|
||||
@@ -660,10 +666,10 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
|
||||
if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) {
|
||||
timerConflict = menu->GetTimerConflictIndex();
|
||||
} else break;
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerConflict);
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerConflict) + 1;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimer *timer = Timers->Get(timerID);
|
||||
const cTimer *timer = Timers->GetById(timerID);
|
||||
#else
|
||||
cTimer *timer = Timers.Get(timerID);
|
||||
#endif
|
||||
|
@@ -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
|
||||
@@ -86,11 +84,13 @@ void cTVGuideTimerConflicts::CalculateConflicts(void) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimers* timers = Timers;
|
||||
for (int j=0; j < numTimers; j++) {
|
||||
const cTimer *timer = timers->GetById(conflicts[i]->timerIDs[j] + 1);
|
||||
#else
|
||||
const cTimers* timers = &Timers;
|
||||
#endif
|
||||
for (int j=0; j < numTimers; j++) {
|
||||
const cTimer *timer = timers->Get(conflicts[i]->timerIDs[j]);
|
||||
#endif
|
||||
if (timer) {
|
||||
if (!unionSet) {
|
||||
unionSet = new cTimeInterval(timer->StartTime(), timer->StopTime());
|
||||
@@ -109,7 +109,11 @@ void cTVGuideTimerConflicts::CalculateConflicts(void) {
|
||||
|
||||
cTimeInterval *intersect = NULL;
|
||||
for (int j=0; j < numTimers; j++) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
const cTimer *timer = timers->GetById(conflicts[i]->timerIDs[j] + 1);
|
||||
#else
|
||||
const cTimer *timer = timers->Get(conflicts[i]->timerIDs[j]);
|
||||
#endif
|
||||
if (timer) {
|
||||
if (!intersect) {
|
||||
intersect = new cTimeInterval(timer->StartTime(), timer->StopTime());
|
||||
@@ -152,7 +156,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 +176,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]);
|
||||
|
Reference in New Issue
Block a user