The main menu function of a plugin can now be called programmatically

This commit is contained in:
Klaus Schmidinger 2005-09-03 12:36:51 +02:00
parent 32733e430a
commit 590d56bf59
4 changed files with 17 additions and 3 deletions

View File

@ -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().

View File

@ -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);

View File

@ -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);

4
vdr.c
View File

@ -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;