summaryrefslogtreecommitdiff
path: root/interface.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2000-07-15 12:39:20 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2000-07-15 12:39:20 +0200
commit20019e7ce51b9e14ce28f96b263b76e6becd4184 (patch)
tree183c0f3bac333786eb71f6825ce40412b8cb7ab4 /interface.c
parent5c574ffb7bba34506479247bf6d924e090bc2d10 (diff)
downloadvdr-20019e7ce51b9e14ce28f96b263b76e6becd4184.tar.gz
vdr-20019e7ce51b9e14ce28f96b263b76e6becd4184.tar.bz2
Added support for LIRC remote control0.0.6
Diffstat (limited to 'interface.c')
-rw-r--r--interface.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/interface.c b/interface.c
index 82f955dc..244488aa 100644
--- a/interface.c
+++ b/interface.c
@@ -4,15 +4,19 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: interface.c 1.9 2000/05/07 09:28:39 kls Exp $
+ * $Id: interface.c 1.10 2000/07/15 12:39:20 kls Exp $
*/
#include "interface.h"
#include <unistd.h>
#include "remote.h"
-#ifndef DEBUG_REMOTE
-cRcIo RcIo("/dev/ttyS1");
+#if defined(REMOTE_RCU)
+cRcIoRCU RcIo("/dev/ttyS1");
+#elif defined(REMOTE_LIRC)
+cRcIoLIRC RcIo("/dev/lircd");
+#else
+cRcIoKBD RcIo;
#endif
cInterface Interface;
@@ -26,9 +30,7 @@ cInterface::cInterface(void)
void cInterface::Init(void)
{
-#ifndef DEBUG_REMOTE
RcIo.SetCode(Keys.code, Keys.address);
-#endif
}
void cInterface::Open(int NumCols, int NumLines)
@@ -47,21 +49,15 @@ void cInterface::Close(void)
unsigned int cInterface::GetCh(bool Wait)
{
-#ifdef DEBUG_REMOTE
- timeout(Wait ? 1000 :10);
- int c = getch();
- return (c > 0) ? c : 0;
-#else
#ifdef DEBUG_OSD
timeout(0);
getch(); // just to make 'ncurses' display the window:
#endif
- if (Wait || RcIo.InputAvailable()) {
+ if (RcIo.InputAvailable(Wait)) {
unsigned int Command;
return RcIo.GetCommand(&Command, NULL) ? Command : 0;
}
return 0;
-#endif
}
eKeys cInterface::GetKey(bool Wait)
@@ -215,12 +211,12 @@ void cInterface::QueryKeys(void)
WriteText(1, 1, "Learning Remote Control Keys");
WriteText(1, 3, "Phase 1: Detecting RC code type");
WriteText(1, 5, "Press any key on the RC unit");
-#ifndef DEBUG_REMOTE
+#ifndef REMOTE_KBD
unsigned char Code = 0;
unsigned short Address;
#endif
for (;;) {
-#ifdef DEBUG_REMOTE
+#ifdef REMOTE_KBD
if (GetCh())
break;
#else
@@ -318,9 +314,7 @@ void cInterface::LearnKeys(void)
void cInterface::DisplayChannel(int Number, const char *Name)
{
-#ifndef DEBUG_REMOTE
RcIo.Number(Number);
-#endif
if (Name && !Recording()) {
Open(MenuColumns, 1);
char buffer[MenuColumns + 1];
@@ -338,9 +332,7 @@ void cInterface::DisplayChannel(int Number, const char *Name)
void cInterface::DisplayRecording(int Index, bool On)
{
-#ifndef DEBUG_REMOTE
RcIo.SetPoints(1 << Index, On);
-#endif
}
bool cInterface::Recording(void)