vdr
2.2.0
|
#include <timers.h>
Public Member Functions | |
cTimer (bool Instant=false, bool Pause=false, cChannel *Channel=NULL) | |
cTimer (const cEvent *Event) | |
cTimer (const cTimer &Timer) | |
virtual | ~cTimer () |
cTimer & | operator= (const cTimer &Timer) |
virtual int | Compare (const cListObject &ListObject) const |
bool | Recording (void) const |
bool | Pending (void) const |
bool | InVpsMargin (void) const |
uint | Flags (void) const |
const cChannel * | Channel (void) const |
time_t | Day (void) const |
int | WeekDays (void) const |
int | Start (void) const |
int | Stop (void) const |
int | Priority (void) const |
int | Lifetime (void) const |
const char * | File (void) const |
time_t | FirstDay (void) const |
const char * | Aux (void) const |
time_t | Deferred (void) const |
cString | ToText (bool UseChannelID=false) const |
cString | ToDescr (void) const |
const cEvent * | Event (void) const |
bool | Parse (const char *s) |
bool | Save (FILE *f) |
bool | IsSingleEvent (void) const |
bool | DayMatches (time_t t) const |
void | SetFile (const char *File) |
bool | Matches (time_t t=0, bool Directly=false, int Margin=0) const |
eTimerMatch | Matches (const cEvent *Event, int *Overlap=NULL) const |
bool | Expired (void) const |
time_t | StartTime (void) const |
time_t | StopTime (void) const |
void | SetEventFromSchedule (const cSchedules *Schedules=NULL) |
void | SetEvent (const cEvent *Event) |
void | SetRecording (bool Recording) |
void | SetPending (bool Pending) |
void | SetInVpsMargin (bool InVpsMargin) |
void | SetDay (time_t Day) |
void | SetWeekDays (int WeekDays) |
void | SetStart (int Start) |
void | SetStop (int Stop) |
void | SetPriority (int Priority) |
void | SetLifetime (int Lifetime) |
void | SetAux (const char *Aux) |
void | SetDeferred (int Seconds) |
void | SetFlags (uint Flags) |
void | ClrFlags (uint Flags) |
void | InvFlags (uint Flags) |
bool | HasFlags (uint Flags) const |
void | Skip (void) |
void | OnOff (void) |
cString | PrintFirstDay (void) const |
![]() | |
cListObject (void) | |
virtual | ~cListObject () |
void | Append (cListObject *Object) |
void | Insert (cListObject *Object) |
void | Unlink (void) |
int | Index (void) const |
cListObject * | Prev (void) const |
cListObject * | Next (void) const |
Static Public Member Functions | |
static int | GetMDay (time_t t) |
static int | GetWDay (time_t t) |
static time_t | IncDay (time_t t, int Days) |
static time_t | SetTime (time_t t, int SecondsFromMidnight) |
static int | TimeToInt (int t) |
static bool | ParseDay (const char *s, time_t &Day, int &WeekDays) |
static cString | PrintDay (time_t Day, int WeekDays, bool SingleByteChars) |
Private Attributes | |
time_t | startTime |
time_t | stopTime |
time_t | lastSetEvent |
time_t | deferred |
bool | recording |
bool | pending |
bool | inVpsMargin |
uint | flags |
cChannel * | channel |
time_t | day |
int | weekdays |
int | start |
int | stop |
int | priority |
int | lifetime |
char | file [NAME_MAX *2+1] |
char * | aux |
const cEvent * | event |
Friends | |
class | cMenuEditTimer |
cTimer::cTimer | ( | bool | Instant = false , |
bool | Pause = false , |
||
cChannel * | Channel = NULL |
||
) |
Definition at line 26 of file timers.c.
References aux, channel, Channels, cDevice::CurrentChannel(), day, cSetup::DefaultLifetime, cSetup::DefaultPriority, deferred, DEFINSTRECTIME, cEvent::EndTime(), Event(), file, flags, cChannels::GetByNumber(), cSetup::InstantRecordTime, inVpsMargin, lastSetEvent, lifetime, cSetup::MarginStart, cSetup::MarginStop, cSetup::MarkInstantRecord, cChannel::Name(), cSetup::NameInstantRecord, cSetup::PauseLifetime, cSetup::PausePriority, pending, priority, recording, cSchedules::Schedules(), SetEvent(), SetFlags(), SetTime(), Setup, start, startTime, cEvent::StartTime(), stop, stopTime, tfActive, tfInstant, tfNone, tfVps, cSetup::UseVps, cEvent::Vps(), and weekdays.
cTimer::cTimer | ( | const cEvent * | Event | ) |
Definition at line 83 of file timers.c.
References aux, channel, cEvent::ChannelID(), Channels, day, cSetup::DefaultLifetime, cSetup::DefaultPriority, deferred, cEvent::Duration(), file, flags, cChannels::GetByChannelID(), HasFlags(), inVpsMargin, isempty(), lastSetEvent, lifetime, cSetup::MarginStart, cSetup::MarginStop, pending, priority, recording, SetEvent(), SetFlags(), SetTime(), Setup, start, startTime, cEvent::StartTime(), stop, stopTime, tfActive, tfVps, cEvent::Title(), cSetup::UseVps, Utf8Strn0Cpy(), cEvent::Vps(), and weekdays.
cTimer::cTimer | ( | const cTimer & | Timer | ) |
|
inline |
Definition at line 65 of file timers.h.
References aux.
Referenced by cRecording::cRecording(), and Event().
|
inline |
Definition at line 56 of file timers.h.
References channel.
Referenced by cMenuEditTimer::cMenuEditTimer(), cMenuTimers::Commands(), cRecording::cRecording(), cShutdownHandler::DoShutdown(), cSkinLCARSDisplayMenu::DrawTimer(), cTimers::GetTimer(), main(), cMenuEditTimer::ProcessKey(), cMenuTimerItem::Set(), SetEventFromSchedule(), cRecordControls::Start(), ToDescr(), and ToText().
void cTimer::ClrFlags | ( | uint | Flags | ) |
Definition at line 654 of file timers.c.
References flags.
Referenced by cSVDRP::CmdMODT(), Event(), OnOff(), Parse(), and SetRecording().
|
virtual |
Must return 0 if this object is equal to ListObject, a positive value if it is "greater", and a negative value if it is "smaller".
Reimplemented from cListObject.
Definition at line 160 of file timers.c.
References priority, and StartTime().
Referenced by cMenuTimerItem::Compare().
|
inline |
Definition at line 57 of file timers.h.
References day.
Referenced by Event(), cTimers::GetTimer(), cMenuTimerItem::Set(), and SetDay().
bool cTimer::DayMatches | ( | time_t | t | ) | const |
Definition at line 364 of file timers.c.
References day, GetWDay(), IsSingleEvent(), SetTime(), and weekdays.
Referenced by cMenuTimers::ActualiseDiskStatus(), Event(), and Matches().
|
inline |
|
inline |
Definition at line 69 of file timers.h.
References Aux(), ClrFlags(), Day(), DayMatches(), event, Expired(), File(), Flags(), GetMDay(), GetWDay(), HasFlags(), IncDay(), InvFlags(), InVpsMargin(), IsSingleEvent(), Lifetime(), Matches(), OnOff(), Parse(), ParseDay(), Pending(), PrintDay(), PrintFirstDay(), Priority(), Recording(), Save(), SetAux(), SetDay(), SetDeferred(), SetEvent(), SetEventFromSchedule(), SetFile(), SetFlags(), SetInVpsMargin(), SetLifetime(), SetPending(), SetPriority(), SetRecording(), SetStart(), SetStop(), SetTime(), SetWeekDays(), Skip(), Start(), StartTime(), Stop(), StopTime(), TimeToInt(), and WeekDays().
Referenced by cMenuTimers::Commands(), cTimer(), cSkinLCARSDisplayMenu::DrawTimer(), cMenuTimers::Info(), main(), SetEvent(), SetEventFromSchedule(), and cMenuTimers::SetHelpKeys().
bool cTimer::Expired | ( | void | ) | const |
Definition at line 492 of file timers.c.
References EXPIRELATENCY, HasFlags(), IsSingleEvent(), Recording(), StopTime(), and tfVps.
Referenced by cTimers::DeleteExpired(), and Event().
|
inline |
Definition at line 63 of file timers.h.
References file.
Referenced by cMenuTimers::Commands(), cRecording::cRecording(), cShutdownHandler::DoShutdown(), Event(), and cMenuTimerItem::Set().
|
inline |
Definition at line 64 of file timers.h.
Referenced by cMenuTimers::OnOff(), and cMenuTimerItem::Set().
|
inline |
Definition at line 55 of file timers.h.
References flags.
Referenced by cSkinLCARSDisplayMenu::DrawTimer(), Event(), HasFlags(), InvFlags(), and SetFlags().
|
static |
Definition at line 351 of file timers.c.
Referenced by Event(), ParseDay(), and cMenuTimerItem::Set().
|
static |
Definition at line 357 of file timers.c.
Referenced by DayMatches(), Event(), and cMenuEditDateItem::ToggleRepeating().
bool cTimer::HasFlags | ( | uint | Flags | ) | const |
Definition at line 664 of file timers.c.
References flags, and Flags().
Referenced by cTimerEntry::active(), cSVDRP::CmdMODT(), cTimer(), Event(), Expired(), main(), Matches(), OnOff(), cMenuTimers::OnOff(), cMenuEditTimer::ProcessKey(), cMenuTimerItem::Set(), SetEventFromSchedule(), and ToDescr().
|
static |
Definition at line 369 of file timers.c.
Referenced by cMenuTimers::ActualiseDiskStatus(), Event(), Matches(), ParseDay(), and Skip().
void cTimer::InvFlags | ( | uint | Flags | ) |
|
inline |
Definition at line 54 of file timers.h.
References inVpsMargin.
Referenced by Event(), and SetInVpsMargin().
bool cTimer::IsSingleEvent | ( | void | ) | const |
Definition at line 346 of file timers.c.
References weekdays.
Referenced by cRecordControl::cRecordControl(), cRecording::cRecording(), DayMatches(), cMenuRecordings::Delete(), Event(), Expired(), Matches(), OnOff(), cTimerEntry::repTimer(), and cMenuEditTimer::SetFirstDayItem().
|
inline |
Definition at line 62 of file timers.h.
References lifetime.
Referenced by cRecording::cRecording(), Event(), and SetLifetime().
bool cTimer::Matches | ( | time_t | t = 0 , |
bool | Directly = false , |
||
int | Margin = 0 |
||
) | const |
Definition at line 400 of file timers.c.
References day, DayMatches(), deferred, EITPRESENTFOLLOWINGRATE, event, HasFlags(), IncDay(), cEvent::IsRunning(), IsSingleEvent(), max(), cSchedule::PresentSeenWithin(), cEvent::Schedule(), SECSINDAY, SetTime(), start, startTime, cEvent::StartTime(), stop, stopTime, tfActive, tfVps, TimeToInt(), and cEvent::Vps().
Referenced by Event(), cTimers::GetNextActiveTimer(), main(), Matches(), OnOff(), cMenuEditTimer::ProcessKey(), cMenuWhatsOn::Record(), cMenuSchedule::Record(), SetEventFromSchedule(), cRecordControls::Start(), StartTime(), and StopTime().
eTimerMatch cTimer::Matches | ( | const cEvent * | Event, |
int * | Overlap = NULL |
||
) | const |
Definition at line 459 of file timers.c.
References channel, cEvent::ChannelID(), cEvent::Duration(), cEvent::EndTime(), FULLMATCH, cChannel::GetChannelID(), HasFlags(), cEvent::IsRunning(), Matches(), max(), min(), startTime, StartTime(), cEvent::StartTime(), stopTime, tfActive, tfVps, tmFull, tmNone, tmPartial, and cEvent::Vps().
void cTimer::OnOff | ( | void | ) |
Definition at line 676 of file timers.c.
References ClrFlags(), day, HasFlags(), InvFlags(), IsSingleEvent(), Matches(), SetEvent(), SetFlags(), Skip(), and tfActive.
Referenced by Event(), and cMenuTimers::OnOff().
bool cTimer::Parse | ( | const char * | s | ) |
Definition at line 292 of file timers.c.
References aux, channel, Channels, ClrFlags(), day, esyslog, file, flags, tChannelID::FromString(), cChannels::GetByChannelID(), cChannels::GetByNumber(), isnumber(), lifetime, MALLOC, ParseDay(), priority, skipspace(), start, stop, strn0cpy(), strreplace(), tfRecording, Utf8Strn0Cpy(), and weekdays.
Referenced by cSVDRP::CmdMODT(), cSVDRP::CmdNEWT(), cSVDRP::CmdUPDT(), and Event().
|
static |
Definition at line 189 of file timers.c.
References day, GetMDay(), IncDay(), SetTime(), and skipspace().
Referenced by Event(), Parse(), and ParseWeekDays().
|
inline |
Definition at line 53 of file timers.h.
References pending.
Referenced by cSkinLCARSDisplayMenu::DrawTimer(), Event(), SetPending(), and cRecordControls::Start().
|
static |
Definition at line 248 of file timers.c.
References DAYBUFFERSIZE, tr, trNOOP, and SI::Utf8CharLen().
Referenced by Event(), PrintFirstDay(), cMenuEditDateItem::Set(), cMenuTimerItem::Set(), and ToText().
cString cTimer::PrintFirstDay | ( | void | ) | const |
Definition at line 282 of file timers.c.
References day, PrintDay(), and weekdays.
Referenced by Event(), and cMenuTimers::OnOff().
|
inline |
Definition at line 61 of file timers.h.
References priority.
Referenced by cRecording::cRecording(), Event(), cTimers::GetMatch(), cTimerEntry::priority(), SetPriority(), and cRecordControls::Start().
|
inline |
Definition at line 52 of file timers.h.
References recording.
Referenced by cSVDRP::CmdDELT(), cMenuTimers::Delete(), cSkinLCARSDisplayMenu::DrawTimer(), Event(), Expired(), main(), cMenuTimerItem::Set(), SetEventFromSchedule(), and SetRecording().
bool cTimer::Save | ( | FILE * | f | ) |
void cTimer::SetAux | ( | const char * | Aux | ) |
void cTimer::SetDay | ( | time_t | Day | ) |
void cTimer::SetDeferred | ( | int | Seconds | ) |
void cTimer::SetEvent | ( | const cEvent * | Event | ) |
void cTimer::SetEventFromSchedule | ( | const cSchedules * | Schedules = NULL | ) |
Definition at line 514 of file timers.c.
References Channel(), cEvent::Duration(), EPGLIMITAFTER, EPGLIMITBEFORE, event, Event(), cSchedule::Events(), cList< T >::First(), FULLMATCH, cSchedules::GetSchedule(), HasFlags(), lastSetEvent, Matches(), cSchedule::Modified(), cList< T >::Next(), Recording(), SI::RunningStatusNotRunning, cSchedules::Schedules(), SetEvent(), StartTime(), cEvent::StartTime(), StopTime(), tfVps, and cEvent::Vps().
Referenced by Event(), cMenuTimers::OnOff(), and cMenuEditTimer::ProcessKey().
void cTimer::SetFile | ( | const char * | File | ) |
Definition at line 392 of file timers.c.
References file, isempty(), and Utf8Strn0Cpy().
Referenced by cRecording::cRecording(), and Event().
void cTimer::SetFlags | ( | uint | Flags | ) |
Definition at line 649 of file timers.c.
References flags, and Flags().
Referenced by cSVDRP::CmdMODT(), cMenuEditTimer::cMenuEditTimer(), cTimer(), Event(), OnOff(), and SetRecording().
void cTimer::SetInVpsMargin | ( | bool | InVpsMargin | ) |
Definition at line 600 of file timers.c.
References inVpsMargin, InVpsMargin(), isyslog, and ToDescr().
void cTimer::SetLifetime | ( | int | Lifetime | ) |
Definition at line 632 of file timers.c.
References lifetime, and Lifetime().
Referenced by Event().
void cTimer::SetPending | ( | bool | Pending | ) |
void cTimer::SetPriority | ( | int | Priority | ) |
Definition at line 627 of file timers.c.
References priority, and Priority().
Referenced by Event().
void cTimer::SetRecording | ( | bool | Recording | ) |
Definition at line 585 of file timers.c.
References ClrFlags(), isyslog, recording, Recording(), SetFlags(), tfRecording, and ToDescr().
Referenced by Event().
void cTimer::SetStart | ( | int | Start | ) |
void cTimer::SetStop | ( | int | Stop | ) |
|
static |
Definition at line 381 of file timers.c.
Referenced by cTimer(), DayMatches(), Event(), Matches(), ParseDay(), cMenuEditDateItem::ProcessKey(), Skip(), and cMenuEditDateItem::ToggleRepeating().
void cTimer::SetWeekDays | ( | int | WeekDays | ) |
Definition at line 612 of file timers.c.
References weekdays, and WeekDays().
Referenced by Event().
void cTimer::Skip | ( | void | ) |
Definition at line 669 of file timers.c.
References day, IncDay(), SetEvent(), SetTime(), startTime, and StartTime().
Referenced by cMenuRecordings::Delete(), cMenuTimers::Delete(), Event(), and OnOff().
|
inline |
Definition at line 59 of file timers.h.
References start.
Referenced by cTimerEntry::duration(), Event(), cTimers::GetTimer(), cMenuTimerItem::Set(), and SetStart().
time_t cTimer::StartTime | ( | void | ) | const |
Definition at line 497 of file timers.c.
References Matches(), and startTime.
Referenced by cSVDRP::CmdNEXT(), cMenuTimers::Commands(), Compare(), cShutdownHandler::ConfirmRestart(), cShutdownHandler::ConfirmShutdown(), cRecording::cRecording(), cShutdownHandler::DoShutdown(), cSkinLCARSDisplayMenu::DrawTimer(), Event(), Matches(), SetEventFromSchedule(), and Skip().
|
inline |
Definition at line 60 of file timers.h.
References stop.
Referenced by cTimerEntry::duration(), Event(), cTimers::GetTimer(), cMenuTimerItem::Set(), SetStop(), and cRecordControls::Stop().
time_t cTimer::StopTime | ( | void | ) | const |
Definition at line 504 of file timers.c.
References Matches(), and stopTime.
Referenced by cMenuTimers::Commands(), cSkinLCARSDisplayMenu::DrawTimer(), Event(), Expired(), cTimers::GetNextActiveTimer(), and SetEventFromSchedule().
|
static |
cString cTimer::ToDescr | ( | void | ) | const |
Definition at line 179 of file timers.c.
References Channel(), file, HasFlags(), cListObject::Index(), cString::sprintf(), start, stop, and tfVps.
Referenced by cSVDRP::CmdDELT(), cSVDRP::CmdMODT(), cSVDRP::CmdNEWT(), cSVDRP::CmdUPDT(), Deferred(), cMenuRecordings::Delete(), cMenuTimers::Delete(), cTimers::DeleteExpired(), cMenuTimers::OnOff(), cMenuEditTimer::ProcessKey(), cMenuWhatsOn::Record(), cMenuSchedule::Record(), SetDeferred(), SetEvent(), SetInVpsMargin(), SetRecording(), cRecordControls::Start(), cRecordControls::Stop(), and cReplayControl::Stop().
cString cTimer::ToText | ( | bool | UseChannelID = false | ) | const |
Definition at line 171 of file timers.c.
References aux, Channel(), day, file, flags, itoa(), lifetime, PrintDay(), priority, cString::sprintf(), start, stop, strreplace(), and weekdays.
Referenced by cSVDRP::CmdLSTT(), cSVDRP::CmdMODT(), cSVDRP::CmdNEWT(), cSVDRP::CmdUPDT(), Deferred(), Save(), and cStatusTest::TimerChange().
|
inline |
Definition at line 58 of file timers.h.
References weekdays.
Referenced by Event(), cTimers::GetTimer(), cMenuTimerItem::Set(), and SetWeekDays().
|
friend |
|
private |
|
private |
Definition at line 35 of file timers.h.
Referenced by Channel(), cTimer(), Matches(), operator=(), Parse(), and cMenuEditTimer::ProcessKey().
|
mutableprivate |
midnight of the day this timer shall hit, or of the first day it shall hit in case of a repeating timer
Definition at line 36 of file timers.h.
Referenced by cMenuEditTimer::cMenuEditTimer(), cTimer(), Day(), DayMatches(), Matches(), OnOff(), operator=(), Parse(), ParseDay(), PrintFirstDay(), SetDay(), cMenuEditTimer::SetFirstDayItem(), Skip(), and ToText().
|
mutableprivate |
Matches(time_t, ...) will return false if the current time is before this value.
Definition at line 32 of file timers.h.
Referenced by cTimer(), Deferred(), Matches(), operator=(), and SetDeferred().
|
private |
Definition at line 44 of file timers.h.
Referenced by Event(), Matches(), SetEvent(), and SetEventFromSchedule().
|
mutableprivate |
Definition at line 42 of file timers.h.
Referenced by cMenuEditTimer::cMenuEditTimer(), cTimer(), File(), operator=(), Parse(), cMenuEditTimer::ProcessKey(), SetFile(), cMenuEditTimer::SetFolder(), ToDescr(), and ToText().
|
private |
Definition at line 34 of file timers.h.
Referenced by ClrFlags(), cMenuEditTimer::cMenuEditTimer(), cTimer(), Flags(), HasFlags(), InvFlags(), operator=(), Parse(), SetFlags(), and ToText().
|
private |
Definition at line 33 of file timers.h.
Referenced by cTimer(), InVpsMargin(), operator=(), and SetInVpsMargin().
|
private |
Definition at line 31 of file timers.h.
Referenced by cTimer(), operator=(), and SetEventFromSchedule().
|
private |
Definition at line 41 of file timers.h.
Referenced by cMenuEditTimer::cMenuEditTimer(), cTimer(), Lifetime(), operator=(), Parse(), SetLifetime(), and ToText().
|
private |
Definition at line 33 of file timers.h.
Referenced by cTimer(), operator=(), Pending(), and SetPending().
|
private |
Definition at line 40 of file timers.h.
Referenced by cMenuEditTimer::cMenuEditTimer(), Compare(), cTimer(), operator=(), Parse(), Priority(), SetPriority(), and ToText().
|
private |
Definition at line 33 of file timers.h.
Referenced by cTimer(), operator=(), Recording(), and SetRecording().
|
private |
Definition at line 38 of file timers.h.
Referenced by cMenuEditTimer::cMenuEditTimer(), cTimer(), Matches(), operator=(), Parse(), SetStart(), Start(), ToDescr(), and ToText().
|
mutableprivate |
Definition at line 30 of file timers.h.
Referenced by cTimer(), Matches(), operator=(), Skip(), and StartTime().
|
private |
|
mutableprivate |
Definition at line 30 of file timers.h.
Referenced by cTimer(), Matches(), operator=(), and StopTime().
|
private |
bitmask, lowest bits: SSFTWTM (the 'M' is the LSB)
Definition at line 37 of file timers.h.
Referenced by cMenuEditTimer::cMenuEditTimer(), cTimer(), DayMatches(), IsSingleEvent(), operator=(), Parse(), PrintFirstDay(), cMenuEditTimer::SetHelpKeys(), SetWeekDays(), ToText(), and WeekDays().