diff options
author | Lars Hanisch <dvb@flensrocker.de> | 2011-07-13 22:50:26 +0200 |
---|---|---|
committer | Lars Hanisch <dvb@flensrocker.de> | 2011-07-13 22:50:26 +0200 |
commit | 3049ae76983337cfc736ddcf4f1855fa22e3fd66 (patch) | |
tree | b825117233952c7e8e9591043b6f4f448f36354a /dynamicdevice.c | |
parent | fff0dbb162919ecd01149898b0eb858ed584b3f7 (diff) | |
download | vdr-plugin-dynamite-3049ae76983337cfc736ddcf4f1855fa22e3fd66.tar.gz vdr-plugin-dynamite-3049ae76983337cfc736ddcf4f1855fa22e3fd66.tar.bz2 |
add italian translations and an idle-hookv0.0.6g
Diffstat (limited to 'dynamicdevice.c')
-rw-r--r-- | dynamicdevice.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/dynamicdevice.c b/dynamicdevice.c index 4910f9b..672cbb1 100644 --- a/dynamicdevice.c +++ b/dynamicdevice.c @@ -6,6 +6,7 @@ cPlugin *cDynamicDevice::dynamite = NULL; int cDynamicDevice::defaultGetTSTimeout = 0; +cString *cDynamicDevice::idleHook = NULL; cDvbDeviceProbe *cDynamicDevice::dvbprobe = NULL; bool cDynamicDevice::enableOsdMessages = false; int cDynamicDevice::numDynamicDevices = 0; @@ -289,6 +290,13 @@ eDynamicDeviceReturnCode cDynamicDevice::SetLockDevice(const char *DevPath, bool return ddrcSuccess; } +static void CallIdleHook(const char *IdleHook, const char *DevPath, bool Idle) +{ + const char *idleHookCmd = *cString::sprintf("%s --idle=%s --device=%s", IdleHook, (Idle ? "on" : "off"), DevPath); + isyslog("dynamite: calling idle hook %s", idleHookCmd); + SystemExec(idleHookCmd, false); +} + eDynamicDeviceReturnCode cDynamicDevice::SetIdle(const char *DevPath, bool Idle) { if (!DevPath) @@ -305,8 +313,16 @@ eDynamicDeviceReturnCode cDynamicDevice::SetIdle(const char *DevPath, bool Idle) if ((index < 0) || (index >= numDynamicDevices)) return ddrcNotFound; - ((cDevice*)dynamicdevice[index])->SetIdle(Idle); isyslog("dynamite: set device %s to %s", DevPath, (Idle ? "idle" : "not idle")); + if (idleHook && !Idle) + CallIdleHook(**idleHook, dynamicdevice[index]->GetDevPath(), Idle); + if (((cDevice*)dynamicdevice[index])->SetIdle(Idle)) { + if (idleHook && Idle) + CallIdleHook(**idleHook, dynamicdevice[index]->GetDevPath(), Idle); + } + else if (idleHook && !Idle) + CallIdleHook(**idleHook, dynamicdevice[index]->GetDevPath(), Idle); + return ddrcSuccess; } |