cTimer Class Reference

#include <timers.h>

Inheritance diagram for cTimer:

Inheritance graph
[legend]
Collaboration diagram for cTimer:

Collaboration graph
[legend]

List of all members.

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
cString ToText (bool UseChannelID=false)
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
char * SetFile (const char *File)
bool Matches (time_t t=0, bool Directly=false, int Margin=0) const
int 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 SetPriority (int Priority)
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

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)

Private Attributes

time_t startTime
time_t stopTime
time_t lastSetEvent
bool recording
bool pending
bool inVpsMargin
uint flags
cChannelchannel
time_t day
 midnight of the day this timer shall hit, or of the first day it shall hit in case of a repeating timer
int weekdays
 bitmask, lowest bits: SSFTWTM (the 'M' is the LSB)
int start
int stop
int priority
int lifetime
char file [MaxFileName]
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 
)

Definition at line 24 of file timers.c.

References aux, channel, Channels, cDevice::CurrentChannel(), day, cSetup::DefaultLifetime, cSetup::DefaultPriority, file, flags, cChannels::GetByNumber(), cSetup::InstantRecordTime, inVpsMargin, lastSetEvent, lifetime, cSetup::MarkInstantRecord, cChannel::Name(), cSetup::NameInstantRecord, cSetup::PauseLifetime, cSetup::PausePriority, pending, priority, recording, SetFlags(), SetTime(), Setup, start, startTime, stop, stopTime, tfActive, tfInstant, tfNone, and weekdays.

Here is the call graph for this function:

cTimer::cTimer ( const cEvent Event  ) 

Definition at line 52 of file timers.c.

References aux, channel, cEvent::ChannelID(), Channels, day, cSetup::DefaultLifetime, cSetup::DefaultPriority, cEvent::Duration(), file, flags, cChannels::GetByChannelID(), HasFlags(), inVpsMargin, isempty(), lastSetEvent, lifetime, cSetup::MarginStart, cSetup::MarginStop, pending, priority, recording, SetFlags(), SetTime(), Setup, start, cEvent::StartTime(), startTime, stop, stopTime, strn0cpy(), tfActive, tfVps, cEvent::Title(), cSetup::UseVps, cEvent::Vps(), and weekdays.

Here is the call graph for this function:

cTimer::cTimer ( const cTimer Timer  ) 

Definition at line 86 of file timers.c.

References aux, and channel.

cTimer::~cTimer (  )  [virtual]

Definition at line 94 of file timers.c.

References aux.


Member Function Documentation

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

Definition at line 99 of file timers.c.

References aux, channel, day, file, flags, inVpsMargin, lastSetEvent, lifetime, pending, priority, recording, start, startTime, stop, stopTime, and weekdays.

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

References priority, and StartTime().

Referenced by cMenuTimerItem::Compare().

Here is the call graph for this function:

bool cTimer::Recording ( void   )  const [inline]

Definition at line 51 of file timers.h.

References recording.

Referenced by cSVDRP::CmdDELT(), cMenuTimers::Delete(), Expired(), main(), cMenuTimerItem::Set(), and SetEventFromSchedule().

bool cTimer::Pending ( void   )  const [inline]

Definition at line 52 of file timers.h.

References pending.

Referenced by cRecordControls::Start().

bool cTimer::InVpsMargin ( void   )  const [inline]

Definition at line 53 of file timers.h.

References inVpsMargin.

uint cTimer::Flags ( void   )  const [inline]

Definition at line 54 of file timers.h.

References flags.

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

Definition at line 55 of file timers.h.

References channel.

Referenced by cMenuEditTimer::cMenuEditTimer(), cRecordControl::cRecordControl(), cRecording::cRecording(), cRecordControl::GetEvent(), cTimers::GetTimer(), main(), cMenuEditTimer::ProcessKey(), cMenuTimerItem::Set(), SetEventFromSchedule(), cRecordControls::Start(), ToDescr(), and ToText().

time_t cTimer::Day ( void   )  const [inline]

Definition at line 56 of file timers.h.

References day.

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

int cTimer::WeekDays ( void   )  const [inline]

Definition at line 57 of file timers.h.

References weekdays.

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

int cTimer::Start ( void   )  const [inline]

Definition at line 58 of file timers.h.

References start.

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

int cTimer::Stop ( void   )  const [inline]

Definition at line 59 of file timers.h.

References stop.

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

int cTimer::Priority ( void   )  const [inline]

Definition at line 60 of file timers.h.

References priority.

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

int cTimer::Lifetime ( void   )  const [inline]

Definition at line 61 of file timers.h.

References lifetime.

Referenced by cRecording::cRecording().

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

Definition at line 62 of file timers.h.

References file.

Referenced by cRecording::cRecording(), main(), and cMenuTimerItem::Set().

time_t cTimer::FirstDay ( void   )  const [inline]

Definition at line 63 of file timers.h.

References day, and weekdays.

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

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

Definition at line 64 of file timers.h.

References aux.

Referenced by cRecording::cRecording().

cString cTimer::ToText ( bool  UseChannelID = false  ) 

Definition at line 135 of file timers.c.

