]> git.vomp.tv Git - vompclient.git/commitdiff
Rename Remote class to Input, RemoteLinux to InputLinux
authorChris Tallon <chris@vomp.tv>
Thu, 6 Feb 2020 15:22:37 +0000 (15:22 +0000)
committerChris Tallon <chris@vomp.tv>
Thu, 6 Feb 2020 15:22:37 +0000 (15:22 +0000)
67 files changed:
audioplayer.h
boxstack.cc
command.cc
command.h
defines.h
input.cc [new file with mode: 0644]
input.h [new file with mode: 0644]
inputlinux.cc [new file with mode: 0644]
inputlinux.h [new file with mode: 0644]
main.cc
objects.mk
player.cc
playerliveradio.cc
playerlivetv.cc
playermedia.h
playerradio.cc
remote.cc [deleted file]
remote.h [deleted file]
remotelinux.cc [deleted file]
remotelinux.h [deleted file]
remotelirc.h
remotewin.h
vaudioselector.cc
vchannellist.cc
vchannelselect.cc
vcolourtuner.cc
vepg.cc
vepglistadvanced.cc
vepgsettimer.cc
vepgsummary.cc
videoomx.cc
vinfo.cc
vmedialist.cc
vmediaview.cc
vmute.cc
vopts.cc
vpicturebanner.cc
vquestion.cc
vradiorec.cc
vrecmove.cc
vrecording.cc
vrecordinglist.cc
vrecordinglistadvanced.cc
vrecordinglistclassic.cc
vrecordingmenu.cc
vscreensaver.cc
vserverselect.cc
vsleeptimer.cc
vteletextview.cc
vtimeredit.cc
vtimerlist.cc
vvideolivetv.cc
vvideomedia.cc
vvideorec.cc
vvolume.cc
vwelcome.cc
winmain.cc
woptionpane.cc
wpictureview.cc
wremoteconfig.cc
wremoteconfig.h
wtabbar.cc
wtextbox.cc
wwinaudiofilter.cc
wwinmp3audiofilter.cc
wwinvideofilter.cc
wwinvideoh264filter.cc

index 86aa71254995d6030830edcab3897e43f09ad24c..08af3d9db7724c06edbe95b8501ecade379b4ee2 100644 (file)
@@ -29,7 +29,7 @@
 #include <time.h>
 
 #include "audio.h"
-#include "remote.h"
+#include "input.h"
 #include "vdr.h"
 #include "callback.h"
 #include "message.h"
index 69345a030381069eed2b40ecc038997e18bd0d80..5ba9cc8581683e35d39f71c3455295c39ed7de99 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "command.h"
 #include "messagequeue.h"
-#include "remote.h"
+#include "input.h"
 #include "log.h"
 
 BoxStack* BoxStack::instance = NULL;
@@ -513,7 +513,7 @@ int BoxStack::handleCommand(int command)
   int retVal2 = 0;
   int i;
 
