summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-10-15 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-10-15 18:00:00 +0200
commit9ef312f888aae6167bf210d0d1bb8fcb9b787584 (patch)
tree1989ca4992d851a76d0c9a50df7d5748dea7fc16 /remote.c
parent948c370a29a21ac1fc9531f7e92d99e24734dcf4 (diff)
downloadvdr-patch-lnbsharing-9ef312f888aae6167bf210d0d1bb8fcb9b787584.tar.gz
vdr-patch-lnbsharing-9ef312f888aae6167bf210d0d1bb8fcb9b787584.tar.bz2
Version 1.4.3-2vdr-1.4.3-2
- Fixed clearing an event's Title, ShortText and Description in case the data comes from an external source. - Updated the Hungarian language texts (thanks to Guido Josten). - Fixed a possible crash if cPluginManager::GetPlugin() is called with a NULL pointer (thanks to Petri Hintukainen). - Fixed displaying the error log message in case an unknown plugin was requested in a key macro (thanks to Petri Hintukainen). - Keys from expanded key macros are now put into the front of the key queue to avoid problems if the queue is not empty at that time (based on a patch from Petri Hintukainen). - cKeyMacro now has an explicit counter for the number of keys it contains. - cRemote::PutMacro() now sets a lock while it expands the macro (thanks to Petri Hintukainen). - Fixed handling plugins from cRemote::PutMacro() and cRemote::CallPlugin() (based on a patch from Petri Hintukainen). - Increased the size of the key queue to avoid problems with long key macros.
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/remote.c b/remote.c
index a427740..112f6c1 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.51 2006/05/12 12:40:15 kls Exp $
+ * $Id: remote.c 1.54 2006/10/14 11:05:57 kls Exp $
*/
#include "remote.h"
@@ -29,7 +29,8 @@ cRemote *cRemote::learning = NULL;
char *cRemote::unknownCode = NULL;
cMutex cRemote::mutex;
cCondVar cRemote::keyPressed;
-const char *cRemote::plugin = NULL;
+const char *cRemote::keyMacroPlugin = NULL;
+const char *cRemote::callPlugin = NULL;
cRemote::cRemote(const char *Name)
{
@@ -105,14 +106,11 @@ bool cRemote::PutMacro(eKeys Key)
{
const cKeyMacro *km = KeyMacros.Get(Key);
if (km) {
- plugin = km->Plugin();
- for (int i = 1; i < MAXKEYSINMACRO; i++) {
- if (km->Macro()[i] != kNone) {
- if (!Put(km->Macro()[i]))
- return false;
- }
- else
- break;
+ keyMacroPlugin = km->Plugin();
+ cMutexLock MutexLock(&mutex);
+ for (int i = km->NumKeys(); --i > 0; ) {
+ if (!Put(km->Macro()[i], true))
+ return false;
}
}
return true;
@@ -148,8 +146,8 @@ bool cRemote::Put(const char *Code, bool Repeat, bool Release)
bool cRemote::CallPlugin(const char *Plugin)
{
cMutexLock MutexLock(&mutex);
- if (!plugin) {
- plugin = Plugin;
+ if (!callPlugin) {
+ callPlugin = Plugin;
Put(k_Plugin);
return true;
}
@@ -159,8 +157,13 @@ bool cRemote::CallPlugin(const char *Plugin)
const char *cRemote::GetPlugin(void)
{
cMutexLock MutexLock(&mutex);
- const char *p = plugin;
- plugin = NULL;
+ const char *p = keyMacroPlugin;
+ if (p)
+ keyMacroPlugin = NULL;
+ else {
+ p = callPlugin;
+ callPlugin = NULL;
+ }
return p;
}