<%pre> #include #include #include #include #include "setup.h" #include "tools.h" #include "timers.h" using namespace std; using namespace vdrlive; <%args> timerid; bool submit = false; bool active = true; channel = ""; title = ""; day = FormatDateTime( "%d", time( 0 ) ); bool wday_mon = false; bool wday_tue = false; bool wday_wed = false; bool wday_thu = false; bool wday_fri = false; bool wday_sat = false; bool wday_sun = false; int start_h = StringToInt( FormatDateTime( "%H", time( 0 ) ) ); int start_m = StringToInt( FormatDateTime( "%M", time( 0 ) ) ); int end_h = StringToInt( FormatDateTime( "%H", time( 0 ) ) ); int end_m = StringToInt( FormatDateTime( "%M", time( 0 ) ) ); bool vps = ::Setup.UseVps; int priority = ::Setup.DefaultPriority; int lifetime = ::Setup.DefaultLifetime; aux = ""; <%cpp> ReadLock channelsLock( Channels ); if (!channelsLock) return DECLINED; // XXX error page cMutexLock timersLock( &LiveTimerManager() ); SortedTimers& timers = LiveTimerManager().GetTimers(); cTimer* timer = 0; if ( !timerid.empty() ) { timer = timers.GetByTimerId( timerid ); if ( timer == 0 ) return DECLINED; // XXX error page } if ( request.getMethod() != "POST" && timer != 0 ) { active = timer->Flags() & tfActive; channel = *timer->Channel()->GetChannelID().ToString(); title = timer->File() ? timer->File() : ""; day = timer->Day() ? FormatDateTime( "%d", timer->Day() ) : ""; wday_mon = timer->WeekDays() & 0x01; wday_tue = timer->WeekDays() & 0x02; wday_wed = timer->WeekDays() & 0x04; wday_thu = timer->WeekDays() & 0x08; wday_fri = timer->WeekDays() & 0x10; wday_sat = timer->WeekDays() & 0x20; wday_sun = timer->WeekDays() & 0x40; start_h = ( timer->Start() / 100 ) % 100; start_m = timer->Start() % 100; end_h = ( timer->Stop() / 100 ) % 100; end_m = timer->Stop() % 100; vps = timer->Flags() & tfVps; priority = timer->Priority(); lifetime = timer->Lifetime(); aux = timer->Aux() ? timer->Aux() : ""; } std::string result; if ( submit ) { uint flags = ( active ? tfActive : 0 ) | ( vps ? tfVps : 0 ); string weekdays = string( wday_mon ? "M" : "-" ) + ( wday_tue ? "T" : "-" ) + ( wday_wed ? "W" : "-" ) + ( wday_thu ? "T" : "-" ) + ( wday_fri ? "F" : "-" ) + ( wday_sat ? "S" : "-" ) + ( wday_sun ? "S" : "-" ); //( wday_mon ? 0x01 : 0 ) | ( wday_tue ? 0x02 : 0 ) | ( wday_wed ? 0x04 : 0 ) | //( wday_thu ? 0x08 : 0 ) | ( wday_fri ? 0x10 : 0 ) | ( wday_sat ? 0x20 : 0 ) | //( wday_sun ? 0x40 : 0 ); ostringstream builder; builder << flags << ":" << channel << ":" << ( weekdays != "-------" ? weekdays : "" ) << ( weekdays == "-------" || day.empty() ? "" : "@" ) << day << ":" << ( start_h * 100 + start_m ) << ":" << ( end_h * 100 + end_m ) << ":" << priority << ":" << lifetime << ":" << title << ":" << aux; std::string error = LiveTimerManager().UpdateTimer( timer, builder.str() ); if ( !error.empty() ) reply.out() << error; } VDR Live - <$ timer ? tr("Edit timer") : tr("New timer") $>
VDR Live! <& menu >
<$ timer ? tr("Edit timer") : tr("New timer") $>
Timer aktiv: type="radio">Ja type="radio">Nein
Kanal: <& channels_widget name=("channel") channelId=(true) selected=(channel) &>
Titel
Tag der Aufnahme
Wochentag /> Montag /> Dienstag /> Mittwoch /> Donnerstag /> Freitag /> Samstag /> Sonntag
Startzeit: :
Endzeit: :
VPS verwenden />
Priorität:
Lebensdauer: