diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2001-09-22 14:23:55 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2001-09-22 14:23:55 +0200 |
commit | 9f1046221d2fd6f8b4b2713174eccb7fe535e6d3 (patch) | |
tree | a047af3caec6d6ea5ce9da5ca91431584f9cd2cb /menu.c | |
parent | 8223bd1f188e9bd61aa70f275d0512770e2d051f (diff) | |
download | vdr-9f1046221d2fd6f8b4b2713174eccb7fe535e6d3.tar.gz vdr-9f1046221d2fd6f8b4b2713174eccb7fe535e6d3.tar.bz2 |
New command line option '-r'
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 1.125 2001/09/21 16:22:15 kls Exp $ + * $Id: menu.c 1.126 2001/09/22 14:17:27 kls Exp $ */ #include "menu.h" @@ -2104,6 +2104,8 @@ eOSState cDisplayChannel::ProcessKey(eKeys Key) // --- cRecordControl -------------------------------------------------------- +const char *cRecordControl::userCommand = NULL; + cRecordControl::cRecordControl(cDvbApi *DvbApi, cTimer *Timer) { eventInfo = NULL; @@ -2128,6 +2130,7 @@ cRecordControl::cRecordControl(cDvbApi *DvbApi, cTimer *Timer) Summary = eventInfo->GetExtendedDescription(); } cRecording Recording(timer, Subtitle, Summary); + InvokeUserCommand(true); if (dvbApi->StartRecord(Recording.FileName(), Channels.GetByNumber(timer->channel)->ca, timer->priority)) Recording.WriteSummary(); Interface->DisplayRecording(dvbApi->CardIndex(), true); @@ -2170,6 +2173,17 @@ bool cRecordControl::GetEventInfo(void) return false; } +void cRecordControl::InvokeUserCommand(bool Before) +{ + if (userCommand) { + char *cmd; + asprintf(&cmd, "%s %d", userCommand, Before); + isyslog(LOG_INFO, "executing '%s'", cmd); + system(cmd); + delete cmd; + } +} + void cRecordControl::Stop(bool KeepInstant) { if (timer) { @@ -2184,6 +2198,7 @@ void cRecordControl::Stop(bool KeepInstant) } timer = NULL; Interface->DisplayRecording(dvbApi->CardIndex(), false); + InvokeUserCommand(false); } } |