vdr  2.4.1
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, const cChannel *Channel=NULL)
 
 cTimer (const cEvent *Event)
 
 cTimer (const cTimer &Timer)
 
virtual ~cTimer ()
 
cTimeroperator= (const cTimer &Timer)
 
virtual int Compare (const cListObject &ListObject) const
 
int Id (void) 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
 
const char * Remote (void) const
 
bool Local (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 SetId (int Id)
 
bool SetEventFromSchedule (const cSchedules *Schedules)
 
bool 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 SetRemote (const char *Remote)
 
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

int id
 
time_t startTime
 
time_t stopTime
 
int scheduleState
 
time_t deferred
 
bool pending
 
bool inVpsMargin
 
uint flags
 
const cChannelchannel
 
time_t day
 
int weekdays
 
int start
 
int stop
 
int priority
 
int lifetime
 
char file [NAME_MAX *2+1]
 
char * aux
 
char * remote
 
const cEventevent
 

Friends

class cMenuEditTimer
 

Detailed Description

Definition at line 27 of file timers.h.

Constructor & Destructor Documentation

◆ cTimer() [1/3]

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

◆ cTimer() [2/3]

cTimer::cTimer ( const cEvent Event)

◆ cTimer() [3/3]

cTimer::cTimer ( const cTimer Timer)

Definition at line 123 of file timers.c.

References aux, channel, flags, remote, and tfNone.

◆ ~cTimer()

cTimer::~cTimer ( )
virtual

Definition at line 133 of file timers.c.

References aux, event, and remote.

Member Function Documentation

◆ Aux()

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

Definition at line 68 of file timers.h.

References aux.

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

◆ Channel()

const cChannel* cTimer::Channel ( void  ) const
inline

◆ ClrFlags()

void cTimer::ClrFlags ( uint  Flags)

◆ Compare()

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 173 of file timers.c.

References priority, and StartTime().

Referenced by cMenuTimerItem::Compare().

◆ Day()

time_t cTimer::Day ( void  ) const
inline

Definition at line 60 of file timers.h.

References day.

Referenced by cTimers::GetTimer(), ParseDay(), PrintDay(), cMenuTimerItem::Set(), and SetDay().

◆ DayMatches()

bool cTimer::DayMatches ( time_t  t) const

Definition at line 379 of file timers.c.

References day, GetWDay(), IsSingleEvent(), SetTime(), and weekdays.

Referenced by Matches().

◆ Deferred()

time_t cTimer::Deferred ( void  ) const
inline

Definition at line 71 of file timers.h.

References deferred.

◆ Event()

const cEvent* cTimer::Event ( void  ) const
inline

◆ Expired()

bool cTimer::Expired ( void  ) const

Definition at line 515 of file timers.c.

References EXPIRELATENCY, HasFlags(), IsSingleEvent(), Recording(), StopTime(), and tfVps.

Referenced by cTimers::DeleteExpired().

◆ File()

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

Definition at line 66 of file timers.h.

References file.

Referenced by cRecording::cRecording(), cShutdownHandler::DoShutdown(), cMenuTimerItem::Set(), and SetFile().

◆ FirstDay()

time_t cTimer::FirstDay ( void  ) const
inline

Definition at line 67 of file timers.h.

References day, and weekdays.

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

◆ Flags()

uint cTimer::Flags ( void  ) const
inline

Definition at line 58 of file timers.h.

References flags.

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

◆ GetMDay()

int cTimer::GetMDay ( time_t  t)
static

Definition at line 366 of file timers.c.

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

◆ GetWDay()

int cTimer::GetWDay ( time_t  t)
static

Definition at line 372 of file timers.c.

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

◆ HasFlags()

bool cTimer::HasFlags ( uint  Flags) const

◆ Id()

int cTimer::Id ( void  ) const
inline

◆ IncDay()

time_t cTimer::IncDay ( time_t  t,
int  Days 
)
static

Definition at line 384 of file timers.c.

Referenced by Matches(), ParseDay(), and Skip().

◆ InvFlags()

void cTimer::InvFlags ( uint  Flags)

Definition at line 691 of file timers.c.

References flags, and Flags().

Referenced by OnOff().

◆ InVpsMargin()

bool cTimer::InVpsMargin ( void  ) const
inline

Definition at line 57 of file timers.h.

References inVpsMargin.

Referenced by SetInVpsMargin().

◆ IsSingleEvent()

bool cTimer::IsSingleEvent ( void  ) const

◆ Lifetime()

int cTimer::Lifetime ( void  ) const
inline

Definition at line 65 of file timers.h.

References lifetime.

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

◆ Local()

bool cTimer::Local ( void  ) const
inline

Definition at line 70 of file timers.h.

References remote.

Referenced by HandleRemoteTimerModifications(), and cMenuEditTimer::ProcessKey().

◆ Matches() [1/2]

eTimerMatch cTimer::Matches ( const cEvent Event,
int *  Overlap = NULL 
) const

◆ Matches() [2/2]

bool cTimer::Matches ( time_t  t = 0,
bool  Directly = false,
int  Margin = 0 
) const

◆ OnOff()

void cTimer::OnOff ( void  )

◆ operator=()

cTimer & cTimer::operator= ( const cTimer Timer)

◆ Parse()

bool cTimer::Parse ( const char *  s)

◆ ParseDay()

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

Definition at line 202 of file timers.c.

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

Referenced by Parse(), and ParseWeekDays().

◆ Pending()

bool cTimer::Pending ( void  ) const
inline

Definition at line 56 of file timers.h.

References pending.

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

◆ PrintDay()

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

◆ PrintFirstDay()

cString cTimer::PrintFirstDay ( void  ) const

Definition at line 295 of file timers.c.

References day, PrintDay(), and weekdays.

Referenced by cMenuTimers::OnOff().

◆ Priority()

int cTimer::Priority ( void  ) const
inline

◆ Recording()

bool cTimer::Recording ( void  ) const
inline

◆ Remote()

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

◆ Save()

bool cTimer::Save ( FILE *  f)

Definition at line 354 of file timers.c.

References Remote(), and ToText().

◆ SetAux()

void cTimer::SetAux ( const char *  Aux)

Definition at line 663 of file timers.c.

References aux, and Aux().

◆ SetDay()

void cTimer::SetDay ( time_t  Day)

Definition at line 633 of file timers.c.

References day, and Day().

◆ SetDeferred()

void cTimer::SetDeferred ( int  Seconds)

Definition at line 675 of file timers.c.

References deferred, isyslog, and ToDescr().

Referenced by cRecordControl::cRecordControl().

◆ SetEvent()

bool cTimer::SetEvent ( const cEvent Event)

◆ SetEventFromSchedule()

bool cTimer::SetEventFromSchedule ( const cSchedules Schedules)

◆ SetFile()

void cTimer::SetFile ( const char *  File)

Definition at line 407 of file timers.c.

References File(), file, isempty(), and Utf8Strn0Cpy().

Referenced by cRecording::cRecording().

◆ SetFlags()

void cTimer::SetFlags ( uint  Flags)

◆ SetId()

void cTimer::SetId ( int  Id)

Definition at line 540 of file timers.c.

References Id().

Referenced by cTimers::Add(), HandleRemoteTimerModifications(), and cTimers::StoreRemoteTimers().

◆ SetInVpsMargin()

void cTimer::SetInVpsMargin ( bool  InVpsMargin)

Definition at line 626 of file timers.c.

References inVpsMargin, InVpsMargin(), isyslog, and ToDescr().

◆ SetLifetime()

void cTimer::SetLifetime ( int  Lifetime)

Definition at line 658 of file timers.c.

References lifetime, and Lifetime().

◆ SetPending()

void cTimer::SetPending ( bool  Pending)

Definition at line 621 of file timers.c.

References pending, and Pending().

Referenced by cRecordControl::cRecordControl(), cRecordControl::Process(), and cRecordControls::Start().

◆ SetPriority()

void cTimer::SetPriority ( int  Priority)

Definition at line 653 of file timers.c.

References priority, and Priority().

◆ SetRecording()

void cTimer::SetRecording ( bool  Recording)

◆ SetRemote()

void cTimer::SetRemote ( const char *  Remote)

◆ SetStart()

void cTimer::SetStart ( int  Start)

Definition at line 643 of file timers.c.

References start, and Start().

◆ SetStop()

void cTimer::SetStop ( int  Stop)

Definition at line 648 of file timers.c.

References stop, and Stop().

◆ SetTime()

time_t cTimer::SetTime ( time_t  t,
int  SecondsFromMidnight 
)
static

◆ SetWeekDays()

void cTimer::SetWeekDays ( int  WeekDays)

Definition at line 638 of file timers.c.

References weekdays, and WeekDays().

◆ Skip()

void cTimer::Skip ( void  )

Definition at line 701 of file timers.c.

References day, IncDay(), SetEvent(), SetTime(), startTime, and StartTime().

Referenced by cMenuTimers::Delete(), OnOff(), and TimerStillRecording().

◆ Start()

int cTimer::Start ( void  ) const
inline

Definition at line 62 of file timers.h.

References start.

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

◆ StartTime()

time_t cTimer::StartTime ( void  ) const

◆ Stop()

int cTimer::Stop ( void  ) const
inline

Definition at line 63 of file timers.h.

References stop.

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

◆ StopTime()

time_t cTimer::StopTime ( void  ) const

◆ TimeToInt()

int cTimer::TimeToInt ( int  t)
static

Definition at line 197 of file timers.c.

Referenced by Matches().

◆ ToDescr()

cString cTimer::ToDescr ( void  ) const

◆ ToText()

cString cTimer::ToText ( bool  UseChannelID = false) const

◆ WeekDays()

int cTimer::WeekDays ( void  ) const
inline

Definition at line 61 of file timers.h.

References weekdays.

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

Friends And Related Function Documentation

◆ cMenuEditTimer

friend class cMenuEditTimer
friend

Definition at line 28 of file timers.h.

Member Data Documentation

◆ aux

char* cTimer::aux
private

Definition at line 44 of file timers.h.

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

◆ channel

const cChannel* cTimer::channel
private

Definition at line 36 of file timers.h.

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

◆ day

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 37 of file timers.h.

Referenced by cMenuEditTimer::cMenuEditTimer(), cTimer(), Day(), DayMatches(), FirstDay(), Matches(), OnOff(), operator=(), Parse(), ParseDay(), PrintFirstDay(), SetDay(), cMenuEditTimer::SetFirstDayItem(), Skip(), and ToText().

◆ deferred

time_t cTimer::deferred
mutableprivate

Matches(time_t, ...) will return false if the current time is before this value.

Definition at line 33 of file timers.h.

Referenced by cTimer(), Deferred(), Matches(), operator=(), and SetDeferred().

◆ event

const cEvent* cTimer::event
private

Definition at line 46 of file timers.h.

Referenced by Event(), Matches(), operator=(), SetEvent(), and ~cTimer().

◆ file

char cTimer::file[NAME_MAX *2+1]
mutableprivate

◆ flags

uint cTimer::flags
private

◆ id

int cTimer::id
private

Definition at line 30 of file timers.h.

Referenced by Id(), and operator=().

◆ inVpsMargin

bool cTimer::inVpsMargin
private

Definition at line 34 of file timers.h.

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

◆ lifetime

int cTimer::lifetime
private

◆ pending

bool cTimer::pending
private

Definition at line 34 of file timers.h.

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

◆ priority

int cTimer::priority
private

◆ remote

char* cTimer::remote
private

◆ scheduleState

int cTimer::scheduleState
private

Definition at line 32 of file timers.h.

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

◆ start

int cTimer::start
private

◆ startTime

time_t cTimer::startTime
mutableprivate

Definition at line 31 of file timers.h.

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

◆ stop

int cTimer::stop
private

◆ stopTime

time_t cTimer::stopTime
private

Definition at line 31 of file timers.h.

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

◆ weekdays

int cTimer::weekdays
private

bitmask, lowest bits: SSFTWTM (the 'M' is the LSB)

Definition at line 38 of file timers.h.

Referenced by cMenuEditTimer::cMenuEditTimer(), cTimer(), DayMatches(), FirstDay(), IsSingleEvent(), operator=(), Parse(), PrintFirstDay(), cMenuEditTimer::SetHelpKeys(), SetWeekDays(), ToText(), and WeekDays().


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