References aux, Channel(), day, file, flags, itoa(), lifetime, PrintDay(), priority, start, stop, strreplace(), and weekdays.

Referenced by cSVDRP::CmdLSTT(), cSVDRP::CmdMODT(), cSVDRP::CmdNEWT(), cSVDRP::CmdUPDT(), and Save().

Here is the call graph for this function:

cString cTimer::ToDescr ( void   )  const

Definition at line 144 of file timers.c.

References Channel(), file, HasFlags(), cListObject::Index(), start, stop, and tfVps.

Referenced by cSVDRP::CmdDELT(), cSVDRP::CmdMODT(), cSVDRP::CmdNEWT(), cSVDRP::CmdUPDT(), cMenuRecordings::Delete(), cMenuTimers::Delete(), cTimers::DeleteExpired(), cMenuTimers::OnOff(), cMenuEditTimer::ProcessKey(), cMenuSchedule::Record(), cMenuWhatsOn::Record(), SetEvent(), SetInVpsMargin(), SetRecording(), cRecordControls::Start(), and cRecordControls::Stop().

Here is the call graph for this function:

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

Definition at line 67 of file timers.h.

References event.

Referenced by cRecordControl::cRecordControl(), cMenuTimers::Info(), main(), SetEventFromSchedule(), and cMenuTimers::SetHelpKeys().

bool cTimer::Parse ( const char *  s  ) 

Definition at line 249 of file timers.c.

References aux, channel, Channels, ClrFlags(), day, esyslog, file, flags, tChannelID::FromString(), cChannels::GetByChannelID(), cChannels::GetByNumber(), isnumber(), lifetime, MALLOC, MaxFileName, ParseDay(), priority, skipspace(), start, stop, strn0cpy(), strreplace(), tfRecording, and weekdays.

Referenced by cSVDRP::CmdMODT(), cSVDRP::CmdNEWT(), and cSVDRP::CmdUPDT().

Here is the call graph for this function:

bool cTimer::Save ( FILE *  f  ) 

Definition at line 298 of file timers.c.

References ToText().

Here is the call graph for this function:

bool cTimer::IsSingleEvent ( void   )  const

Definition at line 303 of file timers.c.

References weekdays.

Referenced by cRecording::cRecording(), DayMatches(), cMenuRecordings::Delete(), Expired(), Matches(), OnOff(), and cMenuEditTimer::SetFirstDayItem().

int cTimer::GetMDay ( time_t  t  )  [static]

Definition at line 308 of file timers.c.

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

int cTimer::GetWDay ( time_t  t  )  [static]

Definition at line 314 of file timers.c.

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

bool cTimer::DayMatches ( time_t  t  )  const

Definition at line 321 of file timers.c.

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

Referenced by Matches().

Here is the call graph for this function:

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

Definition at line 326 of file timers.c.

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

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

Definition at line 338 of file timers.c.

Referenced by cTimer(), DayMatches(), Matches(), ParseDay(), cMenuEditDateItem::ProcessKey(), and Skip().

char * cTimer::SetFile ( const char *  File  ) 

Definition at line 349 of file timers.c.

References file, isempty(), and strn0cpy().

Referenced by cRecording::cRecording().

Here is the call graph for this function:

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

Definition at line 356 of file timers.c.

References day, DayMatches(), event, HasFlags(), IncDay(), IsSingleEvent(), max(), SECSINDAY, SetTime(), start, startTime, stop, stopTime, tfActive, tfVps, TimeToInt(), and cEvent::Vps().

Referenced by cTimers::GetNextActiveTimer(), main(), Matches(), OnOff(), cRecordControl::Process(), cMenuEditTimer::ProcessKey(), cMenuSchedule::Record(), cMenuWhatsOn::Record(), SetEventFromSchedule(), cRecordControls::Start(), StartTime(), and StopTime().

Here is the call graph for this function:

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

Definition at line 406 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().

Here is the call graph for this function:

bool cTimer::Expired ( void   )  const

Definition at line 439 of file timers.c.

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

Referenced by cTimers::DeleteExpired().

Here is the call graph for this function:

time_t cTimer::StartTime ( void   )  const

Definition at line 444 of file timers.c.

References Matches(), and startTime.

Referenced by cSVDRP::CmdNEXT(), Compare(), cRecording::cRecording(), cRecordControl::GetEvent(), main(), Matches(), SetEventFromSchedule(), and Skip().

Here is the call graph for this function:

time_t cTimer::StopTime ( void   )  const

Definition at line 451 of file timers.c.

References Matches(), and stopTime.

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

Here is the call graph for this function:

void cTimer::SetEventFromSchedule ( const cSchedules Schedules = NULL  ) 

Definition at line 461 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(), StopTime(), tfVps, and cEvent::Vps().

Referenced by cMenuTimers::OnOff(), and cMenuEditTimer::ProcessKey().

Here is the call graph for this function:

void cTimer::SetEvent ( const cEvent Event  ) 

Definition at line 519 of file timers.c.

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

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

Here is the call graph for this function:

void cTimer::SetRecording ( bool  Recording  ) 

Definition at line 530 of file timers.c.

