summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-09-03 12:36:51 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-09-03 12:36:51 +0200
commit590d56bf594cbb23ba891c573bf85165baa84538 (patch)
treef9eb6f2e0747ab2763cdd8e2a4bc328bb114e634
parent32733e430a3e91ea359333e2859a05d31fbbcfbe (diff)
downloadvdr-590d56bf594cbb23ba891c573bf85165baa84538.tar.gz
vdr-590d56bf594cbb23ba891c573bf85165baa84538.tar.bz2
The main menu function of a plugin can now be called programmatically
-rw-r--r--HISTORY2
-rw-r--r--remote.c8
-rw-r--r--remote.h6
-rw-r--r--vdr.c4
4 files changed, 17 insertions, 3 deletions
diff --git a/HISTORY b/HISTORY
index 73b75130..ba8b874f 100644
--- a/HISTORY
+++ b/HISTORY
@@ -3779,3 +3779,5 @@ Video Disk Recorder Revision History
SVDRP).
- The menu timeout handling is now done centrally in the main program loop.
- Added missing help for the 'help' keyword in the SVDRP command PLUG.
+- The main menu function of a plugin can now be called programmatically through
+ the static function cRemote::CallPlugin().
diff --git a/remote.c b/remote.c
index 325c3a21..a5f8ff94 100644
--- a/remote.c
+++ b/remote.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: remote.c 1.44 2005/08/14 10:53:55 kls Exp $
+ * $Id: remote.c 1.45 2005/09/03 12:29:48 kls Exp $
*/
#include "remote.h"
@@ -143,6 +143,12 @@ bool cRemote::Put(const char *Code, bool Repeat, bool Release)
return false;
}
+void cRemote::CallPlugin(const char *Plugin)
+{
+ plugin = Plugin;
+ Put(k_Plugin);
+}
+
bool cRemote::HasKeys(void)
{
cMutexLock MutexLock(&mutex);
diff --git a/remote.h b/remote.h
index 995aa6cd..f7917baa 100644
--- a/remote.h
+++ b/remote.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: remote.h 1.30 2005/08/13 11:28:10 kls Exp $
+ * $Id: remote.h 1.31 2005/09/03 12:28:42 kls Exp $
*/
#ifndef __REMOTE_H
@@ -44,6 +44,10 @@ public:
static void Clear(void);
static bool Put(eKeys Key, bool AtFront = false);
static bool PutMacro(eKeys Key);
+ static void CallPlugin(const char *Plugin);
+ ///< Initiates calling the given plugin's main menu function.
+ ///< The Plugin parameter is the name of the plugin, and must be
+ ///< a static string.
static const char *GetPlugin(void) { return plugin; }
static bool HasKeys(void);
static eKeys Get(int WaitMs = 1000, char **UnknownCode = NULL);
diff --git a/vdr.c b/vdr.c
index 721ea11c..8d86089f 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.213 2005/09/03 11:50:28 kls Exp $
+ * $Id: vdr.c 1.214 2005/09/03 12:35:29 kls Exp $
*/
#include <getopt.h>
@@ -724,6 +724,8 @@ int main(int argc, char *argv[])
((cOsdMenu*)Menu)->Display();
}
}
+ else
+ esyslog("ERROR: unknown plugin '%s'", cRemote::GetPlugin());
key = kNone; // nobody else needs to see these keys
}
break;