vdr  2.2.0
Public Member Functions | Static Public Member Functions | Private Attributes | Friends | List of all members
cTimer Class Reference

#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 ()
 
cTimeroperator= (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 cChannelChannel (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 cEventEvent (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
 
- Public Member Functions inherited from cListObject
 cListObject (void)
 
virtual ~cListObject ()
 
void Append (cListObject *Object)
 
void Insert (cListObject *Object)
 
void Unlink (void)
 
int Index (void) const
 
cListObjectPrev (void) const
 
cListObjectNext (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
 
cChannelchannel
 
time_t day
 
int weekdays
 
int start
 
int stop
 
int priority
 
int lifetime
 
char file [NAME_MAX *2+1]
 
char * aux
 
const cEventevent
 

Friends

class cMenuEditTimer
 

Detailed Description

Definition at line 27 of file timers.h.

Constructor & Destructor Documentation

cTimer::cTimer ( bool  Instant = false,
bool  Pause = false,
cChannel Channel = NULL 
)
cTimer::cTimer ( const cEvent Event)
cTimer::cTimer ( const cTimer Timer)

Definition at line 119 of file timers.c.

References aux, channel, flags, and tfNone.

cTimer::~cTimer ( )
virtual

Definition at line 128 of file timers.c.

References aux.

Member Function Documentation

const char* cTimer::Aux ( void  ) const
inline

Definition at line 65 of file timers.h.

References aux.

Referenced by cRecording::cRecording(), and Event().

const cChannel* cTimer::Channel ( void  ) const
inline
void cTimer::ClrFlags ( uint  Flags)

Definition at line 654 of file timers.c.

References flags.

Referenced by cSVDRP::CmdMODT(), Event(), OnOff(), Parse(), and SetRecording().

int cTimer::Compare ( const cListObject ListObject) const
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().

time_t cTimer::Day ( void  ) const
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().

time_t cTimer::Deferred ( void  ) const
inline

Definition at line 66 of file timers.h.

References deferred, ToDescr(), and ToText().

const cEvent* cTimer::Event ( void  ) const
inline
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().

const char* cTimer::File ( void  ) const
inline
time_t cTimer::FirstDay ( void  ) const
inline

Definition at line 64 of file timers.h.

Referenced by cMenuTimers::OnOff(), and cMenuTimerItem::Set().

uint cTimer::Flags ( void  ) const
inline

Definition at line 55 of file timers.h.

References flags.

Referenced by cSkinLCARSDisplayMenu::DrawTimer(), Event(), HasFlags(), InvFlags(), and SetFlags().

int cTimer::GetMDay ( time_t  t)
static

Definition at line 351 of file timers.c.

Referenced by Event(), ParseDay(), and cMenuTimerItem::Set().

int cTimer::GetWDay ( time_t  t)
static

Definition at line 357 of file timers.c.

Referenced by DayMatches(), Event(), and cMenuEditDateItem::ToggleRepeating().

bool cTimer::HasFlags ( uint  Flags) const
time_t cTimer::IncDay ( time_t  t,
int  Days 
)
static

Definition at line 369 of file timers.c.

Referenced by cMenuTimers::ActualiseDiskStatus(), Event(), Matches(), ParseDay(), and Skip().

void cTimer::InvFlags ( uint  Flags)

Definition at line 659 of file timers.c.

References flags, and Flags().

Referenced by Event(), and OnOff().

bool cTimer::InVpsMargin ( void  ) const
inline

Definition at line 54 of file timers.h.

References inVpsMargin.

Referenced by Event(), and SetInVpsMargin().

bool cTimer::IsSingleEvent ( void  ) const
int cTimer::Lifetime ( void  ) const
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
eTimerMatch cTimer::Matches ( const cEvent Event,
int *  Overlap = NULL 
) const
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().

cTimer & cTimer::operator= ( const cTimer Timer)
bool cTimer::Parse ( const char *  s)
bool cTimer::ParseDay ( const char *  s,
time_t &  Day,
int &  WeekDays 
)
static

Definition at line 189 of file timers.c.

References day, GetMDay(), IncDay(), SetTime(), and skipspace().

Referenced by Event(), Parse(), and ParseWeekDays().

bool cTimer::Pending ( void  ) const
inline

Definition at line 53 of file timers.h.

References pending.

Referenced by cSkinLCARSDisplayMenu::DrawTimer(), Event(), SetPending(), and cRecordControls::Start().

cString cTimer::PrintDay ( time_t  Day,
int  WeekDays,
bool  SingleByteChars 
)
static
cString cTimer::PrintFirstDay ( void  ) const

Definition at line 282 of file timers.c.

References day, PrintDay(), and weekdays.

Referenced by Event(), and cMenuTimers::OnOff().

int cTimer::Priority ( void  ) const
inline
bool cTimer::Recording ( void  ) const
inline
bool cTimer::Save ( FILE *  f)

Definition at line 341 of file timers.c.

References ToText().

Referenced by Event().

void cTimer::SetAux ( const char *  Aux)

Definition at line 637 of file timers.c.

References aux.

Referenced by Event().

void cTimer::SetDay ( time_t  Day)

Definition at line 607 of file timers.c.

References day, and Day().

Referenced by Event().

void cTimer::SetDeferred ( int  Seconds)

Definition at line 643 of file timers.c.

References deferred, isyslog, and ToDescr().

Referenced by Event().

void cTimer::SetEvent ( const cEvent Event)

Definition at line 574 of file timers.c.

References event, Event(), isyslog, ToDescr(), and cEvent::ToDescr().

Referenced by cTimer(), Event(), OnOff(), SetEventFromSchedule(), and Skip().

void cTimer::SetEventFromSchedule ( const cSchedules Schedules = NULL)
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().

Referenced by Event(), and main().

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)

Definition at line 595 of file timers.c.

References pending, and Pending().

Referenced by Event(), main(), and cRecordControls::Start().

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)

Definition at line 617 of file timers.c.

References start, and Start().

Referenced by Event().

void cTimer::SetStop ( int  Stop)

Definition at line 622 of file timers.c.

References stop, and Stop().

Referenced by Event().

time_t cTimer::SetTime ( time_t  t,
int  SecondsFromMidnight 
)
static
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().

int cTimer::Start ( void  ) const
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
int cTimer::Stop ( void  ) const
inline
time_t cTimer::StopTime ( void  ) const
int cTimer::TimeToInt ( int  t)
static

Definition at line 184 of file timers.c.

Referenced by Event(), and Matches().

cString cTimer::ToDescr ( void  ) const
cString cTimer::ToText ( bool  UseChannelID = false) const
int cTimer::WeekDays ( void  ) const
inline

Definition at line 58 of file timers.h.

References weekdays.

Referenced by Event(), cTimers::GetTimer(), cMenuTimerItem::Set(), and SetWeekDays().

Friends And Related Function Documentation

friend class cMenuEditTimer
friend

Definition at line 28 of file timers.h.

Member Data Documentation

char* cTimer::aux
private

Definition at line 43 of file timers.h.

Referenced by Aux(), cTimer(), operator=(), Parse(), SetAux(), ToText(), and ~cTimer().

cChannel* cTimer::channel
private

Definition at line 35 of file timers.h.

Referenced by Channel(), cTimer(), Matches(), operator=(), Parse(), and cMenuEditTimer::ProcessKey().

time_t cTimer::day
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().

time_t cTimer::deferred
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().

const cEvent* cTimer::event
private

Definition at line 44 of file timers.h.

Referenced by Event(), Matches(), SetEvent(), and SetEventFromSchedule().

char cTimer::file[NAME_MAX *2+1]
mutableprivate
uint cTimer::flags
private
bool cTimer::inVpsMargin
private

Definition at line 33 of file timers.h.

Referenced by cTimer(), InVpsMargin(), operator=(), and SetInVpsMargin().

time_t cTimer::lastSetEvent
private

Definition at line 31 of file timers.h.

Referenced by cTimer(), operator=(), and SetEventFromSchedule().

int cTimer::lifetime
private
bool cTimer::pending
private

Definition at line 33 of file timers.h.

Referenced by cTimer(), operator=(), Pending(), and SetPending().

int cTimer::priority
private
bool cTimer::recording
private

Definition at line 33 of file timers.h.

Referenced by cTimer(), operator=(), Recording(), and SetRecording().

int cTimer::start
private
time_t cTimer::startTime
mutableprivate

Definition at line 30 of file timers.h.

Referenced by cTimer(), Matches(), operator=(), Skip(), and StartTime().

int cTimer::stop
private
time_t cTimer::stopTime
mutableprivate

Definition at line 30 of file timers.h.

Referenced by cTimer(), Matches(), operator=(), and StopTime().

int cTimer::weekdays
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().


The documentation for this class was generated from the following files: