summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--channelcolumn.c32
-rw-r--r--epggrid.c15
-rw-r--r--recmanager.c16
-rw-r--r--tvguideosd.c14
4 files changed, 30 insertions, 47 deletions
diff --git a/channelcolumn.c b/channelcolumn.c
index 459411d..94cb802 100644
--- a/channelcolumn.c
+++ b/channelcolumn.c
@@ -5,21 +5,11 @@ cChannelColumn::cChannelColumn(int num, const cChannel *channel, cMyTime *myTime
this->channel = channel;
this->num = num;
this->myTime = myTime;
-#if VDRVERSNUM >= 20301
- hasTimer = false;
- const cSchedule *Schedule = NULL;
- LOCK_SCHEDULES_READ;
- const cSchedules* schedules = Schedules;
- if (schedules) {
- Schedule = schedules->GetSchedule(channel);
- hasTimer = Schedule ? Schedule->HasTimer() : false;
- }
-#else
+#if VDRVERSNUM < 20301
hasTimer = channel->HasTimer();
#endif
hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);
-#if VDRVERSNUM >= 20301
-#else
+#if VDRVERSNUM < 20301
schedulesLock = new cSchedulesLock(false, 100);
#endif
header = NULL;
@@ -29,8 +19,7 @@ cChannelColumn::~cChannelColumn(void) {
if (header)
delete header;
grids.Clear();
-#if VDRVERSNUM >= 20301
-#else
+#if VDRVERSNUM < 20301
delete schedulesLock;
#endif
}
@@ -383,25 +372,14 @@ cGrid *cChannelColumn::addDummyGrid(time_t start, time_t end, cGrid *firstGrid,
}
void cChannelColumn::SetTimers() {
-#if VDRVERSNUM >= 20301
- hasTimer = false;
- const cSchedule *Schedule = NULL;
- {
- LOCK_SCHEDULES_READ;
- const cSchedules* schedules = Schedules;
- if (schedules) {
- Schedule = schedules->GetSchedule(channel);
- hasTimer = Schedule ? Schedule->HasTimer() : false;
- }
- }
-#else
+#if VDRVERSNUM < 20301
hasTimer = channel->HasTimer();
#endif
hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);
for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) {
bool gridHadTimer = grid->HasTimer();
grid->SetTimer();
- if (gridHadTimer != grid->HasTimer())
+ if (gridHadTimer || gridHadTimer != grid->HasTimer())
grid->SetDirty();
bool gridHadSwitchTimer = grid->HasSwitchTimer();
grid->SetSwitchTimer();
diff --git a/epggrid.c b/epggrid.c
index 9236ac0..d3eb3bb 100644
--- a/epggrid.c
+++ b/epggrid.c
@@ -62,22 +62,23 @@ void cEpgGrid::PositionPixmap() {
}
void cEpgGrid::SetTimer() {
+ hasTimer = false;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
RemoteTimers_Event_v1_0 rt;
rt.event = event;
if (pRemoteTimers->Service("RemoteTimers::GetTimerByEvent-v1.0", &rt))
hasTimer = true;
- else
- hasTimer = false;
-#if VDRVERSNUM >= 30400
- } else if (event->HasTimer()) {
- hasTimer = true;
+#if VDRVERSNUM >= 20301
+ } else {
+ eTimerMatch TimerMatch = tmNone;
+ LOCK_TIMERS_READ;
+ const cTimers *timers = Timers;
+ if (timers->GetMatch(event, &TimerMatch) && (TimerMatch == tmFull))
+ hasTimer = true;
#else
} else if (column->HasTimer()) {
hasTimer = event->HasTimer();
#endif
- } else {
- hasTimer = false;
}
}
diff --git a/recmanager.c b/recmanager.c
index 45df7b1..015b654 100644
--- a/recmanager.c
+++ b/recmanager.c
@@ -50,9 +50,17 @@ bool cRecManager::CheckEventForTimer(const cEvent *event) {
pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch);
if (rtMatch.timerMatch == tmFull)
hasTimer = true;
- } else
+ } else {
+#if VDRVERSNUM >= 20301
+ eTimerMatch TimerMatch = tmNone;
+ LOCK_TIMERS_READ;
+ const cTimers *timers = Timers;
+ if (timers->GetMatch(event, &TimerMatch) && (TimerMatch == tmFull))
+ hasTimer = true;
+#else
hasTimer = event->HasTimer();
-
+#endif
+ }
return hasTimer;
}
@@ -175,7 +183,6 @@ void cRecManager::SetTimerPath(cTimer *timer, const cEvent *event, std::string p
}
void cRecManager::DeleteTimer(int timerID) {
- dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
#if VDRVERSNUM >= 20301
cTimer *t;
{
@@ -191,7 +198,6 @@ void cRecManager::DeleteTimer(int timerID) {
}
void cRecManager::DeleteTimer(const cEvent *event) {
- dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
if (!event)
return;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
@@ -202,7 +208,6 @@ void cRecManager::DeleteTimer(const cEvent *event) {
}
void cRecManager::DeleteLocalTimer(const cEvent *event) {
- dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
const cTimer *t;
#if VDRVERSNUM >= 20301
{
@@ -218,7 +223,6 @@ void cRecManager::DeleteLocalTimer(const cEvent *event) {
}
void cRecManager::DeleteTimer(const cTimer *timer) {
- dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
#if VDRVERSNUM >= 20301
LOCK_TIMERS_WRITE;
cTimers* timers = Timers;
diff --git a/tvguideosd.c b/tvguideosd.c
index e5afc0e..bd3b812 100644
--- a/tvguideosd.c
+++ b/tvguideosd.c
@@ -139,11 +139,15 @@ void cTvGuideOsd::readChannels(const cChannel *channelStart) {
if (!channelStart)
return;
#if VDRVERSNUM >= 20301
+ const cChannels *channels;
+ {
LOCK_CHANNELS_READ;
- for (const cChannel *channel = channelStart; channel; channel = Channels->Next(channel)) {
+ channels = Channels;
+ }
#else
- for (const cChannel *channel = channelStart; channel; channel = Channels.Next(channel)) {
+ cChannels *channels = &Channels;
#endif
+ for (const cChannel *channel = channelStart; channel; channel = channels->Next(channel)) {
if (!channel->GroupSep()) {
if (channelGroups->IsInLastGroup(channel)) {
break;
@@ -165,11 +169,7 @@ void cTvGuideOsd::readChannels(const cChannel *channelStart) {
int numCurrent = columns.Count();
int numBack = tvguideConfig.numGrids - numCurrent;
int newChannelNumber = columns.First()->getChannel()->Number() - numBack;
-#if VDRVERSNUM >= 20301
- const cChannel *newStart = Channels->GetByNumber(newChannelNumber);
-#else
- const cChannel *newStart = Channels.GetByNumber(newChannelNumber);
-#endif
+ const cChannel *newStart = channels->GetByNumber(newChannelNumber);
readChannels(newStart);
}
}