From f2f66c48c389150791bd85f7828f89c8f42d844c Mon Sep 17 00:00:00 2001 From: Thomas Keil Date: Thu, 4 Jan 2007 14:48:09 +0000 Subject: Made it usable --- pages/schedule.ecpp | 108 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 88 insertions(+), 20 deletions(-) (limited to 'pages') diff --git a/pages/schedule.ecpp b/pages/schedule.ecpp index 76659b4..51bacbb 100644 --- a/pages/schedule.ecpp +++ b/pages/schedule.ecpp @@ -3,43 +3,111 @@ #include #include #include +#include "setup.h" +#include "tools.h" + +using namespace vdrlive; <%args> -int channel; +int channel = -1; - - - ecpp-application testproject - - - - Programm für Channel Nummer <$ channel $>
- <{ cSchedulesLock schedulesLock; const cSchedules* schedules = cSchedules::Schedules(schedulesLock); + cChannel* Channel; + + ReadLock channelsLock( Channels ); + if (channelsLock) { + if (channel > 0) { + Channel = Channels.GetByNumber(channel); + } else { + Channel = Channels.Get(Channels.GetNextNormal(-1)); + } + +}> + + + VDR Live - <$ tr("Schedule") $> + + + +
+ VDR Live! +<& menu > +
+
+
+ + + + + +
Name() ?> +
+ +
+
+
- cChannel* Channel = Channels.GetByNumber(channel); - if (Channel) { - const cSchedule *Schedule = schedules->GetSchedule(Channel); - if (Schedule) { - for (const cEvent *ev = Schedule->Events()->First(); ev; ev = Schedule->Events()->Next(ev)) { +<{ + if (Channel) { + const cSchedule *Schedule = schedules->GetSchedule(Channel); + if (Schedule) { }> - <$ ev->Title() $>
+ +<{ + bool active_line = false; + std::string current_day = ""; + for (const cEvent *Event = Schedule->Events()->First(); Event; Event = Schedule->Events()->Next(Event)) { + active_line = !active_line; + 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()) : ""); + std::string day(Event->StartTime() ? FormatDateTime(tr("%A, %b %d %Y"), Event->StartTime()) : ""); + if (current_day != day) { + current_day = day; +}> + + + +<{ + } +}> + "> + + + + <{ } - } else { }> - Kein Schedule für Channel <$ Channel->Number() $> +
<$ current_day $>
<$ start $> - <$ end $><$ title $>
<$ short_description $>
 
+<{ + } else { +}> + Kein Schedule für Channel <$ Channel->Number() $> <{ } - } else { + } else { }> - Kein Channel mit der Nummer <$ channel $> + Kein Channel mit der Nummer <$ channel $> <{ + } } }> - + -- cgit v1.2.3