Activity
Now is not a good time!
diff --git a/newplugin b/newplugin
index 9ac83c85..2a7cac2a 100755
--- a/newplugin
+++ b/newplugin
@@ -12,7 +12,7 @@
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
-# $Id: newplugin 1.25 2006/04/16 09:04:21 kls Exp $
+# $Id: newplugin 1.26 2006/04/17 09:49:13 kls Exp $
$PLUGIN_NAME = $ARGV[0] || die "Usage: newplugin \n";
@@ -165,6 +165,7 @@ public:
virtual bool Start(void);
virtual void Stop(void);
virtual void Housekeeping(void);
+ virtual void MainThreadHook(void);
virtual cString Active(void);
virtual const char *MainMenuEntry(void) { return MAINMENUENTRY; }
virtual cOsdObject *MainMenuAction(void);
@@ -221,6 +222,12 @@ void cPlugin${PLUGIN_CLASS}::Housekeeping(void)
// Perform any cleanup or other regular tasks.
}
+void cPlugin${PLUGIN_CLASS}::MainThreadHook(void)
+{
+ // Perform actions in the context of the main program thread.
+ // WARNING: Use with great care - see PLUGINS.html!
+}
+
cString cPlugin${PLUGIN_CLASS}::Active(void)
{
// Return a message string if shutdown should be postponed
diff --git a/plugin.c b/plugin.c
index 88841899..82cbd692 100644
--- a/plugin.c
+++ b/plugin.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: plugin.c 1.21 2006/04/16 09:23:30 kls Exp $
+ * $Id: plugin.c 1.22 2006/04/17 09:20:05 kls Exp $
*/
#include "plugin.h"
@@ -70,6 +70,10 @@ void cPlugin::Housekeeping(void)
{
}
+void cPlugin::MainThreadHook(void)
+{
+}
+
cString cPlugin::Active(void)
{
return NULL;
@@ -370,6 +374,15 @@ void cPluginManager::Housekeeping(void)
}
}
+void cPluginManager::MainThreadHook(void)
+{
+ for (cDll *dll = pluginManager->dlls.First(); dll; dll = pluginManager->dlls.Next(dll)) {
+ cPlugin *p = dll->Plugin();
+ if (p)
+ p->MainThreadHook();
+ }
+}
+
bool cPluginManager::Active(const char *Prompt)
{
if (pluginManager) {
diff --git a/plugin.h b/plugin.h
index d113c8eb..19db6134 100644
--- a/plugin.h
+++ b/plugin.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: plugin.h 1.12 2006/04/15 10:30:33 kls Exp $
+ * $Id: plugin.h 1.13 2006/04/17 09:18:16 kls Exp $
*/
#ifndef __PLUGIN_H
@@ -39,6 +39,7 @@ public:
virtual bool Start(void);
virtual void Stop(void);
virtual void Housekeeping(void);
+ virtual void MainThreadHook(void);
virtual cString Active(void);
virtual const char *MainMenuEntry(void);
@@ -90,6 +91,7 @@ public:
bool InitializePlugins(void);
bool StartPlugins(void);
void Housekeeping(void);
+ void MainThreadHook(void);
static bool Active(const char *Prompt = NULL);
static bool HasPlugins(void);
static cPlugin *GetPlugin(int Index);
diff --git a/vdr.c b/vdr.c
index ea1d0580..2b8b484d 100644
--- a/vdr.c
+++ b/vdr.c
@@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/vdr
*
- * $Id: vdr.c 1.260 2006/04/15 13:51:52 kls Exp $
+ * $Id: vdr.c 1.261 2006/04/17 09:23:23 kls Exp $
*/
#include
@@ -830,6 +830,8 @@ int main(int argc, char *argv[])
// Queued messages:
if (!Skins.IsOpen())
Skins.ProcessQueuedMessages();
+ // Main thread hooks of plugins:
+ PluginManager.MainThreadHook();
// User Input:
cOsdObject *Interact = Menu ? Menu : cControl::Control();
eKeys key = Interface->GetKey((!Interact || !Interact->NeedsFastResponse()) && time(NULL) - LastCamMenu > LASTCAMMENUTIMEOUT);