-  if (command != Remote::NA_NONE)
+  if (command != Input::NA_NONE)
   {
     // handle command return values
     // 0 - drop through to next box
index ac05cc8977f588f464334a1081d154802da30abf..edf09749486f20d72e4fd1ce74ca5c6c0bbe0606 100644 (file)
@@ -43,7 +43,7 @@
 #include "wol.h"
 #include "vconnect.h"
 #include "message.h"
-#include "remote.h"
+#include "input.h"
 #include "vinfo.h"
 #include "boxx.h"
 #include "boxstack.h"
@@ -80,7 +80,7 @@ int Command::init(bool tcrashed, char* tServer)
 
   logger = Log::getInstance();
   boxstack = BoxStack::getInstance();
-  remote = Remote::getInstance();
+  remote = Input::getInstance();
   
   remote->InitHWCListwithDefaults();
   
@@ -192,7 +192,7 @@ void Command::run()
   // Start method 2 of getting commands in...
   udp.run(this);
 
-  // FIXME Remote::NA_SIGNAL is possibly obsolete now
+  // FIXME Input::NA_SIGNAL is possibly obsolete now
 
   std::unique_lock<std::mutex> lockWrapper(messageQueueMutex);  // locks. unlocks on out-of-scope
 
@@ -246,7 +246,7 @@ void Command::processMessage(Message* m)
       // << FIXME OBSELETE
       case Message::STOP_PLAYBACK:
       {
-        handleCommand(Remote::STOP); // an odd way of doing it, but so simple
+        handleCommand(Input::STOP); // an odd way of doing it, but so simple
         break;
       }
       // Also connection_lost comes from player - anywhere else?
@@ -342,9 +342,9 @@ void Command::processMessage(Message* m)
 
 void Command::handleCommand(int button)
 {
-  if (isStandby && (button != Remote::POWER) 
-                && (button != Remote::POWERON)
-                && (button != Remote::POWEROFF))  return;
+  if (isStandby && (button != Input::POWER)
+                && (button != Input::POWERON)
+                && (button != Input::POWEROFF))  return;
 
   if (!connLost && boxstack->handleCommand(button)) return; // don't send to boxstack if connLost
 
@@ -352,14 +352,14 @@ void Command::handleCommand(int button)
 
   switch(button)
   {
-    case Remote::DF_LEFT:
-    case Remote::DF_RIGHT:
-    case Remote::VOLUMEUP:
-    case Remote::VOLUMEDOWN:
+    case Input::DF_LEFT:
+    case Input::DF_RIGHT:
+    case Input::VOLUMEUP:
+    case Input::VOLUMEDOWN:
     {
       if (remote->handlesVolume())
       {
-        if (button==Remote::DF_LEFT || button==Remote::VOLUMEDOWN)
+        if (button==Input::DF_LEFT || button==Input::VOLUMEDOWN)
           remote->volumeDown();
         else
           remote->volumeUp();
@@ -372,7 +372,7 @@ void Command::handleCommand(int button)
       }
       return;
     }
-    case Remote::MUTE:
+    case Input::MUTE:
     {
       if (remote->handlesVolume())
       {
@@ -387,29 +387,29 @@ void Command::handleCommand(int button)
       }
       return;
     }
-    case Remote::POWER:
+    case Input::POWER:
     {
       doStandby();
       return;
     }
-    case Remote::POWERON:
+    case Input::POWERON:
     {
       doPowerOn();
       return;
     }
-    case Remote::POWEROFF:
+    case Input::POWEROFF:
     {
       doPowerOff();
       return;
     }
-    case Remote::OK:
+    case Input::OK:
     {
       // FIXME
-      if (!connLost) return; // if connLost, handle Remote::OK
+      if (!connLost) return; // if connLost, handle Input::OK
       doFromTheTop(false);
       return;
     }
-    case Remote::GO:
+    case Input::GO:
     {
       VSleeptimer* sleep = new VSleeptimer();
       boxstack->add(sleep);
@@ -448,7 +448,7 @@ void Command::doPowerOn()
   {
     Video::getInstance()->signalOn();
     Led::getInstance()->on();
-    Remote::getInstance()->changePowerState(true);
+    Input::getInstance()->changePowerState(true);
     isStandby = false;
 
     VConnect* vconnect = new VConnect(server);
@@ -470,7 +470,7 @@ void Command::doPowerOff()
     logger->unsetExternLogger();
     VDR::getInstance()->disconnect();
     Led::getInstance()->off();
-    Remote::getInstance()->changePowerState(false);
+    Input::getInstance()->changePowerState(false);
     isStandby = true;
     Sleeptimer::getInstance()->shutdown();
 #ifdef WIN32
@@ -545,7 +545,7 @@ void Command::doReboot()
   Osd::getInstance()->shutdown();
   Audio::getInstance()->shutdown();
   Video::getInstance()->shutdown();
-  Remote::getInstance()->shutdown();
+  Input::getInstance()->shutdown();
 
   reboot(LINUX_REBOOT_CMD_RESTART);
   // if  reboot is not allowed -> stop
@@ -905,19 +905,19 @@ void Command::doJustConnected(VConnect* vconnect)
     if (!STRCASECMP(config, "New"))
     {
       logger->log("Command", Log::INFO, "Switching to New remote type");
-      remote->setRemoteType(Remote::NEWREMOTE);
+      remote->setRemoteType(Input::NEWREMOTE);
     }
     else
     {
       logger->log("Command", Log::INFO, "Switching to Old remote type");
-      remote->setRemoteType(Remote::OLDREMOTE);
+      remote->setRemoteType(Input::OLDREMOTE);
     }
     delete[] config;
   }
   else
   {
     logger->log("Command", Log::INFO, "Config General/Remote type not found");
-    remote->setRemoteType(Remote::OLDREMOTE);
+    remote->setRemoteType(Input::OLDREMOTE);
   }
 
 
@@ -1070,16 +1070,16 @@ void Command::doJustConnected(VConnect* vconnect)
     boxstack->update(vw);
 
     // Enter pre-keys here
-//    handleCommand(Remote::OK);
-//    handleCommand(Remote::THREE);
-//    handleCommand(Remote::SIX);
-//    handleCommand(Remote::OK);
-//    handleCommand(Remote::UP);
-//    handleCommand(Remote::PLAY);
-//    handleCommand(Remote::DOWN);
-//    handleCommand(Remote::DOWN);
-//    handleCommand(Remote::DOWN);
- //   handleCommand(Remote::OK);
-//    handleCommand(Remote::RED);
+//    handleCommand(Input::OK);
+//    handleCommand(Input::THREE);
+//    handleCommand(Input::SIX);
+//    handleCommand(Input::OK);
+//    handleCommand(Input::UP);
+//    handleCommand(Input::PLAY);
+//    handleCommand(Input::DOWN);
+//    handleCommand(Input::DOWN);
+//    handleCommand(Input::DOWN);
+ //   handleCommand(Input::OK);
+//    handleCommand(Input::RED);
   }
 }
index bc42923befa72c32c17bbb012b7c3aca3a0a84c5..6ac4c50630a7580a1d5f6a6d19b3762ce25a3043 100644 (file)
--- a/command.h
+++ b/command.h
@@ -40,7 +40,7 @@
 
 class VConnect;
 class Message;
-class Remote;
+class Input;
 class Boxx;
 class BoxStack;
 class Log;
@@ -93,7 +93,7 @@ class Command : public MessageQueue
 
     Log* logger;
     BoxStack* boxstack;
-    Remote* remote;
+    Input* remote;
 
     bool initted{};
     bool irun{};
index a7b158ee474badaaea4bc6465acfa5b2c7c60c06..720d2af16c2f9aa1ce8feb46c2ae356b48eefb2d 100644 (file)
--- a/defines.h
+++ b/defines.h
@@ -107,7 +107,7 @@ int getClockRealTime(struct timespec *tp);
 
 // add here defines for plattform specific objects
 #ifdef VOMP_PLATFORM_RASPBERRY
-  #define Remote_TYPE RemoteLinux  // Generic Remote under Linux (Konsole!, not X) will support in the end:
+  #define Remote_TYPE InputLinux  // Generic Remote under Linux (Konsole!, not X) will support in the end:
   #define RemoteStartDev ""//No devices passed
 
   // Keyboard
diff --git a/input.cc b/input.cc
new file mode 100644 (file)
index 0000000..0e0e947
--- /dev/null
+++ b/input.cc
@@ -0,0 +1,489 @@
+/*
+    Copyright 2004-2020 Chris Tallon
+
+    This file is part of VOMP.
+
+    VOMP is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    VOMP is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
+*/
+
+#include "wremoteconfig.h"
+#include "i18n.h"
+#include "log.h"
+#include "vdr.h"
+#include "wtabbar.h"
+#include "input.h"
+
+Input* Input::instance = NULL;
+
+Input::Input()
+{
+  if (instance) return;
+  instance = this;
+  remoteType = OLDREMOTE;
+  learnmode = NOLEARNMODE;
+}
+
+Input::~Input()
+{
+  instance = NULL;
+}
+
+Input* Input::getInstance()
+{
+  return instance;
+}
+
+void Input::setRemoteType(UCHAR newType)
+{
+  if ((newType != OLDREMOTE) && (newType != NEWREMOTE)) return;
+  remoteType = newType;
+}
+
+void Input::EnterLearningMode(UCHAR command)
+{
+    learnmode = command; //Armed
+}
+
+void Input::ResetToDefault()
+{
+  translist.clear();
+  InitHWCListwithDefaults();
+}
+
+
+UCHAR Input::TranslateHWCFixed(ULLONG code)
+{
+  switch (code)
+  {
+    case DOWN:
+      return DOWN;
+    case UP:
+      return UP;
+    case LEFT:
+      return LEFT;
+    case RIGHT:
+      return RIGHT;
+    case DF_DOWN:
+      return DOWN;
+    case DF_UP:
+      return UP;
+    case DF_LEFT:
+      return LEFT;
+    case DF_RIGHT:
+      return RIGHT;
+    case MENU:
+      return MENU;
+    case BACK:
+      return BACK;
+    case OK:
+      return OK;
+    default:
+      return NA_UNKNOWN;
+  }
+}
+
+const char* Input::HardcodedTranslateStr(UCHAR command)
+{
+  switch (command)
+  {
+    case DOWN:
+      return tr("Down");
+    case UP:
+      return tr("Up");
+    case LEFT:
+      return tr("Left");
+    case RIGHT:
+      return tr("Right");
+    case MENU:
+      return tr("Menu");
+    case BACK:
+      return tr("Back");
+    case OK:
+      return tr("Ok");
+    default:
+      return NULL;
+  }
+}
+
+UCHAR Input::TranslateHWCList(ULLONG code)
+{
+  if (learnmode != NOLEARNMODE)
+  {
+    setHWCtoCommand(code, learnmode);
+    learnmode = NOLEARNMODE;
+    return NA_LEARN;
+  }
+  RemoteTranslationList::iterator it = translist.find(code);
+  if (it == translist.end())
+  {
+    return NA_UNKNOWN;
+  }
+  else
+  {
+    return it->second;
+  }
+}
+
+UCHAR Input::TranslateHWC(ULLONG code)
+{
+  UCHAR ret = TranslateHWCFixed(code);
+  if (ret == NA_UNKNOWN)
+  {
+    ret = TranslateHWCList(code);
+  }
+  else
+  {
+    learnmode = NOLEARNMODE;
+  }
+
+  if (ret == NA_UNKNOWN)
+  {
+    return NA_UNKNOWN;
+  }
+  return ret;
+}
+
+void Input::setHWCtoCommand(ULLONG hcw, UCHAR command)
+{
+  translist[hcw] = command;
+}
+
+void Input::unsetHWC(ULLONG hcw)
+{
+  translist.erase(hcw);
+}
+
+void Input::LoadKeysConfig(VDR *vdr,const char *cfg)
+{
+       ULONG number=0;
+       if (sscanf(cfg,"%ld",&number) != 1) return;
+       Log::getInstance()->log("Input", Log::INFO, "Config General/Remote keys num keys %d",number);
+       char keybuf[1024];
+       for (ULONG i = 0; i < number; i++) {
+               sprintf(keybuf, "RemoteKey%lu", i);
+               const char *keytrans = vdr->configLoad("General", keybuf);
+               if (keytrans) {
+                       ULONG ul1, ul2;
+                       ULONG uc;
+                       if (sscanf(keytrans, "%lXI%lXK%lX", &ul1, &ul2, &uc) == 3) {
+                               translist[((ULLONG) ul1) | ((ULLONG) ul2) << 32] = (UCHAR) uc;
+                       }
+                       delete[] keytrans;
+               }
+
+       }
+}
+
+void Input::SaveKeysConfig()
+{
+  int number=0;
+  char buffer[1024];
+  char keybuf[1024];
+  RemoteTranslationList::const_iterator it;
+  for (it = translist.begin(); it != translist.end(); it++)
+  {
+         sprintf(buffer,"%08lXI%08lXK%02X",
+                         (ULONG)it->first ,(ULONG) (it->first >> 32), it->second);
+         sprintf(keybuf,"RemoteKey%d",number);
+         VDR::getInstance()->configSave("General",keybuf,buffer);
+         number++;
+  }
+  sprintf(buffer,"%d",number);
+  VDR::getInstance()->configSave("General","RemoteKeyNum",buffer);
+}
+
+
+void Input::InitHWCListwithDefaults()
+{
+  translist[VOLUMEUP] = VOLUMEUP;
+  translist[VOLUMEDOWN] = VOLUMEDOWN;
+  translist[CHANNELUP] = CHANNELUP;
+  translist[CHANNELDOWN] = CHANNELDOWN;
+
+  // Common buttons
+  translist[ZERO] = ZERO;
+  translist[ONE] = ONE;
+  translist[TWO] = TWO;
+  translist[THREE] = THREE;
+  translist[FOUR] = FOUR;
+  translist[FIVE] = FIVE;
+  translist[SIX] = SIX;
+  translist[SEVEN] = SEVEN;
+  translist[EIGHT] = EIGHT;
+  translist[NINE] = NINE;
+  translist[POWER] = POWER;
+  translist[GO] = GO;
+  translist[RED] = RED;
+  translist[GREEN] = GREEN;
+  translist[YELLOW] = YELLOW;
+  translist[BLUE] = BLUE;
+
+  translist[MUTE] = MUTE;
+  translist[RADIO] = RADIO;
+  translist[REVERSE] = REVERSE;
+  translist[FORWARD] = FORWARD;
+  translist[RECORD] = RECORD;
+  translist[STOP] = STOP;
+  translist[PAUSE] = PAUSE;
+  translist[PLAY] = PLAY;
+  translist[SKIPBACK] = SKIPBACK;
+  translist[SKIPFORWARD] = SKIPFORWARD;
+
+  // Old remote only
+  translist[FULL] = FULL;
+
+  // New remote only
+  translist[TV] = TV;
+  translist[VIDEOS] = VIDEOS;
+  translist[MUSIC] = MUSIC;
+  translist[PICTURES] = PICTURES;
+  translist[GUIDE] = GUIDE;
+  translist[PREVCHANNEL] = PREVCHANNEL;
+  translist[STAR] = STAR;
+  translist[HASH] = HASH;
+}
+
+const char* Input::CommandDesc(UCHAR number)
+{
+  switch (number)
+  {
+    case VOLUMEUP:
+      return tr("Volume Up");
+
+    case VOLUMEDOWN:
+      return tr("Volume Down");
+    case CHANNELUP:
+      return tr("Channel up");
+    case CHANNELDOWN:
+      return tr("Channel down");
+    case ZERO:
+      return "0";
+    case ONE:
+      return "1";
+    case TWO:
+      return "2";
+    case THREE:
+      return "3";
+    case FOUR:
+      return "4";
+    case FIVE:
+      return "5";
+    case SIX:
+      return "6";
+    case SEVEN:
+      return "7";
+    case EIGHT:
+      return "8";
+    case NINE:
+      return "9";
+    case POWER:
+      return tr("Power");
+    case GO:
+      return tr("Go");
+    case BACK:
+      return tr("Back");
+    case MENU:
+      return tr("Menu");
+    case RED:
+      return tr("Red");
+    case GREEN:
+      return tr("Green");
+    case YELLOW:
+      return tr("Yellow");
+    case BLUE:
+      return tr("Blue");
+    case MUTE:
+      return tr("Mute");
+    case RADIO:
+      return tr("Radio");
+    case REVERSE:
+      return tr("Reverse");
+    case PLAY:
+      return tr("Play");
+    case FORWARD:
+      return tr("Forward");
+    case RECORD:
+      return tr("Record");
+    case STOP:
+      return tr("Stop");
+    case PAUSE:
+      return tr("Pause");
+    case SKIPBACK:
+      return tr("Skip back");
+    case SKIPFORWARD:
+      return tr("Skip forward");
+    case OK:
+      return tr("Ok");
+    case FULL:
+      return tr("Fullscreen");
+    case TV:
+      return tr("TV");
+    case VIDEOS:
+      return tr("Videos");
+    case MUSIC:
+      return tr("Music");
+    case PICTURES:
+      return tr("Pictures");
+    case GUIDE:
+      return tr("Guide");
+    case UP:
+      return tr("Up");
+    case DOWN:
+      return tr("Down");
+    case LEFT:
+      return tr("Left");
+    case RIGHT:
+      return tr("Right");
+    case PREVCHANNEL:
+      return tr("Previous Channel");
+    case STAR:
+      return tr("Star");
+    case HASH:
+      return tr("Hash");
+    case PLAYPAUSE:
+       return tr("Play/Pause");
+
+    default:
+      return NULL;
+  }
+}
+
+char* Input::HCWDesc(ULLONG hcw)
+{
+  char *dest,*temp;
+  temp=(char*)CommandDesc((UCHAR)hcw);
+  if (temp != NULL)
+  {
+    dest=new char[strlen(temp)+1];
+    strcpy(dest,temp);
+  }
+  else
+  {
+    dest=new char[20];
+    sprintf(dest,"C:%lX",(ULONG)hcw);
+  }
+  return dest;
+}
+
+char* Input::CommandTranslateStr(UCHAR command)
+{
+  char *desc;
+  int length=5;//:+\t+0
+  int keys=0; //max 10;
+  char *commanddesc=(char*)CommandDesc(command);
+  if (commanddesc != NULL)
+  {
+    length+=strlen(commanddesc);
+  }
+  char *preassigneddesc=(char*)HardcodedTranslateStr(command);
+  if (preassigneddesc != NULL)
+  {
+    length+=strlen(preassigneddesc);
+  }
+
+  char *keydesc[10];
+  RemoteTranslationList::const_iterator it;
+  for (it = translist.begin(); it != translist.end(); it++)
+  {
+    if (it->second == command)
+    {
+      keydesc[keys] = HCWDesc(it->first);
+      length += strlen(keydesc[keys])+2;
+      keys ++;
+      if (keys == 10) break;
+    }
+  }
+
+  desc=new char [length];
+  char *current=desc;
+  if (commanddesc != NULL)
+  {
+    current+=sprintf(current,"%s:\t ",commanddesc);
+  }
+  else
+  {
+    current+=sprintf(current,":\t ");
+  }
+  if (preassigneddesc != NULL)
+  {
+    current+=sprintf(current,"%s\t",preassigneddesc);
+  }
+  else
+  {
+    current+=sprintf(current,"\t");
+  }
+  for (int i = 0;i < keys; i++)
+  {
+    current += sprintf(current,"%s, ",keydesc[i]);
+    delete [] keydesc[i];
+  }
+  return desc;
+}
+
+bool Input::addOptionPagesToWTB(WTabBar *wtb)
+{
+    WRemoteConfig* wrc = new WRemoteConfig();
+    wtb->addTab(tr("Remote Control"), wrc);
+    return true;
+}
+
+bool Input::loadOptionsfromServer(VDR* vdr)
+{
+   // Set remote keys
+  char * config;
+  config = vdr->configLoad("General", "RemoteKeyNum");
+
+  if (config)
+  {
+    Log::getInstance()->log("Input", Log::INFO, "Config General/Remote keys load");
+    LoadKeysConfig(vdr,config);
+    delete[] config;
+  }
+  else
+  {
+    Log::getInstance()->log("Input", Log::INFO, "Config General/Remote keys not found");
+    InitHWCListwithDefaults();
+  }
+  return true;
+}
+
+bool Input::saveOptionstoServer()
+{
+    SaveKeysConfig();
+    return true;
+}
+
+bool Input::start()
+{
+  Log::getInstance()->log("Input", Log::INFO, "start called");
+
+  threadStartProtect.lock();
+  listenThread = std::thread( [this ]
+  {
+    threadStartProtect.lock();
+    threadStartProtect.unlock();
+    // FIXME block signals
+
+    eventLoop();
+  });
+  threadStartProtect.unlock();
+  return true;
+}
+
+void Input::stop()
+{
+  listenLoopStop = true;
+  informStopEventLoop();
+  listenThread.join();
+}
diff --git a/input.h b/input.h
new file mode 100644 (file)
index 0000000..169129a
--- /dev/null
+++ b/input.h
@@ -0,0 +1,177 @@
+/*
+    Copyright 2004-2020 Chris Tallon
+
+    This file is part of VOMP.
+
+    VOMP is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    VOMP is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
+*/
+
+#ifndef INPUT_H
+#define INPUT_H
+
+#include <stdio.h>
+#include <map>
+#include <thread>
+#include <mutex>
+
+#include "defines.h"
+#include "abstractoption.h"
+
+
+typedef std::map<ULLONG,UCHAR> RemoteTranslationList;
+
+class Input: public AbstractOption
+{
+  public:
+    Input();
+    virtual ~Input();
+    static Input* getInstance();
+
+    bool start();
+    void stop();
+
+    bool addOptionPagesToWTB(WTabBar *wtb);
+    bool loadOptionsfromServer(VDR* vdr);
+    bool saveOptionstoServer();
+
+    void setRemoteType(UCHAR type);
+    void setHWCtoCommand(ULLONG hcw,UCHAR command);
+    void unsetHWC(ULLONG hcw);
+    void LoadKeysConfig(VDR *vdr,const char*keynum);
+    void SaveKeysConfig();
+    void EnterLearningMode(UCHAR command);
+
+    virtual int init(const char *devName)=0;
+    virtual int shutdown()=0;
+    virtual UCHAR getButtonPress(int how)=0; // DEPRECATED
+
+    virtual bool mayHaveFewButtons() {return false;};
+
+    virtual bool handlesVolume() {return false;};
+    virtual void volumeUp() {};
+    virtual void volumeDown() {};
+    virtual void volumeMute() {};
+
+    virtual void InitHWCListwithDefaults();
+    virtual char* HCWDesc(ULLONG hcw);
+    const char *CommandDesc(UCHAR number);
+    char *CommandTranslateStr(UCHAR command);
+    virtual const char*HardcodedTranslateStr(UCHAR command);
+    void EnterLearnMode(UCHAR command);
+    void ResetToDefault();
+
+    virtual void changePowerState(bool /* poweron */) {}; //informs the remote control, that about vomp's power state, this is important e.g. for cec
+
+    const static ULONG NOLEARNMODE = 256;
+    // Not buttons
+    const static UCHAR NA_LEARN    = 101;
+    const static UCHAR NA_NONE     = 98;
+    const static UCHAR NA_UNKNOWN  = 99;
+    const static UCHAR NA_SIGNAL   = 100;
+    const static UCHAR DF_UP       = 94;
+    const static UCHAR DF_DOWN     = 95;
+    const static UCHAR DF_LEFT     = 96;
+    const static UCHAR DF_RIGHT    = 97;
+
+    // Problem common buttons
+    const static UCHAR VOLUMEUP    = 16;
+    const static UCHAR VOLUMEDOWN  = 17;
+    const static UCHAR CHANNELUP   = 32;
+    const static UCHAR CHANNELDOWN = 33;
+
+    // Common buttons
+    const static UCHAR ZERO        = 0;
+    const static UCHAR ONE         = 1;
+    const static UCHAR TWO         = 2;
+    const static UCHAR THREE       = 3;
+    const static UCHAR FOUR        = 4;
+    const static UCHAR FIVE        = 5;
+    const static UCHAR SIX         = 6;
+    const static UCHAR SEVEN       = 7;
+    const static UCHAR EIGHT       = 8;
+    const static UCHAR NINE        = 9;
+    const static UCHAR POWER       = 61;
+    const static UCHAR GO          = 59;
+    const static UCHAR BACK        = 31;
+    const static UCHAR MENU        = 13;
+    const static UCHAR RED         = 11;
+    const static UCHAR GREEN       = 46;
+    const static UCHAR YELLOW      = 56;
+    const static UCHAR BLUE        = 41;
+    const static UCHAR MUTE        = 15;
+    const static UCHAR RADIO       = 12; // The unlabelled button on old
+    const static UCHAR REVERSE     = 50;
+    const static UCHAR PLAY        = 53;
+    const static UCHAR FORWARD     = 52;
+    const static UCHAR RECORD      = 55;
+    const static UCHAR STOP        = 54;
+    const static UCHAR PAUSE       = 48;
+    const static UCHAR SKIPBACK    = 36;
+    const static UCHAR SKIPFORWARD = 30;
+    const static UCHAR OK          = 37;
+
+    // Old remote only
+    const static UCHAR FULL        = 60;
+
+    // New remote only
+    const static UCHAR TV          = 28;
+    const static UCHAR VIDEOS      = 24;
+    const static UCHAR MUSIC       = 25;
+    const static UCHAR PICTURES    = 26;
+    const static UCHAR GUIDE       = 27;
+    const static UCHAR UP          = 20;
+    const static UCHAR DOWN        = 21;
+    const static UCHAR LEFT        = 22;
+    const static UCHAR RIGHT       = 23;
+    const static UCHAR PREVCHANNEL = 18;
+    const static UCHAR STAR        = 10;
+    const static UCHAR HASH        = 14;
+
+    // Android only
+    const static UCHAR PLAYPAUSE   = 201;
+    // cec only
+    const static UCHAR POWERON     = 202;
+    const static UCHAR POWEROFF    = 203;
+
+
+    // Remote types
+    const static UCHAR OLDREMOTE   = 1;
+    const static UCHAR NEWREMOTE   = 2;
+
+  protected:
+    virtual UCHAR TranslateHWCFixed(ULLONG code);
+    UCHAR TranslateHWCList(ULLONG code);
+    UCHAR TranslateHWC(ULLONG code);
+    
+    static Input* instance;
+    ULONG learnmode;
+    UCHAR remoteType;
+    RemoteTranslationList translist;
+
+    std::thread listenThread;
+    std::mutex threadStartProtect;
+
+    virtual void eventLoop() {}; // FIXME change to abstract
+    virtual void informStopEventLoop() {}; // abstract
+
+    bool listenLoopStop{};
+};
+
+#endif
+
+// FIXME rename all remote stuff to some sort of INPUT
+// Roll in UDP receiver
+
+// FIXME have Top remote system create new listeners for various devices? Hot plug?
+// Where remotelinux has multi listeners, move that to top?
diff --git a/inputlinux.cc b/inputlinux.cc
new file mode 100644 (file)
index 0000000..8adc479
--- /dev/null
@@ -0,0 +1,1127 @@
+/*
+    Copyright 2004-2020 Chris Tallon; 2012 Marten Richter
+
+    This file is part of VOMP.
+
+    VOMP is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    VOMP is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
+*/
+
+#include <linux/input.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#include <cstdio>
+#include <iostream>
+#include <ostream>
+
+#include <bcm_host.h>
+
+#include <libcec/cec.h>
+#include <libcec/cecloader.h>
+using namespace CEC;
+
+#include "i18n.h"
+#include "vdr.h"
+#include "woptionpane.h"
+#include "message.h"
+#include "messagequeue.h"
+#include "command.h" // FIXME - get rid after predefined message targets
+
+#include "inputlinux.h"
+
+#define W_G_HCW(type,code) ((static_cast<ULLONG>(type) << 32) | code)
+
+#define W_HCW_KC 1 /* key code as defined by kernel for keyboard and remotes through /dev/input */
+#define W_HCW_CEC 2 /* HDMI_CEC */
+#define W_HCW_LIRC 3 /* remote control LIRC*/
+
+
+InputLinux::InputLinux()
+{
+}
+
+InputLinux::~InputLinux()
+{
+  for (unsigned int i = 0; i < devices.size(); i++)
+  {
+    close(devices[i]);
+  }
+}
+
+#define test_bit(input,b)  ((1 << ((b) % 8))&(input)[b / 8] )
+
+int InputLinux::init(const char*)
+{
+  if (initted) return 0;
+  initted = 1;
+
+  InitKeymap();
+
+  for (int eventid = 0; eventid < 100; eventid++)
+  {
+    char buffer[1024];
+    sprintf(buffer,"/dev/input/event%d", eventid);
+
+    struct stat test_buf;
+    if (stat(buffer, &test_buf) == 0)
+    {
+      Log::getInstance()->log("InputLinux", Log::NOTICE, "Probe /dev/input/event%d", eventid);
+      // file exists
+      unsigned long ev_type = 0;
+      int new_fd = open(buffer, O_RDONLY);
+      if (new_fd < 0)
+      {
+        Log::getInstance()->log("InputLinux", Log::NOTICE, "Can not open /dev/input/event%d", eventid);
+        continue;
+      }
+
+      if (ioctl(new_fd, EVIOCGBIT(0, EV_MAX), &ev_type) < 0)
+      {
+        Log::getInstance()->log("InputLinux", Log::NOTICE, "Ioctl failed /dev/input/event%d %d", eventid, errno);
+        close(new_fd);
+      }
+
+      //Now test if it generates keyboard presses
+      if (test_bit(reinterpret_cast<char*>(&ev_type), EV_KEY))
+      {
+        Log::getInstance()->log("InputLinux", Log::NOTICE, "Add /dev/input/event%d to List", eventid);
+        devices.push_back(new_fd);
+
+        // Grab the device - make it exclusive to vomp. Fixes rubbish input going to console in background
+        ioctl(new_fd, EVIOCGRAB, 1);
+      }
+      else
+      {
+        close(new_fd);
+      }
+    }
+  }
+  return initCec();
+}
+
+int InputLinux::initCec() {
+
+  // bcm_host_init(); //may be move to custom hardware init?
+// now init cec
+       Log::getInstance()->log("InputLinux", Log::NOTICE, "Init LibCEC");
+       cec_config.Clear();
+       cec_callbacks.Clear();
+#if CEC_LIB_VERSION_MAJOR >= 4
+       cec_callbacks.logMessage = cecLogMessage;
+       cec_callbacks.keyPress = cecKeyPress;
+       cec_callbacks.commandReceived = cecCommand;
+       cec_callbacks.configurationChanged = cecConfigurationChanged;
+       cec_callbacks.sourceActivated = cecSourceActivated;
+#else
+       cec_callbacks.CBCecLogMessage = cecLogMessage;
+       cec_callbacks.CBCecKeyPress = cecKeyPress;
+       cec_callbacks.CBCecCommand = cecCommand;
+       cec_callbacks.CBCecConfigurationChanged = cecConfigurationChanged;
+       cec_callbacks.CBCecSourceActivated = cecSourceActivated;
+       cec_config.bUseTVMenuLanguage=1;
+#endif
+    cec_config.clientVersion=LIBCEC_VERSION_CURRENT;
+       cec_config.bActivateSource=1;
+       //cec_config.deviceTypes.Add(CEC_DEVICE_TYPE_PLAYBACK_DEVICE);
+       cec_config.deviceTypes.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE);
+       //cec_config.deviceTypes.Add(CEC_DEVICE_TYPE_TUNER);
+
+       strncpy(cec_config.strDeviceName,"vomp",sizeof(cec_config.strDeviceName));
+
+
+       cec_config.callbackParam = NULL; // I do not care
+       cec_config.callbacks = &cec_callbacks;
+
+       cec_adap = LibCecInitialise(&cec_config);
+       if (!cec_adap) {
+               Log::getInstance()->log("InputLinux", Log::ERR, "Init LibCEC failed");
+               return 1;
+       }
+       cec_adap->InitVideoStandalone();
+
+
+#if CEC_LIB_VERSION_MAJOR >= 4
+       cec_adapter_descriptor cec_adapter_descriptors[10];
+       int adap_num=cec_adap->DetectAdapters(cec_adapter_descriptors, 10);
+#else
+       cec_adapter  cec_devices[10];
+       int adap_num=cec_adap->FindAdapters(cec_devices,10,NULL);
+#endif
+       if (adap_num<0) {
+               Log::getInstance()->log("InputLinux", Log::ERR, "CEC:Failed to find adapter");
+               return 1;
+
+       }
+       if (adap_num==0) {
+               Log::getInstance()->log("InputLinux", Log::NOTICE, "CEC: No adapter found");
+               return 1;
+
+       }
+#if CEC_LIB_VERSION_MAJOR >= 4
+       if (!cec_adap->Open(cec_adapter_descriptors[0].strComName)) {
+#else
+       if (!cec_adap->Open(cec_devices[0].comm)) {
+#endif
+      Log::getInstance()->log("InputLinux", Log::ERR, "CEC:Failed to open adapter");
+               return 1;
+       }
+
+       if (!cec_adap->SetActiveSource(cec_config.deviceTypes[0])) {
+               Log::getInstance()->log("InputLinux", Log::ERR, "CEC:Failed set active source");
+               return 1;
+       }
+
+
+
+
+  return 1;
+}
+
+int InputLinux::shutdown()
+{
+  if (!initted) return 0;
+
+  deinitCec();
+  while (devices.size())
+  {
+    int cur_fd = devices.back();
+    devices.pop_back();
+    ioctl(cur_fd, EVIOCGRAB, 0);
+    close(cur_fd);
+  }
+
+  initted = 0;
+  return 1;
+}
+
+void InputLinux::deinitCec()
+{
+       if (cec_adap) {
+               Log::getInstance()->log("InputLinux", Log::NOTICE, "Shutdown libcec begin");
+               cec_adap->SetInactiveView();
+               cec_adap->Close();
+               vc_cec_register_callback(NULL, NULL);//deactivate callback!
+               UnloadLibCec(cec_adap);
+               cec_adap = NULL;
+               Log::getInstance()->log("InputLinux", Log::NOTICE, "Shutdown libcec end");
+       }
+
+}
+
+UCHAR InputLinux::TranslateHWCFixed(ULLONG code)
+{
+    switch (code) 
+    {
+    case W_G_HCW(W_HCW_KC, KEY_DOWN):
+        return DOWN;
+    case W_G_HCW(W_HCW_KC, KEY_UP):
+        return UP;
+    case W_G_HCW(W_HCW_KC, KEY_LEFT):
+        return LEFT;
+    case W_G_HCW(W_HCW_KC, KEY_RIGHT):
+        return RIGHT;
+    case W_G_HCW(W_HCW_KC, KEY_M):
+    case W_G_HCW(W_HCW_KC, KEY_MEDIA):
+        return MENU;
+    case W_G_HCW(W_HCW_KC, KEY_BACKSPACE):
+    case W_G_HCW(W_HCW_KC, KEY_EXIT):
+        return BACK;
+    case W_G_HCW(W_HCW_KC, KEY_ENTER):
+    case W_G_HCW(W_HCW_KC, KEY_SPACE):
+    case W_G_HCW(W_HCW_KC, KEY_OK):
+        return OK;
+
+    //CEC
+    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_DOWN):
+        return DOWN;
+    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_UP):
+        return UP;
+    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_LEFT):
+        return LEFT;
+    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_RIGHT):
+        return RIGHT;
+    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_ROOT_MENU):
+    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_CONTENTS_MENU):
+    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_SETUP_MENU):
+        return MENU;
+    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_EXIT ):
+        return BACK;
+    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_ENTER):
+    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_SELECT):
+    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_AN_RETURN):
+        return OK;
+    case W_G_HCW(W_HCW_KC, KEY_SLEEP):
+    case W_G_HCW(W_HCW_KC, KEY_POWER):
+    case W_G_HCW(W_HCW_KC, KEY_ESC):
+    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_POWER):
+    case POWER:
+        return POWER;
+    default:
+        return NA_UNKNOWN;
+    };
+}
+
+const char* InputLinux::HardcodedTranslateStr(UCHAR command)
+{
+  switch (command)
+  {
+    case DOWN:
+      return tr("Down");
+    case UP:
+      return tr("Up");
+    case LEFT:
+      return tr("Left");
+    case RIGHT:
+      return tr("Right");
+    case MENU:
+      return tr("M");
+    case BACK:
+      return tr("Backspace, Back");
+    case OK:
+      return tr("Return, Space");
+    default:
+      return NULL;
+  }
+}
+
+
+void InputLinux::InitHWCListwithDefaults()
+{
+  // Processing VK_Messages
+  translist[W_G_HCW(W_HCW_KC,KEY_9)] = NINE;
+  translist[W_G_HCW(W_HCW_KC,KEY_8)] = EIGHT;
+  translist[W_G_HCW(W_HCW_KC,KEY_7)] = SEVEN;
+  translist[W_G_HCW(W_HCW_KC,KEY_6)] = SIX;
+  translist[W_G_HCW(W_HCW_KC,KEY_5)] = FIVE;
+  translist[W_G_HCW(W_HCW_KC,KEY_4)] = FOUR;
+  translist[W_G_HCW(W_HCW_KC,KEY_3)] = THREE;
+  translist[W_G_HCW(W_HCW_KC,KEY_2)] = TWO;
+  translist[W_G_HCW(W_HCW_KC,KEY_1)] = ONE;
+  translist[W_G_HCW(W_HCW_KC,KEY_0)] = ZERO;
+  translist[W_G_HCW(W_HCW_KC,KEY_KPDOT)] = STAR;
+  // translist[W_G_HCW(W_HCW_KC,KEY_#)] = HASH;
+
+  translist[W_G_HCW(W_HCW_KC,KEY_KP9)] = NINE;
+  translist[W_G_HCW(W_HCW_KC,KEY_KP8)] = EIGHT;
+  translist[W_G_HCW(W_HCW_KC,KEY_KP7)] = SEVEN;
+  translist[W_G_HCW(W_HCW_KC,KEY_KP6)] = SIX;
+  translist[W_G_HCW(W_HCW_KC,KEY_KP5)] = FIVE;
+  translist[W_G_HCW(W_HCW_KC,KEY_KP4)] = FOUR;
+  translist[W_G_HCW(W_HCW_KC,KEY_KP3)] = THREE;
+  translist[W_G_HCW(W_HCW_KC,KEY_KP2)] = TWO;
+  translist[W_G_HCW(W_HCW_KC,KEY_KP1)] = ONE;
+  translist[W_G_HCW(W_HCW_KC,KEY_KP0)] = ZERO;
+
+  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_9)] = NINE;
+  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_8)] = EIGHT;
+  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_7)] = SEVEN;
+  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_6)] = SIX;
+  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_5)] = FIVE;
+  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_4)] = FOUR;
+  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_3)] = THREE;
+  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_2)] = TWO;
+  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_1)] = ONE;
+  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_0)] = ZERO;
+  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_STAR)] = STAR;
+  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_POUND)] = HASH;
+
+
+  translist[W_G_HCW(W_HCW_KC,KEY_J)] = GO; //j for JUMP TO instead of go to
+  translist[W_G_HCW(W_HCW_KC,KEY_R)] = RED;
+  translist[W_G_HCW(W_HCW_KC,KEY_G)] = GREEN;
+  translist[W_G_HCW(W_HCW_KC,KEY_Y)] = YELLOW;
+  translist[W_G_HCW(W_HCW_KC,KEY_B)] = BLUE;
+  //Processing Remote Style Messages
+  translist[W_G_HCW(W_HCW_KC,KEY_GREEN)] = GREEN;
+  translist[W_G_HCW(W_HCW_KC,KEY_RED)] = RED;
+  translist[W_G_HCW(W_HCW_KC,KEY_YELLOW)] = YELLOW;
+  translist[W_G_HCW(W_HCW_KC,KEY_BLUE)] = BLUE;
+  translist[W_G_HCW(W_HCW_KC,KEY_MENU)] = MENU;
+
+  translist[W_G_HCW(W_HCW_KC,KEY_RECORD)] = RECORD;
+  translist[W_G_HCW(W_HCW_KC,KEY_PLAY)] = PLAY; //Playback Televison
+  translist[W_G_HCW(W_HCW_KC,KEY_PAUSE)] = PAUSE;
+  translist[W_G_HCW(W_HCW_KC,KEY_STOP)] = STOP;
+  translist[W_G_HCW(W_HCW_KC,KEY_PLAYPAUSE)] = PLAYPAUSE;
+  translist[W_G_HCW(W_HCW_KC,KEY_P)] = PLAYPAUSE;
+  translist[W_G_HCW(W_HCW_KC,KEY_NEXT)] = SKIPFORWARD;
+  translist[W_G_HCW(W_HCW_KC,KEY_F2)] = SKIPFORWARD;
+  translist[W_G_HCW(W_HCW_KC,KEY_PREVIOUS)] = SKIPBACK;
+  translist[W_G_HCW(W_HCW_KC,KEY_F1)] = SKIPBACK;
+  translist[W_G_HCW(W_HCW_KC,KEY_FORWARD)] = FORWARD;
+  translist[W_G_HCW(W_HCW_KC,KEY_FASTFORWARD)] = FORWARD;
+  translist[W_G_HCW(W_HCW_KC,KEY_F)] = FORWARD;
+  translist[W_G_HCW(W_HCW_KC,KEY_BACK)] = REVERSE;
+  translist[W_G_HCW(W_HCW_KC,KEY_REWIND)] = REVERSE;
+  translist[W_G_HCW(W_HCW_KC,KEY_T)] = REVERSE;
+  translist[W_G_HCW(W_HCW_KC,KEY_MUTE)] = MUTE;
+  translist[W_G_HCW(W_HCW_KC,KEY_F8)] = MUTE;
+  translist[W_G_HCW(W_HCW_KC,KEY_F10)] = VOLUMEUP;
+  translist[W_G_HCW(W_HCW_KC,KEY_F9)] = VOLUMEDOWN;
+  translist[W_G_HCW(W_HCW_KC,KEY_VOLUMEUP)] = VOLUMEUP;
+  translist[W_G_HCW(W_HCW_KC,KEY_VOLUMEDOWN)] = VOLUMEDOWN;
+  translist[W_G_HCW(W_HCW_KC,KEY_CHANNELUP)] = CHANNELUP;
+  translist[W_G_HCW(W_HCW_KC,KEY_CHANNELDOWN)] = CHANNELDOWN;
+  translist[W_G_HCW(W_HCW_KC,KEY_PAGEUP)] = CHANNELUP;
+  translist[W_G_HCW(W_HCW_KC,KEY_PAGEDOWN)] = CHANNELDOWN;
+
+
+  //Processing CEC_Messages
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER9)] = NINE;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER8)] = EIGHT;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER7)] = SEVEN;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER6)] = SIX;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER5)] = FIVE;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER4)] = FOUR;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER3)] = THREE;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER2)] = TWO;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER1)] = ONE;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER0)] = ZERO;
+  //translist[W_G_HCW(W_HCW_CEC,KEY_KPDOT)] = STAR;
+
+
+
+  //translist[W_G_HCW(W_HCW_CEC,KEY_J)] = GO; //j for JUMP TO instead of go to
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_F2_RED)] = RED;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_F3_GREEN)] = GREEN;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_F4_YELLOW)] = YELLOW;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_F1_BLUE)] = BLUE;
+  //Processing Remote Style Messages
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_FAVORITE_MENU)] = MENU;
+
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_RECORD)] = RECORD;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_PLAY)] = PLAY; //Playback Televison
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_PAUSE)] = PAUSE;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_STOP)] = STOP;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_PAUSE_PLAY_FUNCTION)] = PLAYPAUSE;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_FORWARD)] = SKIPFORWARD;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_BACKWARD)] = SKIPBACK;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_FAST_FORWARD )] = FORWARD;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_REWIND)] = REVERSE;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_MUTE)] = MUTE;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_VOLUME_UP)] = VOLUMEUP;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_VOLUME_DOWN)] = VOLUMEDOWN;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_CHANNEL_UP )] = CHANNELUP;
+  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_CHANNEL_DOWN)] = CHANNELDOWN;
+}
+
+#define NAMETRICK(pre, code) linux_keymap[pre ## code]=  #code
+#define NAMETRICK2(pre, code) cec_keymap[pre ## code]=  #code
+//extracte from linux/input.h
+
+static const char * linux_keymap[KEY_MAX+1];
+static const char * cec_keymap[CEC_USER_CONTROL_CODE_MAX+1];
+
+void InputLinux::InitKeymap()
+{
+  for (int i=0;i<KEY_MAX+1;i++)
+  {
+    linux_keymap[i] = NULL;
+  }
+
+  NAMETRICK(KEY_,RESERVED);
+  NAMETRICK(KEY_,ESC);
+  NAMETRICK(KEY_,1);
+  NAMETRICK(KEY_,2);
+  NAMETRICK(KEY_,3);
+  NAMETRICK(KEY_,4);
+  NAMETRICK(KEY_,5);
+  NAMETRICK(KEY_,6);
+  NAMETRICK(KEY_,7);
+  NAMETRICK(KEY_,8);
+  NAMETRICK(KEY_,9);
+  NAMETRICK(KEY_,0);
+  NAMETRICK(KEY_,MINUS);
+  NAMETRICK(KEY_,EQUAL);
+  NAMETRICK(KEY_,BACKSPACE);
+  NAMETRICK(KEY_,TAB);
+  NAMETRICK(KEY_,Q);
+  NAMETRICK(KEY_,W);
+  NAMETRICK(KEY_,E);
+  NAMETRICK(KEY_,R);
+  NAMETRICK(KEY_,T);
+  NAMETRICK(KEY_,Y);
+  NAMETRICK(KEY_,U);
+  NAMETRICK(KEY_,I);
+  NAMETRICK(KEY_,O);
+  NAMETRICK(KEY_,P);
+  NAMETRICK(KEY_,LEFTBRACE);
+  NAMETRICK(KEY_,RIGHTBRACE);
+  NAMETRICK(KEY_,ENTER);
+  NAMETRICK(KEY_,LEFTCTRL);
+  NAMETRICK(KEY_,A);
+  NAMETRICK(KEY_,S);
+  NAMETRICK(KEY_,D);
+  NAMETRICK(KEY_,F);
+  NAMETRICK(KEY_,G);
+  NAMETRICK(KEY_,H);
+  NAMETRICK(KEY_,J);
+  NAMETRICK(KEY_,K);
+  NAMETRICK(KEY_,L);
+  NAMETRICK(KEY_,SEMICOLON);
+  NAMETRICK(KEY_,APOSTROPHE);
+  NAMETRICK(KEY_,GRAVE);
+  NAMETRICK(KEY_,LEFTSHIFT);
+  NAMETRICK(KEY_,BACKSLASH);
+  NAMETRICK(KEY_,Z);
+  NAMETRICK(KEY_,X);
+  NAMETRICK(KEY_,C);
+  NAMETRICK(KEY_,V);
+  NAMETRICK(KEY_,B);
+  NAMETRICK(KEY_,N);
+  NAMETRICK(KEY_,M);
+  NAMETRICK(KEY_,COMMA);
+  NAMETRICK(KEY_,DOT);
+  NAMETRICK(KEY_,SLASH);
+  NAMETRICK(KEY_,RIGHTSHIFT);
+  NAMETRICK(KEY_,KPASTERISK);
+  NAMETRICK(KEY_,LEFTALT);
+  NAMETRICK(KEY_,SPACE);
+  NAMETRICK(KEY_,CAPSLOCK);
+  NAMETRICK(KEY_,F1);
+  NAMETRICK(KEY_,F2);
+  NAMETRICK(KEY_,F3);
+  NAMETRICK(KEY_,F4);
+  NAMETRICK(KEY_,F5);
+  NAMETRICK(KEY_,F6);
+  NAMETRICK(KEY_,F7);
+  NAMETRICK(KEY_,F8);
+  NAMETRICK(KEY_,F9);
+  NAMETRICK(KEY_,F10);
+  NAMETRICK(KEY_,NUMLOCK);
+  NAMETRICK(KEY_,SCROLLLOCK);
+  NAMETRICK(KEY_,KP7);
+  NAMETRICK(KEY_,KP8);
+  NAMETRICK(KEY_,KP9);
+  NAMETRICK(KEY_,KPMINUS);
+  NAMETRICK(KEY_,KP4);
+  NAMETRICK(KEY_,KP5);
+  NAMETRICK(KEY_,KP6);
+  NAMETRICK(KEY_,KPPLUS);
+  NAMETRICK(KEY_,KP1);
+  NAMETRICK(KEY_,KP2);
+  NAMETRICK(KEY_,KP3);
+  NAMETRICK(KEY_,KP0);
+  NAMETRICK(KEY_,KPDOT);
+  NAMETRICK(KEY_,F11);
+  NAMETRICK(KEY_,F12);
+  NAMETRICK(KEY_,KPENTER);
+  NAMETRICK(KEY_,RIGHTCTRL);
+  NAMETRICK(KEY_,KPSLASH);
+  NAMETRICK(KEY_,SYSRQ);
+  NAMETRICK(KEY_,RIGHTALT);
+  NAMETRICK(KEY_,LINEFEED);
+  NAMETRICK(KEY_,HOME);
+  NAMETRICK(KEY_,UP);
+  NAMETRICK(KEY_,PAGEUP);
+  NAMETRICK(KEY_,LEFT);
+  NAMETRICK(KEY_,RIGHT);
+  NAMETRICK(KEY_,END);
+  NAMETRICK(KEY_,DOWN);
+  NAMETRICK(KEY_,PAGEDOWN);
+  NAMETRICK(KEY_,INSERT);
+  NAMETRICK(KEY_,DELETE);
+  NAMETRICK(KEY_,MACRO);
+  NAMETRICK(KEY_,MUTE);
+  NAMETRICK(KEY_,VOLUMEDOWN);
+  NAMETRICK(KEY_,VOLUMEUP);
+  NAMETRICK(KEY_,POWER);
+  NAMETRICK(KEY_,KPEQUAL);
+  NAMETRICK(KEY_,KPPLUSMINUS);
+  NAMETRICK(KEY_,PLAY);
+  NAMETRICK(KEY_,PAUSE);
+  NAMETRICK(KEY_,SCALE);
+  NAMETRICK(KEY_,KPCOMMA);
+  NAMETRICK(KEY_,YEN);
+  NAMETRICK(KEY_,LEFTMETA);
+  NAMETRICK(KEY_,RIGHTMETA);
+  NAMETRICK(KEY_,COMPOSE);
+  NAMETRICK(KEY_,STOP);
+  NAMETRICK(KEY_,AGAIN);
+  NAMETRICK(KEY_,PROPS);
+  NAMETRICK(KEY_,UNDO);
+  NAMETRICK(KEY_,FRONT);
+  NAMETRICK(KEY_,COPY);
+  NAMETRICK(KEY_,OPEN);
+  NAMETRICK(KEY_,PASTE);
+  NAMETRICK(KEY_,FIND);
+  NAMETRICK(KEY_,CUT);
+  NAMETRICK(KEY_,HELP);
+  NAMETRICK(KEY_,MENU);
+  NAMETRICK(KEY_,CALC);
+  NAMETRICK(KEY_,SETUP);
+  NAMETRICK(KEY_,SLEEP);
+  NAMETRICK(KEY_,WAKEUP);
+  NAMETRICK(KEY_,FILE);
+  NAMETRICK(KEY_,SENDFILE);
+  NAMETRICK(KEY_,DELETEFILE);
+  NAMETRICK(KEY_,XFER);
+  NAMETRICK(KEY_,PROG1);
+  NAMETRICK(KEY_,PROG2);
+  NAMETRICK(KEY_,WWW);
+  NAMETRICK(KEY_,MSDOS);
+  NAMETRICK(KEY_,COFFEE);
+  NAMETRICK(KEY_,DIRECTION);
+  NAMETRICK(KEY_,CYCLEWINDOWS);
+  NAMETRICK(KEY_,MAIL);
+  NAMETRICK(KEY_,BOOKMARKS);
+  NAMETRICK(KEY_,COMPUTER);
+  NAMETRICK(KEY_,BACK);
+  NAMETRICK(KEY_,FORWARD);
+  NAMETRICK(KEY_,FASTFORWARD);
+  NAMETRICK(KEY_,CLOSECD);
+  NAMETRICK(KEY_,EJECTCD);
+  NAMETRICK(KEY_,EJECTCLOSECD);
+  NAMETRICK(KEY_,NEXTSONG);
+  NAMETRICK(KEY_,PLAYPAUSE);
+  NAMETRICK(KEY_,PREVIOUSSONG);
+  NAMETRICK(KEY_,STOPCD);
+  NAMETRICK(KEY_,RECORD);
+  NAMETRICK(KEY_,REWIND);
+  NAMETRICK(KEY_,PHONE);
+  NAMETRICK(KEY_,ISO);
+  NAMETRICK(KEY_,CONFIG);
+  NAMETRICK(KEY_,HOMEPAGE);
+  NAMETRICK(KEY_,REFRESH);
+  NAMETRICK(KEY_,EXIT);
+  NAMETRICK(KEY_,MOVE);
+  NAMETRICK(KEY_,EDIT);
+  NAMETRICK(KEY_,SCROLLUP);
+  NAMETRICK(KEY_,SCROLLDOWN);
+  NAMETRICK(KEY_,KPLEFTPAREN);
+  NAMETRICK(KEY_,KPRIGHTPAREN);
+  NAMETRICK(KEY_,NEW);
+  NAMETRICK(KEY_,REDO);
+  NAMETRICK(KEY_,OK);
+  NAMETRICK(KEY_,SELECT);
+  NAMETRICK(KEY_,GOTO);
+  NAMETRICK(KEY_,CLEAR);
+  NAMETRICK(KEY_,POWER2);
+  NAMETRICK(KEY_,OPTION);
+  NAMETRICK(KEY_,INFO);
+  NAMETRICK(KEY_,TIME);
+  NAMETRICK(KEY_,VENDOR);
+  NAMETRICK(KEY_,ARCHIVE);
+  NAMETRICK(KEY_,PROGRAM);
+  NAMETRICK(KEY_,CHANNEL);
+  NAMETRICK(KEY_,FAVORITES);
+  NAMETRICK(KEY_,EPG);
+  NAMETRICK(KEY_,PVR);
+  NAMETRICK(KEY_,MHP);
+  NAMETRICK(KEY_,LANGUAGE);
+  NAMETRICK(KEY_,TITLE);
+  NAMETRICK(KEY_,SUBTITLE);
+  NAMETRICK(KEY_,ANGLE);
+  NAMETRICK(KEY_,ZOOM);
+  NAMETRICK(KEY_,MODE);
+  NAMETRICK(KEY_,KEYBOARD);
+  NAMETRICK(KEY_,SCREEN);
+  NAMETRICK(KEY_,RED);
+  NAMETRICK(KEY_,GREEN);
+  NAMETRICK(KEY_,YELLOW);
+  NAMETRICK(KEY_,BLUE);
+  NAMETRICK(KEY_,CHANNELUP);
+  NAMETRICK(KEY_,CHANNELDOWN);
+  NAMETRICK(KEY_,FIRST);
+  NAMETRICK(KEY_,LAST);
+  NAMETRICK(KEY_,AB);
+  NAMETRICK(KEY_,NEXT);
+  NAMETRICK(KEY_,RESTART);
+  NAMETRICK(KEY_,SLOW);
+  NAMETRICK(KEY_,SHUFFLE);
+  NAMETRICK(KEY_,BREAK);
+  NAMETRICK(KEY_,PREVIOUS);
+  NAMETRICK(KEY_,DIGITS);
+  NAMETRICK(KEY_,TEEN);
+  NAMETRICK(KEY_,TWEN);
+  NAMETRICK(KEY_,VIDEOPHONE);
+  NAMETRICK(KEY_,GAMES);
+  NAMETRICK(KEY_,ZOOMIN);
+  NAMETRICK(KEY_,ZOOMOUT);
+  NAMETRICK(KEY_,ZOOMRESET);
+  NAMETRICK(KEY_,DOLLAR);
+  NAMETRICK(KEY_,EURO);
+  NAMETRICK(KEY_,MEDIA);
+  NAMETRICK(KEY_,FRAMEBACK);
+  NAMETRICK(KEY_,FRAMEFORWARD);
+  NAMETRICK(KEY_,CONTEXT_MENU);
+  NAMETRICK(KEY_,MEDIA_REPEAT);
+  NAMETRICK(KEY_,NUMERIC_0);
+  NAMETRICK(KEY_,NUMERIC_1);
+  NAMETRICK(KEY_,NUMERIC_2);
+  NAMETRICK(KEY_,NUMERIC_3);
+  NAMETRICK(KEY_,NUMERIC_4);
+  NAMETRICK(KEY_,NUMERIC_5);
+  NAMETRICK(KEY_,NUMERIC_6);
+  NAMETRICK(KEY_,NUMERIC_7);
+  NAMETRICK(KEY_,NUMERIC_8);
+  NAMETRICK(KEY_,NUMERIC_9);
+  NAMETRICK(KEY_,NUMERIC_STAR);
+  NAMETRICK(KEY_,NUMERIC_POUND);
+
+  for (int i=0; i < CEC_USER_CONTROL_CODE_MAX + 1; i++)
+  {
+    cec_keymap[i] = NULL;
+  }
+
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,SELECT);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,UP);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,DOWN);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,LEFT);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,RIGHT);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,RIGHT_UP);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,RIGHT_DOWN);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,LEFT_UP);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,LEFT_DOWN);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,ROOT_MENU);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,SETUP_MENU);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,CONTENTS_MENU);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,FAVORITE_MENU);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,EXIT);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER0);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER1);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER2);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER3);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER4);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER5);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER6);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER7);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER8);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER9);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,DOT);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,ENTER);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,CLEAR);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,NEXT_FAVORITE);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,CHANNEL_UP);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,CHANNEL_DOWN);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,PREVIOUS_CHANNEL);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,SOUND_SELECT);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,INPUT_SELECT);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,DISPLAY_INFORMATION);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,HELP);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,PAGE_UP);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,PAGE_DOWN);
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,POWER );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,VOLUME_UP );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,VOLUME_DOWN );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,MUTE );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,PLAY );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,STOP );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,PAUSE );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,RECORD );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,REWIND );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,FAST_FORWARD );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,EJECT );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,FORWARD );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,BACKWARD );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,STOP_RECORD );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,PAUSE_RECORD );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,ANGLE );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,SUB_PICTURE );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,VIDEO_ON_DEMAND );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,ELECTRONIC_PROGRAM_GUIDE );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,TIMER_PROGRAMMING );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,INITIAL_CONFIGURATION );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,PLAY_FUNCTION );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,PAUSE_PLAY_FUNCTION );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,RECORD_FUNCTION );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,PAUSE_RECORD_FUNCTION );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,STOP_FUNCTION );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,MUTE_FUNCTION );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,RESTORE_VOLUME_FUNCTION );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,TUNE_FUNCTION );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,SELECT_MEDIA_FUNCTION );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,SELECT_AV_INPUT_FUNCTION );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,SELECT_AUDIO_INPUT_FUNCTION );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,POWER_TOGGLE_FUNCTION );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,POWER_OFF_FUNCTION );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,POWER_ON_FUNCTION );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,F1_BLUE );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,F2_RED );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,F3_GREEN );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,F4_YELLOW );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,F5 );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,DATA );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,AN_RETURN );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,AN_CHANNELS_LIST );
+  NAMETRICK2(CEC_USER_CONTROL_CODE_,MAX );
+}
+
+
+
+char* InputLinux::HCWDesc(unsigned long long hcw)
+{
+    //Determine type
+    unsigned int type = static_cast<unsigned int>(hcw >> 32);
+    unsigned int vk = static_cast<ULONG>(hcw);
+    char* rt = NULL;
+
+    switch(type)
+    {
+      case W_HCW_KC:
+      {
+        rt = new char[10];
+        const char *desc=linux_keymap[vk];
+        if (desc)
+          strncpy(rt, desc, 9);
+        else
+          sprintf(rt, "0x%x", vk);
+        break;
+      }
+      case W_HCW_CEC:
+      {
+        rt = new char[10];
+        const char* desc = cec_keymap[vk];
+        if (desc)
+          strncpy(rt, desc, 9);
+        else
+          sprintf(rt, "0x%x", vk);
+        break;
+      }
+  /*
+    case W_HCW_LIRC:{
+        ULONG ri=(ULONG)hcw;
+        rt=new char[10];
+        sprintf(rt,"R: %X",ri);
+                  }break;*/
+    }
+
+    return rt;
+}
+
+void InputLinux::changePowerState(bool poweron)
+{
+  if (cec_adap)
+  {
+    if (poweron)
+    {
+      //Log::getInstance()->log("InputLinux", Log::DEBUG, "CEC set active source");
+      cec_adap->SetActiveSource(cec_config.deviceTypes[0]);
+    }
+    else
+    {
+      //Log::getInstance()->log("InputLinux", Log::DEBUG, "CEC set inactive view");
+      cec_adap->SetInactiveView();
+    }
+  }
+}
+
+#if CEC_LIB_VERSION_MAJOR >= 4
+
+// libcec4 API changed these params to pointers rather than copies, and the returns to void
+// Otherwise, these two blocks of code are the same
+
+void InputLinux::cecLogMessage(void* /* param */, const cec_log_message* message)
+{
+  Log::getInstance()->log("InputLinux", Log::DEBUG, "CECLOG: %lld %d %s", message->time, message->level, message->message);
+}
+
+void InputLinux::cecKeyPress(void* /* param */, const cec_keypress* key)
+{
+  //Log::getInstance()->log("InputLinux", Log::DEBUG, "Incoming cec key %d %d", key->keycode,key->duration);
+  if (key->duration == 0) static_cast<InputLinux*>(Input::getInstance())->incomingCECkey(key->keycode);
+}
+
+void InputLinux::cecCommand(void* /* param */, const cec_command* command)
+{
+       Log::getInstance()->log("InputLinux", Log::DEBUG, "CECCommand: %d",command->opcode);
+       switch (command->opcode) {
+       case CEC_OPCODE_STANDBY: {
+               if (command->initiator==CECDEVICE_TV) {
+                       static_cast<InputLinux*>(Input::getInstance())->incomingPowerkey(POWEROFF);
+               }
+       } break;
+       case CEC_OPCODE_DECK_CONTROL: {
+               if (command->initiator==CECDEVICE_TV && command->parameters.size == 1
+                               && command->parameters[0]==CEC_DECK_CONTROL_MODE_STOP) {
+                       static_cast<InputLinux*>(Input::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_STOP);
+
+               }
+
+       } break;
+       case CEC_OPCODE_PLAY: {
+               if (command->initiator==CECDEVICE_TV && command->parameters.size == 1) {
+                       if (command->parameters[0]==CEC_PLAY_MODE_PLAY_FORWARD) {
+                               static_cast<InputLinux*>(Input::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PLAY);
+                       } else if (command->parameters[0]==CEC_PLAY_MODE_PLAY_STILL) {
+                               static_cast<InputLinux*>(Input::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PAUSE);
+                       }
+               }
+
+
+       } break;
+       default:
+               break;
+       };
+}
+
+void InputLinux::cecConfigurationChanged(void* /* param */, const libcec_configuration*)
+{
+       Log::getInstance()->log("InputLinux", Log::DEBUG, "CECConfig:"/*,config->string()*/);
+}
+
+#else
+
+int InputLinux::cecLogMessage(void *param, const cec_log_message message)
+{
+  Log::getInstance()->log("InputLinux", Log::DEBUG, "CECLOG: %lld %d %s", message.time, message.level, message.message);
+  return 0;
+}
+
+int InputLinux::cecKeyPress(void*param, const cec_keypress key)
+{
+  //Log::getInstance()->log("InputLinux", Log::DEBUG, "Incoming cec key %d %d", key.keycode,key.duration);
+  if (key.duration == 0) ((InputLinux*)Input::getInstance())->incomingCECkey(key.keycode);
+  return 1;
+}
+
+int InputLinux::cecCommand(void *param, const cec_command command)
+{
+       Log::getInstance()->log("InputLinux", Log::DEBUG, "CECCommand: %d",command.opcode);
+       switch (command.opcode) {
+       case CEC_OPCODE_STANDBY: {
+               if (command.initiator==CECDEVICE_TV) {
+                       ((InputLinux*)Input::getInstance())->incomingPowerkey(POWEROFF);
+               }
+       } break;
+       case CEC_OPCODE_DECK_CONTROL: {
+               if (command.initiator==CECDEVICE_TV && command.parameters.size == 1
+                               && command.parameters[0]==CEC_DECK_CONTROL_MODE_STOP) {
+                       ((InputLinux*)Input::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_STOP);
+
+               }
+
+       } break;
+       case CEC_OPCODE_PLAY: {
+               if (command.initiator==CECDEVICE_TV && command.parameters.size == 1) {
+                       if (command.parameters[0]==CEC_PLAY_MODE_PLAY_FORWARD) {
+                               ((InputLinux*)Input::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PLAY);
+                       } else if (command.parameters[0]==CEC_PLAY_MODE_PLAY_STILL) {
+                               ((InputLinux*)Input::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PAUSE);
+                       }
+               }
+
+
+       } break;
+       default:
+               break;
+       };
+       return 1;
+}
+
+int InputLinux::cecConfigurationChanged(void *param, const libcec_configuration config)
+{
+       Log::getInstance()->log("InputLinux", Log::DEBUG, "CECConfig:"/*,config.string()*/);
+       return 1;
+
+}
+
+#endif
+
+void  InputLinux::cecSourceActivated(void* /* param */, const cec_logical_address address, const uint8_t activated)
+{
+  Log::getInstance()->log("InputLinux", Log::DEBUG, "CECSourceActivated: %d %d", address, activated);
+  if (activated == 1)
+  {
+    static_cast<InputLinux*>(Input::getInstance())->incomingPowerkey(POWERON);
+  }
+}
+
+void InputLinux::incomingCECkey(int keys)
+{
+  // Send INPUT message
+  Message* m = new Message();
+  m->message = Message::INPUT_EVENT;
+  m->to = Command::getInstance();
+  m->from = this;
+  m->parameter = static_cast<UCHAR>(TranslateHWC(W_G_HCW(W_HCW_CEC, keys)));
+  MessageQueue::getInstance()->postMessage(m);
+}
+
+void InputLinux::incomingPowerkey(UCHAR key)
+{
+  // Send INPUT message
+  Message* m = new Message();
+  m->message = Message::INPUT_EVENT;
+  m->to = Command::getInstance();
+  m->from = this;
+  m->parameter = key;
+  MessageQueue::getInstance()->postMessage(m);
+}
+
+bool InputLinux::loadOptionsfromServer(VDR* vdr)
+{
+   // Set remote keys
+  char* name;
+  name = vdr->configLoad("InputLinux", "HandleVolume");
+
+  if (name != NULL)
+  {
+    if      (STRCASECMP(name, "Vomp") == 0) cechandlesvolume = false;
+    else if (STRCASECMP(name, "Cec") == 0) cechandlesvolume = true;
+    delete[] name;
+  }
+  return Input::loadOptionsfromServer(vdr);
+}
+
+bool InputLinux::saveOptionstoServer()
+{
+  if (cechandlesvolume) VDR::getInstance()->configSave("InputLinux", "HandleVolume","Cec");
+  else VDR::getInstance()->configSave("InputLinux", "HandleVolume","Vomp");
+
+  return Input::saveOptionstoServer();
+}
+
+bool InputLinux::addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane)
+{
+  if (!Input::addOptionsToPanes(panenumber, options, pane)) return false;
+
+  Option* option;
+  if (panenumber == 2)
+  {
+    static const char* volumeopts[]={"Vomp","Cec"};
+    option = new Option(100,tr("Volume handled by"), "InputLinux","HandleVolume",Option::TYPE_TEXT,/*4,2*/2,0,0,volumeopts,NULL,false,this);
+    options->push_back(option);
+    pane->addOptionLine(option);
+  }
+
+  return true;
+}
+
+bool InputLinux::handleOptionChanges(Option* option)
+{
+    if (Input::handleOptionChanges(option))
+               return true;
+       switch (option->id) {
+       case 100: {
+               if (STRCASECMP(option->options[option->userSetChoice], "Vomp") == 0) {
+                       cechandlesvolume=false;
+               }  else if (STRCASECMP(option->options[option->userSetChoice], "Cec")
+                               == 0) {
+                       cechandlesvolume=true;
+               }
+               Log::getInstance()->log("InputLinux", Log::DEBUG, "Set volume handling to to %s %d",option->options[option->userSetChoice],cechandlesvolume);
+               return true;
+       }
+       break;
+       };
+       return false;
+
+}
+
+void InputLinux::volumeUp()
+{
+  cec_adap->VolumeUp();
+}
+
+void InputLinux::volumeDown()
+{
+  cec_adap->VolumeDown();
+}
+
+void InputLinux::volumeMute()
+{
+#if CEC_LIB_VERSION_MAJOR >= 4
+  cec_adap->AudioToggleMute();
+#else
+  cec_adap->MuteAudio();
+#endif
+}
+
+void InputLinux::informStopEventLoop()
+{
+  listenLoopStop = true;
+  write(pfds[1], "1", 1); // break the select in getButtonPress
+}
+
+void InputLinux::eventLoop()
+{
+  fd_set readfds;
+  int maxfd;
+
+  if (pipe2(pfds, O_NONBLOCK) == -1)
+  {
+    Log::getInstance()->log("InputLinux", Log::ERR, "pipe2() fail");
+    return;
+  }
+
+  Log::getInstance()->log("InputLinux", Log::INFO, "Listen loop");
+
+  while(1)
+  {
+    if (listenLoopStop) break;
+
+    FD_ZERO(&readfds);
+
+    maxfd = 0;
+    for (unsigned int i = 0; i < devices.size(); i++)
+    {
+      int cur_fd = devices[i];
+      maxfd = max(cur_fd, maxfd);
+      FD_SET(cur_fd, &readfds);
+    }
+
+    FD_SET(pfds[0], &readfds);
+    maxfd = max(pfds[0], maxfd);
+
+    // 0 = nothing happened and timeout expired
+    // >0 = num of descriptors that changed
+    // -1 = error
+    if (select(maxfd + 1, &readfds, NULL, NULL, NULL) < 1)
+    {
+      Log::getInstance()->log("InputLinux", Log::ERR, "Select fail");
+      break;
+    }
+
+    if (FD_ISSET(pfds[0], &readfds))
+    {
+      // assume quit signal
+      Log::getInstance()->log("InputLinux", Log::NOTICE, "pfds quit");
+      break;
+
+      // FUTURE: read the byte and do different things? Read listenLoopStop and maybe other bools?
+    }
+
+    for (unsigned int i = 0; i < devices.size(); i++)
+    {
+      int cur_fd = devices[i];
+      if (FD_ISSET(cur_fd, &readfds))
+      {
+        struct input_event ev;
+        int count = read(cur_fd, &ev, sizeof(ev));
+        if (count == sizeof(ev))
+        {
+          if (ev.type == EV_KEY && ev.value == 1)
+          {
+            // Send INPUT message
+            Message* m = new Message();
+            m->message = Message::INPUT_EVENT;
+            m->to = Command::getInstance();
+            m->from = this;
+            m->parameter = static_cast<UCHAR>(TranslateHWC(W_G_HCW(W_HCW_KC,ev.code)));
+            MessageQueue::getInstance()->postMessage(m);
+          }
+        }
+      }
+    }
+  }
+
+  close(pfds[1]);
+  close(pfds[0]);
+}
+
+// FIXME surely NA_SIGNAL can go
diff --git a/inputlinux.h b/inputlinux.h
new file mode 100644 (file)
index 0000000..bfd293f
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+    Copyright 2004-2020 Chris Tallon; 2012 Marten Richter
+
+    This file is part of VOMP.
+
+    VOMP is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    VOMP is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
+*/
+
+#ifndef INPUTLINUX_H
+#define INPUTLINUX_H
+
+#include <stdio.h>
+#include <libcec/cec.h>
+#include <vector>
+
+#include "defines.h"
+#include "log.h"
+#include "input.h"
+
+class InputLinux : public Input
+{
+  public:
+    InputLinux();
+    virtual ~InputLinux();
+
+    int init(const char *devName);
+    int shutdown();
+    int getDevice();
+    UCHAR getButtonPress(int) { return NA_UNKNOWN; } // DEPRECATED
+  //  void Signal();
+
+//  void SendPower();
+    void InitHWCListwithDefaults();
+    const char*HardcodedTranslateStr(UCHAR command);
+    char* HCWDesc(ULLONG hcw);
+    
+    void changePowerState(bool poweron);
+
+    bool loadOptionsfromServer(VDR* vdr);
+    bool saveOptionstoServer();
+    bool addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane);
+    bool handleOptionChanges(Option* option);
+
+    bool mayHaveFewButtons() {return true;};
+
+    virtual bool handlesVolume() { return cechandlesvolume; };
+    virtual void volumeUp();
+    virtual void volumeDown();
+    virtual void volumeMute();
+
+    int initCec();
+    void deinitCec();
+
+  private: 
+    int initted{};
+    bool signal{};
+    bool cechandlesvolume{};
+
+    UCHAR TranslateHWCFixed(ULLONG code);
+    void InitKeymap();
+    std::vector<int> devices;
+    int num_loop{};
+
+    CEC::ICECAdapter* cec_adap{};
+    CEC::libcec_configuration cec_config;
+    CEC::ICECCallbacks cec_callbacks;
+
+    void incomingCECkey(int keys);
+    void incomingPowerkey(UCHAR key);
+
+#if CEC_LIB_VERSION_MAJOR >= 4
+    static void cecLogMessage(void *param, const CEC::cec_log_message* message);
+    static void cecKeyPress(void*param, const CEC::cec_keypress* key);
+    static void cecCommand(void *param, const CEC::cec_command* command);
+    static void cecConfigurationChanged(void *param, const CEC::libcec_configuration* config);
+#else
+    static int cecLogMessage(void *param, const CEC::cec_log_message message);
+    static int cecKeyPress(void*param, const CEC::cec_keypress key);
+    static int cecCommand(void *param, const CEC::cec_command command);
+    static int cecConfigurationChanged(void *param, const CEC::libcec_configuration config);
+#endif
+    static void cecSourceActivated(void*param, const CEC::cec_logical_address address, const uint8_t activated);
+
+    void eventLoop();
+    void informStopEventLoop();
+
+    int pfds[2];
+};
+
+#endif
diff --git a/main.cc b/main.cc
index f00505429252cd88ceb41fa811fc92184081f87c..70067d27372f8ab777f078184da93f8e4b210e42 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -51,7 +51,7 @@
 
 #ifdef VOMP_PLATFORM_RASPBERRY
 
