summaryrefslogtreecommitdiff
path: root/epg.c
diff options
context:
space:
mode:
Diffstat (limited to 'epg.c')
-rw-r--r--epg.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/epg.c b/epg.c
index c93594d5..28d8c1d2 100644
--- a/epg.c
+++ b/epg.c
@@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
*
- * $Id: epg.c 1.17 2004/03/13 12:41:24 kls Exp $
+ * $Id: epg.c 1.18 2004/03/13 15:01:05 kls Exp $
*/
#include "epg.h"
@@ -61,8 +61,11 @@ void cEvent::SetVersion(uchar Version)
version = Version;
}
-void cEvent::SetRunningStatus(int RunningStatus)
+void cEvent::SetRunningStatus(int RunningStatus, cChannel *Channel)
{
+ if (Channel && runningStatus != RunningStatus && (RunningStatus > SI::RunningStatusNotRunning || runningStatus > SI::RunningStatusUndefined))
+ if (Channel->Number() <= 30)//XXX maybe log only those that have timers???
+ isyslog("channel %d (%s) event %s '%s' status %d", Channel->Number(), Channel->Name(), GetTimeString(), Title(), RunningStatus);
runningStatus = RunningStatus;
}
@@ -471,6 +474,7 @@ void cEvent::FixEpgBugs(void)
cSchedule::cSchedule(tChannelID ChannelID)
{
channelID = ChannelID;
+ hasRunning = false;;
}
cEvent *cSchedule::AddEvent(cEvent *Event)
@@ -534,15 +538,26 @@ const cEvent *cSchedule::GetEventAround(time_t Time) const
void cSchedule::SetRunningStatus(cEvent *Event, int RunningStatus, cChannel *Channel)
{
for (cEvent *p = events.First(); p; p = events.Next(p)) {
- if (p == Event) {
- if (Channel && p->RunningStatus() != RunningStatus && (RunningStatus > SI::RunningStatusNotRunning || p->RunningStatus() > SI::RunningStatusUndefined))
- if (Channel->Number() <= 30)//XXX maybe log only those that have timers???
- isyslog("channel %d (%s) event %s '%s' status %d", Channel->Number(), Channel->Name(), Event->GetTimeString(), Event->Title(), RunningStatus);
- p->SetRunningStatus(RunningStatus);
- }
+ if (p == Event)
+ p->SetRunningStatus(RunningStatus, Channel);
else if (RunningStatus >= SI::RunningStatusPausing && p->RunningStatus() > SI::RunningStatusNotRunning)
p->SetRunningStatus(SI::RunningStatusNotRunning);
}
+ if (RunningStatus >= SI::RunningStatusPausing)
+ hasRunning = true;
+}
+
+void cSchedule::ClrRunningStatus(cChannel *Channel)
+{
+ if (hasRunning) {
+ for (cEvent *p = events.First(); p; p = events.Next(p)) {
+ if (p->RunningStatus() >= SI::RunningStatusPausing) {
+ p->SetRunningStatus(SI::RunningStatusNotRunning, Channel);
+ hasRunning = false;
+ break;
+ }
+ }
+ }
}
void cSchedule::ResetVersions(void)