vdr 2.6.9
cTimer Class Reference

#include <timers.h>

Public Member Functions

 cTimer (bool Instant=false, bool Pause=false, const cChannel *Channel=NULL)
 
 cTimer (const cEvent *Event, const char *FileName=NULL, const cTimer *PatternTimer=NULL)
 
 cTimer (const cTimer &Timer)
 
virtual ~cTimer ()
 
cTimeroperator= (const cTimer &Timer)
 
void CalcMargins (int &MarginStart, int &MarginStop, const cEvent *Event)
 
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 * Pattern (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 PatternAndFile (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 SetPattern (const char *Pattern)
 
void SetFile (const char *File)
 
bool IsPatternTimer (void) const
 
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
 
time_t StartTimeEvent (void) const
 
time_t StopTimeEvent (void) const
 
void SetId (int Id)
 
cTimerSpawnPatternTimer (const cEvent *Event, cTimers *Timers)
 
bool SpawnPatternTimers (const cSchedules *Schedules, cTimers *Timers)
 
bool AdjustSpawnedTimer (void)
 
void TriggerRespawn (void)
 
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 scheduleStateSet
 
int scheduleStateSpawn
 
int scheduleStateAdjust
 
time_t deferred
 
time_t vpsNotRunning
 
bool vpsActive
 
bool pending
 
bool inVpsMargin
 
uint flags
 
const cChannelchannel
 
time_t day
 
int weekdays
 
int start
 
int stop
 
int priority
 
int lifetime
 
char pattern [NAME_MAX *2+1]
 
char file [NAME_MAX *2+1]
 
char * aux
 
char * remote
 
const cEventevent
 

Friends

class cMenuEditTimer
 

Detailed Description

Definition at line 31 of file timers.h.

Constructor & Destructor Documentation

◆ cTimer() [1/3]

◆ cTimer() [2/3]

◆ cTimer() [3/3]

cTimer::cTimer ( const cTimer & Timer)

Definition at line 228 of file timers.c.

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

◆ ~cTimer()

cTimer::~cTimer ( )
virtual

Definition at line 238 of file timers.c.

References aux, event, and remote.

Member Function Documentation

◆ AdjustSpawnedTimer()

◆ Aux()

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

Definition at line 79 of file timers.h.

References aux.

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

◆ CalcMargins()

void cTimer::CalcMargins ( int & MarginStart,
int & MarginStop,
const cEvent * Event )

◆ Channel()

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

References IsPatternTimer(), Pattern(), priority, and StartTime().

Referenced by cMenuTimerItem::Compare().

◆ Day()

time_t cTimer::Day ( void ) const
inline

Definition at line 70 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 527 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 82 of file timers.h.

References deferred.

◆ Event()

◆ Expired()

bool cTimer::Expired ( void ) const

Definition at line 726 of file timers.c.

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

Referenced by cTimers::DeleteExpired().

◆ File()

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

◆ FirstDay()

time_t cTimer::FirstDay ( void ) const
inline

Definition at line 78 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 68 of file timers.h.

References flags.

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

◆ GetMDay()

int cTimer::GetMDay ( time_t t)
static

Definition at line 514 of file timers.c.

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

◆ GetWDay()

int cTimer::GetWDay ( time_t t)
static

Definition at line 520 of file timers.c.

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

◆ HasFlags()

◆ Id()

◆ IncDay()

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

Definition at line 532 of file timers.c.

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

◆ InvFlags()

void cTimer::InvFlags ( uint Flags)

Definition at line 1037 of file timers.c.

References Flags(), and flags.

Referenced by OnOff().

◆ InVpsMargin()

bool cTimer::InVpsMargin ( void ) const
inline

Definition at line 67 of file timers.h.

References inVpsMargin.

Referenced by SetInVpsMargin().

◆ IsPatternTimer()

bool cTimer::IsPatternTimer ( void ) const
inline

◆ IsSingleEvent()

bool cTimer::IsSingleEvent ( void ) const

◆ Lifetime()

int cTimer::Lifetime ( void ) const
inline

Definition at line 75 of file timers.h.

References lifetime.

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

◆ Local()

bool cTimer::Local ( void ) const
inline

Definition at line 81 of file timers.h.

References remote.

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

◆ Matches() [1/2]

◆ Matches() [2/2]

◆ OnOff()

◆ operator=()

◆ Parse()

◆ ParseDay()

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

Definition at line 339 of file timers.c.

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

Referenced by Parse(), and ParseWeekDays().

◆ Pattern()

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

Definition at line 76 of file timers.h.

References pattern.

Referenced by Compare(), Matches(), cMenuTimerItem::Set(), SetPattern(), and SpawnPatternTimer().

◆ PatternAndFile()

cString cTimer::PatternAndFile ( void ) const

Definition at line 312 of file timers.c.

References file, IsPatternTimer(), pattern, and cString::sprintf().

Referenced by ToDescr(), and ToText().

◆ Pending()

bool cTimer::Pending ( void ) const
inline

Definition at line 66 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 432 of file timers.c.

References day, PrintDay(), and weekdays.

Referenced by cMenuTimers::OnOff().

◆ Priority()

int cTimer::Priority ( void ) const
inline

◆ Recording()

◆ Remote()

◆ Save()

bool cTimer::Save ( FILE * f)

Definition at line 502 of file timers.c.

References Remote(), and ToText().

◆ SetAux()

void cTimer::SetAux ( const char * Aux)

Definition at line 1009 of file timers.c.

References Aux(), and aux.

◆ SetDay()

void cTimer::SetDay ( time_t Day)

Definition at line 979 of file timers.c.

References Day(), and day.

Referenced by AdjustSpawnedTimer().

◆ SetDeferred()

void cTimer::SetDeferred ( int Seconds)

Definition at line 1021 of file timers.c.

References deferred, isyslog, and ToDescr().

Referenced by cRecordControl::cRecordControl().

◆ SetEvent()

◆ SetEventFromSchedule()

◆ SetFile()

void cTimer::SetFile ( const char * File)

Definition at line 560 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 776 of file timers.c.

References Id().

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

◆ SetInVpsMargin()

void cTimer::SetInVpsMargin ( bool InVpsMargin)

Definition at line 972 of file timers.c.

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

◆ SetLifetime()

void cTimer::SetLifetime ( int Lifetime)

Definition at line 1004 of file timers.c.

References Lifetime(), and lifetime.

◆ SetPattern()

void cTimer::SetPattern ( const char * Pattern)

Definition at line 555 of file timers.c.

References Pattern(), pattern, and Utf8Strn0Cpy().

◆ SetPending()

void cTimer::SetPending ( bool Pending)

Definition at line 967 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 999 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 989 of file timers.c.

References Start(), and start.

Referenced by AdjustSpawnedTimer().

◆ SetStop()

void cTimer::SetStop ( int Stop)

Definition at line 994 of file timers.c.

References Stop(), and stop.

Referenced by AdjustSpawnedTimer().

◆ SetTime()

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

◆ SetWeekDays()

void cTimer::SetWeekDays ( int WeekDays)

Definition at line 984 of file timers.c.

References WeekDays(), and weekdays.

◆ Skip()

void cTimer::Skip ( void )

Definition at line 1047 of file timers.c.

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

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

◆ SpawnPatternTimer()

◆ SpawnPatternTimers()

◆ Start()

int cTimer::Start ( void ) const
inline

Definition at line 72 of file timers.h.

References start.

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

◆ StartTime()

◆ StartTimeEvent()

time_t cTimer::StartTimeEvent ( void ) const

the start/stop times as given by the event (for VPS timers), by event plus margins (for spawned non-VPS timers),

Definition at line 751 of file timers.c.

References event, HasFlags(), cSetup::MarginStart, Setup, StartTime(), tfSpawned, tfVps, and cEvent::Vps().

Referenced by cSkinLCARSDisplayMenu::DrawTimer().

◆ Stop()

int cTimer::Stop ( void ) const
inline

Definition at line 73 of file timers.h.

References stop.

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

◆ StopTime()

time_t cTimer::StopTime ( void ) const

the stop time as given by the user

Definition at line 744 of file timers.c.

References Matches(), and stopTime.

Referenced by AdjustSpawnedTimer(), cRecordControl::GetEvent(), cTimers::GetNextActiveTimer(), SetEventFromSchedule(), and StopTimeEvent().

◆ StopTimeEvent()

time_t cTimer::StopTimeEvent ( void ) const

or by the user (for normal timers)

Definition at line 762 of file timers.c.

References event, HasFlags(), cSetup::MarginStop, Setup, StopTime(), tfSpawned, tfVps, and cEvent::Vps().

Referenced by cSkinLCARSDisplayMenu::DrawTimer(), Expired(), and SpawnPatternTimers().

◆ TimeToInt()

int cTimer::TimeToInt ( int t)
static

Definition at line 334 of file timers.c.

Referenced by Matches().

◆ ToDescr()

◆ ToText()

◆ TriggerRespawn()

void cTimer::TriggerRespawn ( void )

◆ WeekDays()

int cTimer::WeekDays ( void ) const
inline

Definition at line 71 of file timers.h.

References weekdays.

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

Friends And Related Symbol Documentation

◆ cMenuEditTimer

friend class cMenuEditTimer
friend

Definition at line 32 of file timers.h.

Member Data Documentation

◆ aux

char* cTimer::aux
private

Definition at line 53 of file timers.h.

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

◆ channel

const cChannel* cTimer::channel
private

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

Referenced by cMenuEditTimer::cMenuEditTimer(), cTimer(), 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 39 of file timers.h.

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

◆ event

const cEvent* cTimer::event
private

Definition at line 55 of file timers.h.

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

◆ file

◆ flags

uint cTimer::flags
private

◆ id

int cTimer::id
private

Definition at line 34 of file timers.h.

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

◆ inVpsMargin

bool cTimer::inVpsMargin
private

Definition at line 42 of file timers.h.

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

◆ lifetime

int cTimer::lifetime
private

◆ pattern

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

◆ pending

bool cTimer::pending
private

Definition at line 42 of file timers.h.

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

◆ priority

int cTimer::priority
private

◆ remote

char* cTimer::remote
private

◆ scheduleStateAdjust

int cTimer::scheduleStateAdjust
private

Definition at line 38 of file timers.h.

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

◆ scheduleStateSet

int cTimer::scheduleStateSet
private

Definition at line 36 of file timers.h.

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

◆ scheduleStateSpawn

int cTimer::scheduleStateSpawn
private

Definition at line 37 of file timers.h.

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

◆ start

int cTimer::start
private

the start and stop time of this timer as given by the user,

Definition at line 47 of file timers.h.

Referenced by cMenuEditTimer::cMenuEditTimer(), cTimer(), cTimer(), Matches(), operator=(), Parse(), SetStart(), Start(), ToDescr(), and ToText().

◆ startTime

time_t cTimer::startTime
mutableprivate

Definition at line 35 of file timers.h.

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

◆ stop

int cTimer::stop
private

in the form hhmm, with hh (00..23) and mm (00..59) added as hh*100+mm

Definition at line 48 of file timers.h.

Referenced by cMenuEditTimer::cMenuEditTimer(), cTimer(), cTimer(), Matches(), operator=(), Parse(), SetStop(), Stop(), ToDescr(), and ToText().

◆ stopTime

time_t cTimer::stopTime
private

the time_t value calculated from 'day', 'start' and 'stop'

Definition at line 35 of file timers.h.

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

◆ vpsActive

bool cTimer::vpsActive
mutableprivate

true if this is a VPS timer and the event is current

Definition at line 41 of file timers.h.

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

◆ vpsNotRunning

time_t cTimer::vpsNotRunning
mutableprivate

the time when a VPS event's running status changed to "not running"

Definition at line 40 of file timers.h.

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

◆ weekdays

int cTimer::weekdays
private

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

Definition at line 46 of file timers.h.

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


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