References ClrFlags(), isyslog, recording, SetFlags(), tfRecording, and ToDescr().

Referenced by cRecordControl::cRecordControl(), and cRecordControl::Stop().

Here is the call graph for this function:

void cTimer::SetPending ( bool  Pending  ) 

Definition at line 540 of file timers.c.

References pending.

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

void cTimer::SetInVpsMargin ( bool  InVpsMargin  ) 

Definition at line 545 of file timers.c.

References inVpsMargin, isyslog, and ToDescr().

Referenced by main().

Here is the call graph for this function:

void cTimer::SetPriority ( int  Priority  ) 

Definition at line 552 of file timers.c.

References priority.

void cTimer::SetFlags ( uint  Flags  ) 

Definition at line 557 of file timers.c.

References flags.

Referenced by cSVDRP::CmdMODT(), cMenuEditTimer::cMenuEditTimer(), cTimer(), OnOff(), and SetRecording().

void cTimer::ClrFlags ( uint  Flags  ) 

Definition at line 562 of file timers.c.

References flags.

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

void cTimer::InvFlags ( uint  Flags  ) 

Definition at line 567 of file timers.c.

References flags.

Referenced by OnOff().

bool cTimer::HasFlags ( uint  Flags  )  const

Definition at line 572 of file timers.c.

References flags.

Referenced by cSVDRP::CmdMODT(), cTimer(), Expired(), cRecordControl::GetEvent(), main(), Matches(), OnOff(), cMenuTimers::OnOff(), cMenuEditTimer::ProcessKey(), cMenuTimerItem::Set(), SetEventFromSchedule(), and ToDescr().

void cTimer::Skip ( void   ) 

Definition at line 577 of file timers.c.

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

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

Here is the call graph for this function:

void cTimer::OnOff ( void   ) 

Definition at line 584 of file timers.c.

References ClrFlags(), day, HasFlags(), InvFlags(), IsSingleEvent(), Matches(), SetEvent(), SetFlags(), Skip(), and tfActive.

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

Here is the call graph for this function:

cString cTimer::PrintFirstDay ( void   )  const

Definition at line 239 of file timers.c.

References day, PrintDay(), and weekdays.

Referenced by cMenuTimers::OnOff().

Here is the call graph for this function:

int cTimer::TimeToInt ( int  t  )  [static]

Definition at line 151 of file timers.c.

Referenced by Matches().

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

Definition at line 156 of file timers.c.

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

Referenced by Parse(), and ParseWeekDays().

Here is the call graph for this function:

cString cTimer::PrintDay ( time_t  Day,
int  WeekDays 
) [static]

Definition at line 215 of file timers.c.

References DAYBUFFERSIZE, and tr.

Referenced by PrintFirstDay(), cMenuEditDateItem::Set(), cMenuTimerItem::Set(), and ToText().


Friends And Related Function Documentation

friend class cMenuEditTimer [friend]

Definition at line 28 of file timers.h.


Member Data Documentation

time_t cTimer::startTime [mutable, private]

Definition at line 30 of file timers.h.

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

time_t cTimer::stopTime [mutable, private]

Definition at line 30 of file timers.h.

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

time_t cTimer::lastSetEvent [private]

Definition at line 31 of file timers.h.

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

bool cTimer::recording [private]

Definition at line 32 of file timers.h.

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

bool cTimer::pending [private]

Definition at line 32 of file timers.h.

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

bool cTimer::inVpsMargin [private]

Definition at line 32 of file timers.h.

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

uint cTimer::flags [private]

Definition at line 33 of file timers.h.

Referenced by ClrFlags(), cMenuEditTimer::cMenuEditTimer(), cTimer(), Flags(), HasFlags(), InvFlags(), operator=(), Parse(), SetFlags(), and ToText().

cChannel* cTimer::channel [private]

Definition at line 34 of file timers.h.

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

time_t cTimer::day [mutable, private]

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

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

int cTimer::weekdays [private]

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

Definition at line 36 of file timers.h.

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

int cTimer::start [private]

Definition at line 37 of file timers.h.

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

int cTimer::stop [private]

Definition at line 38 of file timers.h.

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

int cTimer::priority [private]

Definition at line 39 of file timers.h.

Referenced by cMenuEditTimer::cMenuEditTimer(), Compare(), cTimer(), operator=(), Parse(), Priority(), SetPriority(), and ToText().

int cTimer::lifetime [private]

Definition at line 40 of file timers.h.

Referenced by cMenuEditTimer::cMenuEditTimer(), cTimer(), Lifetime(), operator=(), Parse(), and ToText().

char cTimer::file[MaxFileName] [private]

Definition at line 41 of file timers.h.

Referenced by cMenuEditTimer::cMenuEditTimer(), cTimer(), File(), operator=(), Parse(), cMenuEditTimer::ProcessKey(), SetFile(), ToDescr(), and ToText().

char* cTimer::aux [private]

Definition at line 42 of file timers.h.

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

const cEvent* cTimer::event [private]

Definition at line 43 of file timers.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Nov 6 20:31:04 2007 for VDR by  doxygen 1.5.3-20071008