summaryrefslogtreecommitdiff
path: root/dynamicdevice.c
diff options
context:
space:
mode:
authorLars Hanisch <dvb@flensrocker.de>2011-07-13 22:50:26 +0200
committerLars Hanisch <dvb@flensrocker.de>2011-07-13 22:50:26 +0200
commit3049ae76983337cfc736ddcf4f1855fa22e3fd66 (patch)
treeb825117233952c7e8e9591043b6f4f448f36354a /dynamicdevice.c
parentfff0dbb162919ecd01149898b0eb858ed584b3f7 (diff)
downloadvdr-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.c18
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;
}