vdr 2.7.2
timers.c File Reference
#include "timers.h"
#include <ctype.h>
#include "device.h"
#include "i18n.h"
#include "libsi/si.h"
#include "recording.h"
#include "remote.h"
#include "status.h"
#include "svdrp.h"

Go to the source code of this file.

Macros

#define VPSGRACE   15
 
#define DAYBUFFERSIZE   64
 
#define EITPRESENTFOLLOWINGRATE   10
 
#define EITPRESENTFOLLOWINGGRACE   60
 
#define FULLMATCH   1000
 
#define EXPIRELATENCY   60
 
#define EPGLIMITBEFORE   (1 * 3600)
 
#define EPGLIMITAFTER   (1 * 3600)
 
#define DELETE_EXPIRED_TIMEOUT   30
 

Functions

static bool MatchPattern (const char *Pattern, const char *Title, cString *Before=NULL, cString *Match=NULL, cString *After=NULL)
 
static cString MakePatternFileName (const char *Pattern, const char *Title, const char *Episode, const char *File)
 
static bool RemoteTimerError (const cTimer *Timer, cString *Msg)
 
bool HandleRemoteTimerModifications (cTimer *NewTimer, cTimer *OldTimer, cString *Msg)
 
static int CompareTimers (const void *a, const void *b)
 

Macro Definition Documentation

◆ DAYBUFFERSIZE

#define DAYBUFFERSIZE   64

Referenced by cTimer::PrintDay().

◆ DELETE_EXPIRED_TIMEOUT

#define DELETE_EXPIRED_TIMEOUT   30

Definition at line 1273 of file timers.c.

Referenced by cTimers::DeleteExpired().

◆ EITPRESENTFOLLOWINGGRACE

#define EITPRESENTFOLLOWINGGRACE   60

Definition at line 567 of file timers.c.

Referenced by cTimer::Matches().

◆ EITPRESENTFOLLOWINGRATE

#define EITPRESENTFOLLOWINGRATE   10

Definition at line 566 of file timers.c.

Referenced by cTimer::Matches().

◆ EPGLIMITAFTER

#define EPGLIMITAFTER   (1 * 3600)

Definition at line 774 of file timers.c.

Referenced by cTimer::SetEventFromSchedule().

◆ EPGLIMITBEFORE

#define EPGLIMITBEFORE   (1 * 3600)

Definition at line 773 of file timers.c.

Referenced by cTimer::SetEventFromSchedule().

◆ EXPIRELATENCY

#define EXPIRELATENCY   60

Definition at line 724 of file timers.c.

Referenced by cTimer::Expired(), and cTimer::SpawnPatternTimers().

◆ FULLMATCH

#define FULLMATCH   1000

Definition at line 668 of file timers.c.

Referenced by cTimer::Matches(), and cTimer::SetEventFromSchedule().

◆ VPSGRACE

#define VPSGRACE   15

Definition at line 24 of file timers.c.

Referenced by cTimer::Matches().

Function Documentation

◆ CompareTimers()

static int CompareTimers ( const void * a,
const void * b )
static

Definition at line 1475 of file timers.c.

Referenced by cSortedTimers::cSortedTimers().

◆ HandleRemoteTimerModifications()

bool HandleRemoteTimerModifications ( cTimer * NewTimer,
cTimer * OldTimer = NULL,
cString * Msg = NULL )

Performs any operations necessary to synchronize changes to a timer between peer VDR machines.

OldTimer must point to the old version of the timer, while NewTimer points to the new version. If either of the two is a remote timer, the necessary SVDRP commands are executed to reflect the changes on the remote machine(s). If NewTimer is NULL, OldTimer will be removed from the remote machine (if applicable). If OldTimer is NULL, NewTimer will be added to the remote machine (if applicable). If anything goes wrong, an error message is generated in the optional Msg string, which should be presented to the user. Any necessary local operations (like adding/deleting the timer to the local list of timers etc.) must be done before and/or after the call to this function. Proper log messages will be generated by this function, even if no remote operations are required. Returns true if successful.

Definition at line 1414 of file timers.c.

References cTimer::ClrFlags(), ExecSVDRPCommand(), cTimer::Id(), isyslog, cTimer::Local(), cTimers::NewTimerId(), cTimer::Remote(), RemoteTimerError(), cTimer::SetId(), cString::sprintf(), SVDRPCode(), SVDRPValue(), tfRecording, cTimer::ToDescr(), and cTimer::ToText().

Referenced by HandleRemoteModifications(), and cTimer::SpawnPatternTimer().

◆ MakePatternFileName()

static cString MakePatternFileName ( const char * Pattern,
const char * Title,
const char * Episode,
const char * File )
static

◆ MatchPattern()

static bool MatchPattern ( const char * Pattern,
const char * Title,
cString * Before = NULL,
cString * Match = NULL,
cString * After = NULL )
static

◆ RemoteTimerError()

static bool RemoteTimerError ( const cTimer * Timer,
cString * Msg )
static

Definition at line 1407 of file timers.c.

References cTimer::Id(), cTimer::Remote(), cString::sprintf(), and tr.

Referenced by HandleRemoteTimerModifications().