diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2001-09-30 12:35:09 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2001-09-30 12:35:09 +0200 |
commit | 726225e083aeab7d8ecc1471cabc0786517a4450 (patch) | |
tree | 86541f1fff8f46188bc81aaa1b51a11f33e8cfea | |
parent | 3b67f70b9db9e12e5e4e87ded3eb8db714fe9e3b (diff) | |
download | vdr-726225e083aeab7d8ecc1471cabc0786517a4450.tar.gz vdr-726225e083aeab7d8ecc1471cabc0786517a4450.tar.bz2 |
Providing channel number and file name to the shutdown program
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | INSTALL | 8 | ||||
-rw-r--r-- | vdr.c | 6 |
3 files changed, 13 insertions, 3 deletions
@@ -795,3 +795,5 @@ Video Disk Recorder Revision History not the result of an editing process shall be written into separate files. - Fixed handling repeat function when using LIRC (thanks to Matthias Weingart). - Fixed the "system time seen..." message in case of overlapping timers. +- The shutdown program (defined with the '-s' option) now also gets the channel + number and recording title of the timer (see INSTALL). @@ -109,7 +109,7 @@ active, the user has been inactive for at least MinUserInactivity minutes and the next timer event is at least MinEventTimeout minutes in the future (see the Setup parameters in MANUAL). -The command given in the '-s' option will be called with two parameters. +The command given in the '-s' option will be called with four parameters. The first one is the time (in UTC) of the next timer event (as a time_t type number), and the second one is the number of seconds from the current time until the next timer event. Your program can choose which one to use @@ -129,6 +129,12 @@ and only perform the system shutdown. A program that uses the second parameter to set the hardware for restart must therefore also check whether the first parameter is '0'. +The third parameter contains the number of the channel that will be recorded +by the next timer (or 0 if no timer is present), and the fourth parameter +contains the file name of the recording as defined in the timer (or an empty +string if no timer is present). These can be used by the shutdown program to +show that information on some display interface etc. + If a timer is currently recording, the parameters will reflect the start time of that timer. This means that the first parameter will be a time in the past, and the second parameter will be a negative number. This only @@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/people/kls/vdr * - * $Id: vdr.c 1.80 2001/09/30 11:42:58 kls Exp $ + * $Id: vdr.c 1.81 2001/09/30 12:13:38 kls Exp $ */ #define _GNU_SOURCE @@ -502,8 +502,10 @@ int main(int argc, char *argv[]) if (WatchdogTimeout > 0) signal(SIGALRM, SIG_IGN); if (Interface->Confirm(tr("Press any key to cancel shutdown"), LastActivity == 1 ? 5 : SHUTDOWNWAIT, true)) { + int Channel = timer ? timer->channel : 0; + const char *File = timer ? timer->file : ""; char *cmd; - asprintf(&cmd, "%s %ld %ld", Shutdown, Next, Delta); + asprintf(&cmd, "%s %ld %ld %d '%s'", Shutdown, Next, Delta, Channel, File); isyslog(LOG_INFO, "executing '%s'", cmd); system(cmd); delete cmd; |