25 void Start(
const char *Message,
int Seconds);
31 operator bool(
void)
const {
return timeout != 0; }
54 void Exit(
int ExitCode) { exitCode = ExitCode; }
57 bool DoExit(
void) {
return exitCode >= 0; }
59 int GetExitCode(
void) {
return exitCode >= 0 ? exitCode : 0; }
63 void RequestEmergencyExit(
void);
65 void CheckManualStart(
int ManualStart);
68 void SetShutdownCommand(
const char *ShutdownCommand);
70 void CallShutdownCommand(time_t WakeupTime,
int Channel,
const char *File,
bool UserShutdown);
72 bool IsUserInactive(time_t AtTime = 0) {
return activeTimeout && activeTimeout <= (AtTime ? AtTime : time(NULL)); }
77 void SetUserInactiveTimeout(
int Seconds = -1,
bool Force =
false);
88 bool Retry(time_t AtTime = 0) {
return retry <= (AtTime ? AtTime : time(NULL)); }
93 void SetRetry(
int Seconds) { retry = time(NULL) + Seconds; }
96 bool ConfirmShutdown(
bool Ask);
101 bool ConfirmRestart(
bool Ask);
106 bool DoShutdown(
bool Force);
bool IsUserInactive(time_t AtTime=0)
Check whether VDR is in interactive mode or non-interactive mode (waiting for shutdown).
time_t GetRetry(void)
Time when shutdown retry block ends.
int counter
last shown time in 10s units
bool timedOut
countdown did run down to 0 and was not canceled
time_t retry
Time for retrying the shutdown.
void SetUserInactive(void)
Set VDR manually into non-interactive mode from now on.
bool Update(void)
Update status display of the countdown.
bool EmergencyExitRequested(void)
Returns true if an emergency exit was requested.
void Exit(int ExitCode)
Set VDR exit code and initiate end of VDR main loop.
char * shutdownCommand
Command for shutting down VDR.
time_t activeTimeout
Time when VDR will become non-interactive. 0 means never, 1 means unknown time ago.
void Start(const char *Message, int Seconds)
Start the 5 minute shutdown warning countdown.
time_t GetUserInactiveTime(void)
Time when user will become non-inactive, or 0 if never, 1 if a long time ago.
int GetExitCode(void)
Get the currently set exit code of VDR.
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 DoExit(void)
Check if an exit code was set, and VDR should exit.
bool Retry(time_t AtTime=0)
Check whether its time to re-try the shutdown.
cShutdownHandler ShutdownHandler
void SetRetry(int Seconds)
Set shutdown retry so that VDR will not try to automatically shut down within Seconds.
bool emergencyExitRequested
The requested exit is an emergency exit.
time_t timeout
5-minute countdown timer
void Cancel(void)
Cancel the 5 minute shutdown warning countdown.
bool Done(void)
Check if countdown timer has run out without canceling.