-#include "remotelinux.h"
+#include "inputlinux.h"
 #include "ledraspberry.h"
 #include "osdopenvg.h"
 #include "audioomx.h"
@@ -72,7 +72,7 @@ void shutdown(int code);
 
 // Global variables --------------------------------------------------------------------------------------------------
 Log* logger;
-Remote* remote;
+Input* remote;
 Led* led;
 Osd* osd;
 Timers* timers;
index 45e88d778d18e908f8d5176733d8654d407e6593..2f630979ddd63952d1d4206bedc4aae7f25040a9 100644 (file)
@@ -12,7 +12,7 @@ OBJ_COMMON = command.o tcp.o dsock.o thread.o timers.o i18n.o vdp6.o
              vradiorec.o vaudioselector.o vscreensaver.o vopts.o                   \
              wselectlist.o wjpeg.o wsymbol.o wbutton.o wtextbox.o                  \
              woptionpane.o woptionbox.o wremoteconfig.o wtabbar.o led.o            \
-             remote.o osd.o surface.o vpicturebanner.o abstractoption.o            \
+             input.o osd.o surface.o vpicturebanner.o abstractoption.o             \
              eventdispatcher.o vdrrequestpacket.o vdrresponsepacket.o              \
              vvideolivetv.o vsleeptimer.o playerlivetv.o playerliveradio.o         \
              wprogressbar.o bitmap.o dvbsubtitles.o tfeed.o vteletextview.o        \
@@ -22,7 +22,7 @@ OBJ_COMMON = command.o tcp.o dsock.o thread.o timers.o i18n.o vdp6.o
 
 OBJ_RASPBERRY = main.o threadp.o osdopenvg.o                                       \
                 ledraspberry.o videoomx.o audioomx.o imageomx.o                    \
-                wjpegsimple.o remotelinux.o signal.o
+                wjpegsimple.o inputlinux.o signal.o
 
 OBJ_WINDOWS = winmain.o threadwin.o remotewin.o ledwin.o videowin.o                \
               audiowin.o windowsosd.o dsallocator.o dssourcefilter.o dssourcepin.o \
index be9be81060c5df98c5282fb801c62f7c18af7980..a65f3dfb81efb5d27ec2a40df952a4eee296798c 100644 (file)
--- a/player.cc
+++ b/player.cc
@@ -26,7 +26,7 @@
 #include "demuxerts.h"
 #include "vdr.h"
 #include "messagequeue.h"
-#include "remote.h"
+#include "input.h"
 #include "message.h"
 #include "dvbsubtitles.h"
 #include "osdreceiver.h"
index 95e0f1294fc5ae4a1b3f4fdffd18b23c925db485..54b9c293293ac6347e37232203f168a193a39c5c 100644 (file)
@@ -25,7 +25,7 @@
 #include "demuxerts.h"
 #include "vdr.h"
 #include "messagequeue.h"
-#include "remote.h"
+#include "input.h"
 #include "message.h"
 #include "channel.h"
 #include "video.h"
index ce1e5fcdf12c8fac53e558453606500879449e75..d055dcaf57fd357809fd40d3c84d46abd5900ecb 100644 (file)
@@ -26,7 +26,7 @@
 #include "demuxerts.h"
 #include "vdr.h"
 #include "messagequeue.h"
-#include "remote.h"
+#include "input.h"
 #include "message.h"
 #include "channel.h"
 #include "dvbsubtitles.h"
index 0aac75c4189c0f3d3ace86e4c719d9da20394d7a..d97e17b24e781ebf5e5d7c132a3d9f2c66fa5c14 100644 (file)
@@ -29,7 +29,7 @@
 #include <time.h>
 
 #include "audio.h"
-#include "remote.h"
+#include "input.h"
 #include "vdr.h"
 #include "callback.h"
 #include "message.h"
index b5f84176576a2db055a5d6ae206244be4f24f3ac..cc184d28a68a24d3a4574a18326f7add02eb4c7b 100644 (file)
@@ -24,7 +24,7 @@
 #include "video.h"
 #include "demuxervdr.h"
 #include "demuxerts.h"
-#include "remote.h"
+#include "input.h"
 #include "vdr.h"
 #include "message.h"
 #include "messagequeue.h"
