mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 15:58:31 +00:00
added VDR 2.3.1 compatibility
This commit is contained in:
@@ -51,36 +51,36 @@ cArea::cArea(const cArea &other) {
|
||||
blinking = false;
|
||||
scrollFunc = NULL;
|
||||
|
||||
for (cFunction *func = other.functions.First(); func; func = other.functions.Next(func)) {
|
||||
if (cFuncFill *f = dynamic_cast<cFuncFill*>(func)) {
|
||||
for (const cFunction *func = other.functions.First(); func; func = other.functions.Next(func)) {
|
||||
if (cFuncFill *f = dynamic_cast<cFuncFill*>((cFunction*)func)) {
|
||||
cFuncFill *fFill = new cFuncFill(*f);
|
||||
fFill->SetOwner(this);
|
||||
functions.Add(fFill);
|
||||
} else if (cFuncDrawRectangle *f = dynamic_cast<cFuncDrawRectangle*>(func)) {
|
||||
} else if (cFuncDrawRectangle *f = dynamic_cast<cFuncDrawRectangle*>((cFunction*)func)) {
|
||||
cFuncDrawRectangle *fDrawRect = new cFuncDrawRectangle(*f);
|
||||
fDrawRect->SetOwner(this);
|
||||
functions.Add(fDrawRect);
|
||||
} else if (cFuncDrawEllipse *f = dynamic_cast<cFuncDrawEllipse*>(func)) {
|
||||
} else if (cFuncDrawEllipse *f = dynamic_cast<cFuncDrawEllipse*>((cFunction*)func)) {
|
||||
cFuncDrawEllipse *fDrawEllipse = new cFuncDrawEllipse(*f);
|
||||
fDrawEllipse->SetOwner(this);
|
||||
functions.Add(fDrawEllipse);
|
||||
} else if (cFuncDrawSlope *f = dynamic_cast<cFuncDrawSlope*>(func)) {
|
||||
} else if (cFuncDrawSlope *f = dynamic_cast<cFuncDrawSlope*>((cFunction*)func)) {
|
||||
cFuncDrawSlope *fDrawSlope = new cFuncDrawSlope(*f);
|
||||
fDrawSlope->SetOwner(this);
|
||||
functions.Add(fDrawSlope);
|
||||
} else if (cFuncDrawText *f = dynamic_cast<cFuncDrawText*>(func)) {
|
||||
} else if (cFuncDrawText *f = dynamic_cast<cFuncDrawText*>((cFunction*)func)) {
|
||||
cFuncDrawText *fDrawText = new cFuncDrawText(*f);
|
||||
fDrawText->SetOwner(this);
|
||||
functions.Add(fDrawText);
|
||||
} else if (cFuncDrawTextVertical *f = dynamic_cast<cFuncDrawTextVertical*>(func)) {
|
||||
} else if (cFuncDrawTextVertical *f = dynamic_cast<cFuncDrawTextVertical*>((cFunction*)func)) {
|
||||
cFuncDrawTextVertical *fDrawTextVertical = new cFuncDrawTextVertical(*f);
|
||||
fDrawTextVertical->SetOwner(this);
|
||||
functions.Add(fDrawTextVertical);
|
||||
} else if (cFuncDrawTextBox *f = dynamic_cast<cFuncDrawTextBox*>(func)) {
|
||||
} else if (cFuncDrawTextBox *f = dynamic_cast<cFuncDrawTextBox*>((cFunction*)func)) {
|
||||
cFuncDrawTextBox *fDrawTextBox = new cFuncDrawTextBox(*f);
|
||||
fDrawTextBox->SetOwner(this);
|
||||
functions.Add(fDrawTextBox);
|
||||
} else if (cFuncDrawImage *f = dynamic_cast<cFuncDrawImage*>(func)) {
|
||||
} else if (cFuncDrawImage *f = dynamic_cast<cFuncDrawImage*>((cFunction*)func)) {
|
||||
cFuncDrawImage *fDrawImage = new cFuncDrawImage(*f);
|
||||
fDrawImage->SetOwner(this);
|
||||
functions.Add(fDrawImage);
|
||||
@@ -580,7 +580,7 @@ cAreaContainer::cAreaContainer(void) {
|
||||
cAreaContainer::cAreaContainer(const cAreaContainer &other) {
|
||||
globals = other.globals;
|
||||
attribs = new cAreaContainerAttribs(*other.attribs);
|
||||
for (cArea *area = other.areas.First(); area; area = other.areas.Next(area)) {
|
||||
for (const cArea *area = other.areas.First(); area; area = other.areas.Next(area)) {
|
||||
cArea *a = new cArea(*area);
|
||||
a->SetAreaContainer(this);
|
||||
areas.Add(a);
|
||||
|
@@ -99,7 +99,7 @@ void cCond::Debug(void) {
|
||||
if (compareValue >= 0)
|
||||
esyslog("skindesigner: compare value: %d", compareValue);
|
||||
if (compareStrValue)
|
||||
esyslog("skindesigner: compare string value: %d", compareStrValue);
|
||||
esyslog("skindesigner: compare string value: %s", compareStrValue);
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
@@ -117,7 +117,7 @@ cCondition::cCondition(const cCondition &other) {
|
||||
globals = NULL;
|
||||
tokenContainer = NULL;
|
||||
loopInfo = NULL;
|
||||
for (cCond *cond = other.conds.First(); cond; cond = other.conds.Next(cond))
|
||||
for (const cCond *cond = other.conds.First(); cond; cond = other.conds.Next(cond))
|
||||
conds.Add(new cCond(*cond));
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ cSummand::cSummand(const cSummand &other) {
|
||||
if (other.summand)
|
||||
summand = strdup(other.summand);
|
||||
positive = other.positive;
|
||||
for (cFactor *fac = other.factors.First(); fac; fac = other.factors.Next(fac)) {
|
||||
for (const cFactor *fac = other.factors.First(); fac; fac = other.factors.Next(fac)) {
|
||||
factors.Add(new cFactor(*fac));
|
||||
}
|
||||
}
|
||||
@@ -490,13 +490,13 @@ void cSummand::Debug(void) {
|
||||
else if (f->type == eFactorType::looptoken)
|
||||
esyslog("skindesigner: LoopToken factor, index %d, %s", f->tokenIndex, link);
|
||||
else if (f->type == eFactorType::xref)
|
||||
esyslog("skindesigner: posx reference factor, %s, %p, %s, result: %f", f->funcRefName, f->funcRef, link, f->funcRef->FuncX());
|
||||
esyslog("skindesigner: posx reference factor, %s, %p, %s, result: %d", f->funcRefName, f->funcRef, link, f->funcRef->FuncX());
|
||||
else if (f->type == eFactorType::yref)
|
||||
esyslog("skindesigner: posy reference factor, %s, %p, %s, result: %f", f->funcRefName, f->funcRef, link, f->funcRef->FuncY());
|
||||
esyslog("skindesigner: posy reference factor, %s, %p, %s, result: %d", f->funcRefName, f->funcRef, link, f->funcRef->FuncY());
|
||||
else if (f->type == eFactorType::widthref)
|
||||
esyslog("skindesigner: width reference factor, %s, %p, %s, result: %f", f->funcRefName, f->funcRef, link, f->funcRef->FuncWidth());
|
||||
esyslog("skindesigner: width reference factor, %s, %p, %s, result: %d", f->funcRefName, f->funcRef, link, f->funcRef->FuncWidth());
|
||||
else if (f->type == eFactorType::heightref)
|
||||
esyslog("skindesigner: height reference factor, %s, %p %s, result: %f", f->funcRefName, f->funcRef, link, f->funcRef->FuncHeight());
|
||||
esyslog("skindesigner: height reference factor, %s, %p %s, result: %d", f->funcRefName, f->funcRef, link, f->funcRef->FuncHeight());
|
||||
else if (f->type == eFactorType::areawidth)
|
||||
esyslog("skindesigner: {areawidth} factor, %s", link);
|
||||
else if (f->type == eFactorType::areaheight)
|
||||
@@ -531,7 +531,7 @@ cNumericExpr::cNumericExpr(const cNumericExpr &other) {
|
||||
horizontal = other.horizontal;
|
||||
value = other.value;
|
||||
dynamic = other.dynamic;
|
||||
for (cSummand *s = other.summands.First(); s; s = other.summands.Next(s)) {
|
||||
for (const cSummand *s = other.summands.First(); s; s = other.summands.Next(s)) {
|
||||
summands.Add(new cSummand(*s));
|
||||
}
|
||||
}
|
||||
@@ -1079,7 +1079,7 @@ cTextExpr::cTextExpr(const cTextExpr &other) {
|
||||
expr = strdup(other.expr);
|
||||
tokenContainer = NULL;
|
||||
loopInfo = NULL;
|
||||
for (cTextToken* t = other.textTokens.First(); t; t = other.textTokens.Next(t)) {
|
||||
for (const cTextToken* t = other.textTokens.First(); t; t = other.textTokens.Next(t)) {
|
||||
textTokens.Add(new cTextToken(*t));
|
||||
}
|
||||
}
|
||||
|
@@ -797,10 +797,14 @@ bool cCeMenuSchedules::Parse(bool forced) {
|
||||
|
||||
if (menuCat == mcScheduleNow || menuCat == mcScheduleNext) {
|
||||
int eventsAvailable = 0;
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_SCHEDULES_READ;
|
||||
const cSchedules* schedules = Schedules;
|
||||
#else
|
||||
cSchedulesLock schedulesLock;
|
||||
const cSchedules *schedules = cSchedules::Schedules(schedulesLock);
|
||||
const cSchedule *schedule = NULL;
|
||||
schedule = schedules->GetSchedule(channel);
|
||||
const cSchedules* schedules = (cSchedules*)cSchedules::Schedules(schedulesLock);
|
||||
#endif
|
||||
const cSchedule *schedule = schedules->GetSchedule(channel);
|
||||
if (schedule) {
|
||||
for (const cEvent *e = schedule->GetPresentEvent(); e; e = schedule->Events()->Next(e)) {
|
||||
eventsAvailable++;
|
||||
@@ -917,10 +921,14 @@ bool cLeMenuChannels::Parse(bool forced) {
|
||||
}
|
||||
|
||||
//current schedule
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_SCHEDULES_READ;
|
||||
const cSchedules* schedules = Schedules;
|
||||
#else
|
||||
cSchedulesLock schedulesLock;
|
||||
const cSchedules *schedules = cSchedules::Schedules(schedulesLock);
|
||||
const cSchedule *schedule = NULL;
|
||||
schedule = schedules->GetSchedule(channel);
|
||||
const cSchedules* schedules = (cSchedules*)cSchedules::Schedules(schedulesLock);
|
||||
#endif
|
||||
const cSchedule *schedule = schedules->GetSchedule(channel);
|
||||
if (schedule) {
|
||||
const cEvent *presentEvent = schedule->GetPresentEvent();
|
||||
if (presentEvent) {
|
||||
@@ -1046,10 +1054,14 @@ bool cCeMenuChannels::Parse(bool forced) {
|
||||
tokenContainer->AddIntToken((int)eCeMenuChannelsIT::isTerr, source->IsTerr(source->Code()));
|
||||
}
|
||||
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_SCHEDULES_READ;
|
||||
const cSchedules* schedules = Schedules;
|
||||
#else
|
||||
cSchedulesLock schedulesLock;
|
||||
const cSchedules *schedules = cSchedules::Schedules(schedulesLock);
|
||||
const cSchedule *schedule = NULL;
|
||||
schedule = schedules->GetSchedule(channel);
|
||||
const cSchedules* schedules = (cSchedules*)cSchedules::Schedules(schedulesLock);
|
||||
#endif
|
||||
const cSchedule *schedule = schedules->GetSchedule(channel);
|
||||
if (schedule) {
|
||||
const cEvent *presentEvent = schedule->GetPresentEvent();
|
||||
if (presentEvent) {
|
||||
@@ -1484,7 +1496,13 @@ bool cLeMenuRecordings::Parse(bool forced) {
|
||||
cRecordingsFolderInfo::cFolderInfo *folderInfo = recFolderInfo.Get(folderName);
|
||||
delete[] folderName;
|
||||
if (folderInfo) {
|
||||
cRecording *newestRec = Recordings.GetByName(*folderInfo->LatestFileName);
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_RECORDINGS_READ;
|
||||
const cRecordings* recordings = Recordings;
|
||||
#else
|
||||
cRecordings* recordings = &Recordings;
|
||||
#endif
|
||||
const cRecording *newestRec = recordings->GetByName(*folderInfo->LatestFileName);
|
||||
if (newestRec) {
|
||||
usedRecording = newestRec;
|
||||
}
|
||||
@@ -1724,7 +1742,13 @@ bool cCeMenuRecordings::Parse(bool forced) {
|
||||
if (isFolder) {
|
||||
cRecordingsFolderInfo::cFolderInfo *folderInfo = recFolderInfo.Get(folderName.str().c_str());
|
||||
if (folderInfo) {
|
||||
cRecording *newestRec = Recordings.GetByName(*folderInfo->LatestFileName);
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_RECORDINGS_READ;
|
||||
const cRecordings* recordings = Recordings;
|
||||
#else
|
||||
cRecordings* recordings = &Recordings;
|
||||
#endif
|
||||
const cRecording *newestRec = recordings->GetByName(*folderInfo->LatestFileName);
|
||||
if (newestRec) {
|
||||
usedRecording = newestRec;
|
||||
}
|
||||
|
@@ -353,7 +353,13 @@ bool cViewDetailEpg::Parse(bool forced) {
|
||||
tokenContainer->AddIntToken((int)eDmDetailedEpgIT::year, sStartTime->tm_year + 1900);
|
||||
tokenContainer->AddIntToken((int)eDmDetailedEpgIT::daynumeric, sStartTime->tm_mday);
|
||||
tokenContainer->AddIntToken((int)eDmDetailedEpgIT::month, sStartTime->tm_mon+1);
|
||||
const cChannel *channel = Channels.GetByChannelID(event->ChannelID());
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannels* channels = Channels;
|
||||
#else
|
||||
cChannels* channels = &Channels;
|
||||
#endif
|
||||
const cChannel *channel = channels->GetByChannelID(event->ChannelID());
|
||||
if (channel) {
|
||||
tokenContainer->AddStringToken((int)eDmDetailedEpgST::channelname, channel->Name());
|
||||
tokenContainer->AddIntToken((int)eDmDetailedEpgIT::channelnumber, channel->Number());
|
||||
@@ -434,7 +440,13 @@ int cViewDetailEpg::NumReruns(cList<Epgsearch_searchresults_v1_0::cServiceSearch
|
||||
for (Epgsearch_searchresults_v1_0::cServiceSearchResult *r = reruns->First(); r && i < maxNumReruns; r = reruns->Next(r)) {
|
||||
time_t eventStart = event->StartTime();
|
||||
time_t rerunStart = r->event->StartTime();
|
||||
cChannel *channel = Channels.GetByChannelID(r->event->ChannelID(), true, true);
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannels* channels = Channels;
|
||||
#else
|
||||
cChannels* channels = &Channels;
|
||||
#endif
|
||||
const cChannel *channel = channels->GetByChannelID(r->event->ChannelID(), true, true);
|
||||
//check for identical event
|
||||
if ((event->ChannelID() == r->event->ChannelID()) && (eventStart == rerunStart))
|
||||
continue;
|
||||
@@ -463,7 +475,13 @@ void cViewDetailEpg::SetReruns(cList<Epgsearch_searchresults_v1_0::cServiceSearc
|
||||
for (Epgsearch_searchresults_v1_0::cServiceSearchResult *r = reruns->First(); r && i < maxNumReruns; r = reruns->Next(r)) {
|
||||
time_t eventStart = event->StartTime();
|
||||
time_t rerunStart = r->event->StartTime();
|
||||
cChannel *channel = Channels.GetByChannelID(r->event->ChannelID(), true, true);
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannels* channels = Channels;
|
||||
#else
|
||||
cChannels* channels = &Channels;
|
||||
#endif
|
||||
const cChannel *channel = channels->GetByChannelID(r->event->ChannelID(), true, true);
|
||||
//check for identical event
|
||||
if ((event->ChannelID() == r->event->ChannelID()) && (eventStart == rerunStart))
|
||||
continue;
|
||||
@@ -792,7 +810,13 @@ void cViewDetailRec::SetRecInfos(void) {
|
||||
|
||||
const cRecordingInfo *info = recording->Info();
|
||||
if (info) {
|
||||
cChannel *channel = Channels.GetByChannelID(info->ChannelID());
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannels* channels = Channels;
|
||||
#else
|
||||
cChannels* channels = &Channels;
|
||||
#endif
|
||||
const cChannel *channel = channels->GetByChannelID(info->ChannelID());
|
||||
if (channel) {
|
||||
tokenContainer->AddStringToken((int)eDmDetailedRecST::recchannelname, channel->Name());
|
||||
tokenContainer->AddStringToken((int)eDmDetailedRecST::recchannelid, *channel->GetChannelID().ToString());
|
||||
|
@@ -406,7 +406,12 @@ void cViewMenu::SetChannelHeader(const cEvent *event) {
|
||||
if (!event)
|
||||
return;
|
||||
if (menuChange && menuCat == mcSchedule) {
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannel *channel = Channels->GetByChannelID(event->ChannelID());
|
||||
#else
|
||||
const cChannel *channel = Channels.GetByChannelID(event->ChannelID());
|
||||
#endif
|
||||
if (channel)
|
||||
activeSubview->SetChannel(channel);
|
||||
}
|
||||
|
@@ -39,10 +39,10 @@ cViewElement::cViewElement(const cViewElement &other) {
|
||||
tokenContainer = NULL;
|
||||
attribs = new cViewElementAttribs(*other.attribs);
|
||||
|
||||
for (cAreaNode *node = other.areaNodes.First(); node; node = other.areaNodes.Next(node)) {
|
||||
if (cArea *a = dynamic_cast<cArea*>(node)) {
|
||||
for (const cAreaNode *node = other.areaNodes.First(); node; node = other.areaNodes.Next(node)) {
|
||||
if (cArea *a = dynamic_cast<cArea*>((cAreaNode*)node)) {
|
||||
areaNodes.Add(new cArea(*a));
|
||||
} else if (cAreaContainer *ac = dynamic_cast<cAreaContainer*>(node)) {
|
||||
} else if (cAreaContainer *ac = dynamic_cast<cAreaContainer*>((cAreaNode*)node)) {
|
||||
areaNodes.Add(new cAreaContainer(*ac));
|
||||
}
|
||||
}
|
||||
|
@@ -287,18 +287,27 @@ bool cVeDevices::Parse(bool forced) {
|
||||
else
|
||||
deviceLiveTV = primaryDevice->DeviceNumber();
|
||||
}
|
||||
//check currently recording devices
|
||||
for (cTimer *timer = Timers.First(); timer; timer = Timers.Next(timer)) {
|
||||
if (!timer->Recording()) {
|
||||
continue;
|
||||
}
|
||||
if (cRecordControl *RecordControl = cRecordControls::GetRecordControl(timer)) {
|
||||
const cDevice *recDevice = RecordControl->Device();
|
||||
if (recDevice) {
|
||||
mutexDevices.Lock();
|
||||
if (recDevices)
|
||||
recDevices[recDevice->DeviceNumber()] = true;
|
||||
mutexDevices.Unlock();
|
||||
// check currently recording devices
|
||||
// BLOCK for LOCK_TIMERS_READ scope !!
|
||||
{
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimers* timers = Timers;
|
||||
#else
|
||||
const cTimers* timers = &Timers;
|
||||
#endif
|
||||
for (const cTimer *timer = timers->First(); timer; timer = timers->Next(timer)) {
|
||||
if (!timer->Recording()) {
|
||||
continue;
|
||||
}
|
||||
if (cRecordControl *RecordControl = cRecordControls::GetRecordControl(timer)) {
|
||||
const cDevice *recDevice = RecordControl->Device();
|
||||
if (recDevice) {
|
||||
mutexDevices.Lock();
|
||||
if (recDevices)
|
||||
recDevices[recDevice->DeviceNumber()] = true;
|
||||
mutexDevices.Unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -91,9 +91,16 @@ void cVeDcChannelGroup::Set(const cChannel *c) {
|
||||
}
|
||||
|
||||
const char *cVeDcChannelGroup::GetChannelSep(const cChannel *c, bool prev) {
|
||||
const cChannel *sep = prev ? Channels.Prev(c) :
|
||||
Channels.Next(c);
|
||||
for (; sep; (prev)?(sep = Channels.Prev(sep)):(sep = Channels.Next(sep))) {
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannels* channels = Channels;
|
||||
#else
|
||||
const cChannels* channels = &Channels;
|
||||
#endif
|
||||
const cChannel *sep = prev ? channels->Prev(c) :
|
||||
channels->Next(c);
|
||||
|
||||
for (; sep; (prev)?(sep = channels->Prev(sep)):(sep = channels->Next(sep))) {
|
||||
if (sep->GroupSep()) {
|
||||
return sep->Name();
|
||||
}
|
||||
@@ -169,7 +176,17 @@ void cVeDcEpgInfo::Close(void) {
|
||||
|
||||
bool cVeDcEpgInfo::EventHasTimer(const cEvent *e) {
|
||||
if (!e) return false;
|
||||
cGlobalSortedTimers SortedTimers;// local and remote timers
|
||||
int timerCount = 0;
|
||||
// BLOCK for LOCK_TIMERS_READ scope !!
|
||||
{
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_TIMERS_READ;
|
||||
timerCount = Timers->Count();
|
||||
#else
|
||||
timerCount = Timers.Count();
|
||||
#endif
|
||||
}
|
||||
cGlobalSortedTimers SortedTimers(timerCount); // local and remote timers
|
||||
bool hasTimer = e->HasTimer();
|
||||
for (int i = 0; i < SortedTimers.Size() && !hasTimer; i++)
|
||||
if (const cTimer *Timer = SortedTimers[i])
|
||||
@@ -311,7 +328,17 @@ void cVeDcStatusInfo::Set(const cChannel *c) {
|
||||
bool isDolby = c->Dpid(0);
|
||||
bool isEncrypted = c->Ca();
|
||||
bool isRecording = cRecordControls::Active();
|
||||
cGlobalSortedTimers SortedTimers;// local and remote timers
|
||||
int timerCount = 0;
|
||||
// BLOCK for LOCK_TIMERS_READ scope !!
|
||||
{
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_TIMERS_READ;
|
||||
timerCount = Timers->Count();
|
||||
#else
|
||||
timerCount = Timers.Count();
|
||||
#endif
|
||||
}
|
||||
cGlobalSortedTimers SortedTimers(timerCount); // local and remote timers
|
||||
for (int i = 0; i < SortedTimers.Size() && !isRecording; i++)
|
||||
if (const cTimer *Timer = SortedTimers[i])
|
||||
if (Timer->Recording())
|
||||
|
@@ -351,9 +351,19 @@ void cVeDmTimers::SetTokenContainer(void) {
|
||||
bool cVeDmTimers::Parse(bool forced) {
|
||||
if (!cViewElement::Parse(forced))
|
||||
return false;
|
||||
|
||||
tokenContainer->Clear();
|
||||
cGlobalSortedTimers SortedTimers;// local and remote timers
|
||||
|
||||
int timerCount = 0;
|
||||
// BLOCK for LOCK_TIMERS_READ scope !!
|
||||
{
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_TIMERS_READ;
|
||||
timerCount = Timers->Count();
|
||||
#else
|
||||
timerCount = Timers.Count();
|
||||
#endif
|
||||
}
|
||||
cGlobalSortedTimers SortedTimers(timerCount); // local and remote timers
|
||||
int numTimers = SortedTimers.Size();
|
||||
tokenContainer->AddIntToken((int)eDMTimersIT::numtimers, numTimers);
|
||||
tokenContainer->AddIntToken((int)eDMTimersIT::numtimerconflicts, SortedTimers.NumTimerConfilicts());
|
||||
@@ -469,8 +479,15 @@ bool cVeDmCurrentschedule::Parse(bool forced) {
|
||||
|
||||
cDevice *device = cDevice::PrimaryDevice();
|
||||
const cChannel *channel = NULL;
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannels* channels = Channels;
|
||||
#else
|
||||
cChannels* channels = &Channels;
|
||||
#endif
|
||||
|
||||
if (!device->Replaying() || device->Transferring()) {
|
||||
channel = Channels.GetByNumber(device->CurrentChannel());
|
||||
channel = channels->GetByNumber(device->CurrentChannel());
|
||||
}
|
||||
if (channel) {
|
||||
ParseFromChannel(channel);
|
||||
@@ -489,9 +506,17 @@ bool cVeDmCurrentschedule::Parse(bool forced) {
|
||||
|
||||
void cVeDmCurrentschedule::ParseFromChannel(const cChannel *channel) {
|
||||
const cEvent *event = NULL;
|
||||
cSchedulesLock SchedulesLock;
|
||||
if (const cSchedules *Schedules = cSchedules::Schedules(SchedulesLock))
|
||||
if (const cSchedule *Schedule = Schedules->GetSchedule(channel))
|
||||
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_SCHEDULES_READ;
|
||||
const cSchedules* schedules = Schedules;
|
||||
#else
|
||||
cSchedulesLock schedulesLock;
|
||||
const cSchedules* schedules = (cSchedules*)cSchedules::Schedules(schedulesLock);
|
||||
#endif
|
||||
|
||||
if (schedules)
|
||||
if (const cSchedule *Schedule = schedules->GetSchedule(channel))
|
||||
event = Schedule->GetPresentEvent();
|
||||
if (!event)
|
||||
return;
|
||||
@@ -839,20 +864,37 @@ bool cVeDmLastrecordings::Parse(bool forced) {
|
||||
return false;
|
||||
|
||||
tokenContainer->Clear();
|
||||
cGlobalSortedTimers SortedTimers;// local and remote timers
|
||||
int numTimers = SortedTimers.Size();
|
||||
int numTimers = 0;
|
||||
// BLOCK for LOCK_TIMERS_READ scope !!
|
||||
{
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_TIMERS_READ;
|
||||
numTimers = Timers->Count();
|
||||
#else
|
||||
numTimers = Timers.Count();
|
||||
#endif
|
||||
}
|
||||
|
||||
cGlobalSortedTimers SortedTimers(numTimers); // local and remote timers
|
||||
//set number of timers so that it is possible to adapt this viewelement accordingly
|
||||
tokenContainer->AddIntToken((int)eDMLastrecordingsIT::numtimers, numTimers);
|
||||
tokenContainer->AddIntToken((int)eDMLastrecordingsIT::numtimers, SortedTimers.Size());
|
||||
|
||||
list<cRecording*> orderedRecs;
|
||||
list<const cRecording*> orderedRecs;
|
||||
|
||||
for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) {
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_RECORDINGS_READ;
|
||||
const cRecordings* recordings = Recordings;
|
||||
#else
|
||||
const cRecordings* recordings = &Recordings;
|
||||
#endif
|
||||
|
||||
for (const cRecording *recording = recordings->First(); recording; recording = recordings->Next(recording)) {
|
||||
if (orderedRecs.size() == 0) {
|
||||
orderedRecs.push_back(recording);
|
||||
continue;
|
||||
}
|
||||
bool inserted = false;
|
||||
for (list<cRecording*>::iterator it = orderedRecs.begin(); it != orderedRecs.end(); it++) {
|
||||
for (list<const cRecording*>::iterator it = orderedRecs.begin(); it != orderedRecs.end(); it++) {
|
||||
const cRecording *orderedRec = *it;
|
||||
if (recording->Start() >= orderedRec->Start()) {
|
||||
orderedRecs.insert(it, recording);
|
||||
@@ -876,7 +918,7 @@ bool cVeDmLastrecordings::Parse(bool forced) {
|
||||
tokenContainer->CreateLoopTokenContainer(&loopInfo);
|
||||
|
||||
int i = 0;
|
||||
for (list<cRecording*>::iterator it = orderedRecs.begin(); it != orderedRecs.end(); it++) {
|
||||
for (list<const cRecording*>::iterator it = orderedRecs.begin(); it != orderedRecs.end(); it++) {
|
||||
const cRecording *recording = *it;
|
||||
#if APIVERSNUM >= 20101
|
||||
if (recording->IsInUse()) {
|
||||
@@ -1000,7 +1042,13 @@ bool cVeDmDetailheaderEpg::Parse(bool forced) {
|
||||
tokenContainer->AddIntToken((int)eDmDetailedHeaderEpgIT::year, sStartTime->tm_year + 1900);
|
||||
tokenContainer->AddIntToken((int)eDmDetailedHeaderEpgIT::daynumeric, sStartTime->tm_mday);
|
||||
tokenContainer->AddIntToken((int)eDmDetailedHeaderEpgIT::month, sStartTime->tm_mon+1);
|
||||
const cChannel *channel = Channels.GetByChannelID(event->ChannelID());
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannels* channels = Channels;
|
||||
#else
|
||||
cChannels* channels = &Channels;
|
||||
#endif
|
||||
const cChannel *channel = channels->GetByChannelID(event->ChannelID());
|
||||
if (channel) {
|
||||
tokenContainer->AddStringToken((int)eDmDetailedHeaderEpgST::channelname, channel->Name());
|
||||
tokenContainer->AddIntToken((int)eDmDetailedHeaderEpgIT::channelnumber, channel->Number());
|
||||
@@ -1132,7 +1180,13 @@ bool cVeDmDetailheaderRec::Parse(bool forced) {
|
||||
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::durationeventhours, duration / 60);
|
||||
tokenContainer->AddStringToken((int)eDmDetailedHeaderRecST::durationeventminutes, *cString::sprintf("%.2d", duration%60));
|
||||
}
|
||||
cChannel *channel = Channels.GetByChannelID(info->ChannelID());
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannels* channels = Channels;
|
||||
#else
|
||||
cChannels* channels = &Channels;
|
||||
#endif
|
||||
const cChannel *channel = channels->GetByChannelID(info->ChannelID());
|
||||
if (channel) {
|
||||
tokenContainer->AddStringToken((int)eDmDetailedHeaderRecST::recchannelname, channel->Name());
|
||||
tokenContainer->AddStringToken((int)eDmDetailedHeaderRecST::recchannelid, *channel->GetChannelID().ToString());
|
||||
|
Reference in New Issue
Block a user