67 int NewCounter = (
timeout - time(NULL) + 9) / 10;
106 if (
Setup.EmergencyExit) {
107 esyslog(
"initiating emergency exit");
112 dsyslog(
"emergency exit request ignored according to setup");
117 time_t Delta =
Setup.NextWakeupTime ?
Setup.NextWakeupTime - time(NULL) : 0;
119 if (!
Setup.NextWakeupTime || abs(Delta) > ManualStart) {
121 dsyslog(
"assuming manual start of VDR");
127 dsyslog(
"scheduled wakeup time in %jd minutes, assuming automatic start of VDR", intmax_t(Delta / 60));
140 time_t Delta = WakeupTime ? WakeupTime - time(NULL) : 0;
142 isyslog(
"executing '%s'", *cmd);
144 if (!WIFEXITED(Status) || WEXITSTATUS(Status))
145 esyslog(
"SystemExec() failed with status %d", Status);
147 Setup.NextWakeupTime = WakeupTime;
154 if (!
Setup.MinUserInactivity && !Force) {
160 else if (Seconds == -1)
162 else if (Seconds == -2)
164 else if (Seconds == -3)
175 Skins.Message(
mtError,
tr(
"Can't shutdown - option '-s' not given!"));
179 if (!Interactive || !
Interface->Confirm(
tr(
"Editing - shut down anyway?")))
185 time_t Delta = Next ? Next - time(NULL) : 0;
189 if (!Interactive || !
Interface->Confirm(
tr(
"Recording - shut down anyway?")))
192 else if (Next && Delta <=
Setup.MinEventTimeout * 60) {
206 Delta = Next ? Next - time(NULL) : 0;
207 if (Next && Delta <=
Setup.MinEventTimeout * 60) {
222 if (!Interactive || !
Interface->Confirm(
tr(
"Editing - restart anyway?")))
228 time_t Delta = Next ? Next - time(NULL) : 0;
232 if (!Interactive || !
Interface->Confirm(
tr(
"Recording - restart anyway?")))
245 time_t Now = time(NULL);
246 const cTimer *Timer = Timers->GetNextActiveTimer();
250 time_t NextPlugin = Plugin ? Plugin->
WakeupTime() : 0;
251 if (NextPlugin && (!Next || Next > NextPlugin)) {
255 time_t Delta = Next ? Next - Now : 0;
257 if (Next && Delta <
Setup.MinEventTimeout * 60) {
260 Delta =
Setup.MinEventTimeout * 60;
270 else if (Next && Plugin) {
time_t timeout
5-minute countdown timer
bool timedOut
countdown did run down to 0 and was not canceled
bool Update(void)
Update status display of the countdown.
int counter
last shown time in 10s units
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
void Cancel(void)
Cancel the 5 minute shutdown warning countdown.
bool Done(void)
Check if countdown timer has run out without canceling.
static cPlugin * GetNextWakeupPlugin(void)
static bool Active(const char *Prompt=NULL)
virtual time_t WakeupTime(void)
static bool Enabled(void)
void CheckManualStart(int ManualStart)
Check whether the next timer is in ManualStart time window.
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.
char * shutdownCommand
Command for shutting down VDR.
bool ConfirmShutdown(bool Ask)
Check for background activity that blocks shutdown.
int exitCode
Exit code, if VDR exit was requested, or -1 if not requested.
void RequestEmergencyExit(void)
Requests an emergency exit of the VDR main loop.
bool DoShutdown(bool Force)
Call the shutdown script with data of the next pending timer.
bool ConfirmRestart(bool Ask)
Check for background activity that blocks restart.
void Exit(int ExitCode)
Set VDR exit code and initiate end of VDR main loop.
void CallShutdownCommand(time_t WakeupTime, int Channel, const char *File, bool UserShutdown)
Call the shutdown command with the given parameters.
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 retry
Time for retrying the shutdown.
bool emergencyExitRequested
The requested exit is an emergency exit.
static cString sprintf(const char *fmt,...) __attribute__((format(printf
const char * File(void) const
time_t StartTime(void) const
The start time of this timer, which is the time as given by the user (for normal timers) or the start...
const cChannel * Channel(void) const
bool HasFlags(uint Flags) const
cRecordingsHandler RecordingsHandler
cShutdownHandler ShutdownHandler
static time_t GetWakeupTime(const cTimer *Timer)
int SystemExec(const char *Command, bool Detached)