diff --git a/remote.cc b/remote.cc
deleted file mode 100644 (file)
index 1d0041e..0000000
--- a/remote.cc
+++ /dev/null
@@ -1,570 +0,0 @@
-/*
-    Copyright 2004-2005 Chris Tallon
-
-    This file is part of VOMP.
-
-    VOMP is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    VOMP is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with VOMP; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*/
-
-#include "remote.h"
-#include "wremoteconfig.h"
-#include "i18n.h"
-#include "log.h"
-#include "vdr.h"
-#include "wtabbar.h"
-
-Remote* Remote::instance = NULL;
-
-#ifndef _MSC_VER
-
-const ULONG Remote::NOLEARNMODE;
-// Not buttons
-const  UCHAR Remote::NA_LEARN;
-const  UCHAR Remote::NA_NONE;
-const  UCHAR Remote::NA_UNKNOWN;
-const  UCHAR Remote::NA_SIGNAL;
-const  UCHAR Remote::DF_UP;
-const  UCHAR Remote::DF_DOWN;
-const  UCHAR Remote::DF_LEFT;
-const  UCHAR Remote::DF_RIGHT;
-
-// Problem common buttons
-const  UCHAR Remote::VOLUMEUP;
-const  UCHAR Remote::VOLUMEDOWN;
-const  UCHAR Remote::CHANNELUP;
-const  UCHAR Remote::CHANNELDOWN;
-
-// Common buttons
-const  UCHAR Remote::ZERO;
-const  UCHAR Remote::ONE;
-const  UCHAR Remote::TWO;
-const  UCHAR Remote::THREE;
-const  UCHAR Remote::FOUR;
-const  UCHAR Remote::FIVE;
-const  UCHAR Remote::SIX;
-const  UCHAR Remote::SEVEN;
-const  UCHAR Remote::EIGHT;
-const  UCHAR Remote::NINE;
-const  UCHAR Remote::POWER;
-const  UCHAR Remote::GO;
-const  UCHAR Remote::BACK;
-const  UCHAR Remote::MENU;
-const  UCHAR Remote::RED;
-const  UCHAR Remote::GREEN;
-const  UCHAR Remote::YELLOW;
-const  UCHAR Remote::BLUE;
-const  UCHAR Remote::MUTE;
-const  UCHAR Remote::RADIO;
-const  UCHAR Remote::REVERSE;
-const  UCHAR Remote::PLAY;
-const  UCHAR Remote::FORWARD;
-const  UCHAR Remote::RECORD;
-const  UCHAR Remote::STOP;
-const  UCHAR Remote::PAUSE;
-const  UCHAR Remote::SKIPBACK;
-const  UCHAR Remote::SKIPFORWARD;
-const  UCHAR Remote::OK;
-
-// Old remote only
-const  UCHAR Remote::FULL;
-
-// New remote only
-const  UCHAR Remote::TV;
-const  UCHAR Remote::VIDEOS;
-const  UCHAR Remote::MUSIC;
-const  UCHAR Remote::PICTURES;
-const  UCHAR Remote::GUIDE;
-const  UCHAR Remote::UP;
-const  UCHAR Remote::DOWN;
-const  UCHAR Remote::LEFT;
-const  UCHAR Remote::RIGHT;
-const  UCHAR Remote::PREVCHANNEL;
-const  UCHAR Remote::STAR;
-const  UCHAR Remote::HASH;
-
-// Android only
-const  UCHAR Remote::PLAYPAUSE;
-
-
-// Remote types
-const  UCHAR Remote::OLDREMOTE;
-const  UCHAR Remote::NEWREMOTE;
-
-#endif
-
-Remote::Remote()
-{
-  if (instance) return;
-  instance = this;
-  remoteType = OLDREMOTE;
-  learnmode = NOLEARNMODE;
-}
-
-Remote::~Remote()
-{
-  instance = NULL;
-}
-
-Remote* Remote::getInstance()
-{
-  return instance;
-}
-
-void Remote::setRemoteType(UCHAR newType)
-{
-  if ((newType != OLDREMOTE) && (newType != NEWREMOTE)) return;
-  remoteType = newType;
-}
-
-void Remote::EnterLearningMode(UCHAR command)
-{
-    learnmode = command; //Armed
-}
-
-void Remote::ResetToDefault()
-{
-  translist.clear();
-  InitHWCListwithDefaults();
-}
-
-
-UCHAR Remote::TranslateHWCFixed(ULLONG code)
-{
-  switch (code)
-  {
-    case DOWN:
-      return DOWN;
-    case UP:
-      return UP;
-    case LEFT:
-      return LEFT;
-    case RIGHT:
-      return RIGHT;
-    case DF_DOWN:
-      return DOWN;
-    case DF_UP:
-      return UP;
-    case DF_LEFT:
-      return LEFT;
-    case DF_RIGHT:
-      return RIGHT;
-    case MENU:
-      return MENU;
-    case BACK:
-      return BACK;
-    case OK:
-      return OK;
-    default:
-      return NA_UNKNOWN;
-  }
-}
-
-const char*Remote::HardcodedTranslateStr(UCHAR command)
-{
-  switch (command)
-  {
-    case DOWN:
-      return tr("Down");
-    case UP:
-      return tr("Up");
-    case LEFT:
-      return tr("Left");
-    case RIGHT:
-      return tr("Right");
-    case MENU:
-      return tr("Menu");
-    case BACK:
-      return tr("Back");
-    case OK:
-      return tr("Ok");
-    default:
-      return NULL;
-  }
-}
-
-UCHAR Remote::TranslateHWCList(ULLONG code)
-{
-  if (learnmode != NOLEARNMODE)
-  {
-    setHWCtoCommand(code, learnmode);
-    learnmode = NOLEARNMODE;
-    return NA_LEARN;
-  }
-  RemoteTranslationList::iterator it = translist.find(code);
-  if (it == translist.end())
-  {
-    return NA_UNKNOWN;
-  }
-  else
-  {
-    return it->second;
-  }
-}
-
-UCHAR Remote::TranslateHWC(ULLONG code)
-{
-  UCHAR ret = TranslateHWCFixed(code);
-  if (ret == NA_UNKNOWN)
-  {
-    ret = TranslateHWCList(code);
-  }
-  else
-  {
-    learnmode = NOLEARNMODE;
-  }
-
-  if (ret == NA_UNKNOWN)
-  {
-    return NA_UNKNOWN;
-  }
-  return ret;
-}
-
-void Remote::setHWCtoCommand(ULLONG hcw, UCHAR command)
-{
-  translist[hcw] = command;
-}
-
-void Remote::unsetHWC(ULLONG hcw)
-{
-  translist.erase(hcw);
-}
-
-void Remote::LoadKeysConfig(VDR *vdr,const char *cfg)
-{
-       ULONG number=0;
-       if (sscanf(cfg,"%ld",&number) != 1) return;
-       Log::getInstance()->log("Remote", Log::INFO, "Config General/Remote keys num keys %d",number);
-       char keybuf[1024];
-       for (ULONG i = 0; i < number; i++) {
-               sprintf(keybuf, "RemoteKey%lu", i);
-               const char *keytrans = vdr->configLoad("General", keybuf);
-               if (keytrans) {
-                       ULONG ul1, ul2;
-                       ULONG uc;
-                       if (sscanf(keytrans, "%lXI%lXK%lX", &ul1, &ul2, &uc) == 3) {
-                               translist[((ULLONG) ul1) | ((ULLONG) ul2) << 32] = (UCHAR) uc;
-                       }
-                       delete[] keytrans;
-               }
-
-       }
-}
-
-void Remote::SaveKeysConfig()
-{
-  int number=0;
-  char buffer[1024];
-  char keybuf[1024];
-  RemoteTranslationList::const_iterator it;
-  for (it = translist.begin(); it != translist.end(); it++)
-  {
-         sprintf(buffer,"%08lXI%08lXK%02X",
-                         (ULONG)it->first ,(ULONG) (it->first >> 32), it->second);
-         sprintf(keybuf,"RemoteKey%d",number);
-         VDR::getInstance()->configSave("General",keybuf,buffer);
-         number++;
-  }
-  sprintf(buffer,"%d",number);
-  VDR::getInstance()->configSave("General","RemoteKeyNum",buffer);
-}
-
-
-void Remote::InitHWCListwithDefaults()
-{
-  translist[VOLUMEUP] = VOLUMEUP;
-  translist[VOLUMEDOWN] = VOLUMEDOWN;
-  translist[CHANNELUP] = CHANNELUP;
-  translist[CHANNELDOWN] = CHANNELDOWN;
-
-  // Common buttons
-  translist[ZERO] = ZERO;
-  translist[ONE] = ONE;
-  translist[TWO] = TWO;
-  translist[THREE] = THREE;
-  translist[FOUR] = FOUR;
-  translist[FIVE] = FIVE;
-  translist[SIX] = SIX;
-  translist[SEVEN] = SEVEN;
-  translist[EIGHT] = EIGHT;
-  translist[NINE] = NINE;
-  translist[POWER] = POWER;
-  translist[GO] = GO;
-  translist[RED] = RED;
-  translist[GREEN] = GREEN;
-  translist[YELLOW] = YELLOW;
-  translist[BLUE] = BLUE;
-
-  translist[MUTE] = MUTE;
-  translist[RADIO] = RADIO;
-  translist[REVERSE] = REVERSE;
-  translist[FORWARD] = FORWARD;
-  translist[RECORD] = RECORD;
-  translist[STOP] = STOP;
-  translist[PAUSE] = PAUSE;
-  translist[PLAY] = PLAY;
-  translist[SKIPBACK] = SKIPBACK;
-  translist[SKIPFORWARD] = SKIPFORWARD;
-
-  // Old remote only
-  translist[FULL] = FULL;
-
-  // New remote only
-  translist[TV] = TV;
-  translist[VIDEOS] = VIDEOS;
-  translist[MUSIC] = MUSIC;
-  translist[PICTURES] = PICTURES;
-  translist[GUIDE] = GUIDE;
-  translist[PREVCHANNEL] = PREVCHANNEL;
-  translist[STAR] = STAR;
-  translist[HASH] = HASH;
-}
-
-const char *Remote::CommandDesc(UCHAR number)
-{
-  switch (number)
-  {
-    case VOLUMEUP:
-      return tr("Volume Up");
-
-    case VOLUMEDOWN:
-      return tr("Volume Down");
-    case CHANNELUP:
-      return tr("Channel up");
-    case CHANNELDOWN:
-      return tr("Channel down");
-    case ZERO:
-      return "0";
-    case ONE:
-      return "1";
-    case TWO:
-      return "2";
-    case THREE:
-      return "3";
-    case FOUR:
-      return "4";
-    case FIVE:
-      return "5";
-    case SIX:
-      return "6";
-    case SEVEN:
-      return "7";
-    case EIGHT:
-      return "8";
-    case NINE:
-      return "9";
-    case POWER:
-      return tr("Power");
-    case GO:
-      return tr("Go");
-    case BACK:
-      return tr("Back");
-    case MENU:
-      return tr("Menu");
-    case RED:
-      return tr("Red");
-    case GREEN:
-      return tr("Green");
-    case YELLOW:
-      return tr("Yellow");
-    case BLUE:
-      return tr("Blue");
-    case MUTE:
-      return tr("Mute");
-    case RADIO:
-      return tr("Radio");
-    case REVERSE:
-      return tr("Reverse");
-    case PLAY:
-      return tr("Play");
-    case FORWARD:
-      return tr("Forward");
-    case RECORD:
-      return tr("Record");
-    case STOP:
-      return tr("Stop");
-    case PAUSE:
-      return tr("Pause");
-    case SKIPBACK:
-      return tr("Skip back");
-    case SKIPFORWARD:
-      return tr("Skip forward");
-    case OK:
-      return tr("Ok");
-    case FULL:
-      return tr("Fullscreen");
-    case TV:
-      return tr("TV");
-    case VIDEOS:
-      return tr("Videos");
-    case MUSIC:
-      return tr("Music");
-    case PICTURES:
-      return tr("Pictures");
-    case GUIDE:
-      return tr("Guide");
-    case UP:
-      return tr("Up");
-    case DOWN:
-      return tr("Down");
-    case LEFT:
-      return tr("Left");
-    case RIGHT:
-      return tr("Right");
-    case PREVCHANNEL:
-      return tr("Previous Channel");
-    case STAR:
-      return tr("Star");
-    case HASH:
-      return tr("Hash");
-    case PLAYPAUSE:
-       return tr("Play/Pause");
-
-    default:
-      return NULL;
-  }
-}
-
-char* Remote::HCWDesc(ULLONG hcw)
-{
-  char *dest,*temp;
-  temp=(char*)CommandDesc((UCHAR)hcw);
-  if (temp != NULL)
-  {
-    dest=new char[strlen(temp)+1];
-    strcpy(dest,temp);
-  }
-  else
-  {
-    dest=new char[20];
-    sprintf(dest,"C:%lX",(ULONG)hcw);
-  }
-  return dest;
-}
-
-char *Remote::CommandTranslateStr(UCHAR command)
-{
-  char *desc;
-  int length=5;//:+\t+0
-  int keys=0; //max 10;
-  char *commanddesc=(char*)CommandDesc(command);
-  if (commanddesc != NULL)
-  {
-    length+=strlen(commanddesc);
-  }
-  char *preassigneddesc=(char*)HardcodedTranslateStr(command);
-  if (preassigneddesc != NULL)
-  {
-    length+=strlen(preassigneddesc);
-  }
-
-  char *keydesc[10];
-  RemoteTranslationList::const_iterator it;
-  for (it = translist.begin(); it != translist.end(); it++)
-  {
-    if (it->second == command)
-    {
-      keydesc[keys] = HCWDesc(it->first);
-      length += strlen(keydesc[keys])+2;
-      keys ++;
-      if (keys == 10) break;
-    }
-  }
-
-  desc=new char [length];
-  char *current=desc;
-  if (commanddesc != NULL)
-  {
-    current+=sprintf(current,"%s:\t ",commanddesc);
-  }
-  else
-  {
-    current+=sprintf(current,":\t ");
-  }
-  if (preassigneddesc != NULL)
-  {
-    current+=sprintf(current,"%s\t",preassigneddesc);
-  }
-  else
-  {
-    current+=sprintf(current,"\t");
-  }
-  for (int i = 0;i < keys; i++)
-  {
-    current += sprintf(current,"%s, ",keydesc[i]);
-    delete [] keydesc[i];
-  }
-  return desc;
-}
-
-bool Remote::addOptionPagesToWTB(WTabBar *wtb)
-{
-    WRemoteConfig* wrc = new WRemoteConfig();
-    wtb->addTab(tr("Remote Control"), wrc);
-    return true;
-}
-
-bool Remote::loadOptionsfromServer(VDR* vdr)
-{
-   // Set remote keys
-  char * config;
-  config = vdr->configLoad("General", "RemoteKeyNum");
-
-  if (config)
-  {
-    Log::getInstance()->log("Remote", Log::INFO, "Config General/Remote keys load");
-    LoadKeysConfig(vdr,config);
-    delete[] config;
-  }
-  else
-  {
-    Log::getInstance()->log("Remote", Log::INFO, "Config General/Remote keys not found");
-    InitHWCListwithDefaults();
-  }
-  return true;
-}
-
-bool Remote::saveOptionstoServer()
-{
-    SaveKeysConfig();
-    return true;
-}
-
-
-
-
-bool Remote::start()
-{
-  Log::getInstance()->log("Remote", Log::INFO, "start called");
-
-  threadStartProtect.lock();
-  listenThread = std::thread( [this ]
-  {
-    threadStartProtect.lock();
-    threadStartProtect.unlock();
-    // FIXME block signals
-
-    eventLoop();
-  });
-  threadStartProtect.unlock();
-  return true;
-}
-
-void Remote::stop()
-{
-  listenLoopStop = true;
-  informStopEventLoop();
-  listenThread.join();
-}
diff --git a/remote.h b/remote.h
deleted file mode 100644 (file)
index 2308ba6..0000000
--- a/remote.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
-    Copyright 2004-2005 Chris Tallon
-
-    This file is part of VOMP.
-
-    VOMP is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    VOMP is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
-*/
-
-#ifndef REMOTE_H
-#define REMOTE_H
-
-#include <stdio.h>
-#include <map>
-#include <thread>
-#include <mutex>
-
-#include "defines.h"
-#include "abstractoption.h"
-
-
-typedef std::map<ULLONG,UCHAR> RemoteTranslationList;
-
-class Remote: public AbstractOption
-{
-  public:
-    Remote();
-    virtual ~Remote();
-    static Remote* getInstance();
-
-    bool start();
-    void stop();
-
-    bool addOptionPagesToWTB(WTabBar *wtb);
-    bool loadOptionsfromServer(VDR* vdr);
-    bool saveOptionstoServer();
-
-    void setRemoteType(UCHAR type);
-    void setHWCtoCommand(ULLONG hcw,UCHAR command);
-    void unsetHWC(ULLONG hcw);
-    void LoadKeysConfig(VDR *vdr,const char*keynum);
-    void SaveKeysConfig();
-    void EnterLearningMode(UCHAR command);
-
-    virtual int init(const char *devName)=0;
-    virtual int shutdown()=0;
-    virtual UCHAR getButtonPress(int how)=0; // DEPRECATED
-
-    virtual bool mayHaveFewButtons() {return false;};
-
-    virtual bool handlesVolume() {return false;};
-    virtual void volumeUp() {};
-    virtual void volumeDown() {};
-    virtual void volumeMute() {};
-
-    virtual void InitHWCListwithDefaults();
-    virtual char* HCWDesc(ULLONG hcw);
-    const char *CommandDesc(UCHAR number);
-    char *CommandTranslateStr(UCHAR command);
-    virtual const char*HardcodedTranslateStr(UCHAR command);
-    void EnterLearnMode(UCHAR command);
-    void ResetToDefault();
-
-    virtual void changePowerState(bool /* poweron */) {}; //informs the remote control, that about vomp's power state, this is important e.g. for cec
-
-    const static ULONG NOLEARNMODE = 256;
-    // Not buttons
-    const static UCHAR NA_LEARN    = 101;
-    const static UCHAR NA_NONE     = 98;
-    const static UCHAR NA_UNKNOWN  = 99;
-    const static UCHAR NA_SIGNAL   = 100;
-    const static UCHAR DF_UP       = 94;
-    const static UCHAR DF_DOWN     = 95;
-    const static UCHAR DF_LEFT     = 96;
-    const static UCHAR DF_RIGHT    = 97;
-
-    // Problem common buttons
-    const static UCHAR VOLUMEUP    = 16;
-    const static UCHAR VOLUMEDOWN  = 17;
-    const static UCHAR CHANNELUP   = 32;
-    const static UCHAR CHANNELDOWN = 33;
-
-    // Common buttons
-    const static UCHAR ZERO        = 0;
-    const static UCHAR ONE         = 1;
-    const static UCHAR TWO         = 2;
-    const static UCHAR THREE       = 3;
-    const static UCHAR FOUR        = 4;
-    const static UCHAR FIVE        = 5;
-    const static UCHAR SIX         = 6;
-    const static UCHAR SEVEN       = 7;
-    const static UCHAR EIGHT       = 8;
-    const static UCHAR NINE        = 9;
-    const static UCHAR POWER       = 61;
-    const static UCHAR GO          = 59;
-    const static UCHAR BACK        = 31;
-    const static UCHAR MENU        = 13;
-    const static UCHAR RED         = 11;
-    const static UCHAR GREEN       = 46;
-    const static UCHAR YELLOW      = 56;
-    const static UCHAR BLUE        = 41;
-    const static UCHAR MUTE        = 15;
-    const static UCHAR RADIO       = 12; // The unlabelled button on old
-    const static UCHAR REVERSE     = 50;
-    const static UCHAR PLAY        = 53;
-    const static UCHAR FORWARD     = 52;
-    const static UCHAR RECORD      = 55;
-    const static UCHAR STOP        = 54;
-    const static UCHAR PAUSE       = 48;
-    const static UCHAR SKIPBACK    = 36;
-    const static UCHAR SKIPFORWARD = 30;
-    const static UCHAR OK          = 37;
-
-    // Old remote only
-    const static UCHAR FULL        = 60;
-
-    // New remote only
-    const static UCHAR TV          = 28;
-    const static UCHAR VIDEOS      = 24;
-    const static UCHAR MUSIC       = 25;
-    const static UCHAR PICTURES    = 26;
-    const static UCHAR GUIDE       = 27;
-    const static UCHAR UP          = 20;
-    const static UCHAR DOWN        = 21;
-    const static UCHAR LEFT        = 22;
-    const static UCHAR RIGHT       = 23;
-    const static UCHAR PREVCHANNEL = 18;
-    const static UCHAR STAR        = 10;
-    const static UCHAR HASH        = 14;
-
-    // Android only
-    const static UCHAR PLAYPAUSE       = 201;
-    // cec only
-    const static UCHAR POWERON       = 202;
-    const static UCHAR POWEROFF       = 203;
-
-
-    // Remote types
-    const static UCHAR OLDREMOTE   = 1;
-    const static UCHAR NEWREMOTE   = 2;
-
-  protected:
-    virtual UCHAR TranslateHWCFixed(ULLONG code);
-    UCHAR TranslateHWCList(ULLONG code);
-    UCHAR TranslateHWC(ULLONG code);
-    
-
-    ULONG learnmode;
-    static Remote* instance;
-    UCHAR remoteType;
-    RemoteTranslationList translist;
-
-
-    std::thread listenThread;
-    std::mutex threadStartProtect;
-
-    virtual void eventLoop() {}; // FIXME change to abstract
-    virtual void informStopEventLoop() {}; // abstract
-
-    bool listenLoopStop{};
-};
-
-#endif
-
-// FIXME rename all remote stuff to some sort of INPUT
-// Roll in UDP receiver
-
-// FIXME have Top remote system create new listeners for various devices? Hot plug?
-// Where remotelinux has multi listeners, move that to top?
diff --git a/remotelinux.cc b/remotelinux.cc
deleted file mode 100644 (file)
index 6367355..0000000
+++ /dev/null
@@ -1,1231 +0,0 @@
-/*
-    Copyright 2004-2020 Chris Tallon; 2012 Marten Richter
-
-    This file is part of VOMP.
-
-    VOMP is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    VOMP is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
-*/
-
-#include <linux/input.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include <cstdio>
-#include <iostream>
-#include <ostream>
-
-#include <bcm_host.h>
-
-#include <libcec/cec.h>
-#include <libcec/cecloader.h>
-using namespace CEC;
-
-#include "i18n.h"
-#include "vdr.h"
-#include "woptionpane.h"
-#include "message.h"
-#include "messagequeue.h"
-#include "command.h" // FIXME - get rid after predefined message targets
-
-#include "remotelinux.h"
-
-#define W_G_HCW(type,code) ((static_cast<ULLONG>(type) << 32) | code)
-
-#define W_HCW_KC 1 /* key code as defined by kernel for keyboard and remotes through /dev/input */
-#define W_HCW_CEC 2 /* HDMI_CEC */
-#define W_HCW_LIRC 3 /* remote control LIRC*/
-
-
-RemoteLinux::RemoteLinux()
-{
-}
-
-RemoteLinux::~RemoteLinux()
-{
-  for (unsigned int i = 0; i < devices.size(); i++)
-  {
-    close(devices[i]);
-  }
-}
-
-#define test_bit(input,b)  ((1 << ((b) % 8))&(input)[b / 8] )
-
-int RemoteLinux::init(const char*)
-{
-  if (initted) return 0;
-  initted = 1;
-
-  InitKeymap();
-
-  for (int eventid = 0; eventid < 100; eventid++)
-  {
-    char buffer[1024];
-    sprintf(buffer,"/dev/input/event%d", eventid);
-
-    struct stat test_buf;
-    if (stat(buffer, &test_buf) == 0)
-    {
-      Log::getInstance()->log("Remote", Log::NOTICE, "Probe /dev/input/event%d", eventid);
-      // file exists
-      unsigned long ev_type = 0;
-      int new_fd = open(buffer, O_RDONLY);
-      if (new_fd < 0)
-      {
-        Log::getInstance()->log("Remote", Log::NOTICE, "Can not open /dev/input/event%d", eventid);
-        continue;
-      }
-
-      if (ioctl(new_fd, EVIOCGBIT(0, EV_MAX), &ev_type) < 0)
-      {
-        Log::getInstance()->log("Remote", Log::NOTICE, "Ioctl failed /dev/input/event%d %d", eventid, errno);
-        close(new_fd);
-      }
-
-      //Now test if it generates keyboard presses
-      if (test_bit(reinterpret_cast<char*>(&ev_type), EV_KEY))
-      {
-        Log::getInstance()->log("Remote", Log::NOTICE, "Add /dev/input/event%d to List", eventid);
-        devices.push_back(new_fd);
-
-        // Grab the device - make it exclusive to vomp. Fixes rubbish input going to console in background
-        ioctl(new_fd, EVIOCGRAB, 1);
-      }
-      else
-      {
-        close(new_fd);
-      }
-    }
-  }
-  return initCec();
-}
-
-int RemoteLinux::initCec() {
-
-  // bcm_host_init(); //may be move to custom hardware init?
-// now init cec
-       Log::getInstance()->log("Remote", Log::NOTICE, "Init LibCEC");
-       cec_config.Clear();
-       cec_callbacks.Clear();
-#if CEC_LIB_VERSION_MAJOR >= 4
-       cec_callbacks.logMessage = cecLogMessage;
-       cec_callbacks.keyPress = cecKeyPress;
-       cec_callbacks.commandReceived = cecCommand;
-       cec_callbacks.configurationChanged = cecConfigurationChanged;
-       cec_callbacks.sourceActivated = cecSourceActivated;
-#else
-       cec_callbacks.CBCecLogMessage = cecLogMessage;
-       cec_callbacks.CBCecKeyPress = cecKeyPress;
-       cec_callbacks.CBCecCommand = cecCommand;
-       cec_callbacks.CBCecConfigurationChanged = cecConfigurationChanged;
-       cec_callbacks.CBCecSourceActivated = cecSourceActivated;
-       cec_config.bUseTVMenuLanguage=1;
-#endif
-    cec_config.clientVersion=LIBCEC_VERSION_CURRENT;
-       cec_config.bActivateSource=1;
-       //cec_config.deviceTypes.Add(CEC_DEVICE_TYPE_PLAYBACK_DEVICE);
-       cec_config.deviceTypes.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE);
-       //cec_config.deviceTypes.Add(CEC_DEVICE_TYPE_TUNER);
-
-       strncpy(cec_config.strDeviceName,"vomp",sizeof(cec_config.strDeviceName));
-
-
-       cec_config.callbackParam = NULL; // I do not care
-       cec_config.callbacks = &cec_callbacks;
-
-       cec_adap = LibCecInitialise(&cec_config);
-       if (!cec_adap) {
-               Log::getInstance()->log("Remote", Log::ERR, "Init LibCEC failed");
-               return 1;
-       }
-       cec_adap->InitVideoStandalone();
-
-
-#if CEC_LIB_VERSION_MAJOR >= 4
-       cec_adapter_descriptor cec_adapter_descriptors[10];
-       int adap_num=cec_adap->DetectAdapters(cec_adapter_descriptors, 10);
-#else
-       cec_adapter  cec_devices[10];
-       int adap_num=cec_adap->FindAdapters(cec_devices,10,NULL);
-#endif
-       if (adap_num<0) {
-               Log::getInstance()->log("Remote", Log::ERR, "CEC:Failed to find adapter");
-               return 1;
-
-       }
-       if (adap_num==0) {
-               Log::getInstance()->log("Remote", Log::NOTICE, "CEC: No adapter found");
-               return 1;
-
-       }
-#if CEC_LIB_VERSION_MAJOR >= 4
-       if (!cec_adap->Open(cec_adapter_descriptors[0].strComName)) {
-#else
-       if (!cec_adap->Open(cec_devices[0].comm)) {
-#endif
-      Log::getInstance()->log("Remote", Log::ERR, "CEC:Failed to open adapter");
-               return 1;
-       }
-
-       if (!cec_adap->SetActiveSource(cec_config.deviceTypes[0])) {
-               Log::getInstance()->log("Remote", Log::ERR, "CEC:Failed set active source");
-               return 1;
-       }
-
-
-
-
-  return 1;
-}
-
-int RemoteLinux::shutdown()
-{
-  if (!initted) return 0;
-
-  deinitCec();
-  while (devices.size())
-  {
-    int cur_fd = devices.back();
-    devices.pop_back();
-    ioctl(cur_fd, EVIOCGRAB, 0);
-    close(cur_fd);
-  }
-
-  initted = 0;
-  return 1;
-}
-
-void RemoteLinux::deinitCec()
-{
-       if (cec_adap) {
-               Log::getInstance()->log("Remote", Log::NOTICE, "Shutdown libcec begin");
-               cec_adap->SetInactiveView();
-               cec_adap->Close();
-               vc_cec_register_callback(NULL, NULL);//deactivate callback!
-               UnloadLibCec(cec_adap);
-               cec_adap = NULL;
-               Log::getInstance()->log("Remote", Log::NOTICE, "Shutdown libcec end");
-       }
-
-}
-/*
-UCHAR RemoteLinux::getButtonPress(int waitType) {
-       / * how = 0 - block
-        how = 1 - start new wait
-        how = 2 - continue wait
-        how = 3 - no wait
-        * /
-
-        //in units of 40 ms
-               Log::getInstance()->log("Remote", Log::NOTICE, "get button press");
-
-       int retval;
-       fd_set readfds;
-       struct timeval tv;
-
-       tv.tv_sec = 0;
-       tv.tv_usec = 40000;
-       if (waitType == 0) {
-               num_loop = -1;
-       } else if (waitType == 1) {
-
-               num_loop = 25;
-       } else if (waitType == 2) {
-               if (num_loop<=0) num_loop = 25;
-       } else if (waitType == 3) {
-               tv.tv_sec = 0;
-               tv.tv_usec = 0;
-               num_loop = 0;
-       }
-
-
-       int ret = 0;
-       while (num_loop!=0) {
-               ret = NA_UNKNOWN;
-               FD_ZERO(&readfds);
-
-               int maxfd = 0;
-               for (unsigned int i = 0; i < devices.size(); i++) {
-                       int cur_fd = devices[i];
-                       maxfd = max(cur_fd, maxfd);
-                       FD_SET(cur_fd, &readfds);
-               }
-
-        FD_SET(pfds[0], &readfds);
-        maxfd = max(pfds[0], maxfd);
-
-               retval = select(maxfd + 1, &readfds, NULL, NULL, &tv);
-               tv.tv_sec = 0;
-               tv.tv_usec = 40000;
-               // 0 = nothing happened
-               // 1 = data arrived (actually num of descriptors that changed)
-               // other value = signal or error
-               if (retval == 0) {
-                       if (hascurcec) {
-                               hascurcec = false;
-                               return (UCHAR) TranslateHWC(W_G_HCW(W_HCW_CEC,curcec));
-                       }
-                       if (haspower) {
-                               haspower =false;
-                               return powerkey;
-                       }
-                       ret = NA_NONE;
-               } else {
-                       if (retval == -1) {
-                               Log::getInstance()->log("Remote", Log::NOTICE, "na_signal");
-                               return NA_SIGNAL;
-                       }
-
-                       if (FD_ISSET(pfds[0], &readfds))
-            {
-              // quit signal
-              Log::getInstance()->log("Remote", Log::NOTICE, "pfds quit");
-              return NA_SIGNAL; // use NA_SIGNAL for now
-            }
-
-                       for (unsigned int i = 0; i < devices.size(); i++) {
-                               int cur_fd = devices[i];
-                               if (FD_ISSET(cur_fd, &readfds)) {
-                                       struct input_event ev;
-                                       int count = read(cur_fd, &ev, sizeof(ev));
-                                       if (count == sizeof(ev)) {
-                                               if (ev.type == EV_KEY && ev.value == 1) {
-                                                       UCHAR retty=(UCHAR) TranslateHWC(
-                                                                                       W_G_HCW(W_HCW_KC,ev.code));
-                                                       return retty;
-                                               }
-                                       }
-
-                               }
-
-                       }
-
-               }
-               //Log::getInstance()->log("Remote", Log::NOTICE, "numloop: %d %d",num_loop,retval);
-               if (num_loop > 0)
-               num_loop--;
-       }
-       if (ret != 0)
-               return ret;
-
-       return NA_UNKNOWN;
-
-}
-*/
-
-UCHAR RemoteLinux::TranslateHWCFixed(ULLONG code)
-{
-    switch (code) 
-    {
-    case W_G_HCW(W_HCW_KC, KEY_DOWN):
-        return DOWN;
-    case W_G_HCW(W_HCW_KC, KEY_UP):
-        return UP;
-    case W_G_HCW(W_HCW_KC, KEY_LEFT):
-        return LEFT;
-    case W_G_HCW(W_HCW_KC, KEY_RIGHT):
-        return RIGHT;
-    case W_G_HCW(W_HCW_KC, KEY_M):
-    case W_G_HCW(W_HCW_KC, KEY_MEDIA):
-        return MENU;
-    case W_G_HCW(W_HCW_KC, KEY_BACKSPACE):
-    case W_G_HCW(W_HCW_KC, KEY_EXIT):
-        return BACK;
-    case W_G_HCW(W_HCW_KC, KEY_ENTER):
-    case W_G_HCW(W_HCW_KC, KEY_SPACE):
-    case W_G_HCW(W_HCW_KC, KEY_OK):
-        return OK;
-
-    //CEC
-    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_DOWN):
-        return DOWN;
-    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_UP):
-        return UP;
-    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_LEFT):
-        return LEFT;
-    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_RIGHT):
-        return RIGHT;
-    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_ROOT_MENU):
-    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_CONTENTS_MENU):
-    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_SETUP_MENU):
-        return MENU;
-    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_EXIT ):
-        return BACK;
-    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_ENTER):
-    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_SELECT):
-    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_AN_RETURN):
-        return OK;
-    case W_G_HCW(W_HCW_KC, KEY_SLEEP):
-    case W_G_HCW(W_HCW_KC, KEY_POWER):
-    case W_G_HCW(W_HCW_KC, KEY_ESC):
-    case W_G_HCW(W_HCW_CEC, CEC_USER_CONTROL_CODE_POWER):
-    case POWER:
-        return POWER;
-    default:
-        return NA_UNKNOWN;
-    };
-}
-
-const char*RemoteLinux::HardcodedTranslateStr(UCHAR command)
-{
-  switch (command)
-  {
-    case DOWN:
-      return tr("Down");
-    case UP:
-      return tr("Up");
-    case LEFT:
-      return tr("Left");
-    case RIGHT:
-      return tr("Right");
-    case MENU:
-      return tr("M");
-    case BACK:
-      return tr("Backspace, Back");
-    case OK:
-      return tr("Return, Space");
-    default:
-      return NULL;
-  }
-}
-
-
-void RemoteLinux::InitHWCListwithDefaults()
-{
-  // Processing VK_Messages
-  translist[W_G_HCW(W_HCW_KC,KEY_9)] = NINE;
-  translist[W_G_HCW(W_HCW_KC,KEY_8)] = EIGHT;
-  translist[W_G_HCW(W_HCW_KC,KEY_7)] = SEVEN;
-  translist[W_G_HCW(W_HCW_KC,KEY_6)] = SIX;
-  translist[W_G_HCW(W_HCW_KC,KEY_5)] = FIVE;
-  translist[W_G_HCW(W_HCW_KC,KEY_4)] = FOUR;
-  translist[W_G_HCW(W_HCW_KC,KEY_3)] = THREE;
-  translist[W_G_HCW(W_HCW_KC,KEY_2)] = TWO;
-  translist[W_G_HCW(W_HCW_KC,KEY_1)] = ONE;
-  translist[W_G_HCW(W_HCW_KC,KEY_0)] = ZERO;
-  translist[W_G_HCW(W_HCW_KC,KEY_KPDOT)] = STAR;
-  // translist[W_G_HCW(W_HCW_KC,KEY_#)] = HASH;
-
-  translist[W_G_HCW(W_HCW_KC,KEY_KP9)] = NINE;
-  translist[W_G_HCW(W_HCW_KC,KEY_KP8)] = EIGHT;
-  translist[W_G_HCW(W_HCW_KC,KEY_KP7)] = SEVEN;
-  translist[W_G_HCW(W_HCW_KC,KEY_KP6)] = SIX;
-  translist[W_G_HCW(W_HCW_KC,KEY_KP5)] = FIVE;
-  translist[W_G_HCW(W_HCW_KC,KEY_KP4)] = FOUR;
-  translist[W_G_HCW(W_HCW_KC,KEY_KP3)] = THREE;
-  translist[W_G_HCW(W_HCW_KC,KEY_KP2)] = TWO;
-  translist[W_G_HCW(W_HCW_KC,KEY_KP1)] = ONE;
-  translist[W_G_HCW(W_HCW_KC,KEY_KP0)] = ZERO;
-
-  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_9)] = NINE;
-  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_8)] = EIGHT;
-  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_7)] = SEVEN;
-  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_6)] = SIX;
-  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_5)] = FIVE;
-  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_4)] = FOUR;
-  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_3)] = THREE;
-  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_2)] = TWO;
-  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_1)] = ONE;
-  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_0)] = ZERO;
-  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_STAR)] = STAR;
-  translist[W_G_HCW(W_HCW_KC,KEY_NUMERIC_POUND)] = HASH;
-
-
-  translist[W_G_HCW(W_HCW_KC,KEY_J)] = GO; //j for JUMP TO instead of go to
-  translist[W_G_HCW(W_HCW_KC,KEY_R)] = RED;
-  translist[W_G_HCW(W_HCW_KC,KEY_G)] = GREEN;
-  translist[W_G_HCW(W_HCW_KC,KEY_Y)] = YELLOW;
-  translist[W_G_HCW(W_HCW_KC,KEY_B)] = BLUE;
-  //Processing Remote Style Messages
-  translist[W_G_HCW(W_HCW_KC,KEY_GREEN)] = GREEN;
-  translist[W_G_HCW(W_HCW_KC,KEY_RED)] = RED;
-  translist[W_G_HCW(W_HCW_KC,KEY_YELLOW)] = YELLOW;
-  translist[W_G_HCW(W_HCW_KC,KEY_BLUE)] = BLUE;
-  translist[W_G_HCW(W_HCW_KC,KEY_MENU)] = MENU;
-
-  translist[W_G_HCW(W_HCW_KC,KEY_RECORD)] = RECORD;
-  translist[W_G_HCW(W_HCW_KC,KEY_PLAY)] = PLAY; //Playback Televison
-  translist[W_G_HCW(W_HCW_KC,KEY_PAUSE)] = PAUSE;
-  translist[W_G_HCW(W_HCW_KC,KEY_STOP)] = STOP;
-  translist[W_G_HCW(W_HCW_KC,KEY_PLAYPAUSE)] = PLAYPAUSE;
-  translist[W_G_HCW(W_HCW_KC,KEY_P)] = PLAYPAUSE;
-  translist[W_G_HCW(W_HCW_KC,KEY_NEXT)] = SKIPFORWARD;
-  translist[W_G_HCW(W_HCW_KC,KEY_F2)] = SKIPFORWARD;
-  translist[W_G_HCW(W_HCW_KC,KEY_PREVIOUS)] = SKIPBACK;
-  translist[W_G_HCW(W_HCW_KC,KEY_F1)] = SKIPBACK;
-  translist[W_G_HCW(W_HCW_KC,KEY_FORWARD)] = FORWARD;
-  translist[W_G_HCW(W_HCW_KC,KEY_FASTFORWARD)] = FORWARD;
-  translist[W_G_HCW(W_HCW_KC,KEY_F)] = FORWARD;
-  translist[W_G_HCW(W_HCW_KC,KEY_BACK)] = REVERSE;
-  translist[W_G_HCW(W_HCW_KC,KEY_REWIND)] = REVERSE;
-  translist[W_G_HCW(W_HCW_KC,KEY_T)] = REVERSE;
-  translist[W_G_HCW(W_HCW_KC,KEY_MUTE)] = MUTE;
-  translist[W_G_HCW(W_HCW_KC,KEY_F8)] = MUTE;
-  translist[W_G_HCW(W_HCW_KC,KEY_F10)] = VOLUMEUP;
-  translist[W_G_HCW(W_HCW_KC,KEY_F9)] = VOLUMEDOWN;
-  translist[W_G_HCW(W_HCW_KC,KEY_VOLUMEUP)] = VOLUMEUP;
-  translist[W_G_HCW(W_HCW_KC,KEY_VOLUMEDOWN)] = VOLUMEDOWN;
-  translist[W_G_HCW(W_HCW_KC,KEY_CHANNELUP)] = CHANNELUP;
-  translist[W_G_HCW(W_HCW_KC,KEY_CHANNELDOWN)] = CHANNELDOWN;
-  translist[W_G_HCW(W_HCW_KC,KEY_PAGEUP)] = CHANNELUP;
-  translist[W_G_HCW(W_HCW_KC,KEY_PAGEDOWN)] = CHANNELDOWN;
-
-
-  //Processing CEC_Messages
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER9)] = NINE;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER8)] = EIGHT;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER7)] = SEVEN;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER6)] = SIX;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER5)] = FIVE;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER4)] = FOUR;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER3)] = THREE;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER2)] = TWO;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER1)] = ONE;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_NUMBER0)] = ZERO;
-  //translist[W_G_HCW(W_HCW_CEC,KEY_KPDOT)] = STAR;
-
-
-
-  //translist[W_G_HCW(W_HCW_CEC,KEY_J)] = GO; //j for JUMP TO instead of go to
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_F2_RED)] = RED;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_F3_GREEN)] = GREEN;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_F4_YELLOW)] = YELLOW;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_F1_BLUE)] = BLUE;
-  //Processing Remote Style Messages
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_FAVORITE_MENU)] = MENU;
-
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_RECORD)] = RECORD;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_PLAY)] = PLAY; //Playback Televison
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_PAUSE)] = PAUSE;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_STOP)] = STOP;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_PAUSE_PLAY_FUNCTION)] = PLAYPAUSE;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_FORWARD)] = SKIPFORWARD;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_BACKWARD)] = SKIPBACK;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_FAST_FORWARD )] = FORWARD;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_REWIND)] = REVERSE;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_MUTE)] = MUTE;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_VOLUME_UP)] = VOLUMEUP;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_VOLUME_DOWN)] = VOLUMEDOWN;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_CHANNEL_UP )] = CHANNELUP;
-  translist[W_G_HCW(W_HCW_CEC,CEC_USER_CONTROL_CODE_CHANNEL_DOWN)] = CHANNELDOWN;
-}
-
-#define NAMETRICK(pre, code) linux_keymap[pre ## code]=  #code
-#define NAMETRICK2(pre, code) cec_keymap[pre ## code]=  #code
-//extracte from linux/input.h
-
-static const char * linux_keymap[KEY_MAX+1];
-static const char * cec_keymap[CEC_USER_CONTROL_CODE_MAX+1];
-
-void RemoteLinux::InitKeymap()
-{
-  for (int i=0;i<KEY_MAX+1;i++)
-  {
-    linux_keymap[i] = NULL;
-  }
-
-  NAMETRICK(KEY_,RESERVED);
-  NAMETRICK(KEY_,ESC);
-  NAMETRICK(KEY_,1);
-  NAMETRICK(KEY_,2);
-  NAMETRICK(KEY_,3);
-  NAMETRICK(KEY_,4);
-  NAMETRICK(KEY_,5);
-  NAMETRICK(KEY_,6);
-  NAMETRICK(KEY_,7);
-  NAMETRICK(KEY_,8);
-  NAMETRICK(KEY_,9);
-  NAMETRICK(KEY_,0);
-  NAMETRICK(KEY_,MINUS);
-  NAMETRICK(KEY_,EQUAL);
-  NAMETRICK(KEY_,BACKSPACE);
-  NAMETRICK(KEY_,TAB);
-  NAMETRICK(KEY_,Q);
-  NAMETRICK(KEY_,W);
-  NAMETRICK(KEY_,E);
-  NAMETRICK(KEY_,R);
-  NAMETRICK(KEY_,T);
-  NAMETRICK(KEY_,Y);
-  NAMETRICK(KEY_,U);
-  NAMETRICK(KEY_,I);
-  NAMETRICK(KEY_,O);
-  NAMETRICK(KEY_,P);
-  NAMETRICK(KEY_,LEFTBRACE);
-  NAMETRICK(KEY_,RIGHTBRACE);
-  NAMETRICK(KEY_,ENTER);
-  NAMETRICK(KEY_,LEFTCTRL);
-  NAMETRICK(KEY_,A);
-  NAMETRICK(KEY_,S);
-  NAMETRICK(KEY_,D);
-  NAMETRICK(KEY_,F);
-  NAMETRICK(KEY_,G);
-  NAMETRICK(KEY_,H);
-  NAMETRICK(KEY_,J);
-  NAMETRICK(KEY_,K);
-  NAMETRICK(KEY_,L);
-  NAMETRICK(KEY_,SEMICOLON);
-  NAMETRICK(KEY_,APOSTROPHE);
-  NAMETRICK(KEY_,GRAVE);
-  NAMETRICK(KEY_,LEFTSHIFT);
-  NAMETRICK(KEY_,BACKSLASH);
-  NAMETRICK(KEY_,Z);
-  NAMETRICK(KEY_,X);
-  NAMETRICK(KEY_,C);
-  NAMETRICK(KEY_,V);
-  NAMETRICK(KEY_,B);
-  NAMETRICK(KEY_,N);
-  NAMETRICK(KEY_,M);
-  NAMETRICK(KEY_,COMMA);
-  NAMETRICK(KEY_,DOT);
-  NAMETRICK(KEY_,SLASH);
-  NAMETRICK(KEY_,RIGHTSHIFT);
-  NAMETRICK(KEY_,KPASTERISK);
-  NAMETRICK(KEY_,LEFTALT);
-  NAMETRICK(KEY_,SPACE);
-  NAMETRICK(KEY_,CAPSLOCK);
-  NAMETRICK(KEY_,F1);
-  NAMETRICK(KEY_,F2);
-  NAMETRICK(KEY_,F3);
-  NAMETRICK(KEY_,F4);
-  NAMETRICK(KEY_,F5);
-  NAMETRICK(KEY_,F6);
-  NAMETRICK(KEY_,F7);
-  NAMETRICK(KEY_,F8);
-  NAMETRICK(KEY_,F9);
-  NAMETRICK(KEY_,F10);
-  NAMETRICK(KEY_,NUMLOCK);
-  NAMETRICK(KEY_,SCROLLLOCK);
-  NAMETRICK(KEY_,KP7);
-  NAMETRICK(KEY_,KP8);
-  NAMETRICK(KEY_,KP9);
-  NAMETRICK(KEY_,KPMINUS);
-  NAMETRICK(KEY_,KP4);
-  NAMETRICK(KEY_,KP5);
-  NAMETRICK(KEY_,KP6);
-  NAMETRICK(KEY_,KPPLUS);
-  NAMETRICK(KEY_,KP1);
-  NAMETRICK(KEY_,KP2);
-  NAMETRICK(KEY_,KP3);
-  NAMETRICK(KEY_,KP0);
-  NAMETRICK(KEY_,KPDOT);
-  NAMETRICK(KEY_,F11);
-  NAMETRICK(KEY_,F12);
-  NAMETRICK(KEY_,KPENTER);
-  NAMETRICK(KEY_,RIGHTCTRL);
-  NAMETRICK(KEY_,KPSLASH);
-  NAMETRICK(KEY_,SYSRQ);
-  NAMETRICK(KEY_,RIGHTALT);
-  NAMETRICK(KEY_,LINEFEED);
-  NAMETRICK(KEY_,HOME);
-  NAMETRICK(KEY_,UP);
-  NAMETRICK(KEY_,PAGEUP);
-  NAMETRICK(KEY_,LEFT);
-  NAMETRICK(KEY_,RIGHT);
-  NAMETRICK(KEY_,END);
-  NAMETRICK(KEY_,DOWN);
-  NAMETRICK(KEY_,PAGEDOWN);
-  NAMETRICK(KEY_,INSERT);
-  NAMETRICK(KEY_,DELETE);
-  NAMETRICK(KEY_,MACRO);
-  NAMETRICK(KEY_,MUTE);
-  NAMETRICK(KEY_,VOLUMEDOWN);
-  NAMETRICK(KEY_,VOLUMEUP);
-  NAMETRICK(KEY_,POWER);
-  NAMETRICK(KEY_,KPEQUAL);
-  NAMETRICK(KEY_,KPPLUSMINUS);
-  NAMETRICK(KEY_,PLAY);
-  NAMETRICK(KEY_,PAUSE);
-  NAMETRICK(KEY_,SCALE);
-  NAMETRICK(KEY_,KPCOMMA);
-  NAMETRICK(KEY_,YEN);
-  NAMETRICK(KEY_,LEFTMETA);
-  NAMETRICK(KEY_,RIGHTMETA);
-  NAMETRICK(KEY_,COMPOSE);
-  NAMETRICK(KEY_,STOP);
-  NAMETRICK(KEY_,AGAIN);
-  NAMETRICK(KEY_,PROPS);
-  NAMETRICK(KEY_,UNDO);
-  NAMETRICK(KEY_,FRONT);
-  NAMETRICK(KEY_,COPY);
-  NAMETRICK(KEY_,OPEN);
-  NAMETRICK(KEY_,PASTE);
-  NAMETRICK(KEY_,FIND);
-  NAMETRICK(KEY_,CUT);
-  NAMETRICK(KEY_,HELP);
-  NAMETRICK(KEY_,MENU);
-  NAMETRICK(KEY_,CALC);
-  NAMETRICK(KEY_,SETUP);
-  NAMETRICK(KEY_,SLEEP);
-  NAMETRICK(KEY_,WAKEUP);
-  NAMETRICK(KEY_,FILE);
-  NAMETRICK(KEY_,SENDFILE);
-  NAMETRICK(KEY_,DELETEFILE);
-  NAMETRICK(KEY_,XFER);
-  NAMETRICK(KEY_,PROG1);
-  NAMETRICK(KEY_,PROG2);
-  NAMETRICK(KEY_,WWW);
-  NAMETRICK(KEY_,MSDOS);
-  NAMETRICK(KEY_,COFFEE);
-  NAMETRICK(KEY_,DIRECTION);
-  NAMETRICK(KEY_,CYCLEWINDOWS);
-  NAMETRICK(KEY_,MAIL);
-  NAMETRICK(KEY_,BOOKMARKS);
-  NAMETRICK(KEY_,COMPUTER);
-  NAMETRICK(KEY_,BACK);
-  NAMETRICK(KEY_,FORWARD);
-  NAMETRICK(KEY_,FASTFORWARD);
-  NAMETRICK(KEY_,CLOSECD);
-  NAMETRICK(KEY_,EJECTCD);
-  NAMETRICK(KEY_,EJECTCLOSECD);
-  NAMETRICK(KEY_,NEXTSONG);
-  NAMETRICK(KEY_,PLAYPAUSE);
-  NAMETRICK(KEY_,PREVIOUSSONG);
-  NAMETRICK(KEY_,STOPCD);
-  NAMETRICK(KEY_,RECORD);
-  NAMETRICK(KEY_,REWIND);
-  NAMETRICK(KEY_,PHONE);
-  NAMETRICK(KEY_,ISO);
-  NAMETRICK(KEY_,CONFIG);
-  NAMETRICK(KEY_,HOMEPAGE);
-  NAMETRICK(KEY_,REFRESH);
-  NAMETRICK(KEY_,EXIT);
-  NAMETRICK(KEY_,MOVE);
-  NAMETRICK(KEY_,EDIT);
-  NAMETRICK(KEY_,SCROLLUP);
-  NAMETRICK(KEY_,SCROLLDOWN);
-  NAMETRICK(KEY_,KPLEFTPAREN);
-  NAMETRICK(KEY_,KPRIGHTPAREN);
-  NAMETRICK(KEY_,NEW);
-  NAMETRICK(KEY_,REDO);
-  NAMETRICK(KEY_,OK);
-  NAMETRICK(KEY_,SELECT);
-  NAMETRICK(KEY_,GOTO);
-  NAMETRICK(KEY_,CLEAR);
-  NAMETRICK(KEY_,POWER2);
-  NAMETRICK(KEY_,OPTION);
-  NAMETRICK(KEY_,INFO);
-  NAMETRICK(KEY_,TIME);
-  NAMETRICK(KEY_,VENDOR);
-  NAMETRICK(KEY_,ARCHIVE);
-  NAMETRICK(KEY_,PROGRAM);
-  NAMETRICK(KEY_,CHANNEL);
-  NAMETRICK(KEY_,FAVORITES);
-  NAMETRICK(KEY_,EPG);
-  NAMETRICK(KEY_,PVR);
-  NAMETRICK(KEY_,MHP);
-  NAMETRICK(KEY_,LANGUAGE);
-  NAMETRICK(KEY_,TITLE);
-  NAMETRICK(KEY_,SUBTITLE);
-  NAMETRICK(KEY_,ANGLE);
-  NAMETRICK(KEY_,ZOOM);
-  NAMETRICK(KEY_,MODE);
-  NAMETRICK(KEY_,KEYBOARD);
-  NAMETRICK(KEY_,SCREEN);
-  NAMETRICK(KEY_,RED);
-  NAMETRICK(KEY_,GREEN);
-  NAMETRICK(KEY_,YELLOW);
-  NAMETRICK(KEY_,BLUE);
-  NAMETRICK(KEY_,CHANNELUP);
-  NAMETRICK(KEY_,CHANNELDOWN);
-  NAMETRICK(KEY_,FIRST);
-  NAMETRICK(KEY_,LAST);
-  NAMETRICK(KEY_,AB);
-  NAMETRICK(KEY_,NEXT);
-  NAMETRICK(KEY_,RESTART);
-  NAMETRICK(KEY_,SLOW);
-  NAMETRICK(KEY_,SHUFFLE);
-  NAMETRICK(KEY_,BREAK);
-  NAMETRICK(KEY_,PREVIOUS);
-  NAMETRICK(KEY_,DIGITS);
-  NAMETRICK(KEY_,TEEN);
-  NAMETRICK(KEY_,TWEN);
-  NAMETRICK(KEY_,VIDEOPHONE);
-  NAMETRICK(KEY_,GAMES);
-  NAMETRICK(KEY_,ZOOMIN);
-  NAMETRICK(KEY_,ZOOMOUT);
-  NAMETRICK(KEY_,ZOOMRESET);
-  NAMETRICK(KEY_,DOLLAR);
-  NAMETRICK(KEY_,EURO);
-  NAMETRICK(KEY_,MEDIA);
-  NAMETRICK(KEY_,FRAMEBACK);
-  NAMETRICK(KEY_,FRAMEFORWARD);
-  NAMETRICK(KEY_,CONTEXT_MENU);
-  NAMETRICK(KEY_,MEDIA_REPEAT);
-  NAMETRICK(KEY_,NUMERIC_0);
-  NAMETRICK(KEY_,NUMERIC_1);
-  NAMETRICK(KEY_,NUMERIC_2);
-  NAMETRICK(KEY_,NUMERIC_3);
-  NAMETRICK(KEY_,NUMERIC_4);
-  NAMETRICK(KEY_,NUMERIC_5);
-  NAMETRICK(KEY_,NUMERIC_6);
-  NAMETRICK(KEY_,NUMERIC_7);
-  NAMETRICK(KEY_,NUMERIC_8);
-  NAMETRICK(KEY_,NUMERIC_9);
-  NAMETRICK(KEY_,NUMERIC_STAR);
-  NAMETRICK(KEY_,NUMERIC_POUND);
-
-  for (int i=0; i < CEC_USER_CONTROL_CODE_MAX + 1; i++)
-  {
-    cec_keymap[i] = NULL;
-  }
-
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,SELECT);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,UP);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,DOWN);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,LEFT);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,RIGHT);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,RIGHT_UP);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,RIGHT_DOWN);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,LEFT_UP);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,LEFT_DOWN);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,ROOT_MENU);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,SETUP_MENU);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,CONTENTS_MENU);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,FAVORITE_MENU);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,EXIT);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER0);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER1);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER2);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER3);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER4);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER5);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER6);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER7);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER8);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,NUMBER9);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,DOT);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,ENTER);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,CLEAR);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,NEXT_FAVORITE);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,CHANNEL_UP);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,CHANNEL_DOWN);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,PREVIOUS_CHANNEL);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,SOUND_SELECT);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,INPUT_SELECT);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,DISPLAY_INFORMATION);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,HELP);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,PAGE_UP);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,PAGE_DOWN);
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,POWER );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,VOLUME_UP );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,VOLUME_DOWN );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,MUTE );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,PLAY );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,STOP );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,PAUSE );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,RECORD );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,REWIND );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,FAST_FORWARD );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,EJECT );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,FORWARD );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,BACKWARD );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,STOP_RECORD );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,PAUSE_RECORD );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,ANGLE );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,SUB_PICTURE );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,VIDEO_ON_DEMAND );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,ELECTRONIC_PROGRAM_GUIDE );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,TIMER_PROGRAMMING );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,INITIAL_CONFIGURATION );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,PLAY_FUNCTION );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,PAUSE_PLAY_FUNCTION );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,RECORD_FUNCTION );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,PAUSE_RECORD_FUNCTION );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,STOP_FUNCTION );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,MUTE_FUNCTION );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,RESTORE_VOLUME_FUNCTION );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,TUNE_FUNCTION );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,SELECT_MEDIA_FUNCTION );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,SELECT_AV_INPUT_FUNCTION );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,SELECT_AUDIO_INPUT_FUNCTION );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,POWER_TOGGLE_FUNCTION );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,POWER_OFF_FUNCTION );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,POWER_ON_FUNCTION );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,F1_BLUE );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,F2_RED );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,F3_GREEN );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,F4_YELLOW );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,F5 );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,DATA );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,AN_RETURN );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,AN_CHANNELS_LIST );
-  NAMETRICK2(CEC_USER_CONTROL_CODE_,MAX );
-}
-
-
-
-char* RemoteLinux::HCWDesc(unsigned long long hcw)
-{
-    //Determine type
-    unsigned int type = static_cast<unsigned int>(hcw >> 32);
-    unsigned int vk = static_cast<ULONG>(hcw);
-    char* rt = NULL;
-
-    switch(type)
-    {
-      case W_HCW_KC:
-      {
-        rt = new char[10];
-        const char *desc=linux_keymap[vk];
-        if (desc)
-          strncpy(rt, desc, 9);
-        else
-          sprintf(rt, "0x%x", vk);
-        break;
-      }
-      case W_HCW_CEC:
-      {
-        rt = new char[10];
-        const char* desc = cec_keymap[vk];
-        if (desc)
-          strncpy(rt, desc, 9);
-        else
-          sprintf(rt, "0x%x", vk);
-        break;
-      }
-  /*
-    case W_HCW_LIRC:{
-        ULONG ri=(ULONG)hcw;
-        rt=new char[10];
-        sprintf(rt,"R: %X",ri);
-                  }break;*/
-    }
-
-    return rt;
-}
-
-void RemoteLinux::changePowerState(bool poweron)
-{
-  if (cec_adap)
-  {
-    if (poweron)
-    {
-      //Log::getInstance()->log("Remote", Log::DEBUG, "CEC set active source");
-      cec_adap->SetActiveSource(cec_config.deviceTypes[0]);
-    }
-    else
-    {
-      //Log::getInstance()->log("Remote", Log::DEBUG, "CEC set inactive view");
-      cec_adap->SetInactiveView();
-    }
-  }
-}
-
-#if CEC_LIB_VERSION_MAJOR >= 4
-
-// libcec4 API changed these params to pointers rather than copies, and the returns to void
-// Otherwise, these two blocks of code are the same
-
-void RemoteLinux::cecLogMessage(void* /* param */, const cec_log_message* message)
-{
-  Log::getInstance()->log("Remote", Log::DEBUG, "CECLOG: %lld %d %s", message->time, message->level, message->message);
-}
-
-void RemoteLinux::cecKeyPress(void* /* param */, const cec_keypress* key)
-{
-  //Log::getInstance()->log("Remote", Log::DEBUG, "Incoming cec key %d %d", key->keycode,key->duration);
-  if (key->duration == 0) static_cast<RemoteLinux*>(Remote::getInstance())->incomingCECkey(key->keycode);
-}
-
-void RemoteLinux::cecCommand(void* /* param */, const cec_command* command)
-{
-       Log::getInstance()->log("Remote", Log::DEBUG, "CECCommand: %d",command->opcode);
-       switch (command->opcode) {
-       case CEC_OPCODE_STANDBY: {
-               if (command->initiator==CECDEVICE_TV) {
-                       static_cast<RemoteLinux*>(Remote::getInstance())->incomingPowerkey(POWEROFF);
-               }
-       } break;
-       case CEC_OPCODE_DECK_CONTROL: {
-               if (command->initiator==CECDEVICE_TV && command->parameters.size == 1
-                               && command->parameters[0]==CEC_DECK_CONTROL_MODE_STOP) {
-                       static_cast<RemoteLinux*>(Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_STOP);
-
-               }
-
-       } break;
-       case CEC_OPCODE_PLAY: {
-               if (command->initiator==CECDEVICE_TV && command->parameters.size == 1) {
-                       if (command->parameters[0]==CEC_PLAY_MODE_PLAY_FORWARD) {
-                               static_cast<RemoteLinux*>(Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PLAY);
-                       } else if (command->parameters[0]==CEC_PLAY_MODE_PLAY_STILL) {
-                               static_cast<RemoteLinux*>(Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PAUSE);
-                       }
-               }
-
-
-       } break;
-       default:
-               break;
-       };
-}
-
-void RemoteLinux::cecConfigurationChanged(void* /* param */, const libcec_configuration*)
-{
-       Log::getInstance()->log("Remote", Log::DEBUG, "CECConfig:"/*,config->string()*/);
-}
-
-#else
-
-int RemoteLinux::cecLogMessage(void *param, const cec_log_message message)
-{
-  Log::getInstance()->log("Remote", Log::DEBUG, "CECLOG: %lld %d %s", message.time, message.level, message.message);
-  return 0;
-}
-
-int RemoteLinux::cecKeyPress(void*param, const cec_keypress key)
-{
-  //Log::getInstance()->log("Remote", Log::DEBUG, "Incoming cec key %d %d", key.keycode,key.duration);
-  if (key.duration == 0) ((RemoteLinux*)Remote::getInstance())->incomingCECkey(key.keycode);
-  return 1;
-}
-
-int RemoteLinux::cecCommand(void *param, const cec_command command)
-{
-       Log::getInstance()->log("Remote", Log::DEBUG, "CECCommand: %d",command.opcode);
-       switch (command.opcode) {
-       case CEC_OPCODE_STANDBY: {
-               if (command.initiator==CECDEVICE_TV) {
-                       ((RemoteLinux*)Remote::getInstance())->incomingPowerkey(POWEROFF);
-               }
-       } break;
-       case CEC_OPCODE_DECK_CONTROL: {
-               if (command.initiator==CECDEVICE_TV && command.parameters.size == 1
-                               && command.parameters[0]==CEC_DECK_CONTROL_MODE_STOP) {
-                       ((RemoteLinux*)Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_STOP);
-
-               }
-
-       } break;
-       case CEC_OPCODE_PLAY: {
-               if (command.initiator==CECDEVICE_TV && command.parameters.size == 1) {
-                       if (command.parameters[0]==CEC_PLAY_MODE_PLAY_FORWARD) {
-                               ((RemoteLinux*)Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PLAY);
-                       } else if (command.parameters[0]==CEC_PLAY_MODE_PLAY_STILL) {
-                               ((RemoteLinux*)Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PAUSE);
-                       }
-               }
-
-
-       } break;
-       default:
-               break;
-       };
-       return 1;
-}
-
-int RemoteLinux::cecConfigurationChanged(void *param, const libcec_configuration config)
-{
-       Log::getInstance()->log("Remote", Log::DEBUG, "CECConfig:"/*,config.string()*/);
-       return 1;
-
-}
-
-#endif
-
-void  RemoteLinux::cecSourceActivated(void* /* param */, const cec_logical_address address, const uint8_t activated)
-{
-  Log::getInstance()->log("Remote", Log::DEBUG, "CECSourceActivated: %d %d", address, activated);
-  if (activated == 1)
-  {
-    static_cast<RemoteLinux*>(Remote::getInstance())->incomingPowerkey(POWERON);
-  }
-}
-
-void RemoteLinux::incomingCECkey(int keys)
-{
-  // Send INPUT message
-  Message* m = new Message();
-  m->message = Message::INPUT_EVENT;
-  m->to = Command::getInstance();
-  m->from = this;
-  m->parameter = static_cast<UCHAR>(TranslateHWC(W_G_HCW(W_HCW_CEC, keys)));
-  MessageQueue::getInstance()->postMessage(m);
-}
-
-void RemoteLinux::incomingPowerkey(UCHAR key)
-{
-  // Send INPUT message
-  Message* m = new Message();
-  m->message = Message::INPUT_EVENT;
-  m->to = Command::getInstance();
-  m->from = this;
-  m->parameter = key;
-  MessageQueue::getInstance()->postMessage(m);
-}
-
-bool RemoteLinux::loadOptionsfromServer(VDR* vdr)
-{
-   // Set remote keys
-  char* name;
-  name = vdr->configLoad("RemoteLinux", "HandleVolume");
-
-  if (name != NULL)
-  {
-    if      (STRCASECMP(name, "Vomp") == 0) cechandlesvolume = false;
-    else if (STRCASECMP(name, "Cec") == 0) cechandlesvolume = true;
-    delete[] name;
-  }
-  return Remote::loadOptionsfromServer(vdr);
-}
-
-bool RemoteLinux::saveOptionstoServer()
-{
-  if (cechandlesvolume) VDR::getInstance()->configSave("RemoteLinux", "HandleVolume","Cec");
-  else VDR::getInstance()->configSave("RemoteLinux", "HandleVolume","Vomp");
-
-  return Remote::saveOptionstoServer();
-}
-
-bool RemoteLinux::addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane)
-{
-  if (!Remote::addOptionsToPanes(panenumber, options, pane)) return false;
-
-  Option* option;
-  if (panenumber == 2)
-  {
-    static const char* volumeopts[]={"Vomp","Cec"};
-    option = new Option(100,tr("Volume handled by"), "RemoteLinux","HandleVolume",Option::TYPE_TEXT,/*4,2*/2,0,0,volumeopts,NULL,false,this);
-    options->push_back(option);
-    pane->addOptionLine(option);
-  }
-
-  return true;
-}
-
-bool RemoteLinux::handleOptionChanges(Option* option)
-{
-    if (Remote::handleOptionChanges(option))
-               return true;
-       switch (option->id) {
-       case 100: {
-               if (STRCASECMP(option->options[option->userSetChoice], "Vomp") == 0) {
-                       cechandlesvolume=false;
-               }  else if (STRCASECMP(option->options[option->userSetChoice], "Cec")
-                               == 0) {
-                       cechandlesvolume=true;
-               }
-               Log::getInstance()->log("Remote", Log::DEBUG, "Set volume handling to to %s %d",option->options[option->userSetChoice],cechandlesvolume);
-               return true;
-       }
-       break;
-       };
-       return false;
-
-}
-
-void RemoteLinux::volumeUp()
-{
-  cec_adap->VolumeUp();
-}
-
-void RemoteLinux::volumeDown()
-{
-  cec_adap->VolumeDown();
-}
-
-void RemoteLinux::volumeMute()
-{
-#if CEC_LIB_VERSION_MAJOR >= 4
-  cec_adap->AudioToggleMute();
-#else
-  cec_adap->MuteAudio();
-#endif
-}
-
-void RemoteLinux::informStopEventLoop()
-{
-  listenLoopStop = true;
-  write(pfds[1], "1", 1); // break the select in getButtonPress
-}
-
-void RemoteLinux::eventLoop()
-{
-  fd_set readfds;
-  int maxfd;
-
-  if (pipe2(pfds, O_NONBLOCK) == -1)
-  {
-    Log::getInstance()->log("RemoteLinux", Log::ERR, "pipe2() fail");
-    return;
-  }
-
-  Log::getInstance()->log("RemoteLinux", Log::INFO, "Listen loop");
-
-  while(1)
-  {
-    if (listenLoopStop) break;
-
-    FD_ZERO(&readfds);
-
-    maxfd = 0;
-    for (unsigned int i = 0; i < devices.size(); i++)
-    {
-      int cur_fd = devices[i];
-      maxfd = max(cur_fd, maxfd);
-      FD_SET(cur_fd, &readfds);
-    }
-
-    FD_SET(pfds[0], &readfds);
-    maxfd = max(pfds[0], maxfd);
-
-    // 0 = nothing happened and timeout expired
-    // >0 = num of descriptors that changed
-    // -1 = error
-    if (select(maxfd + 1, &readfds, NULL, NULL, NULL) < 1)
-    {
-      Log::getInstance()->log("RemoteLinux", Log::ERR, "Select fail");
-      break;
-    }
-
-    if (FD_ISSET(pfds[0], &readfds))
-    {
-      // assume quit signal
-      Log::getInstance()->log("Remote", Log::NOTICE, "pfds quit");
-      break;
-
-      // FUTURE: read the byte and do different things? Read listenLoopStop and maybe other bools?
-    }
-
-    for (unsigned int i = 0; i < devices.size(); i++)
-    {
-      int cur_fd = devices[i];
-      if (FD_ISSET(cur_fd, &readfds))
-      {
-        struct input_event ev;
-        int count = read(cur_fd, &ev, sizeof(ev));
-        if (count == sizeof(ev))
-        {
-          if (ev.type == EV_KEY && ev.value == 1)
-          {
-            // Send INPUT message
-            Message* m = new Message();
-            m->message = Message::INPUT_EVENT;
-            m->to = Command::getInstance();
-            m->from = this;
-            m->parameter = static_cast<UCHAR>(TranslateHWC(W_G_HCW(W_HCW_KC,ev.code)));
-            MessageQueue::getInstance()->postMessage(m);
-          }
-        }
-      }
-    }
-  }
-
-  close(pfds[1]);
-  close(pfds[0]);
-}
-
-// FIXME surely NA_SIGNAL can go
diff --git a/remotelinux.h b/remotelinux.h
deleted file mode 100644 (file)
index 7de9e60..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
-    Copyright 2004-2020 Chris Tallon; 2012 Marten Richter
-
-    This file is part of VOMP.
-
-    VOMP is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    VOMP is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
-*/
-
-#ifndef REMOTELINUX_H
-#define REMOTELINUX_H
-
-#include <stdio.h>
-#include <libcec/cec.h>
-#include <vector>
-
-#include "defines.h"
-#include "log.h"
-#include "remote.h"
-
-class RemoteLinux : public Remote
-{
-  public:
-    RemoteLinux();
-    virtual ~RemoteLinux();
-
-    int init(const char *devName);
-    int shutdown();
-    int getDevice();
-    UCHAR getButtonPress(int) { return NA_UNKNOWN; } // DEPRECATED
-  //  void Signal();
-
-//  void SendPower();
-    void InitHWCListwithDefaults();
-    const char*HardcodedTranslateStr(UCHAR command);
-    char* HCWDesc(ULLONG hcw);
-    
-    void changePowerState(bool poweron);
-
-    bool loadOptionsfromServer(VDR* vdr);
-    bool saveOptionstoServer();
-    bool addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane);
-    bool handleOptionChanges(Option* option);
-
-    bool mayHaveFewButtons() {return true;};
-
-    virtual bool handlesVolume() { return cechandlesvolume; };
-    virtual void volumeUp();
-    virtual void volumeDown();
-    virtual void volumeMute();
-
-    int initCec();
-    void deinitCec();
-
-  private: 
-    int initted{};
-    bool signal{};
-    bool cechandlesvolume{};
-
-    UCHAR TranslateHWCFixed(ULLONG code);
-    void InitKeymap();
-    std::vector<int> devices;
-    int num_loop{};
-
-    CEC::ICECAdapter* cec_adap{};
-    CEC::libcec_configuration cec_config;
-    CEC::ICECCallbacks cec_callbacks;
-
-    void incomingCECkey(int keys);
-    void incomingPowerkey(UCHAR key);
-
-#if CEC_LIB_VERSION_MAJOR >= 4
-    static void cecLogMessage(void *param, const CEC::cec_log_message* message);
-    static void cecKeyPress(void*param, const CEC::cec_keypress* key);
-    static void cecCommand(void *param, const CEC::cec_command* command);
-    static void cecConfigurationChanged(void *param, const CEC::libcec_configuration* config);
-#else
-    static int cecLogMessage(void *param, const CEC::cec_log_message message);
-    static int cecKeyPress(void*param, const CEC::cec_keypress key);
-    static int cecCommand(void *param, const CEC::cec_command command);
-    static int cecConfigurationChanged(void *param, const CEC::libcec_configuration config);
-#endif
-    static void cecSourceActivated(void*param, const CEC::cec_logical_address address, const uint8_t activated);
-
-    void eventLoop();
-    void informStopEventLoop();
-
-    int pfds[2];
-};
-
-#endif
index d681b6160f8184dc36567ec16d4a9ca30bc6bd63..44f4fdb8a4ef642a8821f96ec81cc9d2a25883b0 100644 (file)
@@ -27,7 +27,7 @@
 #include <fcntl.h>
 #include <sys/un.h>
 
