summaryrefslogtreecommitdiff
path: root/dynamicdevice.c
diff options
context:
space:
mode:
authorLars Hanisch <dvb@flensrocker.de>2011-03-17 18:37:24 +0100
committerLars Hanisch <dvb@flensrocker.de>2011-03-17 18:37:24 +0100
commit346ebc85cd43fbf778a200e912bcb6079b611e64 (patch)
treeaabc62f576036d308a70afb59de7244c6d99cd19 /dynamicdevice.c
parentc2b418c56d5f6e179bd6a62a45a186c70d2b14e2 (diff)
downloadvdr-plugin-dynamite-346ebc85cd43fbf778a200e912bcb6079b611e64.tar.gz
vdr-plugin-dynamite-346ebc85cd43fbf778a200e912bcb6079b611e64.tar.bz2
- use getopt_long on commandline argument processing, look at README for new arguments
- raise event via cPlugin::Service if a device is attached/detached so other plugins can react on it ("dynamite-event-DeviceAttached-v0.1", "dynamite-event-DeviceDetached-v0.1")
Diffstat (limited to 'dynamicdevice.c')
-rw-r--r--dynamicdevice.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/dynamicdevice.c b/dynamicdevice.c
index bf675e7..bfd06af 100644
--- a/dynamicdevice.c
+++ b/dynamicdevice.c
@@ -161,6 +161,7 @@ attach:
dynamicdevice[freeIndex]->devpath = new cString(DevPath);
isyslog("dynamite: attached device %s to dynamic device slot %d", DevPath, freeIndex + 1);
dynamicdevice[freeIndex]->ReadUdevProperties();
+ cPluginManager::CallAllServices("dynamite-event-DeviceAttached-v0.1", (void*)DevPath);
return ddrcSuccess;
}
@@ -267,7 +268,7 @@ void cDynamicDevice::SetDefaultGetTSTimeout(int Seconds)
{
if (Seconds >= 0) {
defaultGetTSTimeout = Seconds;
- isyslog("dynamite: set default GetTSTimeout to %d seconds", Seconds);
+ isyslog("dynamite: set default GetTS-Timeout to %d seconds", Seconds);
cMutexLock lock(&arrayMutex);
for (int i = 0; i < numDynamicDevices; i++)
dynamicdevice[i]->InternSetGetTSTimeout(Seconds);
@@ -386,6 +387,8 @@ void cDynamicDevice::DeleteSubDevice()
delete subDevice;
subDevice = NULL;
isyslog("dynamite: deleted device for %s", (devpath ? **devpath : "(unknown)"));
+ if (devpath)
+ cPluginManager::CallAllServices("dynamite-event-DeviceDetached-v0.1", (void*)**devpath);
}
if (devpath) {
delete devpath;