diff options
author | Thomas Keil <tkeil (at) datacrystal (dot) de> | 2007-01-04 14:48:29 +0000 |
---|---|---|
committer | Thomas Keil <tkeil (at) datacrystal (dot) de> | 2007-01-04 14:48:29 +0000 |
commit | 17300da7b229b3178f9f947d35eceae96846cbdd (patch) | |
tree | b7cadb747de4d425eddf68c6b210f978bde01bda /pages | |
parent | f2f66c48c389150791bd85f7828f89c8f42d844c (diff) | |
download | vdr-plugin-live-17300da7b229b3178f9f947d35eceae96846cbdd.tar.gz vdr-plugin-live-17300da7b229b3178f9f947d35eceae96846cbdd.tar.bz2 |
added Channel-Locks
Diffstat (limited to 'pages')
-rw-r--r-- | pages/whats_on_next.ecpp | 25 | ||||
-rw-r--r-- | pages/whats_on_now.ecpp | 25 |
2 files changed, 28 insertions, 22 deletions
diff --git a/pages/whats_on_next.ecpp b/pages/whats_on_next.ecpp index 22df5df..6145864 100644 --- a/pages/whats_on_next.ecpp +++ b/pages/whats_on_next.ecpp @@ -35,21 +35,24 @@ const cSchedules* Schedules = cSchedules::Schedules(schedulesLock); </div> <{ - for (cChannel *Channel = Channels.First(); Channel && Channel->Number() <= LiveSetup().GetLastChannel(); Channel = Channels.Next(Channel)) { - if (!Channel->GroupSep()) { - const cSchedule *Schedule = Schedules->GetSchedule(Channel); - if (Schedule) { - const cEvent *Event = Schedule->GetFollowingEvent(); - if (Event) { - std::string title(Event->Title() ? Event->Title() : ""); - std::string short_description(Event->ShortText() ? Event->ShortText() : ""); - std::string description(Event->Description() ? Event->Description() : ""); - std::string start(Event->StartTime() ? FormatDateTime(tr("%I:%M %p"), Event->StartTime()) : ""); - std::string end(Event->EndTime() ? FormatDateTime(tr("%I:%M %p"), Event->EndTime()) : ""); + ReadLock channelsLock( Channels ); + if (channelsLock) { + for (cChannel *Channel = Channels.First(); Channel && Channel->Number() <= LiveSetup().GetLastChannel(); Channel = Channels.Next(Channel)) { + if (!Channel->GroupSep()) { + const cSchedule *Schedule = Schedules->GetSchedule(Channel); + if (Schedule) { + const cEvent *Event = Schedule->GetFollowingEvent(); + if (Event) { + std::string title(Event->Title() ? Event->Title() : ""); + std::string short_description(Event->ShortText() ? Event->ShortText() : ""); + std::string description(Event->Description() ? Event->Description() : ""); + std::string start(Event->StartTime() ? FormatDateTime(tr("%I:%M %p"), Event->StartTime()) : ""); + std::string end(Event->EndTime() ? FormatDateTime(tr("%I:%M %p"), Event->EndTime()) : ""); }> <& event_widget title=(title) short_description=(short_description) description=(description) channel_name=(Channel->Name()) start=(start) end=(end)> <{ } + } } } } diff --git a/pages/whats_on_now.ecpp b/pages/whats_on_now.ecpp index e0a2ba1..a79be7d 100644 --- a/pages/whats_on_now.ecpp +++ b/pages/whats_on_now.ecpp @@ -35,21 +35,24 @@ const cSchedules* Schedules = cSchedules::Schedules(schedulesLock); </div> <{ - for (cChannel *Channel = Channels.First(); Channel && Channel->Number() <= LiveSetup().GetLastChannel(); Channel = Channels.Next(Channel)) { - if (!Channel->GroupSep()) { - const cSchedule *Schedule = Schedules->GetSchedule(Channel); - if (Schedule) { - const cEvent *Event = Schedule->GetPresentEvent(); - if (Event) { - std::string title(Event->Title() ? Event->Title() : ""); - std::string short_description(Event->ShortText() ? Event->ShortText() : ""); - std::string description(Event->Description() ? Event->Description() : ""); - std::string start(Event->StartTime() ? FormatDateTime(tr("%I:%M %p"), Event->StartTime()) : ""); - std::string end(Event->EndTime() ? FormatDateTime(tr("%I:%M %p"), Event->EndTime()) : ""); + ReadLock channelsLock( Channels ); + if (channelsLock) { + for (cChannel *Channel = Channels.First(); Channel && Channel->Number() <= LiveSetup().GetLastChannel(); Channel = Channels.Next(Channel)) { + if (!Channel->GroupSep()) { + const cSchedule *Schedule = Schedules->GetSchedule(Channel); + if (Schedule) { + const cEvent *Event = Schedule->GetPresentEvent(); + if (Event) { + std::string title(Event->Title() ? Event->Title() : ""); + std::string short_description(Event->ShortText() ? Event->ShortText() : ""); + std::string description(Event->Description() ? Event->Description() : ""); + std::string start(Event->StartTime() ? FormatDateTime(tr("%I:%M %p"), Event->StartTime()) : ""); + std::string end(Event->EndTime() ? FormatDateTime(tr("%I:%M %p"), Event->EndTime()) : ""); }> <& event_widget title=(title) short_description=(short_description) description=(description) channel_name=(Channel->Name()) start=(start) end=(end)> <{ } + } } } } |