-#include "remote.h"
+#include "input.h"
 #include "defines.h"
 
 class RemoteLirc : public Remote
index c86633331d2d0524e8fd7f961a28c8b550a38d67..3fd543448da038a09f6af8b8bd6e953c0050415b 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "defines.h"
 #include "log.h"
-#include "remote.h"
+#include "input.h"
 
 #define _WIN32_WINNT 0x501
 #include <winsock2.h>
index fd808001185f6c9a305c839d8bd234324c6f7987..2e0d2604ee58eb7364528cbd18c38839985f2941 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "vaudioselector.h"
 
-#include "remote.h"
+#include "input.h"
 #include "colour.h"
 #include "video.h"
 #include "audio.h"
@@ -468,14 +468,14 @@ int VAudioSelector::handleCommand(int command)
 {
   switch (command)
   {
-    case Remote::BACK:
-    case Remote::OK:
-    case Remote::GREEN:
+    case Input::BACK:
+    case Input::OK:
+    case Input::GREEN:
     {
       return 4;
     }
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
         if (editsubtitles) {
             ssl.up();
@@ -501,8 +501,8 @@ int VAudioSelector::handleCommand(int command)
 
       return 2;
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
         if (editsubtitles) {
             ssl.down();
@@ -530,8 +530,8 @@ int VAudioSelector::handleCommand(int command)
 
       return 2;
     }
-    case Remote::LEFT:
-    case Remote::DF_LEFT:
+    case Input::LEFT:
+    case Input::DF_LEFT:
      {
         if (editsubtitles && subtitles) {
             ssl.setDarkSelOption(true);
@@ -543,8 +543,8 @@ int VAudioSelector::handleCommand(int command)
         }
         return 2;
      }
-     case Remote::RIGHT:
-     case Remote::DF_RIGHT:
+     case Input::RIGHT:
+     case Input::DF_RIGHT:
      {
          if (!editsubtitles && subtitles) {
              ssl.setDarkSelOption(false);
@@ -619,7 +619,7 @@ void VAudioSelector::processMessage(Message* m)
       asl.setDarkSelOption(false);
       asl.draw();
       ssl.draw();
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press
     }
     else if (ssl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
@@ -628,7 +628,7 @@ void VAudioSelector::processMessage(Message* m)
       asl.setDarkSelOption(true);
       asl.draw();
       ssl.draw();
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press
     }
     else
     { //check if press is outside this view! then simulate cancel
@@ -636,7 +636,7 @@ void VAudioSelector::processMessage(Message* m)
       int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
-        BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
+        BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press
       }
     }
   }
index 8d6573db818d80b3385fc46685e5cf6ced7e027c..7d1edae305d4ac7df692f43fb2b4c9ca4989a4f6 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "vchannellist.h"
 
-#include "remote.h"
+#include "input.h"
 #include "wsymbol.h"
 #include "vvideolivetv.h"
 #include "colour.h"
@@ -186,8 +186,8 @@ int VChannelList::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
       sl.up();
       quickUpdate();
@@ -195,8 +195,8 @@ int VChannelList::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
       sl.down();
       quickUpdate();
@@ -204,7 +204,7 @@ int VChannelList::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::SKIPBACK:
+    case Input::SKIPBACK:
     {
       sl.pageUp();
       quickUpdate();
@@ -212,7 +212,7 @@ int VChannelList::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::SKIPFORWARD:
+    case Input::SKIPFORWARD:
     {
       sl.pageDown();
       quickUpdate();
@@ -220,16 +220,16 @@ int VChannelList::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::ZERO:
-    case Remote::ONE:
-    case Remote::TWO:
-    case Remote::THREE:
-    case Remote::FOUR:
-    case Remote::FIVE:
-    case Remote::SIX:
-    case Remote::SEVEN:
-    case Remote::EIGHT:
-    case Remote::NINE:
+    case Input::ZERO:
+    case Input::ONE:
+    case Input::TWO:
+    case Input::THREE:
+    case Input::FOUR:
+    case Input::FIVE:
+    case Input::SIX:
+    case Input::SEVEN:
+    case Input::EIGHT:
+    case Input::NINE:
     {
       VChannelSelect* v = new VChannelSelect(this);
       v->draw();
@@ -238,8 +238,8 @@ int VChannelList::handleCommand(int command)
       v->handleCommand(command);
       return 2;
     }
-    case Remote::OK:
-    case Remote::PLAY:
+    case Input::OK:
+    case Input::PLAY:
     {
       Channel* chan = NULL;
       if (chanList) chan = (Channel*)sl.getCurrentOptionData();
@@ -251,7 +251,7 @@ int VChannelList::handleCommand(int command)
 
       return 2;
     }
-    case Remote::BACK:
+    case Input::BACK:
     {
       return 4;
     }
@@ -282,7 +282,7 @@ void VChannelList::processMessage(Message* m)
   {
     if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      boxstack->handleCommand(Remote::OK); //simulate OK press
+      boxstack->handleCommand(Input::OK); //simulate OK press
     }
     else
     { //check if press is outside this view! then simulate cancel
@@ -290,7 +290,7 @@ void VChannelList::processMessage(Message* m)
       int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
-        boxstack->handleCommand(Remote::BACK); //simulate cancel press
+        boxstack->handleCommand(Input::BACK); //simulate cancel press
       }
     }
   }
index 1fac3f070c1a4e5abc50e0fbc7a3be00dc47288d..f41b31166848d44d1f7ccea6e670d0169fc67fdc 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "vchannelselect.h"
 
-#include "remote.h"
+#include "input.h"
 #include "message.h"
 #include "boxstack.h"
 #include "colour.h"
@@ -130,16 +130,16 @@ int VChannelSelect::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::ZERO:
-    case Remote::ONE:
-    case Remote::TWO:
-    case Remote::THREE:
-    case Remote::FOUR:
-    case Remote::FIVE:
-    case Remote::SIX:
-    case Remote::SEVEN:
-    case Remote::EIGHT:
-    case Remote::NINE:
+    case Input::ZERO:
+    case Input::ONE:
+    case Input::TWO:
+    case Input::THREE:
+    case Input::FOUR:
+    case Input::FIVE:
+    case Input::SIX:
+    case Input::SEVEN:
+    case Input::EIGHT:
+    case Input::NINE:
     {
       doInput(command);
       draw();
@@ -148,7 +148,7 @@ int VChannelSelect::handleCommand(int command)
       else Timers::getInstance()->setTimerD(this, 1, 3);
       return 2;
     }
-    case Remote::OK:
+    case Input::OK:
     {
       changeChannel();
       return 2;
index 178c22aa206feac81357d27fee9d93ea2be23f26..b20a0082f2d4d55bffe48ed254f8da8794a095b1 100644 (file)
@@ -20,7 +20,7 @@
 #include "vcolourtuner.h"
 
 #include "wsymbol.h"
-#include "remote.h"
+#include "input.h"
 #include "colour.h"
 #include "video.h"
 #include "vinfo.h"
@@ -114,56 +114,56 @@ int VColourTuner::handleCommand(int command)
 {
   int rt=0;
   switch(command) {
-      case Remote::ONE:
+      case Input::ONE:
       updateFactor(1,-1);
       rt=2;
       hasChanged=true;
       break;
-    case Remote::TWO:
+    case Input::TWO:
       updateFactor(1,1);
       rt=2;
       hasChanged=true;
       break;
-    case Remote::FOUR:
+    case Input::FOUR:
       updateFactor(2,-1);
       rt=2;
       hasChanged=true;
       break;
-    case Remote::FIVE:
+    case Input::FIVE:
       updateFactor(2,1);
       rt=2;
       hasChanged=true;
       break;
-    case Remote::SEVEN:
+    case Input::SEVEN:
       updateFactor(3,-1);
       rt=2;
       hasChanged=true;
       break;
-    case Remote::EIGHT:
+    case Input::EIGHT:
       updateFactor(3,1);
       hasChanged=true;
       rt=2;
       break;
-    case Remote::THREE:
+    case Input::THREE:
       updateFactor(4,-1);
       hasChanged=true;
       rt=2;
       break;
-    case Remote::SIX:
+    case Input::SIX:
       updateFactor(4,1);
       hasChanged=true;
       rt=2;
       break;
-    case Remote::NINE:
+    case Input::NINE:
       updateFactor(5,0);
       hasChanged=true;
       rt=2;
       break;
-    case Remote::ZERO:
+    case Input::ZERO:
       drawPicture=true;
       rt=2;
       break;
-    case Remote::BACK:
+    case Input::BACK:
       vrfactor=rfactor;
       vgfactor=gfactor;
       vbfactor=bfactor;
@@ -176,7 +176,7 @@ int VColourTuner::handleCommand(int command)
 #endif
       rt=4;
       break;
-    case Remote::OK:
+    case Input::OK:
       rfactor=vrfactor;
       gfactor=vgfactor;
       bfactor=vbfactor;
@@ -231,7 +231,7 @@ void VColourTuner::processMessage(Message* m)
     int y=(m->parameter&0xFFFF)-getScreenY();
     if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
     {
-      BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
+      BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press
     }
     else if (y>=(int)area.h-24 && y<=(int)area.h-6)
     {
diff --git a/vepg.cc b/vepg.cc
index fe338a7d0bd6d2ed21291adfdab8376e53e3f86a..676b896e4de8793dae9bee8d3fa9a6de731a8ae9 100644 (file)
--- a/vepg.cc
+++ b/vepg.cc
@@ -32,7 +32,7 @@
 
 #include "vepg.h"
 
-#include "remote.h"
+#include "input.h"
 #include "vchannellist.h"
 #include "messagequeue.h"
 #include "video.h"
@@ -356,16 +356,16 @@ int VEpg::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     { // cursor up the channel list
       chanListbox.up();
       drawData();
       boxstack->update(this);
       return 2;
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     { // cursor down the channel list
       Log::getInstance()->log("VEPG", Log::DEBUG, "Down start");
       
@@ -376,16 +376,16 @@ int VEpg::handleCommand(int command)
 
       return 2;
     }
-    case Remote::DF_LEFT:
-    case Remote::LEFT:
+    case Input::DF_LEFT:
+    case Input::LEFT:
     { // cursor left through time
       selTime = thisEvent.time - 1;
       drawData();
       boxstack->update(this);
       return 2;
     }
-    case Remote::DF_RIGHT:
-    case Remote::RIGHT:
+    case Input::DF_RIGHT:
+    case Input::RIGHT:
     {
     // cursor right through time
       selTime = thisEvent.time + thisEvent.duration;
@@ -393,7 +393,7 @@ int VEpg::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::RED:
+    case Input::RED:
     {
     // cursor up one page
       chanListbox.pageUp();
@@ -401,7 +401,7 @@ int VEpg::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::GREEN:
+    case Input::GREEN:
     {
     // cursor down one page
       chanListbox.pageDown();
@@ -409,7 +409,7 @@ int VEpg::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::BLUE:
+    case Input::BLUE:
     {
     // step forward 24 hours
       selTime += 24 * 60 * 60;
@@ -417,7 +417,7 @@ int VEpg::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::YELLOW:
+    case Input::YELLOW:
     {
     // step forward 24 hours
       selTime -= 24 * 60 * 60;
@@ -425,7 +425,7 @@ int VEpg::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::RECORD:
+    case Input::RECORD:
     {
       if (!chanList) return 2;
       Log::getInstance()->log("VEPG", Log::DEBUG, "ID %lu TIME %lu DURATION %lu TITLE %s", thisEvent.id, thisEvent.time, thisEvent.duration, thisEvent.title);
@@ -435,9 +435,9 @@ int VEpg::handleCommand(int command)
       boxstack->update(vs);
       return 2;
     }
-    case Remote::PLAY:
-    case Remote::GO:
-    case Remote::OK:
+    case Input::PLAY:
+    case Input::GO:
+    case Input::OK:
     {
       if (!chanList) return 2;
 
@@ -457,16 +457,16 @@ int VEpg::handleCommand(int command)
       
       setCurrentChannel();
 
-      if(command == Remote::GO)
+      if(command == Input::GO)
         return 2;
       // GO just changes channel in preview, PLAY changes channel and returns to normal TV
     }
-    case Remote::BACK:
-    case Remote::GUIDE:
+    case Input::BACK:
+    case Input::GUIDE:
     {
       return 4;
     }
-    case Remote::CHANNELUP:
+    case Input::CHANNELUP:
     {
       if (currentChannelIndex == (chanList->size() - 1)) // at the end
         currentChannelIndex = 0;
@@ -487,7 +487,7 @@ int VEpg::handleCommand(int command)
 
       return 2;
     }
-    case Remote::CHANNELDOWN:
+    case Input::CHANNELDOWN:
     {
       if (currentChannelIndex == 0) // at the start
         currentChannelIndex = chanList->size() - 1; // so go to end
@@ -779,7 +779,7 @@ void VEpg::processMessage(Message* m)
   {
     if (chanListbox.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      boxstack->handleCommand(Remote::OK); //simulate OK press
+      boxstack->handleCommand(Input::OK); //simulate OK press
     }
     else
     {
@@ -791,39 +791,39 @@ void VEpg::processMessage(Message* m)
 
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
-        boxstack->handleCommand(Remote::BACK); //simulate cancel press
+        boxstack->handleCommand(Input::BACK); //simulate cancel press
       }
       else if (x>=(keyx+72) && y>=(keyy+4) &&x<=(keyx+72+104) &&y<=(keyy+4+getFontHeight() + 2))
       {
-        boxstack->handleCommand(Remote::RED);
+        boxstack->handleCommand(Input::RED);
       }
       else if (x>=(keyx+72) && y>=(keyy+ getFontHeight() + 8) &&x<=(keyx+72+104) &&y<=(keyy+8+2*getFontHeight() + 2))
          {
-        boxstack->handleCommand(Remote::GREEN);
+        boxstack->handleCommand(Input::GREEN);
       }
       else if (x>=(keyx+180) && y>=(keyy+4) &&x<=(keyx+180+104) &&y<=(keyy+4+getFontHeight() + 2))
       {
-        boxstack->handleCommand(Remote::YELLOW);
+        boxstack->handleCommand(Input::YELLOW);
       }
       else if (x>=(keyx+180) && y>=(keyy+ getFontHeight() + 8) &&x<=(keyx+180+104) &&y<=(keyy+8+2*getFontHeight() + 2))
       {
-        boxstack->handleCommand(Remote::BLUE);
+        boxstack->handleCommand(Input::BLUE);
       }
       else if (x>=(keyx+290) && y>=(keyy+4) &&x<=(keyx+180+290) &&y<=(keyy+4+getFontHeight() + 2))
       {
-        boxstack->handleCommand(Remote::BACK);
+        boxstack->handleCommand(Input::BACK);
       }
       else if (x>=(keyx+290) && y>=(keyy+ getFontHeight() + 8) &&x<=(keyx+290+180) &&y<=(keyy+8+2*getFontHeight() + 2))
       {
-        boxstack->handleCommand(Remote::RECORD);
+        boxstack->handleCommand(Input::RECORD);
       }
       else if (x>=(keyx+474) && y>=(keyy+4) &&x<=(keyx+128+474) &&y<=(keyy+4+getFontHeight() + 2))
       {
-        boxstack->handleCommand(Remote::PLAY);
+        boxstack->handleCommand(Input::PLAY);
       }
       else if (x>=(keyx+474) && y>=(keyy+ getFontHeight() + 8) &&x<=(keyx+238+474) &&y<=(keyy+8+2*getFontHeight() + 2))
       {
-        boxstack->handleCommand(Remote::GO);
+        boxstack->handleCommand(Input::GO);
       }
       else if ( x>=(chanListbox.getRootBoxOffsetX())
                 && y>=(chanListbox.getRootBoxOffsetY() + 5)
index 3b6f9f8dd5adfb5f4789630313a6f44e41f7f37d..48f286ef2ecda187394a4564422f0f797df1743f 100644 (file)
@@ -20,7 +20,7 @@
 #include "vepglistadvanced.h"
 
 #include "boxstack.h"
-#include "remote.h"
+#include "input.h"
 #include "wsymbol.h"
 #include "boxstack.h"
 #include "vdr.h"
@@ -769,8 +769,8 @@ int VEpgListAdvanced::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
       sl.up();
       quickUpdate();
@@ -778,8 +778,8 @@ int VEpgListAdvanced::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
       sl.down();
       quickUpdate();
@@ -787,7 +787,7 @@ int VEpgListAdvanced::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::SKIPBACK:
+    case Input::SKIPBACK:
     {
       sl.pageUp();
       quickUpdate();
@@ -795,7 +795,7 @@ int VEpgListAdvanced::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::SKIPFORWARD:
+    case Input::SKIPFORWARD:
     {
       sl.pageDown();
       quickUpdate();
@@ -803,27 +803,27 @@ int VEpgListAdvanced::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::RED:
+    case Input::RED:
     {
        doRed();
        return 2;
     }
-    case Remote::GREEN:
+    case Input::GREEN:
     {
        doGreen();
        return 2;
     }
-    case Remote::YELLOW:
+    case Input::YELLOW:
     {
        doYellow();
        return 2;
     }
-    case Remote::BLUE:
+    case Input::BLUE:
     {
        doBlue();
        return 2;
     }
-    case Remote::OK:
+    case Input::OK:
     {
       if (sl.getNumOptions() == 0) return 2;
 
@@ -852,7 +852,7 @@ int VEpgListAdvanced::handleCommand(int command)
       // should not get to here
       return 1;
     }
-    case Remote::BACK:
+    case Input::BACK:
     {
         return 4;
     }
@@ -877,23 +877,23 @@ void VEpgListAdvanced::processMessage(Message* m)
   {
     if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      boxstack->handleCommand(Remote::OK); //simulate OK press
+      boxstack->handleCommand(Input::OK); //simulate OK press
     }
        else if (boxRed.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
        {
-               boxstack->handleCommand(Remote::RED);
+               boxstack->handleCommand(Input::RED);
        }
        else if (boxGreen.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
        {
-               boxstack->handleCommand(Remote::GREEN);
+               boxstack->handleCommand(Input::GREEN);
        }
        else if (boxYellow.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
        {
-               boxstack->handleCommand(Remote::GREEN);
+               boxstack->handleCommand(Input::GREEN);
        }
        else if (boxBlue.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
        {
-               boxstack->handleCommand(Remote::GREEN);
+               boxstack->handleCommand(Input::GREEN);
        }
     else
     {
@@ -902,7 +902,7 @@ void VEpgListAdvanced::processMessage(Message* m)
       int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
-        boxstack->handleCommand(Remote::BACK); //simulate cancel press
+        boxstack->handleCommand(Input::BACK); //simulate cancel press
       }
     }
   }
index cc0ded6c7c02b9c1a46d6d7d46281710cbc8e98d..0725c080fa7e44c5625e86757499e0d4abb461a8 100644 (file)
@@ -30,7 +30,7 @@
 #include "command.h"
 #include "messagequeue.h"
 #include "video.h"
-#include "remote.h"
+#include "input.h"
 #include "i18n.h"
 
 VEpgSetTimer::VEpgSetTimer(Event* tevent, Channel* tchannel)
@@ -210,27 +210,27 @@ int VEpgSetTimer::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::DF_LEFT:
-    case Remote::LEFT:
+    case Input::DF_LEFT:
+    case Input::LEFT:
     {
       swap();
       draw();
       boxstack->update(this);
       return 2;
     }
-    case Remote::DF_RIGHT:
-    case Remote::RIGHT:
+    case Input::DF_RIGHT:
+    case Input::RIGHT:
     {
       swap();
       draw();
       boxstack->update(this);
       return 2;
     }
-    case Remote::BACK:
+    case Input::BACK:
     {
       return 4;
     }
-    case Remote::OK:
+    case Input::OK:
     {
       if (selectedOption != YES) return 4;
       doit();
@@ -306,11 +306,11 @@ void VEpgSetTimer::processMessage(Message* m)
   {
     if (buttonYes.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      boxstack->handleCommand(Remote::OK); //simulate OK press
+      boxstack->handleCommand(Input::OK); //simulate OK press
     }
     else if (buttonNo.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      boxstack->handleCommand(Remote::OK); //simulate OK press
+      boxstack->handleCommand(Input::OK); //simulate OK press
     }
     else
     {
@@ -319,7 +319,7 @@ void VEpgSetTimer::processMessage(Message* m)
       int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
-        boxstack->handleCommand(Remote::BACK); //simulate cancel press
+        boxstack->handleCommand(Input::BACK); //simulate cancel press
       }
     }
   }
index 75c5a3fc1266ab7a08ecc871c886a04593164030..6b99822621680734a97356f8705aaad686ec77e6 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "vepgsummary.h"
 
-#include "remote.h"
+#include "input.h"
 #include "vquestion.h"
 #include "vepgsettimer.h"
 #include "vinfo.h"
@@ -167,10 +167,10 @@ VEpgSummary::~VEpgSummary()
 
 int VEpgSummary::handleCommand(int command)
 {
-       if (command==Remote::BACK) {
+       if (command==Input::BACK) {
                return 4;
        }
-       if (command==Remote::RED)
+       if (command==Input::RED)
     {
       if (!channel) return 2;
       Log::getInstance()->log("VEpgSummary", Log::DEBUG, "ID %lu TIME %lu DURATION %lu TITLE %s", event->id, event->time, event->duration, event->title);
@@ -220,7 +220,7 @@ void VEpgSummary::processMessage(Message* m)
 
                if ((boxRed.getX() <= x) && (boxRed.getX() + (int)boxRed.getWidth() >= x) &&
                                (boxRed.getY() <= y) && (boxRed.getY() + (int)boxRed.getHeight() >= y)) {
-                       BoxStack::getInstance()->handleCommand(Remote::RED);
+                       BoxStack::getInstance()->handleCommand(Input::RED);
                        cancel = false;
                }
 
@@ -237,7 +237,7 @@ void VEpgSummary::processMessage(Message* m)
                        int checkY=(m->parameter&0xFFFF)-getScreenY();
                        if (checkX<0 || checkY <0 || checkX>(int)getWidth() || checkY>(int)getHeight())
                        {
-                               BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
+                               BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press
                        }
                }
        } else if (m->message == Message::MOUSE_SCROLL)
index 76b629252f5b9d7e6e7a3fc6a3adef1fc8955208..da5f26d90afb6a7a69007f0a52afe2ecfd1bddd0 100644 (file)
@@ -25,7 +25,7 @@
 #include "woptionpane.h"
 #include "osdopenvg.h"
 #include "boxstack.h"
-#include "remote.h"
+#include "input.h"
 
 #include <bcm_host.h>
 
@@ -471,7 +471,7 @@ void VideoOMX::selectVideoMode(int interlaced)
 
                        }
                }
-               Remote::getInstance()->shutdown();
+               Input::getInstance()->shutdown();
                vc_tv_power_off();
                if (mymode) {
                        Log::getInstance()->log("Video", Log::NOTICE, "Switch to optimum mode");
@@ -489,7 +489,7 @@ void VideoOMX::selectVideoMode(int interlaced)
        } else {
                /* analog tv case */
                Log::getInstance()->log("Video", Log::NOTICE, "Analog tv case");
-               Remote::getInstance()->shutdown();
+               Input::getInstance()->shutdown();
                vc_tv_power_off();
                SDTV_MODE_T setmode=SDTV_MODE_PAL;
                SDTV_OPTIONS_T options;
@@ -515,7 +515,7 @@ void VideoOMX::selectVideoMode(int interlaced)
                hdmi=false;
        }
 
-       Remote::getInstance()->init("");
+       Input::getInstance()->init("");
 
 
        signalon=true;
@@ -724,9 +724,9 @@ int VideoOMX::signalOff()
        //TODO reinit osd
        Log::getInstance()->log("Video", Log::NOTICE, "signalOff");
        Osd::getInstance()->stopUpdate(); // turn off drawing thread
-       Remote::getInstance()->shutdown();
+       Input::getInstance()->shutdown();
        vc_tv_power_off();
-       Remote::getInstance()->init("");
+       Input::getInstance()->init("");
        signalon=false;
     return 1;
 }
index 288954845145cbd8982ec946e5311ebd93d20bed..f7b89d67b5210541649966121c8da28b4967ed32 100644 (file)
--- a/vinfo.cc
+++ b/vinfo.cc
@@ -20,7 +20,7 @@
 
 #include "vinfo.h"
 
-#include "remote.h"
+#include "input.h"
 #include "colour.h"
 #include "i18n.h"
 #include "boxstack.h"
@@ -93,8 +93,8 @@ int VInfo::handleCommand(int command)
 
   switch(command)
   {
-    case Remote::OK:
-    case Remote::BACK:
+    case Input::OK:
+    case Input::BACK:
     {
       if (exitable) return 4;
     }
@@ -115,6 +115,6 @@ void VInfo::processMessage(Message* m)
 {
   if (m->message == Message::MOUSE_LBDOWN)
   {
-    BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
+    BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press
   }
 }
index e1001c440c53e514d907ca67a1119b2c0162def4..63db05f26081512b2cace82d3a0f5677f2b252a0 100644 (file)
@@ -58,7 +58,7 @@
 
 #include "vmediaview.h"
 #include "vvideomedia.h"
-#include "remote.h"
+#include "input.h"
 #include "wsymbol.h"
 #include "boxstack.h"
 #include "colour.h"
@@ -715,7 +715,7 @@ int VMediaList::handleCommand(int command)
   playingAll=false;
   switch(command)
   {
-    case Remote::ONE:
+    case Input::ONE:
     {
       sl.hintSetCurrent(0);
       sl.draw();
@@ -724,8 +724,8 @@ int VMediaList::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
       sl.up();
       sl.draw();
@@ -735,8 +735,8 @@ int VMediaList::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
       sl.down();
       sl.draw();
@@ -746,7 +746,7 @@ int VMediaList::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::SKIPBACK:
+    case Input::SKIPBACK:
     {
       sl.pageUp();
       sl.draw();
@@ -756,7 +756,7 @@ int VMediaList::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::SKIPFORWARD:
+    case Input::SKIPFORWARD:
     {
       sl.pageDown();
       sl.draw();
@@ -766,7 +766,7 @@ int VMediaList::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::BLUE:
+    case Input::BLUE:
     {
       switch(sortOrder) {
         case SORT_NAME:
@@ -783,8 +783,8 @@ int VMediaList::handleCommand(int command)
           return 2;
       }
     }
-    case Remote::OK:
-    case Remote::PLAY:
+    case Input::OK:
+    case Input::PLAY:
     {
       Media* media = NULL;
       if (dirlist) media = getCurrentMedia(dirlist);
@@ -797,12 +797,12 @@ int VMediaList::handleCommand(int command)
         //create child
         Log::getInstance()->log("VMediaList", Log::DEBUG, "create child for %s",media->getFileName());
         if (media->getFileName() == NULL ) return 2;
-        if (command == Remote::PLAY) {
+        if (command == Input::PLAY) {
           dirlist->setStartLevel();
           playingAll=true;
         }
         bool rt=changeDirectory(media);
-        if (command == Remote::PLAY && rt) {
+        if (command == Input::PLAY && rt) {
           playAll();
         }
         else {
@@ -813,10 +813,10 @@ int VMediaList::handleCommand(int command)
         case MEDIA_TYPE_AUDIO:
         Log::getInstance()->log("VMediaList", Log::DEBUG, "play audio file %s",
           media->getFileName());
-        if (dirmode != M_NONE && command == Remote::PLAY)
+        if (dirmode != M_NONE && command == Input::PLAY)
           playAll();
         else
-          playAudio(command==Remote::PLAY,true,true);
+          playAudio(command==Input::PLAY,true,true);
         break;
         case MEDIA_TYPE_VIDEO: {
 #ifndef WIN32 //Only DVB style MPEG is supported by the Windows Part!
@@ -846,10 +846,10 @@ int VMediaList::handleCommand(int command)
         case MEDIA_TYPE_PICTURE:
         Log::getInstance()->log("VMediaList", Log::DEBUG, "show picture file %s",
          media->getFileName());
-        if (dirmode != M_NONE && command == Remote::PLAY)
+        if (dirmode != M_NONE && command == Input::PLAY)
           playAll();
         else
-          getViewer()->showPicture(MV_NONE,command==Remote::PLAY,true);
+          getViewer()->showPicture(MV_NONE,command==Input::PLAY,true);
         break;
         default:
         Log::getInstance()->log("VMediaList", Log::DEBUG, "unknown media type %d file %s",
@@ -868,7 +868,7 @@ int VMediaList::handleCommand(int command)
 
       return 2;
     }
-    case Remote::BACK:
+    case Input::BACK:
     {
                        if (dirlist->getLevel() < 1) return 4;
                        dirlist->dropTop();
@@ -1079,7 +1079,7 @@ void VMediaList::processMessage(Message* m)
     if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       updateSelection();
-      boxstack->handleCommand(Remote::OK); //simulate OK press
+      boxstack->handleCommand(Input::OK); //simulate OK press
     }
     else
     { //check if press is outside this view! then simulate cancel
@@ -1087,7 +1087,7 @@ void VMediaList::processMessage(Message* m)
       int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
-        boxstack->handleCommand(Remote::BACK); //simulate cancel press
+        boxstack->handleCommand(Input::BACK); //simulate cancel press
       }
     }
   }
index 6f3f95569060a80834e37e7348071faae4b9486d..cf7874a569b498ea8abb0e8ea659162755a3580f 100644 (file)
@@ -27,7 +27,7 @@
 #include "timers.h"
 #include "boxx.h"
 #include "wselectlist.h"
-#include "remote.h"
+#include "input.h"
 #include "wsymbol.h"
 #include "boxstack.h"
 #include "vdr.h"
@@ -433,7 +433,7 @@ int VMediaView::handleCommand(int command)
   Log::getInstance()->log("VMediaView::handleCommand", Log::DEBUG, "cmd=%d,p=%p", command,this);
   if ( !audioEnabled && ! pictureEnabled ) {
     //only handle YELLOW
-    if (command == Remote::YELLOW) {
+    if (command == Input::YELLOW) {
       setAudioMode(true);
       return 1;
     }
@@ -445,29 +445,29 @@ int VMediaView::handleCommand(int command)
     int rt=1;
     switch(command)
     {
-      case Remote::DF_UP:
-      case Remote::UP:
-      case Remote::SKIPBACK:
+      case Input::DF_UP:
+      case Input::UP:
+      case Input::SKIPBACK:
         rotate=WJpegComplex::ROT_0;
         showPicture(VMediaList::MV_PREV,slideshow,true);
         rt= 2;
         break;
-      case Remote::FORWARD:
+      case Input::FORWARD:
         if (showtime > 1) showtime--;
         updatePictureBanner(true);
         break;
-      case Remote::DF_DOWN:
-      case Remote::DOWN:
-      case Remote::SKIPFORWARD:
+      case Input::DF_DOWN:
+      case Input::DOWN:
+      case Input::SKIPFORWARD:
         rotate=WJpegComplex::ROT_0;
         showPicture(VMediaList::MV_NEXT,slideshow,true);
         rt= 2;
         break;
-      case Remote::REVERSE:
+      case Input::REVERSE:
         if (showtime < 50 ) showtime++;
         updatePictureBanner(true);
         break;
-      case Remote::OK:
+      case Input::OK:
       {
         if (pictureBanner) {
           destroyPictureBanner();
@@ -481,7 +481,7 @@ int VMediaView::handleCommand(int command)
         rt= 2;
       }
       break;
-      case Remote::PLAY:
+      case Input::PLAY:
       {
         slideshow=true;
         rotate=WJpegComplex::ROT_0;
@@ -489,7 +489,7 @@ int VMediaView::handleCommand(int command)
         rt= 2;
       }
       break;
-      case Remote::PAUSE:
+      case Input::PAUSE:
         if (slideshow) {
           stopSlideshow(true);
           updatePictureBanner();
@@ -501,13 +501,13 @@ int VMediaView::handleCommand(int command)
         }
         rt= 2;
         break;
-      case Remote::STOP:
+      case Input::STOP:
         stopSlideshow(true);
         showtime=INITIAL_SHOWTIME;
         updatePictureBanner();
         rt= 2;
         break;
-      case Remote::RED:
+      case Input::RED:
         switch(rotate) {
           case WJpegComplex::ROT_0:
             rotate=WJpegComplex::ROT_90;
@@ -525,12 +525,12 @@ int VMediaView::handleCommand(int command)
         showPicture(VMediaList::MV_NONE,slideshow,true);
         rt=2;
         break;
-      case Remote::GREEN:
+      case Input::GREEN:
         if (info) destroyInfo();
         else showPictureInfo();
         rt=2;
         break;
-      case Remote::BLUE:
+      case Input::BLUE:
         switch (cropmode) {
           case WJpegComplex::CROP:
             cropmode=WJpegComplex::LETTER;
@@ -545,7 +545,7 @@ int VMediaView::handleCommand(int command)
         showPicture(VMediaList::MV_NONE,slideshow,true);
         rt=2;
         break;
-      case Remote::MENU: {
+      case Input::MENU: {
         stopSlideshow(true);
         destroyPictureBanner();
         destroyInfo();
@@ -556,13 +556,13 @@ int VMediaView::handleCommand(int command)
         rt=2;
        
                          } break;
-      case Remote::BACK:
+      case Input::BACK:
       {
         setPictureMode(false);
         rt= 2;
       }
       break;
-      case Remote::YELLOW:
+      case Input::YELLOW:
       {
         setAudioMode(true);
       }
@@ -576,78 +576,78 @@ int VMediaView::handleCommand(int command)
     //------------------------- command in mode AUDIO (i.e. audio is on top) ----------------
     switch(command)
     {
-      case Remote::YELLOW:
+      case Input::YELLOW:
         setAudioMode(false);
         rt=2;
         break;
-      case Remote::DF_UP:
-      case Remote::UP:
+      case Input::DF_UP:
+      case Input::UP:
         play(playall,false,VMediaList::MV_PREV);
         rt= 2;
         break;
-      case Remote::FORWARD:
+      case Input::FORWARD:
         if (! audioError) getPlayer()->fastForward();
         updateInfo=true;
         rt=2;
         break;
-      case Remote::DF_DOWN:
-      case Remote::DOWN:
+      case Input::DF_DOWN:
+      case Input::DOWN:
         play(playall,false,VMediaList::MV_NEXT);
         rt= 2;
         break;
-      case Remote::SKIPFORWARD:
+      case Input::SKIPFORWARD:
         if (! audioError) getPlayer()->skipForward(10);
         rt=2;
         break;
-      case Remote::SKIPBACK:
+      case Input::SKIPBACK:
         if (! audioError) getPlayer()->skipBackward(10);
         rt=2;
         break;
-      case Remote::REVERSE:
+      case Input::REVERSE:
         rt=2;
         break;
-      case Remote::ZERO:
+      case Input::ZERO:
         if (! audioError) getPlayer()->jumpToPercent(0);
         rt=2;
         break;
-      case Remote::ONE:
+      case Input::ONE:
         if (! audioError) getPlayer()->jumpToPercent(10);
         rt=2;
         break;
-      case Remote::TWO:
+      case Input::TWO:
         if (! audioError) getPlayer()->jumpToPercent(20);
         rt=2;
         break;
-      case Remote::THREE:
+      case Input::THREE:
         if (! audioError) getPlayer()->jumpToPercent(30);
         rt=2;
         break;
-      case Remote::FOUR:
+      case Input::FOUR:
         if (! audioError) getPlayer()->jumpToPercent(40);
         rt=2;
         break;
-      case Remote::FIVE:
+      case Input::FIVE:
         if (! audioError) getPlayer()->jumpToPercent(50);
         rt=2;
         break;
-      case Remote::SIX:
+      case Input::SIX:
         if (! audioError) getPlayer()->jumpToPercent(60);
         rt=2;
         break;
-      case Remote::SEVEN:
+      case Input::SEVEN:
         if (! audioError) getPlayer()->jumpToPercent(70);
         rt=2;
         break;
-      case Remote::EIGHT:
+      case Input::EIGHT:
         if (! audioError) getPlayer()->jumpToPercent(80);
         rt=2;
         break;
-      case Remote::NINE:
+      case Input::NINE:
         if (! audioError) getPlayer()->jumpToPercent(90);
         rt=2;
         break;
-      case Remote::OK:
-      case Remote::GREEN:
+      case Input::OK:
+      case Input::GREEN:
       {
         if (info) {
           destroyInfo();
@@ -663,7 +663,7 @@ int VMediaView::handleCommand(int command)
         rt= 2;
       }
       break;
-      case Remote::PLAY:
+      case Input::PLAY:
       {
         if (! audioError) getPlayer()->unpause();
         updateInfo=true;
@@ -672,18 +672,18 @@ int VMediaView::handleCommand(int command)
         rt= 2;
       }
       break;
-      case Remote::PAUSE:
+      case Input::PAUSE:
         if (! audioError) getPlayer()->pause();
         updateInfo=true;
         rt= 2;
         break;
-      case Remote::STOP:
+      case Input::STOP:
         getPlayer()->stop();
         justPlaying=false;
         updateInfo=true;
         rt= 2;
         break;
-      case Remote::BACK:
+      case Input::BACK:
       {
         getPlayer()->stop();
         playall=false;
@@ -715,7 +715,7 @@ void VMediaView::processMessage(Message* m)
     int y=(m->parameter&0xFFFF)-getScreenY();
     if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
     {
-      BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
+      BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press
     }
   }
   else if (m->message = Message::PLAYER_EVENT) {
index 3691253a60eb72b85779b10be4346c116de5d74a..b2fd4dfeb4be5827e3f1937c89f52d19cd96c9c2 100644 (file)
--- a/vmute.cc
+++ b/vmute.cc
@@ -19,7 +19,7 @@
 
 #include "vmute.h"
 
-#include "remote.h"
+#include "input.h"
 #include "audio.h"
 #include "video.h"
 #include "wsymbol.h"
@@ -79,7 +79,7 @@ int VMute::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::MUTE:
+    case Input::MUTE:
     {
       isMuted = Audio::getInstance()->toggleUserMute();
       draw();
index 1f3e4a30437d35052cf106ad010c5ce2402850da..0ebd83ee3eb80ffd328464fdaf7fe8feccc50a43 100644 (file)
--- a/vopts.cc
+++ b/vopts.cc
@@ -24,7 +24,7 @@
 #include "video.h"
 #include "osd.h"
 #include "audio.h"
-#include "remote.h"
+#include "input.h"
 #include "boxstack.h"
 #include "woptionpane.h"
 #include "wremoteconfig.h"
@@ -192,14 +192,14 @@ VOpts::VOpts()
   options.push_back(option);
   wop->addOptionLine(option);
 
-  Remote::getInstance()->addOptionsToPanes(0,&options,wop);
+  Input::getInstance()->addOptionsToPanes(0,&options,wop);
   Video::getInstance()->addOptionsToPanes(0,&options,wop);
   Audio::getInstance()->addOptionsToPanes(0,&options,wop);
 
     
 /*  WRemoteConfig* wrc = new WRemoteConfig();
   tabbar.addTab(tr("Remote Control"), wrc);*/
-  Remote::getInstance()->addOptionPagesToWTB(&tabbar);
+  Input::getInstance()->addOptionPagesToWTB(&tabbar);
  // panes[1] = wrc;
 
   Video::getInstance()->addOptionPagesToWTB(&tabbar);
@@ -226,7 +226,7 @@ VOpts::VOpts()
   options.push_back(option);
   wop->addOptionLine(option);
 
-  Remote::getInstance()->addOptionsToPanes(1,&options,wop);
+  Input::getInstance()->addOptionsToPanes(1,&options,wop);
   Video::getInstance()->addOptionsToPanes(1,&options,wop);
   Audio::getInstance()->addOptionsToPanes(1,&options,wop);
 
@@ -264,7 +264,7 @@ VOpts::VOpts()
   wop->addOptionLine(option);
 #endif
 
-  Remote::getInstance()->addOptionsToPanes(2,&options,wop);
+  Input::getInstance()->addOptionsToPanes(2,&options,wop);
   Video::getInstance()->addOptionsToPanes(2,&options,wop);
   Audio::getInstance()->addOptionsToPanes(2,&options,wop);
 }
@@ -282,7 +282,7 @@ VOpts::~VOpts()
 int VOpts::handleCommand(int command)
 {
   // either is active, handle back
-  if (command == Remote::BACK)
+  if (command == Input::BACK)
   {
     doSave();
     return 4;
@@ -311,7 +311,7 @@ void VOpts::doSave()
 {
   VDR* vdr = VDR::getInstance();
 
-  Remote::getInstance()->saveOptionstoServer(); //Remote
+  Input::getInstance()->saveOptionstoServer(); //Remote
   Video::getInstance()->saveOptionstoServer(); //Video
   Audio::getInstance()->saveOptionstoServer(); //Remote
 #ifdef VOMP_PLATTFORM_MVP
@@ -511,7 +511,7 @@ void VOpts::processMessage(Message* m)
     } 
     else if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
     {
-      BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
+      BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press
     }
   }
 }
index c1ceef62eb4c87ddf928b6f41b42886e714f6644..89761984e487ea6db17e085cae7a974af72f0b8c 100644 (file)
@@ -21,7 +21,7 @@
 #include "vpicturebanner.h"
 
 #include "wsymbol.h"
-#include "remote.h"
+#include "input.h"
 #include "colour.h"
 #include "video.h"
 #include "vinfo.h"
@@ -109,18 +109,18 @@ void VPictureBanner::processMessage(Message* m)
     int y=(m->parameter&0xFFFF)-getScreenY();
     if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
     {
-      BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
+      BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press
     }
     else if (y>=(int)area.h-24 && y<=(int)area.h-6)
     {
       //y coordinate is right!
       if (x>=7 &&x<=25)
       {
-        BoxStack::getInstance()->handleCommand(Remote::RED); //simulate red press
+        BoxStack::getInstance()->handleCommand(Input::RED); //simulate red press
       }
       else if (x>=110 &&x<=128)
       {
-        BoxStack::getInstance()->handleCommand(Remote::GREEN); //simulate red press
+        BoxStack::getInstance()->handleCommand(Input::GREEN); //simulate red press
       }
     }
   }
index d51e0e519be18a874357e0f68a757929875769cf..81bc1edfe5755ad9c646d991137a153edea9382b 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "vquestion.h"
 
-#include "remote.h"
+#include "input.h"
 #include "boxstack.h"
 #include "colour.h"
 #include "i18n.h"
@@ -81,27 +81,27 @@ int VQuestion::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::DF_LEFT:
-    case Remote::LEFT:
+    case Input::DF_LEFT:
+    case Input::LEFT:
     {
       swap();
       draw();
       BoxStack::getInstance()->update(this);
       return 2;
     }
-    case Remote::DF_RIGHT:
-    case Remote::RIGHT:
+    case Input::DF_RIGHT:
+    case Input::RIGHT:
     {
       swap();
       draw();
       BoxStack::getInstance()->update(this);
       return 2;
     }
-    case Remote::BACK:
+    case Input::BACK:
     {
       return 4;
     }
-    case Remote::OK:
+    case Input::OK:
     {
       if (selectedOption != YES) return 4;
 
@@ -145,11 +145,11 @@ void VQuestion::processMessage(Message* m)
   {
     if (buttonYes.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press
     }
     else if (buttonNo.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press
     }
     else
     {
@@ -158,7 +158,7 @@ void VQuestion::processMessage(Message* m)
       int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
-        BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
+        BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press
       }
     }
   }
index 232564c58a4c0f670f77d2b504e1ef115cf37f65..9b9b5f0db0d63ea7d4f5efc524ea83954fcdb491 100644 (file)
@@ -32,7 +32,7 @@
 #include "timers.h"
 #include "playerradio.h"
 #include "boxstack.h"
-#include "remote.h"
+#include "input.h"
 #include "vinfo.h"
 #include "i18n.h"
 #include "log.h"
@@ -186,82 +186,82 @@ int VRadioRec::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::PLAY:
+    case Input::PLAY:
     {
       player->play();
       doBar(0);
       return 2;
     }
-    case Remote::PLAYPAUSE:
+    case Input::PLAYPAUSE:
     {
        player->playpause();
         doBar(0);
         return 2;
     }
 
-    case Remote::STOP:
-    case Remote::BACK:
-    case Remote::MENU:
+    case Input::STOP:
+    case Input::BACK:
+    case Input::MENU:
     {
       if (playing) stopPlay();
       return 4;
     }
-    case Remote::PAUSE:
+    case Input::PAUSE:
     {
       player->pause();
       doBar(0);
       return 2;
     }
-    case Remote::SKIPFORWARD:
+    case Input::SKIPFORWARD:
     {
       doBar(3);
       player->skipForward(60);
       return 2;
     }
-    case Remote::SKIPBACK:
+    case Input::SKIPBACK:
     {
       doBar(4);
       player->skipBackward(60);
       return 2;
     }
-    case Remote::YELLOW:
+    case Input::YELLOW:
     {
       doBar(2);
       player->skipBackward(10);
       return 2;
     }
-    case Remote::BLUE:
+    case Input::BLUE:
     {
       doBar(1);
       player->skipForward(10);
       return 2;
     }
-    case Remote::OK:
+    case Input::OK:
     {
       if (barShowing) removeBar();
       else doBar(0);
       return 2;
     }
 
-    case Remote::ZERO:  player->jumpToPercent(0);  doBar(0);  return 2;
-    case Remote::ONE:   player->jumpToPercent(10); doBar(0);  return 2;
-    case Remote::TWO:   player->jumpToPercent(20); doBar(0);  return 2;
-    case Remote::THREE: player->jumpToPercent(30); doBar(0);  return 2;
-    case Remote::FOUR:  player->jumpToPercent(40); doBar(0);  return 2;
-    case Remote::FIVE:  player->jumpToPercent(50); doBar(0);  return 2;
-    case Remote::SIX:   player->jumpToPercent(60); doBar(0);  return 2;
-    case Remote::SEVEN: player->jumpToPercent(70); doBar(0);  return 2;
-    case Remote::EIGHT: player->jumpToPercent(80); doBar(0);  return 2;
-    case Remote::NINE:  player->jumpToPercent(90); doBar(0);  return 2;
+    case Input::ZERO:  player->jumpToPercent(0);  doBar(0);  return 2;
+    case Input::ONE:   player->jumpToPercent(10); doBar(0);  return 2;
+    case Input::TWO:   player->jumpToPercent(20); doBar(0);  return 2;
+    case Input::THREE: player->jumpToPercent(30); doBar(0);  return 2;
+    case Input::FOUR:  player->jumpToPercent(40); doBar(0);  return 2;
+    case Input::FIVE:  player->jumpToPercent(50); doBar(0);  return 2;
+    case Input::SIX:   player->jumpToPercent(60); doBar(0);  return 2;
+    case Input::SEVEN: player->jumpToPercent(70); doBar(0);  return 2;
+    case Input::EIGHT: player->jumpToPercent(80); doBar(0);  return 2;
+    case Input::NINE:  player->jumpToPercent(90); doBar(0);  return 2;
 
 #ifdef DEV
-    case Remote::RED:
+    case Input::RED:
     {
       //player->test1();
 
       return 2;
     }
-    case Remote::GREEN:
+    case Input::GREEN:
     {
       //player->test2();
       return 2;
@@ -281,7 +281,7 @@ void VRadioRec::processMessage(Message* m)
     int y=(m->parameter&0xFFFF)-(int)getScreenY();
     if (!barShowing)
     {
-      boxstack->handleCommand(Remote::OK); //simulate rok press
+      boxstack->handleCommand(Input::OK); //simulate rok press
     }
     else if ((int)barRegion.x<=x && (int)barRegion.y<=y && ((int)barRegion.x+(int)barRegion.w)>=x
              &&  ((int)barRegion.y+(int)barRegion.h)>=y)
@@ -303,7 +303,7 @@ void VRadioRec::processMessage(Message* m)
     }
     else
     {
-      boxstack->handleCommand(Remote::OK); //simulate rok press
+      boxstack->handleCommand(Input::OK); //simulate rok press
     }
   }
   else if (m->message == Message::PLAYER_EVENT)
index b84328c9419bb178d7540d9bcec0df5e5c9fb058..361b1bf2031d3fffd1542e1c2d322bf2b5e282c0 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "defines.h"
 #include "recording.h"
-#include "remote.h"
+#include "input.h"
 #include "vinfo.h"
 #include "colour.h"
 #include "video.h"
@@ -109,23 +109,23 @@ int VRecMove::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
       sl.up();
       sl.draw();
       BoxStack::getInstance()->update(this);
       return 2;
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
       sl.down();
       sl.draw();
       BoxStack::getInstance()->update(this);
       return 2;
     }
-    case Remote::OK:
+    case Input::OK:
     {
       Message* m = new Message();
       m->message = Message::MOVE_RECORDING;
@@ -135,7 +135,7 @@ int VRecMove::handleCommand(int command)
 
       return 4;
     }
-    case Remote::BACK:
+    case Input::BACK:
     {
       return 4;
     }
@@ -158,7 +158,7 @@ void VRecMove::processMessage(Message* m)
   {
     if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press
     }
     else
     {
@@ -167,7 +167,7 @@ void VRecMove::processMessage(Message* m)
       int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
-        BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
+        BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press
       }
     }
   }
index 6666c7a2faad57c165c85eef42c4bcd832fe31c5..cb569d9d3327eed6b514f20d0611ae3837c7b539 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "vrecording.h"
 
-#include "remote.h"
+#include "input.h"
 #include "recinfo.h"
 #include "vquestion.h"
 #include "vinfo.h"
@@ -183,31 +183,31 @@ void VRecording::draw()
 
 int VRecording::handleCommand(int command)
 {
-       if (command==Remote::BACK) {
+       if (command==Input::BACK) {
                return 4;
        }
        if (buttons) {
                switch(command)
                {
-               case Remote::DF_UP:
-               case Remote::UP:
+               case Input::DF_UP:
+               case Input::UP:
                {
                        tabbar.activateFocus(false);
                        moveCursor(LEFT);
                        return 2;
                }
 
-               case Remote::DF_DOWN:
-               case Remote::DOWN:
+               case Input::DF_DOWN:
+               case Input::DOWN:
                {
                        tabbar.activateFocus(false);
                        moveCursor(RIGHT);
                        return 2;
                }
-               case Remote::LEFT:
-               case Remote::DF_LEFT:
-               case Remote::RIGHT:
-               case Remote::DF_RIGHT:
+               case Input::LEFT:
+               case Input::DF_LEFT:
+               case Input::RIGHT:
+               case Input::DF_RIGHT:
                {
                        buttons = false;
                        button[selected].setActive(0);
@@ -217,7 +217,7 @@ int VRecording::handleCommand(int command)
                        BoxStack::getInstance()->update(this);
                        return 2;
                }
-               case Remote::OK:
+               case Input::OK:
                {
 
                        if (selected == PLAY)
@@ -336,8 +336,8 @@ int VRecording::handleCommand(int command)
                else if (retval == 2)
                {
                        // command was taken and actively ignored
-                       if (command==Remote::LEFT || command==Remote::DF_LEFT
-                                       || command==Remote::RIGHT || command==Remote::DF_RIGHT)
+                       if (command==Input::LEFT || command==Input::DF_LEFT
+                                       || command==Input::RIGHT || command==Input::DF_RIGHT)
                        {
                                buttons=true;
                                button[selected].setActive(1);
@@ -413,7 +413,7 @@ void VRecording::processMessage(Message* m)
     {
       if (button[i].mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
       {
-        BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
+        BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press
                buttons = true;
         cancel = false;
         break;
@@ -434,7 +434,7 @@ void VRecording::processMessage(Message* m)
       int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
-        BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
+        BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press
       }
     }
   }
index f5a66ada445607f98c089ee608e2b01f4fb8399b..e6834409d4ed6ccb38cfd2ef9f2129753b802270 100644 (file)
@@ -22,7 +22,7 @@
 #include "recman.h"
 #include "directory.h"
 #include "recording.h"
-#include "remote.h"
+#include "input.h"
 #include "wsymbol.h"
 #include "boxstack.h"
 #include "vrecordingmenu.h"
@@ -66,7 +66,7 @@ void VRecordingList::processMessage(Message* m)
   {
     if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      boxstack->handleCommand(Remote::OK); //simulate OK press
+      boxstack->handleCommand(Input::OK); //simulate OK press
     }
     else
     {
@@ -75,7 +75,7 @@ void VRecordingList::processMessage(Message* m)
       int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
-        boxstack->handleCommand(Remote::BACK); //simulate cancel press
+        boxstack->handleCommand(Input::BACK); //simulate cancel press
       }
     }
   }
@@ -321,8 +321,8 @@ int VRecordingList::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
       sl.up();
       quickUpdate();
@@ -330,8 +330,8 @@ int VRecordingList::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
       sl.down();
       quickUpdate();
@@ -339,7 +339,7 @@ int VRecordingList::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::SKIPBACK:
+    case Input::SKIPBACK:
     {
       sl.pageUp();
       quickUpdate();
@@ -347,7 +347,7 @@ int VRecordingList::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::SKIPFORWARD:
+    case Input::SKIPFORWARD:
     {
       sl.pageDown();
       quickUpdate();
@@ -355,7 +355,7 @@ int VRecordingList::handleCommand(int command)
       boxstack->update(this);
       return 2;
     }
-    case Remote::OK:
+    case Input::OK:
     {
       if (sl.getNumOptions() == 0) return 2;
 
@@ -400,7 +400,7 @@ int VRecordingList::handleCommand(int command)
       // should not get to here
       return 1;
     }
-    case Remote::BACK:
+    case Input::BACK:
     {
       if (recman->isSubDir())
       {
@@ -415,15 +415,15 @@ int VRecordingList::handleCommand(int command)
         return 4;
       }
     }
-    case Remote::PLAYPAUSE:
-    case Remote::PLAY:
+    case Input::PLAYPAUSE:
+    case Input::PLAY:
     {
       if (doPlay(true)) return 2;
       return 1;
     }
-    case Remote::LEFT:
-    case Remote::RIGHT:
-    case Remote::ZERO:
+    case Input::LEFT:
+    case Input::RIGHT:
+    case Input::ZERO:
     {
       reSort();
       return 2;
index 9007d8ab923eb10d0f19494f19686a497cc25f2d..b4e990bccb3bec83ce7e03315244266072d8a0fb 100644 (file)
@@ -24,7 +24,7 @@
 #include "directory.h"
 #include "recording.h"
 #include "recinfo.h"
-#include "remote.h"
+#include "input.h"
 #include "wsymbol.h"
 #include "boxstack.h"
 #include "vrecordingmenu.h"
index 4e08a8479af9aa70a90fff7e088c0cbec1b29bbb..7f92a23d05fdeec7c4044d42da16a7333c31b661 100644 (file)
@@ -23,7 +23,7 @@
 #include "recman.h"
 #include "directory.h"
 #include "recording.h"
-#include "remote.h"
+#include "input.h"
 #include "wsymbol.h"
 #include "boxstack.h"
 #include "vrecordingmenu.h"
index 1af32d8d4f2eec2aeab406afc2dd0065f40a17f1..1a10d67855d6c53875c3086cc51e1d4212f81d40 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "vrecordingmenu.h"
 
-#include "remote.h"
+#include "input.h"
 #include "recinfo.h"
 #include "vquestion.h"
 #include "vinfo.h"
@@ -84,23 +84,23 @@ int VRecordingMenu::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
       sl.up();
       sl.draw();
       BoxStack::getInstance()->update(this);
       return 2;
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
       sl.down();
       sl.draw();
       BoxStack::getInstance()->update(this);
       return 2;
     }
-    case Remote::OK:
+    case Input::OK:
     {
       if (sl.getCurrentOptionData() == 1)
       {
@@ -185,7 +185,7 @@ int VRecordingMenu::handleCommand(int command)
 
       [[fallthrough]]; // it won't, as long as sl.getCurrentOptionData() is 1-5, but keep the compiler happy
     }
-    case Remote::BACK:
+    case Input::BACK:
     {
       return 4;
     }
@@ -208,7 +208,7 @@ void VRecordingMenu::processMessage(Message* m)
   {
     if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press
     }
     else
     {
@@ -217,7 +217,7 @@ void VRecordingMenu::processMessage(Message* m)
       int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
-        BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
+        BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press
       }
     }
   }
index fd5d4eaeaec01cb859ca0166088c5a2386360332..6e2e6e36691999696309450687f1a507c30b44b9 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "defines.h"
 #include "log.h"
-#include "remote.h"
+#include "input.h"
 #include "colour.h"
 #include "video.h"
 #include "surface.h"
index bddee345799c6593e0d87a7f95613fffca62faf7..2a7fb396d82e38a693377ff63cfc91b202d02672 100644 (file)
@@ -21,7 +21,7 @@
 #include "vserverselect.h"
 
 #include "defines.h"
-#include "remote.h"
+#include "input.h"
 #include "colour.h"
 #include "video.h"
 #include "boxstack.h"
@@ -77,23 +77,23 @@ int VServerSelect::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
       sl.up();
       sl.draw();
       BoxStack::getInstance()->update(this);
       return 2;
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
       sl.down();
       sl.draw();
       BoxStack::getInstance()->update(this);
       return 2;
     }
-    case Remote::OK:
+    case Input::OK:
     {
       Message* m = new Message(); // Question/Answer mech. Better being messages
       m->to = replyTo;
@@ -121,7 +121,7 @@ void VServerSelect::processMessage(Message* m)
   {
     if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press
     }
   }
 }
index 85c387240c370fbb3e9f33991f8061b5da3aeaed..7402047e7b3179f2ae81e3b612541111bd5011df 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "vsleeptimer.h"
 
-#include "remote.h"
+#include "input.h"
 #include "wsymbol.h"
 #include "colour.h"
 #include "video.h"
@@ -238,7 +238,7 @@ int VSleeptimer::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::GO:
+    case Input::GO:
     {
       displaySleeptimer = Sleeptimer::getInstance()->SetTime();
       draw();
index 975a58afdd0a5681dad2b227bcc6ac224e830170..bc765f652396f44f39f9395af413a2fe967b780b 100644 (file)
@@ -22,7 +22,7 @@
 #include "video.h"
 #include "timers.h"
 #include "boxstack.h"
-#include "remote.h"
+#include "input.h"
 #include "playerlivetv.h"
 
 
@@ -107,21 +107,21 @@ void VTeletextView::draw(bool completedraw, bool onlyfirstline)
 int VTeletextView::handleCommand(int command) {
     if (subtitlemode) return 0; //Ok we are in  subtitle mode, we are a slave of the player
     switch (command) {
-    case Remote::OK:
+    case Input::OK:
         return 2;
-    case Remote::BACK:
+    case Input::BACK:
         if(player) player->tellSubtitlesOSDVisible(false); // Only on liveTV
         return 4;
-    case Remote::ZERO:
-    case Remote::ONE:
-    case Remote::TWO:
-    case Remote::THREE:
-    case Remote::FOUR:
-    case Remote::FIVE:
-    case Remote::SIX:
-    case Remote::SEVEN:
-    case Remote::EIGHT:
-    case Remote::NINE:
+    case Input::ZERO:
+    case Input::ONE:
+    case Input::TWO:
+    case Input::THREE:
+    case Input::FOUR:
+    case Input::FIVE:
+    case Input::SIX:
+    case Input::SEVEN:
+    case Input::EIGHT:
+    case Input::NINE:
     {
       // key in teletext page
       doKey(command);
index b8dd5f686524ad18b8a544881996e7bc428322d0..480c28cf2ff1042d83bcdced41a9db3c30314dfa 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "vtimeredit.h"
 
-#include "remote.h"
+#include "input.h"
 #include "wsymbol.h"
 #include "boxstack.h"
 #include "vdr.h"
@@ -170,23 +170,23 @@ int VTimerEdit::handleCommand(int command)
   switch(command)
   {
     /*
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
 
       ViewMan::getInstance()->updateView(this);
       return 2;
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
 
       ViewMan::getInstance()->updateView(this);
       return 2;
     }
     */
-    case Remote::LEFT:
-    case Remote::DF_RIGHT:
+    case Input::LEFT:
+    case Input::DF_RIGHT:
     {
       swap();
       buttonBack.draw();
@@ -194,8 +194,8 @@ int VTimerEdit::handleCommand(int command)
       BoxStack::getInstance()->update(this);
       return 2;
     }
-    case Remote::RIGHT:
-    case Remote::DF_LEFT:
+    case Input::RIGHT:
+    case Input::DF_LEFT:
     {
       swap();
       buttonBack.draw();
@@ -203,7 +203,7 @@ int VTimerEdit::handleCommand(int command)
       BoxStack::getInstance()->update(this);
       return 2;
     }
-    case Remote::OK:
+    case Input::OK:
     {
       // Back
       if (selectedButton == 0) return 4;
@@ -226,7 +226,7 @@ int VTimerEdit::handleCommand(int command)
       BoxStack::getInstance()->update(v);
       return 2;
     }
-    case Remote::BACK:
+    case Input::BACK:
     {
       return 4;
     }
@@ -257,7 +257,7 @@ void VTimerEdit::processMessage(Message* m)
 
   } else if (m->message == Message::MOUSE_LBDOWN)
   {
-    BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
+    BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press
   }
   else if (m->message == Message::QUESTION_YES)
   {
index 2a4f65da676ce01b571a602a5a10851c831d969a..5f4e75e2ea575f8ea3bbfcf143e6a89ea4c5872b 100644 (file)
@@ -21,7 +21,7 @@
 #include "vtimerlist.h"
 
 #include "message.h"
-#include "remote.h"
+#include "input.h"
 #include "wsymbol.h"
 #include "colour.h"
 #include "video.h"
@@ -265,37 +265,37 @@ int VTimerList::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
       sl.up();
       quickUpdate();
       BoxStack::getInstance()->update(this);
       return 2;
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
       sl.down();
       quickUpdate();
       BoxStack::getInstance()->update(this);
       return 2;
     }
-    case Remote::SKIPBACK:
+    case Input::SKIPBACK:
     {
       sl.pageUp();
       quickUpdate();
       BoxStack::getInstance()->update(this);
       return 2;
     }
-    case Remote::SKIPFORWARD:
+    case Input::SKIPFORWARD:
     {
       sl.pageDown();
       quickUpdate();
       BoxStack::getInstance()->update(this);
       return 2;
     }
-    case Remote::OK:
+    case Input::OK:
     {
       RecTimer* recTimer = NULL;
       if (recTimerList) recTimer = (RecTimer*)sl.getCurrentOptionData();
@@ -309,7 +309,7 @@ int VTimerList::handleCommand(int command)
 
       return 2;
     }
-    case Remote::BACK:
+    case Input::BACK:
     {
       return 4;
     }
@@ -332,7 +332,7 @@ void VTimerList::processMessage(Message* m)
   {
     if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press
     }
     else
     {
@@ -341,7 +341,7 @@ void VTimerList::processMessage(Message* m)
       int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
-        BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
+        BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press
       }
     }
   }
index 48a5b71c820c66e0d9fb1b75261eda287fa59e53..29abae01a9cda33709310ee82277a0a3d629e800 100644 (file)
@@ -32,7 +32,7 @@
 #include "command.h"
 #include "i18n.h"
 #include "wtextbox.h"
-#include "remote.h"
+#include "input.h"
 #include "vaudioselector.h"
 #include "colour.h"
 #include "event.h"
@@ -304,7 +304,7 @@ int VVideoLiveTV::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::BACK:
+    case Input::BACK:
     {
       if (osd.getVisible() && !textUnavailable.getVisible())
       {
@@ -314,7 +314,7 @@ int VVideoLiveTV::handleCommand(int command)
       // else drop through to stop
     }
     [[fallthrough]];
-    case Remote::STOP:
+    case Input::STOP:
     {
       stop();
       vchannelList->highlightChannel((*chanList)[currentChannelIndex]);
@@ -322,9 +322,9 @@ int VVideoLiveTV::handleCommand(int command)
     }
     
     // NEW REMOTE ONLY - navigate EPG, bring it onscreen if it's not there
-    case Remote::UP:
+    case Input::UP:
     {
-      if (Remote::getInstance()->mayHaveFewButtons())
+      if (Input::getInstance()->mayHaveFewButtons())
       {
         if (okTriggeredOSD) doUpDown(false);
         else doChanUpDown(UP);
@@ -335,9 +335,9 @@ int VVideoLiveTV::handleCommand(int command)
       }
       return 2;
     }
-    case Remote::DOWN:
+    case Input::DOWN:
     {
-      if (Remote::getInstance()->mayHaveFewButtons())
+      if (Input::getInstance()->mayHaveFewButtons())
       {
         if (okTriggeredOSD) doUpDown(true);
         else doChanUpDown(DOWN);
@@ -348,23 +348,23 @@ int VVideoLiveTV::handleCommand(int command)
       }
       return 2;
     }
-    case Remote::LEFT:
+    case Input::LEFT:
     {
       doLeftRight(false);
       return 2;
     }
-    case Remote::RIGHT:
+    case Input::RIGHT:
     {
       doLeftRight(true);
       return 2;
     }
     // Continue new remote only...
-    case Remote::CHANNELUP:
+    case Input::CHANNELUP:
     {
       doChanUpDown(UP);
       return 2;
     }
-    case Remote::CHANNELDOWN:
+    case Input::CHANNELDOWN:
     {
       doChanUpDown(DOWN);
       return 2;
@@ -379,14 +379,14 @@ int VVideoLiveTV::handleCommand(int command)
     // OK was pressed - osd shown manually, use up/down for epg nav
     // UP/DOWN was pressed to change channel, osd was shown auto, use up/down for ch+/ch-
     
-    case Remote::DF_UP:
+    case Input::DF_UP:
     {
       // Old remote, decide what to do based on okTriggeredOSD
       if (okTriggeredOSD) doUpDown(false);
       else doChanUpDown(UP);
       return 2;
     }
-    case Remote::DF_DOWN:
+    case Input::DF_DOWN:
     {
       // Old remote, decide what to do based on okTriggeredOSD
       if (okTriggeredOSD) doUpDown(true);
@@ -396,53 +396,53 @@ int VVideoLiveTV::handleCommand(int command)
 
     // END NEW/OLD REMOTE STUFF
 
-    case Remote::PREVCHANNEL:
+    case Input::PREVCHANNEL:
     {
       channelChange(PREVIOUS, 0);
       osdChannelIndex = currentChannelIndex;
       displayOSD(true);
       return 2;
     }
-    case Remote::OK:
+    case Input::OK:
     {
       doOK();
       return 2;
     }
-    case Remote::RED:
-    case Remote::MENU:
+    case Input::RED:
+    case Input::MENU:
     {
       doSummary();
       return 2;
     }
-    case Remote::FULL:
-    case Remote::TV:
+    case Input::FULL:
+    case Input::TV:
     {
       toggleChopSides();
       return 2;
     }
 
-    case Remote::ZERO:
-    case Remote::ONE:
-    case Remote::TWO:
-    case Remote::THREE:
-    case Remote::FOUR:
-    case Remote::FIVE:
-    case Remote::SIX:
-    case Remote::SEVEN:
-    case Remote::EIGHT:
-    case Remote::NINE:
+    case Input::ZERO:
+    case Input::ONE:
+    case Input::TWO:
+    case Input::THREE:
+    case Input::FOUR:
+    case Input::FIVE:
+    case Input::SIX:
+    case Input::SEVEN:
+    case Input::EIGHT:
+    case Input::NINE:
     {
       // key in channel number
       doKey(command);
       return 2;
     }
 
-    case Remote::GREEN:
+    case Input::GREEN:
     {
       if (streamType == VDR::VIDEO) doAudioSelector();
       return 2;   
     }
-    case Remote::YELLOW:
+    case Input::YELLOW:
     {
       if (streamType ==VDR::VIDEO) 
       {
@@ -450,13 +450,13 @@ int VVideoLiveTV::handleCommand(int command)
       }
       return 2;
     }
-    case Remote::GUIDE:
-    case Remote::BLUE:
+    case Input::GUIDE:
+    case Input::BLUE:
     {
       doEPG();
       return 2;
     }
-    case Remote::RECORD:
+    case Input::RECORD:
       if (streamType == VDR::VIDEO)
         (static_cast<PlayerLiveTV*>(player))->toggleSubtitles();
       return 2;
@@ -1033,30 +1033,30 @@ void VVideoLiveTV::processMessage(Message* m)
         if ((boxRed.getX()<=x) && (boxRed.getX()+(int)boxRed.getWidth()>=x ) &&
             (boxRed.getY()<=y) && (boxRed.getY()+(int)boxRed.getHeight()>=y ))
         {
-          BoxStack::getInstance()->handleCommand(Remote::RED);
+          BoxStack::getInstance()->handleCommand(Input::RED);
         }
         else if ((boxGreen.getX()<=x) && (boxGreen.getX()+(int)boxGreen.getWidth()>=x ) &&
                  (boxGreen.getY()<=y) && (boxGreen.getY()+(int)boxGreen.getHeight()>=y))
         {
-          BoxStack::getInstance()->handleCommand(Remote::GREEN);
+          BoxStack::getInstance()->handleCommand(Input::GREEN);
         }
         else if ((boxYellow.getX()<=x) && (boxYellow.getX()+(int)boxYellow.getWidth()>=x ) &&
                  (boxYellow.getY()<=y) && (boxYellow.getY()+(int)boxYellow.getHeight()>=y )){
-          BoxStack::getInstance()->handleCommand(Remote::YELLOW);
+          BoxStack::getInstance()->handleCommand(Input::YELLOW);
         }
         else if ((boxBlue.getX()<=x) && (boxBlue.getX()+(int)boxBlue.getWidth()>=x ) &&
                  (boxBlue.getY()<=y) && (boxBlue.getY()+(int)boxBlue.getHeight()>=y ))
         {
-          BoxStack::getInstance()->handleCommand(Remote::BLUE);
+          BoxStack::getInstance()->handleCommand(Input::BLUE);
         }
         else
         {
-          BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press
+          BoxStack::getInstance()->handleCommand(Input::OK); //simulate rok press
         }
     }
     else
     {
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate rok press
     }
   }
   else if (m->message == Message::CHANNEL_CHANGE)
index c91cda056fa71310897e20b272b072ed7eaac3e8..d6154f894ccf53203d75bb63ee289b8eb2b47f2a 100644 (file)
@@ -32,7 +32,7 @@
 #include "recording.h"
 #include "vaudioselector.h"
 #include "message.h"
-#include "remote.h"
+#include "input.h"
 #include "boxstack.h"
 #include "vinfo.h"
 #include "i18n.h"
@@ -202,14 +202,14 @@ int VVideoMedia::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::PLAY:
+    case Input::PLAY:
     {
       player->play();
       doBar(0);
       return 2;
     }
 
-    case Remote::BACK:
+    case Input::BACK:
     {
       if (vsummary)
       {
@@ -217,86 +217,86 @@ int VVideoMedia::handleCommand(int command)
         return 2;
       }
     } // DROP THROUGH
-    case Remote::STOP:
-    case Remote::MENU:
+    case Input::STOP:
+    case Input::MENU:
     {
       if (playing) stopPlay();
 
       return 4;
     }
-    case Remote::PAUSE:
+    case Input::PAUSE:
     {
       player->pause();
       doBar(0);
       return 2;
     }
-    case Remote::SKIPFORWARD:
+    case Input::SKIPFORWARD:
     {
       doBar(3);
       player->skipForward(60);
       return 2;
     }
-    case Remote::SKIPBACK:
+    case Input::SKIPBACK:
     {
       doBar(4);
       player->skipBackward(60);
       return 2;
     }
-    case Remote::FORWARD:
+    case Input::FORWARD:
     {
       player->fastForward();
       doBar(0);
       return 2;
     }
-    case Remote::REVERSE:
+    case Input::REVERSE:
     {
       player->fastBackward();
       doBar(0);
       return 2;
     }
-    case Remote::RED:
+    case Input::RED:
     {
       if (vsummary) removeSummary();
       else doSummary();
       return 2;
     }
-    case Remote::GREEN:
+    case Input::GREEN:
     {
       doAudioSelector();
       return 2;
     }
-    case Remote::YELLOW:
+    case Input::YELLOW:
     {
       doBar(2);
       player->skipBackward(10);
       return 2;
     }
-    case Remote::BLUE:
+    case Input::BLUE:
     {
       doBar(1);
       player->skipForward(10);
       return 2;
     }
-    case Remote::STAR:
+    case Input::STAR:
     {
       doBar(2);
       player->skipBackward(10);
       return 2;
     }
-    case Remote::HASH:
+    case Input::HASH:
     {
       doBar(1);
       player->skipForward(10);
       return 2;
     }
-    case Remote::FULL:
-    case Remote::TV:
+    case Input::FULL:
+    case Input::TV:
     {
       toggleChopSides();
       return 2;
     }
 
-    case Remote::OK:
+    case Input::OK:
     {
       if (vsummary)
       {
@@ -312,16 +312,16 @@ int VVideoMedia::handleCommand(int command)
       return 2;
     }
 
-    case Remote::ZERO:  player->jumpToPercent(0);  doBar(0);  return 2;
-    case Remote::ONE:   player->jumpToPercent(10); doBar(0);  return 2;
-    case Remote::TWO:   player->jumpToPercent(20); doBar(0);  return 2;
-    case Remote::THREE: player->jumpToPercent(30); doBar(0);  return 2;
-    case Remote::FOUR:  player->jumpToPercent(40); doBar(0);  return 2;
-    case Remote::FIVE:  player->jumpToPercent(50); doBar(0);  return 2;
-    case Remote::SIX:   player->jumpToPercent(60); doBar(0);  return 2;
-    case Remote::SEVEN: player->jumpToPercent(70); doBar(0);  return 2;
-    case Remote::EIGHT: player->jumpToPercent(80); doBar(0);  return 2;
-    case Remote::NINE:  player->jumpToPercent(90); doBar(0);  return 2;
+    case Input::ZERO:  player->jumpToPercent(0);  doBar(0);  return 2;
+    case Input::ONE:   player->jumpToPercent(10); doBar(0);  return 2;
+    case Input::TWO:   player->jumpToPercent(20); doBar(0);  return 2;
+    case Input::THREE: player->jumpToPercent(30); doBar(0);  return 2;
+    case Input::FOUR:  player->jumpToPercent(40); doBar(0);  return 2;
+    case Input::FIVE:  player->jumpToPercent(50); doBar(0);  return 2;
+    case Input::SIX:   player->jumpToPercent(60); doBar(0);  return 2;
+    case Input::SEVEN: player->jumpToPercent(70); doBar(0);  return 2;
+    case Input::EIGHT: player->jumpToPercent(80); doBar(0);  return 2;
+    case Input::NINE:  player->jumpToPercent(90); doBar(0);  return 2;
 
 
   }
@@ -340,7 +340,7 @@ void VVideoMedia::processMessage(Message* m)
 
     if (!barShowing)
     {
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate rok press
     }
     else if (barRegion.x<=x && barRegion.y<=y && (barRegion.x+barRegion.w)>=x && (barRegion.y+barRegion.h)>=y)
     {
@@ -361,7 +361,7 @@ void VVideoMedia::processMessage(Message* m)
     }
     else
     {
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate rok press
     }
   }
   else if (m->message == Message::PLAYER_EVENT)
index 5b15739a8372f7b3f08aa572d2e8be617e42e40c..43e4b7bd398e9533a795b7f1f798f4e42e5d8784 100644 (file)
@@ -30,7 +30,7 @@
 #include "recording.h"
 #include "vaudioselector.h"
 #include "message.h"
-#include "remote.h"
+#include "input.h"
 #include "boxstack.h"
 #include "vinfo.h"
 #include "i18n.h"
@@ -223,22 +223,22 @@ int VVideoRec::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::UP:
-    case Remote::PLAY:
+    case Input::UP:
+    case Input::PLAY:
     {
       player->play();
       doBar(0);
       return 2;
     }
 
-    case Remote::PLAYPAUSE:
+    case Input::PLAYPAUSE:
     {
        player->playpause();
         doBar(0);
         return 2;
     }
 
-    case Remote::BACK:
+    case Input::BACK:
     {
       if (vsummary)
       {
@@ -247,58 +247,58 @@ int VVideoRec::handleCommand(int command)
       }
     }
     [[fallthrough]];
-    case Remote::STOP:
-    case Remote::MENU:
+    case Input::STOP:
+    case Input::MENU:
     {
       if (playing) stopPlay();
 
       return 4;
     }
-    case Remote::DOWN:
-    case Remote::PAUSE:
+    case Input::DOWN:
+    case Input::PAUSE:
     {
       player->pause();
       doBar(0);
       return 2;
     }
-    case Remote::SKIPFORWARD:
+    case Input::SKIPFORWARD:
     {
       doBar(3);
       player->skipForward(60);
       return 2;
     }
-    case Remote::SKIPBACK:
+    case Input::SKIPBACK:
     {
       doBar(4);
       player->skipBackward(60);
       return 2;
     }
-    case Remote::RIGHT:
-    case Remote::FORWARD:
+    case Input::RIGHT:
+    case Input::FORWARD:
     {
       player->fastForward();
       doBar(0);
       return 2;
     }
-    case Remote::LEFT:
-    case Remote::REVERSE:
+    case Input::LEFT:
+    case Input::REVERSE:
     {
       player->fastBackward();
       doBar(0);
       return 2;
     }
-    case Remote::RED:
+    case Input::RED:
     {
       if (vsummary) removeSummary();
       else doSummary();
       return 2;
     }
-    case Remote::GREEN:
+    case Input::GREEN:
     {
       doAudioSelector();
       return 2;
     }
-    case Remote::YELLOW:
+    case Input::YELLOW:
     {
       if (myRec->hasMarks())
       {
@@ -322,7 +322,7 @@ int VVideoRec::handleCommand(int command)
       }
       return 2;
     }
-    case Remote::BLUE:
+    case Input::BLUE:
     {
       if (myRec->hasMarks())
       {
@@ -346,31 +346,31 @@ int VVideoRec::handleCommand(int command)
       }
       return 2;
     }
-    case Remote::PREVCHANNEL:
+    case Input::PREVCHANNEL:
     {
       player->skipBackward(2);
       return 2;
     }
-    case Remote::STAR:
+    case Input::STAR:
     {
       doBar(2);
       player->skipBackward(10);
       return 2;
     }
-    case Remote::HASH:
+    case Input::HASH:
     {
       doBar(1);
       player->skipForward(10);
       return 2;
     }
-    case Remote::FULL:
-    case Remote::TV:
+    case Input::FULL:
+    case Input::TV:
     {
       toggleChopSides();
       return 2;
     }
 
-    case Remote::OK:
+    case Input::OK:
     {
       if (vsummary)
       {
@@ -383,20 +383,20 @@ int VVideoRec::handleCommand(int command)
       return 2;
     }
 
-    case Remote::ZERO:  player->jumpToPercent(0);  doBar(0);  return 2;
-    case Remote::ONE:   player->jumpToPercent(10); doBar(0);  return 2;
-    case Remote::TWO:   player->jumpToPercent(20); doBar(0);  return 2;
-    case Remote::THREE: player->jumpToPercent(30); doBar(0);  return 2;
-    case Remote::FOUR:  player->jumpToPercent(40); doBar(0);  return 2;
-    case Remote::FIVE:  player->jumpToPercent(50); doBar(0);  return 2;
-    case Remote::SIX:   player->jumpToPercent(60); doBar(0);  return 2;
-    case Remote::SEVEN: player->jumpToPercent(70); doBar(0);  return 2;
-    case Remote::EIGHT: player->jumpToPercent(80); doBar(0);  return 2;
-    case Remote::NINE:  player->jumpToPercent(90); doBar(0);  return 2;
-
-    case Remote::RECORD: player->toggleSubtitles(); return 2;
+    case Input::ZERO:  player->jumpToPercent(0);  doBar(0);  return 2;
+    case Input::ONE:   player->jumpToPercent(10); doBar(0);  return 2;
+    case Input::TWO:   player->jumpToPercent(20); doBar(0);  return 2;
+    case Input::THREE: player->jumpToPercent(30); doBar(0);  return 2;
+    case Input::FOUR:  player->jumpToPercent(40); doBar(0);  return 2;
+    case Input::FIVE:  player->jumpToPercent(50); doBar(0);  return 2;
+    case Input::SIX:   player->jumpToPercent(60); doBar(0);  return 2;
+    case Input::SEVEN: player->jumpToPercent(70); doBar(0);  return 2;
+    case Input::EIGHT: player->jumpToPercent(80); doBar(0);  return 2;
+    case Input::NINE:  player->jumpToPercent(90); doBar(0);  return 2;
+
+    case Input::RECORD: player->toggleSubtitles(); return 2;
 #ifdef DEV
-//    case Remote::RED:
+//    case Input::RED:
 //    {
       //Don't use RED for anything. It will eventually be recording summary
 
@@ -458,7 +458,7 @@ void VVideoRec::processMessage(Message* m)
 
     if (!barShowing)
     {
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate rok press
     }
     else if (barRegion.x<=x && barRegion.y<=y && (barRegion.x+barRegion.w)>=x && (barRegion.y+barRegion.h)>=y)
     {
@@ -516,7 +516,7 @@ void VVideoRec::processMessage(Message* m)
     }
     else
     {
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate rok press
     }
   }
   else if (m->from == player)
index bf9dce1e5cc89ef9e8cccd47cc49066b755a99b8..eef3899dc65cb9bb48587aaf5e09ac3163abd1a5 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "vvolume.h"
 
-#include "remote.h"
+#include "input.h"
 #include "audio.h"
 #include "wsymbol.h"
 #include "colour.h"
@@ -95,8 +95,8 @@ int VVolume::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::DF_LEFT:
-    case Remote::VOLUMEDOWN:
+    case Input::DF_LEFT:
+    case Input::VOLUMEDOWN:
     {
       displayVolume = Audio::getInstance()->volumeDown();
       draw();
@@ -104,8 +104,8 @@ int VVolume::handleCommand(int command)
       // handled
       return 2;
     }
-    case Remote::DF_RIGHT:
-    case Remote::VOLUMEUP:
+    case Input::DF_RIGHT:
+    case Input::VOLUMEUP:
     {
       displayVolume = Audio::getInstance()->volumeUp();
       draw();
index 5ce34fd79fa457a8e04a6792ae4d388b47f68d80..4e0f1e148a73bd94fc2a2491b078d2984bd5e75a 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "vwelcome.h"
 
-#include "remote.h"
+#include "input.h"
 #include "vdr.h"
 #include "vchannellist.h"
 #include "vrecordinglistclassic.h"
@@ -187,60 +187,60 @@ int VWelcome::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
       sl.up();
       sl.draw();
       boxstack->update(this);
       return 2;
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
       sl.down();
       sl.draw();
       boxstack->update(this);
       return 2;
     }
-    case Remote::ONE:
+    case Input::ONE:
     {
       doChannelsList();
       return 2;
     }
-    case Remote::TWO:
+    case Input::TWO:
     {
       doRadioList();
       return 2;
     }
-    case Remote::THREE:
+    case Input::THREE:
     {
       doRecordingsList();
       return 2;
     }
-    case Remote::FOUR:
+    case Input::FOUR:
     {
       doTimersList();
       return 2;
     }
-    case Remote::FIVE:
+    case Input::FIVE:
     {
 #ifdef VOMP_PLATTFORM_MVP
       doMediaList();
 #endif
       return 2;
     }
-    case Remote::SIX:
+    case Input::SIX:
     {
       doOptions();
       return 2;
     }
-    case Remote::SEVEN:
+    case Input::SEVEN:
     {
       Command::getInstance()->doReboot();
       return 2;
     }
-    case Remote::OK:
+    case Input::OK:
     {
       ULONG option = sl.getCurrentOptionData();
       if (option == 1)
@@ -281,7 +281,7 @@ int VWelcome::handleCommand(int command)
       return 2; // never gets here
     }
 //#ifdef DEV
-    case Remote::NINE:
+    case Input::NINE:
     {
       VScreensaver* vscreensaver = new VScreensaver();
       boxstack->add(vscreensaver);
@@ -293,7 +293,7 @@ int VWelcome::handleCommand(int command)
 //#endif
 
     // Test
-//    case Remote::BACK:
+//    case Input::BACK:
 //    {
 //      return 4;
 //    }
@@ -407,7 +407,7 @@ void VWelcome::processMessage(Message* m)
   {
     if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      boxstack->handleCommand(Remote::OK); //simulate OK press
+      boxstack->handleCommand(Input::OK); //simulate OK press
     }
   }
 }
index 8f1ad64c29ff07031016c51e2ad6a83bef118543..7b1c0e28ed48f1314a51afeceedd2dc031c6527a 100644 (file)
@@ -564,7 +564,7 @@ LONG FAR PASCAL WindowProc(HWND wind, UINT msg, WPARAM wparam, LPARAM lparam)
      //TODO: call command
      logger->log("Core", Log::NOTICE, "Window closed, shutting down...");
 
-     ((RemoteWin*)Remote::getInstance())->SendPower();
+     ((RemoteWin*)Input::getInstance())->SendPower();
      PostQuitMessage(0);
   }break;
    case WM_SIZING: {
index d2b053b09d82fc1a9a3b04f03cefdbaad3d28f06..c2cdd62a6ace41fba229fe91e63d3f0496761ea9 100644 (file)
@@ -24,7 +24,7 @@
 #include "woptionbox.h"
 #include "log.h"
 #include "vdr.h"
-#include "remote.h"
+#include "input.h"
 #include "option.h"
 
 WOptionPane::WOptionPane()
@@ -120,8 +120,8 @@ int WOptionPane::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
       if (selectedOption > 0)
       {
@@ -142,8 +142,8 @@ int WOptionPane::handleCommand(int command)
         return 1;
       }
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
       if (selectedOption < (numOptions - 1))
       {
@@ -159,19 +159,19 @@ int WOptionPane::handleCommand(int command)
         return 4; // Signal return control to parent
       }
     }
-    case Remote::DF_LEFT:
-    case Remote::LEFT:
+    case Input::DF_LEFT:
+    case Input::LEFT:
     {
       optionBoxes[selectedOption]->left();
       return 1;
     }
-    case Remote::DF_RIGHT:
-    case Remote::RIGHT:
+    case Input::DF_RIGHT:
+    case Input::RIGHT:
     {
       optionBoxes[selectedOption]->right();
       return 1;
     }
-    case Remote::OK:
+    case Input::OK:
     {
       optionBoxes[selectedOption]->cycle();
       return 1;
index 50be37c9bdefddc5355b9dd12dcc678e50b62cb5..8a0bc439f6c633887bd3147b4e46624c958dbe91 100644 (file)
@@ -22,7 +22,7 @@
 #include "wpictureview.h"
 
 #include "colour.h"
-#include "remote.h"
+#include "input.h"
 #include "osd.h"
 #include "movieinfo.h"
 #include "seriesinfo.h"
@@ -151,8 +151,8 @@ int WPictureView::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
       if (cur_scroll_line > 0)
       {
@@ -165,8 +165,8 @@ int WPictureView::handleCommand(int command)
          return 4; // Signal return control to parent
       }
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
        if (rem_scroll_line > 0)
        {
@@ -177,10 +177,10 @@ int WPictureView::handleCommand(int command)
                return 4;
        }
     }
-    case Remote::LEFT:
-    case Remote::RIGHT:
-    case Remote::DF_LEFT:
-    case Remote::DF_RIGHT:
+    case Input::LEFT:
+    case Input::RIGHT:
+    case Input::DF_LEFT:
+    case Input::DF_RIGHT:
     {
        return 5;
     }
index 0d4497a209b820e7b5933e7884162ec29fc92b1f..cb8ddd93d9eb6253990d7f6a7c4b70e1d5cd8708 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "wremoteconfig.h"
 
-#include "remote.h"
+#include "input.h"
 #include "wsymbol.h"
 #include "colour.h"
 #include "i18n.h"
@@ -27,7 +27,7 @@
 
 WRemoteConfig::WRemoteConfig()
 {
-  remote = Remote::getInstance();
+  remote = Input::getInstance();
   learnmode = false;
   active = false;
 
@@ -102,7 +102,7 @@ bool WRemoteConfig::mouseLBDOWN(int x, int y)
 {
     if (sl.mouseLBDOWN(x,y))
     {
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press
       return true;
     }
     return false;
@@ -136,7 +136,7 @@ void WRemoteConfig::processMessage(Message* m)
   {
     if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      ViewMan::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      ViewMan::getInstance()->handleCommand(Input::OK); //simulate OK press
     }
     else
     {
@@ -145,7 +145,7 @@ void WRemoteConfig::processMessage(Message* m)
       int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>getWidth() || y>getHeight())
       {
-        ViewMan::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
+        ViewMan::getInstance()->handleCommand(Input::BACK); //simulate cancel press
       }
     }
   }
@@ -169,7 +169,7 @@ int WRemoteConfig::handleCommand(int command)
   if (learnmode)
   {
     learnmode = false;
-    if (command == Remote::NA_LEARN)
+    if (command == Input::NA_LEARN)
     {
       initSelectList(false);
     }
@@ -177,8 +177,8 @@ int WRemoteConfig::handleCommand(int command)
   }
   switch(command)
   {
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
       if (sl.getCurrentOption() != 0)
       {
@@ -192,8 +192,8 @@ int WRemoteConfig::handleCommand(int command)
         return 4; // return control to vopts
       }
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
       if (!active)
       {
@@ -206,23 +206,23 @@ int WRemoteConfig::handleCommand(int command)
       }
       return 1;
     }
-    case Remote::SKIPBACK:
+    case Input::SKIPBACK:
     {
       sl.pageUp();
       return 1;
     }
-    case Remote::SKIPFORWARD:
+    case Input::SKIPFORWARD:
     {
       sl.pageDown();
       return 1;
     }
-    case Remote::OK:
+    case Input::OK:
     {
       learnmode = true;
       remote->EnterLearningMode(sl.getCurrentOptionData());
       return 1;
     }
-    case Remote::BACK:
+    case Input::BACK:
     {
       return 0;
 /*
@@ -241,7 +241,7 @@ int WRemoteConfig::handleCommand(int command)
       return 2;
 */      
     }
-    case Remote::MENU:
+    case Input::MENU:
     {
       remote->ResetToDefault();
       initSelectList(false);
index a3caa4c4f351bbf6b559e6c0869203331df3da99..78006b7e9982af669c5b4b8092e4ab3061443274 100644 (file)
@@ -24,7 +24,7 @@
 #include "boxx.h"
 #include "wselectlist.h"
 
-class Remote;
+class Input;
 class Message;
 
 class WRemoteConfig : public Boxx
@@ -42,7 +42,7 @@ class WRemoteConfig : public Boxx
 
   private:
     WSelectList sl;
-    Remote *remote;
+    Input* remote;
     bool learnmode;
     void initSelectList(bool startup);
     bool active;
index dae739081dc0505d66d2553ada5f519622d67107..dd3315e1c2f06b8c652e72f9a1262dd4ebab1c11 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "wtabbar.h"
 #include "surface.h"
-#include "remote.h"
+#include "input.h"
 #include "wbutton.h"
 #include "colour.h"
 
@@ -144,24 +144,24 @@ int WTabBar::handleCommand(int command)
   {
     switch(command)
     {
-      case Remote::DF_LEFT:
-      case Remote::LEFT:
+      case Input::DF_LEFT:
+      case Input::LEFT:
       {
         if (!left()) return 2;
         draw();
         return 1;
       }
-      case Remote::DF_RIGHT:
-      case Remote::RIGHT:
+      case Input::DF_RIGHT:
+      case Input::RIGHT:
       {
         if (!right()) return 2;
         draw();
         return 1;
       }
-      case Remote::UP:
-      case Remote::DF_UP:
-      case Remote::DOWN:
-      case Remote::DF_DOWN:
+      case Input::UP:
+      case Input::DF_UP:
+      case Input::DOWN:
+      case Input::DF_DOWN:
       {
         int handleResult = tabs[visiblePane].pane->handleCommand(command);
         // A WOptionPane will accept control being passed into it from inactive, up or down (== 1).
index a57bfdb0772116611fbebca2e07a4eaa54439c74..0d1f90e6a165c8a9b4ac6d88cd8ec4c56a698189 100644 (file)
@@ -21,7 +21,7 @@
 #include "wtextbox.h"
 
 #include "colour.h"
-#include "remote.h"
+#include "input.h"
 
 WTextbox::WTextbox(const char* ttext):
 foreColour(DrawStyle::LIGHTTEXT)
@@ -86,8 +86,8 @@ int WTextbox::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
       if (cur_scroll_line > 0)
       {
@@ -100,8 +100,8 @@ int WTextbox::handleCommand(int command)
          return 4; // Signal return control to parent
       }
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
        if (rem_scroll_line > 0)
        {
@@ -112,10 +112,10 @@ int WTextbox::handleCommand(int command)
                return 4;
        }
     }
-    case Remote::LEFT:
-    case Remote::RIGHT:
-    case Remote::DF_LEFT:
-    case Remote::DF_RIGHT:
+    case Input::LEFT:
+    case Input::RIGHT:
+    case Input::DF_LEFT:
+    case Input::DF_RIGHT:
     {
        return 5;
     }
index 19a2cd6c474bcf942eb09f1db37c50be195ed988..c7599028af21cfcf9675755137b1c44b1036dbc2 100644 (file)
@@ -20,7 +20,7 @@
 #include "wwinaudiofilter.h"
 #include "audiowin.h"
 #include "i18n.h"
-#include "remote.h"
+#include "input.h"
 #include "boxstack.h"
 
 WWinAudioFilter::WWinAudioFilter()
@@ -112,7 +112,7 @@ bool WWinAudioFilter::mouseLBDOWN(int x, int y)
 {
     if (sl.mouseLBDOWN(x,y))
     {
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press
       return true;
     }
     return false;
@@ -147,7 +147,7 @@ void WWinAudioFilter::processMessage(Message* m)
   {
     if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      ViewMan::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      ViewMan::getInstance()->handleCommand(Input::OK); //simulate OK press
     }
     else
     {
@@ -156,7 +156,7 @@ void WWinAudioFilter::processMessage(Message* m)
       int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>getWidth() || y>getHeight())
       {
-        ViewMan::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
+        ViewMan::getInstance()->handleCommand(Input::BACK); //simulate cancel press
       }
     }
   }
@@ -180,8 +180,8 @@ int WWinAudioFilter::handleCommand(int command)
   
   switch(command)
   {
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
       if (sl.getCurrentOption() != 0)
       {
@@ -195,34 +195,34 @@ int WWinAudioFilter::handleCommand(int command)
           return 4; //Control to vopts control
       }
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
       Log::getInstance()->log("P", Log::DEBUG, "1");
       sl.down();
       sl.setShowSelOption(true);
       return 1;
     }
-    case Remote::SKIPBACK:
+    case Input::SKIPBACK:
     {
       sl.pageUp();
       sl.draw();
       return 1;
     }
-    case Remote::SKIPFORWARD:
+    case Input::SKIPFORWARD:
     {
       sl.pageDown();
       sl.draw();
       return 1;
     }
-    case Remote::OK:
+    case Input::OK:
     {
       AudioWin*aw=(AudioWin*)Audio::getInstance();
       aw->selectAudioFilter(sl.getCurrentOptionData());
      
       return 1;
     }
-    case Remote::BACK:
+    case Input::BACK:
     {
       return 0;
       
index 50392c3ac105ef7f760d22dc2bda658e225bfd66..85f5644a4f6675f70076e0cc1c14f47101eff094 100644 (file)
@@ -20,7 +20,7 @@
 #include "wwinmp3audiofilter.h"
 #include "audiowin.h"
 #include "i18n.h"
-#include "remote.h"
+#include "input.h"
 #include "boxstack.h"
 
 WWinMp3AudioFilter::WWinMp3AudioFilter()
@@ -119,7 +119,7 @@ bool WWinMp3AudioFilter::mouseLBDOWN(int x, int y)
 {
     if (sl.mouseLBDOWN(x,y))
     {
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press
       return true;
     }
     return false;
@@ -155,7 +155,7 @@ void WWinMp3AudioFilter::processMessage(Message* m)
   {
     if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      ViewMan::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      ViewMan::getInstance()->handleCommand(Input::OK); //simulate OK press
     }
     else
     {
@@ -164,7 +164,7 @@ void WWinMp3AudioFilter::processMessage(Message* m)
       int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>getWidth() || y>getHeight())
       {
-        ViewMan::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
+        ViewMan::getInstance()->handleCommand(Input::BACK); //simulate cancel press
       }
     }
   }
@@ -188,8 +188,8 @@ int WWinMp3AudioFilter::handleCommand(int command)
   
   switch(command)
   {
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
       if (sl.getCurrentOption() != 0)
       {
@@ -203,22 +203,22 @@ int WWinMp3AudioFilter::handleCommand(int command)
           return 4; //Control to vpots control
       }
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
       
       sl.down();
       sl.setShowSelOption(true);
       return 1;
     }
-    case Remote::SKIPBACK:
+    case Input::SKIPBACK:
     {
       sl.pageUp();
       sl.draw();
 
       return 1;
     }
-    case Remote::SKIPFORWARD:
+    case Input::SKIPFORWARD:
     {
       sl.pageDown();
       sl.draw();
@@ -226,14 +226,14 @@ int WWinMp3AudioFilter::handleCommand(int command)
       
       return 1;
     }
-    case Remote::OK:
+    case Input::OK:
     {
         AudioWin*aw=(AudioWin*)Audio::getInstance();
         aw->selectMp3AudioFilter(sl.getCurrentOptionData());
        
       return 1;
     }
-    case Remote::BACK:
+    case Input::BACK:
     {
       return 0;
       
index b91f45b90f3b5585dd9718771ca043be68120f69..a179816a060c367cd97cdf468da1cdee1a522565 100644 (file)
@@ -20,7 +20,7 @@
 #include "wwinvideofilter.h"
 #include "videowin.h"
 #include "i18n.h"
-#include "remote.h"
+#include "input.h"
 #include "boxstack.h"
 
 WWinVideoFilter::WWinVideoFilter()
@@ -111,7 +111,7 @@ bool WWinVideoFilter::mouseLBDOWN(int x, int y)
 {
     if (sl.mouseLBDOWN(x,y))
     {
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press
       return true;
     }
     return false;
@@ -147,7 +147,7 @@ void WWinVideoFilter::processMessage(Message* m)
   {
     if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      ViewMan::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      ViewMan::getInstance()->handleCommand(Input::OK); //simulate OK press
     }
     else
     {
@@ -156,7 +156,7 @@ void WWinVideoFilter::processMessage(Message* m)
       int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>getWidth() || y>getHeight())
       {
-        ViewMan::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
+        ViewMan::getInstance()->handleCommand(Input::BACK); //simulate cancel press
       }
     }
   }
@@ -180,8 +180,8 @@ int WWinVideoFilter::handleCommand(int command)
   
   switch(command)
   {
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
       if (sl.getCurrentOption() != 0)
       {
@@ -195,30 +195,30 @@ int WWinVideoFilter::handleCommand(int command)
           return 4; //Control to vopts control
       }
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
       sl.down();
       sl.setShowSelOption(true);
       return 1;
     }
-    case Remote::SKIPBACK:
+    case Input::SKIPBACK:
     {
       sl.pageUp();
       return 1;
     }
-    case Remote::SKIPFORWARD:
+    case Input::SKIPFORWARD:
     {
       sl.pageDown();
       return 1;
     }
-    case Remote::OK:
+    case Input::OK:
     {
         VideoWin*vw=(VideoWin*)Video::getInstance();
         vw->selectVideoFilter(sl.getCurrentOptionData());
       return 1;
     }
-    case Remote::BACK:
+    case Input::BACK:
     {
       return 0;
       
index 7c6ec07cefadac1b4fc0b8d983ba0bf7c69094ec..756cb463f2c62ca97832116a514d411fc1230fef 100644 (file)
@@ -20,7 +20,7 @@
 #include "wwinvideoh264filter.h"
 #include "videowin.h"
 #include "i18n.h"
-#include "remote.h"
+#include "input.h"
 #include "boxstack.h"
 
 WWinVideoH264Filter::WWinVideoH264Filter()
@@ -111,7 +111,7 @@ bool WWinVideoH264Filter::mouseLBDOWN(int x, int y)
 {
     if (sl.mouseLBDOWN(x,y))
     {
-      BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press
       return true;
     }
     return false;
@@ -147,7 +147,7 @@ void WWinVideoH264Filter::processMessage(Message* m)
   {
     if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
-      ViewMan::getInstance()->handleCommand(Remote::OK); //simulate OK press
+      ViewMan::getInstance()->handleCommand(Input::OK); //simulate OK press
     }
     else
     {
@@ -156,7 +156,7 @@ void WWinVideoH264Filter::processMessage(Message* m)
       int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>getWidth() || y>getHeight())
       {
-        ViewMan::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
+        ViewMan::getInstance()->handleCommand(Input::BACK); //simulate cancel press
       }
     }
   }
@@ -180,8 +180,8 @@ int WWinVideoH264Filter::handleCommand(int command)
   
   switch(command)
   {
-    case Remote::DF_UP:
-    case Remote::UP:
+    case Input::DF_UP:
+    case Input::UP:
     {
       if (sl.getCurrentOption() != 0)
       {
@@ -195,30 +195,30 @@ int WWinVideoH264Filter::handleCommand(int command)
           return 4; //Control to vopts control
       }
     }
-    case Remote::DF_DOWN:
-    case Remote::DOWN:
+    case Input::DF_DOWN:
+    case Input::DOWN:
     {
       sl.down();
       sl.setShowSelOption(true);
       return 1;
     }
-    case Remote::SKIPBACK:
+    case Input::SKIPBACK:
     {
       sl.pageUp();
       return 1;
     }
-    case Remote::SKIPFORWARD:
+    case Input::SKIPFORWARD:
     {
       sl.pageDown();
       return 1;
     }
-    case Remote::OK:
+    case Input::OK:
     {
         VideoWin*vw=(VideoWin*)Video::getInstance();
         vw->selectVideoH264Filter(sl.getCurrentOptionData());
       return 1;
     }
-    case Remote::BACK:
+    case Input::BACK:
     {
       return 0;