Go to the documentation of this file.
15 #include <sys/types.h>
67 int NewCounter = (
timeout - time(NULL) + 9) / 10;
96 esyslog(
"initiating emergency exit");
101 dsyslog(
"emergency exit request ignored according to setup");
110 dsyslog(
"assuming manual start of VDR");
116 dsyslog(
"scheduled wakeup time in %ld minutes, assuming automatic start of VDR", Delta / 60);
129 time_t Delta = WakeupTime ? WakeupTime - time(NULL) : 0;
131 isyslog(
"executing '%s'", *cmd);
133 if (!WIFEXITED(Status) || WEXITSTATUS(Status))
134 esyslog(
"SystemExec() failed with status %d", Status);
149 else if (Seconds == -1)
151 else if (Seconds == -2)
153 else if (Seconds == -3)
173 const cTimer *Timer = Timers->GetNextActiveTimer();
174 time_t Next = Timer ? Timer->
StartTime() : 0;
175 time_t Delta = Timer ? Next - time(NULL) : 0;
196 Delta = Next ? Next - time(NULL) : 0;
217 const cTimer *Timer = Timers->GetNextActiveTimer();
218 time_t Next = Timer ? Timer->
StartTime() : 0;
219 time_t Delta = Timer ? Next - time(NULL) : 0;
236 time_t Now = time(NULL);
237 const cTimer *Timer = Timers->GetNextActiveTimer();
240 time_t Next = Timer ? Timer->
StartTime() : 0;
241 time_t NextPlugin = Plugin ? Plugin->
WakeupTime() : 0;
242 if (NextPlugin && (!Next || Next > NextPlugin)) {
246 time_t Delta = Next ? Next - Now : 0;
261 else if (Next && Plugin) {
static cString sprintf(const char *fmt,...) __attribute__((format(printf
const cChannel * Channel(void) const
static bool Active(const char *Prompt=NULL)
eKeys Message(eMessageType Type, const char *s, int Seconds=0)
Displays the given message, either through a currently visible display object that is capable of doin...
cRecordingsHandler RecordingsHandler
bool ConfirmRestart(bool Ask)
Check for background activity that blocks restart.
void Start(const char *Message, int Seconds)
Start the 5 minute shutdown warning countdown.
const char * message
message to display, s is placeholder for time
int exitCode
Exit code, if VDR exit was requested, or -1 if not requested.
bool emergencyExitRequested
The requested exit is an emergency exit.
bool ConfirmShutdown(bool Ask)
Check for background activity that blocks shutdown.
cShutdownHandler ShutdownHandler
static bool Enabled(void)
void CheckManualStart(int ManualStart)
Check whether the next timer is in ManualStart time window.
void SetUserInactiveTimeout(int Seconds=-1, bool Force=false)
Set the time in the future when VDR will switch into non-interactive mode or power down.
time_t StartTime(void) const
int counter
last shown time in 10s units
bool Update(void)
Update status display of the countdown.
bool Confirm(const char *s, int Seconds=10, bool WaitForTimeout=false)
bool timedOut
countdown did run down to 0 and was not canceled
const char * File(void) const
time_t retry
Time for retrying the shutdown.
void RequestEmergencyExit(void)
Requests an emergency exit of the VDR main loop.
char * shutdownCommand
Command for shutting down VDR.
time_t timeout
5-minute countdown timer
time_t activeTimeout
Time when VDR will become non-interactive. 0 means never, 1 means unknown time ago.
void SetShutdownCommand(const char *ShutdownCommand)
Set the command string for shutdown command.
bool Done(void)
Check if countdown timer has run out without canceling.
void Cancel(void)
Cancel the 5 minute shutdown warning countdown.
void CallShutdownCommand(time_t WakeupTime, int Channel, const char *File, bool UserShutdown)
Call the shutdown command with the given parameters.
bool Active(void)
Checks whether the thread is still alive.
virtual time_t WakeupTime(void)
int SystemExec(const char *Command, bool Detached)
bool DoShutdown(bool Force)
Call the shutdown script with data of the next pending timer.
static cPlugin * GetNextWakeupPlugin(void)