Improved to "half-way usable" (version 0.5)
authorJohn Pietrzak <john@pietrzak.org>
Tue, 31 Jan 2012 01:37:40 +0000 (20:37 -0500)
committerJohn Pietrzak <john@pietrzak.org>
Tue, 31 Jan 2012 01:37:40 +0000 (20:37 -0500)
With some incremental improvements to the UI, some fairly decent back-end
improvements, and a variety of bug-fixes, I'm declaring that this program
is now half-way usable, therefore giving it a version number of 0.5. :)

74 files changed:
doc/about.html
doc/documentation.html
jvcprotocol.cpp [new file with mode: 0644]
jvcprotocol.h [new file with mode: 0644]
keysets/apple.cpp
keysets/denon.cpp
keysets/ei.cpp
keysets/ei.h
keysets/elgato.cpp [new file with mode: 0644]
keysets/elgato.h [new file with mode: 0644]
keysets/goldstar.cpp
keysets/goldstar.h
keysets/hauppauge.cpp
keysets/hitachi.cpp
keysets/jvc.cpp
keysets/jvc.h
keysets/lg.cpp
keysets/magnavox.cpp
keysets/mitsubishi.cpp
keysets/nokia.cpp
keysets/panasonic.cpp
keysets/philips.cpp
keysets/pinnacle.cpp
keysets/raite.cpp
keysets/rca.cpp
keysets/sagem.cpp
keysets/samsung.cpp
keysets/sanyo.cpp
keysets/sanyo.h
keysets/sharp.cpp
keysets/sony.cpp
keysets/sony.h
keysets/tivo.cpp
keysets/toshiba.cpp
keysets/toshiba.h
keysets/westinghouse.cpp
keysets/yamaha.cpp
keysets/zenith.cpp
mainwindow.cpp
mainwindow.h
mainwindow.ui
necprotocol.cpp
necprotocol.h
pierogi.pro
pierogi.pro.user
pirkeynames.h
pirkeysetmanager.cpp
pirkeysetmanager.h
pirkeysetmetadata.cpp
pirkeysetmetadata.h
pirmakenames.cpp
pirmakenames.h
pirprotocol.cpp
pirprotocol.h
qtc_packaging/debian_fremantle/changelog
qtc_packaging/debian_fremantle/postinst
rc5protocol.cpp
rc6protocol.cpp
sharpprotocol.cpp [new file with mode: 0644]
sharpprotocol.h [new file with mode: 0644]
sircprotocol.cpp [new file with mode: 0644]
sircprotocol.h [new file with mode: 0644]
www/FavoriteTab.png [new file with mode: 0755]
www/FavoritesTab.png [deleted file]
www/KeypadTab.png
www/MainTab.png
www/Media2Tab.png [new file with mode: 0755]
www/MediaTab.png
www/MenuTab.png
www/MiscTab.png [deleted file]
www/SelectKeysetWindow.png
www/TVTab.png [new file with mode: 0755]
www/UtilityTab.png
www/index.html

index 441bad4..f0a62be 100644 (file)
@@ -1,12 +1,15 @@
 <html>
 <head>
+<title>
+Pierogi UIRC
+</title>
 </head>
 <body>
 <h1 align="center"><img src="qrc:///icons/PierogiIcon.png"> Pierogi</h1>
 <h2 align="center">A Universal Infrared Remote Control</h2>
 
 <p align="center">
-Version 0.1
+Version 0.5 -- "Half-Way Usable"
 </p>
 
 <p>
index 0bdf9f2..81b387b 100644 (file)
@@ -1,5 +1,9 @@
 <html>
 <head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>
+Pierogi UIRC
+</title>
 </head>
 <body>
 
@@ -63,8 +67,9 @@ controls.  The name of the current keyset is also provided in this tab.</p>
 
 <p>The Utility tab contains a selection of commonly useful controls, such as
 "Mute", "Sleep", "Input", "Closed Captions / Subtitles", and the color buttons.
-The exact selection of buttons on this tab will probably change to reflect
-which commands turn out to be the most popular.</p>
+This tab is intended to be a quick way to reach the most frequently used
+buttons; as such, the selection may be updated in future versions of Pierogi.
+</p>
 
 <h3>Keypad Tab</h3>
 
@@ -82,8 +87,9 @@ allow you to enter a second digit.</p>
 
 <p>This tab contains buttons used to enter and exit a menu, navigate within
 a menu, and select menu entries.  The "Menu" button is meant to enter the
-main system menu of a given device; the "Info" and "Guide" buttons are
-targeted towards entering other useful menus when available.</p>
+main system menu of a given device; "Guide" is a content-related menu available
+on many modern devices; and "Disc Menu" is used to access the menu interface
+provided with DVD and Blu-Ray media.</p>
 
 <h3>Media Tab</h3>
 
@@ -92,16 +98,23 @@ targeted towards entering other useful menus when available.</p>
 (often called rewind) and "Fast Forward".  A variety of other less common
 navigation controls are included, along with the "Eject" command.</p>
 
-<h3>Misc Tab</h3>
+<h3>Media2 Tab</h3>
+
+<p>This is another page of media buttons, containing a mix of commands useful
+for DVD players, VCRs, audio devices, and possibly other devices.  The content
+of this page may change in the future.</p>
+
+<h3>TV Tab</h3>
 
-<p>This tab contains a selection of buttons that did not fit into any of the
-previous tabs.  The content of this tab is subject to change.</p>
+<p>This page contains several more TV-oriented buttons, including controls for
+picture-in-picture, teletext, and some graphics and audio controls.  The
+content of this page is subject to change.</p>
 
-<h3>Favorites Tab</h3>
+<h3>Favorite Tab</h3>
 
-<p>As there are numerous keysets available in Pierogi, a "favorites" tab has
+<p>As there are numerous keysets available in Pierogi, a "Favorite" tab has
 been implemented.  To add a favorite keyset to the tab, first select that
-keyset from the "Select Keyset" window.  Then, navigate to the Favorites tab
+keyset from the "Select Keyset" window.  Then, navigate to the Favorite tab
 and press "Add Current Keyset".</p>
 
 <p>Once you have added some keysets to the favorites list, you can tell
@@ -264,14 +277,15 @@ of code once I've seen it, so I've rewritten it in C++, reorganizing it in
 an object-oriented manner along the way.</p>
 
 <p>
-Here's one way in which I disagree with the authors of LIRC: they've managed
-to cram support for practically every protocol used by every remote control
-ever made into a single codepath.  So, there's a single "transmit" function,
-sorting through a massive pile of flags, conditional statements, and some
-really funky delayed-action buffering to make everything work.  The simple act
-of splitting the code into one routine for the RC5 (biphase) protocol and
-another for the NEC (space-encoded) protocol makes it much easier to read, at
-least to my eyes.  (I haven't yet implemented the RC6 or other protocols.)
+As I have progressed in adding support for additional IR protocols, I'm
+beginning to see why the authors of the LIRC made the attempt to compress
+every possible IR protocol into a straightforward count of individual IR
+pulses.  The total number of IR protocols in use is amazing, and many of them
+(through oversight or due to the longevity of their use) are mind-numbingly
+complicated to deal with.  Still, I believe that separating the major protocols
+into their own code paths results in code that is easier to understand and
+maintain; I'm slowly moving away from the LIRC's system to my own as time
+goes on.
 </p>
 
 <p>
@@ -307,12 +321,13 @@ to the theory and practice behind consumer IR devices
 
 <li>Some <a href="http://www2.renesas.com/faq/en/mi_com/f_com_remo.html">More info on the NEC protocol</a>
 
+<li>An introduction to the <a href="http://www.sbprojects.com/knowledge/ir/sirc.php">Sony SIRC protocol</a>
+
+<li>An excellent collection of <a href="http://www.hifi-remote.com/sony/">Sony command codes</a>
+
 <li>Link to (what appears to be) source code for the N900's
 <a href="http://svn.jacekowski.org/host_mode/trunk/drivers/input/lirc/lirc_rx51.c">/dev/lirc0 device driver</a>.
 
-<li>A surprisingly decent description of how to use the
-<a href="http://www.yamahapab.com/assets/downloads/codes/Custom_Install_HB.pdf">Yamaha Remote Control</a>.
-
 <ul>
 
 </body>
diff --git a/jvcprotocol.cpp b/jvcprotocol.cpp
new file mode 100644 (file)
index 0000000..37909fc
--- /dev/null
@@ -0,0 +1,177 @@
+#include "jvcprotocol.h"
+
+#include "pirexception.h"
+#include <string>
+//#include <iostream>
+
+// Some global communications stuff:
+#include <QMutex>
+extern bool commandInFlight;
+extern QMutex commandIFMutex;
+
+// The JVC protocol should have the following attributes:
+// A "zero" is encoded with a 526 usec pulse, 52626 usec space.
+// A "one" is encoded with a 526 usec pulse, and 3*526 (1578) usec space.
+// The header is a 8400 usec pulse, 4200 usec space.
+// Commands end with a trailing 526 usec pulse.
+// Commands are repeated by re-sending entire command without the header.
+// Repeats are broadcast every 60000 usec.
+// The carrier frequency is 38 kHz, duty cycle is 1/3.
+
+JVCProtocol::JVCProtocol(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRProtocol(guiObject, index, 60000, true),
+    zeroPulse(526),
+    zeroSpace(526),
+    onePulse(526),
+    oneSpace(1578),
+    headerPulse(8400),
+    headerSpace(4200),
+    trailerPulse(526)
+{
+  setCarrierFrequency(38000);
+  setDutyCycle(33);
+}
+
+
+void JVCProtocol::startSendingCommand(
+  unsigned int threadableID,
+  PIRKeyName command)
+{
+  // Exceptions here are problematic; I'll try to weed them out by putting the
+  // whole thing in a try/catch block:
+  try
+  {
+    // First, check if we are meant to be the recipient of this command:
+    if (threadableID != id) return;
+
+    clearRepeatFlag();
+
+    KeycodeCollection::const_iterator i = keycodes.find(command);
+
+    // Do we even have this key defined?
+    if (i == keycodes.end())
+    {
+      std::string s = "Tried to send a non-existent command.\n";
+      throw PIRException(s);
+    }
+
+    // construct the device:
+    PIRRX51Hardware rx51device(carrierFrequency, dutyCycle);
+
+    int repeatCount = 0;
+    int commandDuration = 0;
+    while (repeatCount < MAX_REPEAT_COUNT)
+    {
+      // If we are currently repeating, and have a special "repeat signal",
+      // use that signal.  Otherwise, generate a normal command string.
+      if (repeatCount)
+      {
+        commandDuration = generateHeadlessCommand((*i).second, rx51device);
+      }
+      else
+      {
+        commandDuration = generateStandardCommand((*i).second, rx51device);
+      }
+
+      // Now, tell the device to send the whole command:
+      rx51device.sendCommandToDevice();
+
+      // sleep until the next repetition of command:
+      sleepUntilRepeat(commandDuration);
+
+      // Check whether we've reached the minimum required number of repetitons:
+      if (repeatCount >= minimumRepetitions)
+      {
+        // Check whether we've been asked to stop:
+        if (checkRepeatFlag())
+        {
+          QMutexLocker cifLocker(&commandIFMutex);
+          commandInFlight = false;
+          return;
+        }
+      }
+
+      ++repeatCount;
+    }
+  }
+  catch (PIRException e)
+  {
+    // inform the gui:
+    emit commandFailed(e.getError().c_str());
+  }
+
+  QMutexLocker cifLocker(&commandIFMutex);
+  commandInFlight = false;
+}
+
+
+// JVC data is sent in reverse order, i.e., the least signficant bit is
+// sent first.
+int JVCProtocol::generateStandardCommand(
+  const CommandSequence &bits,
+  PIRRX51Hardware &rx51device)
+{
+  int duration = 0;
+
+  // First, the "header" pulse:
+  rx51device.addPair(headerPulse, headerSpace);
+  duration += (headerPulse + headerSpace);
+
+  // Now, push the actual data:
+  duration += pushReverseBits(preData, rx51device);
+  duration += pushReverseBits(bits, rx51device);
+
+  // Finally add the "trail":
+  rx51device.addSingle(trailerPulse);
+  duration += trailerPulse;
+
+  return duration;
+}
+
+
+int JVCProtocol::generateHeadlessCommand(
+  const CommandSequence &bits,
+  PIRRX51Hardware &rx51device)
+{
+  int duration = 0;
+
+  // Push the actual data:
+  duration += pushReverseBits(preData, rx51device);
+  duration += pushReverseBits(bits, rx51device);
+
+  // Finally add the "trail":
+  rx51device.addSingle(trailerPulse);
+  duration += trailerPulse;
+
+  return duration;
+}
+
+
+int JVCProtocol::pushReverseBits(
+  const CommandSequence &bits,
+  PIRRX51Hardware &rx51device)
+{
+  int duration = 0;
+  CommandSequence::const_reverse_iterator i = bits.rbegin();
+  while (i != bits.rend())
+  {
+    if (*i)
+    {
+      // Send the pulse for "One":
+      rx51device.addPair(onePulse, oneSpace);
+      duration += (onePulse + oneSpace);
+    }
+    else
+    {
+      // Send the pulse for "Zero":
+      rx51device.addPair(zeroPulse, zeroSpace);
+      duration += (zeroPulse + zeroSpace);
+    }
+    ++i;
+  }
+
+  return duration;
+}
+
diff --git a/jvcprotocol.h b/jvcprotocol.h
new file mode 100644 (file)
index 0000000..75d52ef
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef JVCPROTOCOL_H
+#define JVCPROTOCOL_H
+
+#include "pirprotocol.h"
+#include "pirrx51hardware.h"
+
+//
+// JVC has its own protocol, similar in some ways to the popular NEC protocol.
+// The main differences are that the address and command segments are not
+// sent with an inverted copy, and that repeats are implemented by sending
+// the body without a header, rather than a header without a body.
+//
+
+class JVCProtocol: public PIRProtocol
+{
+public:
+  JVCProtocol(
+    QObject *guiObject,
+    unsigned int index);
+
+public slots:
+  void startSendingCommand(
+    unsigned int threadableID,
+    PIRKeyName command);
+
+private:
+  unsigned int zeroPulse;
+  unsigned int zeroSpace;
+  unsigned int onePulse;
+  unsigned int oneSpace;
+
+  unsigned int headerPulse;
+  unsigned int headerSpace;
+
+  unsigned int trailerPulse;
+
+  int generateStandardCommand(
+    const CommandSequence &bits,
+    PIRRX51Hardware &device);
+
+  int generateHeadlessCommand(
+    const CommandSequence &bits,
+    PIRRX51Hardware &device);
+
+  int pushReverseBits(
+    const CommandSequence &bits,
+    PIRRX51Hardware &device);
+};
+
+#endif // JVCPROTOCOL_H
index c7aa9c2..7b79f79 100644 (file)
@@ -14,7 +14,7 @@ AppleWhiteRemote::AppleWhiteRemote(
   addControlledDevice(Apple_Make, "Mac Mini", Computer_Device);
 
   // Set up the threadable object:
-  threadableProtocol = new NECProtocol(guiObject, index);
+  threadableProtocol = new NECProtocol(guiObject, index, LIRC_NEC);
 
   setPreData(0x77e1, 16);
   setPostData(0xc5, 8);
index e59402f..5ca685d 100644 (file)
@@ -1,4 +1,5 @@
 #include "denon.h"
+#include "sharpprotocol.h"
 #include "necprotocol.h"
 
 // This whole set of Denon keysets is a mess.  Need to clean it up!!!
@@ -13,66 +14,55 @@ DenonDVD1::DenonDVD1(
 {
   addControlledDevice(Denon_Make, "DVD-1930", DVD_Device);
 
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    349, 647,
-    349, 1689,
-    65002, true); // 43802 between?
-
-  threadableProtocol = np;
-
-  np->setElevenBitToggle(true);
-
-  np->setTrailerPulse(349);
-
-//  np->setCarrierFrequency(26500); //?
-
-  addKey("POWER_ON", Unmapped_Key, 0x0A34, 15);
-  addKey("POWER_OFF", Unmapped_Key, 0x300C, 15);
-  addKey("MODE", Unmapped_Key, 0x08E4, 15);
-  addKey("OPEN_CLOSE", Eject_Key, 0x0824, 15);
-  addKey("A_B_REPEAT", Unmapped_Key, 0x0974, 15);
-  addKey("REPEAT", Unmapped_Key, 0x08A4, 15);
-  addKey("RANDOM", Unmapped_Key, 0x0954, 15);
-  addKey("ZOOM", Unmapped_Key, 0x13E4, 15);
-  addKey("CLEAR", Clear_Key, 0x0B14, 15);
-  addKey("1", One_Key, 0x0904, 15);
-  addKey("2", Two_Key, 0x0B04, 15);
-  addKey("3", Three_Key, 0x0884, 15);
-  addKey("4", Four_Key, 0x0A84, 15);
-  addKey("5", Five_Key, 0x0984, 15);
-  addKey("6", Six_Key, 0x0B84, 15);
-  addKey("7", Seven_Key, 0x0844, 15);
-  addKey("8", Eight_Key, 0x0A44, 15);
-  addKey("9", Nine_Key, 0x0944, 15);
-  addKey("0", Zero_Key, 0x0A04, 15);
-  addKey("10+", DoubleDigit_Key, 0x08C4, 15);
-  addKey("ANGLE", Unmapped_Key, 0x0BC4, 15);
-  addKey("SUBTITLE", Captions_Key, 0x0AC4, 15);
-  addKey("AUDIO", Language_Key, 0x09C4, 15);
-  addKey("DISPLAY", Info_Key, 0x0B94, 15);
-  addKey("MENU", DiscMenu_Key, 0x0A24, 15);
-  addKey("TOP_MENU", DiscTitle_Key, 0x0AF4, 15);
-  addKey("UP", Up_Key, 0x08D4, 15);
-  addKey("DOWN", Down_Key, 0x0AD4, 15);
-  addKey("LEFT", Left_Key, 0x0BD4, 15);
-  addKey("RIGHT", Right_Key, 0x09D4, 15);
-  addKey("ENTER", Select_Key, 0x0B74, 15);
-  addKey("RETURN", Exit_Key, 0x0924, 15);
-  addKey("SETUP", Menu_Key, 0x08F4, 15);
-  addKey("SEARCH_MODE", Unmapped_Key, 0x11E4, 15);
-  addKey("SKIP_DOWN", Next_Key, 0x0A64, 15);
-  addKey("SKIP_UP", Previous_Key, 0x0864, 15);
-  addKey("FAST_REVERSE", Rewind_Key, 0x0B64, 15);
-  addKey("STOP", Stop_Key, 0x0A14, 15);
-  addKey("PLAY", Play_Key, 0x0814, 15);
-  addKey("FAST_FORWARD", FastForward_Key, 0x0964, 15);
-  addKey("PAUSE", Pause_Key, 0x0AE4, 15);
-  addKey("GROUP", Unmapped_Key, 0x33FC, 15);
-  addKey("SACD_SETUP", Unmapped_Key, 0x09F8, 15);
-  addKey("PAGE+", Unmapped_Key, 0x31FC, 15);
-  addKey("PAGE-", Unmapped_Key, 0x32FC, 15);
+  threadableProtocol = new SharpProtocol(guiObject, index, false);
+
+  addSharpKey("SEARCH_MODE", Unmapped_Key, 0x04, 0x9E);
+  addSharpKey("ZOOM", Zoom_Key, 0x04, 0x9F);
+
+  addSharpKey("POWER_OFF", PowerOff_Key, 0x06, 0xC0);
+  addSharpKey("PAGE-", PageDown_Key, 0x06, 0xFD);
+  addSharpKey("PAGE+", PageUp_Key, 0x06, 0xFE);
+  addSharpKey("GROUP", Unmapped_Key, 0x06, 0xFF);
+
+  addSharpKey("SACD_SETUP", Unmapped_Key, 0x08, 0x7E);
+  addSharpKey("0", Zero_Key, 0x08, 0x81);
+  addSharpKey("1", One_Key, 0x08, 0x82);
+  addSharpKey("2", Two_Key, 0x08, 0x83);
+  addSharpKey("3", Three_Key, 0x08, 0x84);
+  addSharpKey("4", Four_Key, 0x08, 0x85);
+  addSharpKey("5", Five_Key, 0x08, 0x86);
+  addSharpKey("6", Six_Key, 0x08, 0x87);
+  addSharpKey("7", Seven_Key, 0x08, 0x88);
+  addSharpKey("8", Eight_Key, 0x08, 0x89);
+  addSharpKey("9", Nine_Key, 0x08, 0x8A);
+  addSharpKey("10+", DoubleDigit_Key, 0x08, 0x8C);
+  addSharpKey("SUBTITLE", Captions_Key, 0x08, 0x8D);
+  addSharpKey("AUDIO", Audio_Key, 0x08, 0x8E);
+  addSharpKey("ANGLE", Angle_Key, 0x08, 0x8F);
+  addSharpKey("OPEN_CLOSE", Eject_Key, 0x08, 0x90);
+  addSharpKey("MENU", DiscMenu_Key, 0x08, 0x91);
+  addSharpKey("RETURN", Exit_Key, 0x08, 0x92);
+  addSharpKey("REPEAT", Repeat_Key, 0x08, 0x94);
+  addSharpKey("SKIP_UP", Previous_Key, 0x08, 0x98);
+  addSharpKey("SKIP_DOWN", Next_Key, 0x08, 0x99);
+  addSharpKey("FAST_FORWARD", FastForward_Key, 0x08, 0x9A);
+  addSharpKey("FAST_REVERSE", Rewind_Key, 0x08, 0x9B);
+  addSharpKey("MODE", Unmapped_Key, 0x08, 0x9C);
+  addSharpKey("PAUSE", Pause_Key, 0x08, 0x9D);
+  addSharpKey("PLAY", Play_Key, 0x08, 0xA0);
+  addSharpKey("STOP", Stop_Key, 0x08, 0xA1);
+  addSharpKey("CLEAR", Clear_Key, 0x08, 0xA3);
+  addSharpKey("DISPLAY", Info_Key, 0x08, 0xA7);
+  addSharpKey("RANDOM", Random_Key, 0x08, 0xAA);
+  addSharpKey("UP", Up_Key, 0x08, 0xAC);
+  addSharpKey("DOWN", Down_Key, 0x08, 0xAD);
+  addSharpKey("RIGHT", Right_Key, 0x08, 0xAE);
+  addSharpKey("LEFT", Left_Key, 0x08, 0xAF);
+  addSharpKey("POWER_ON", PowerOn_Key, 0x08, 0xB2);
+  addSharpKey("A_B_REPEAT", RepeatAB_Key, 0x08, 0xBA);
+  addSharpKey("ENTER", Select_Key, 0x08, 0xBB);
+  addSharpKey("SETUP", Menu_Key, 0x08, 0xBC);
+  addSharpKey("TOP_MENU", DiscTitle_Key, 0x08, 0xBD);
 }
 
 
@@ -91,7 +81,8 @@ DenonDVD2::DenonDVD2(
     index,
     400, 500,
     400, 1400,
-    43000, false);
+    43000, false,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -119,12 +110,12 @@ DenonDVD2::DenonDVD2(
   addKey("Left", Left_Key, 0xE1EC, 16);
   addKey("Select", Select_Key, 0x414C, 16);
   addKey("Subtitle", Captions_Key, 0x8984, 16);
-  addKey("Audio", Language_Key, 0xCCC1, 16);
-  addKey("Angle", Unmapped_Key, 0x0904, 16);
+  addKey("Audio", Audio_Key, 0xCCC1, 16);
+  addKey("Angle", Angle_Key, 0x0904, 16);
   addKey("Marker", Unmapped_Key, 0x717C, 16);
   addKey("PlayMode", Unmapped_Key, 0xB1BC, 16);
-  addKey("RepeatMode", Unmapped_Key, 0x313C, 16);
-  addKey("A-B_Repeat", Unmapped_Key, 0x121F, 16);
+  addKey("RepeatMode", Repeat_Key, 0x313C, 16);
+  addKey("A-B_Repeat", RepeatAB_Key, 0x121F, 16);
   addKey("Setup", Menu_Key, 0x2924, 16);
   addKey("Clear", Clear_Key, 0xC1CC, 16);
   addKey("VSS", Unmapped_Key, 0x7974, 16);
@@ -146,70 +137,58 @@ DenonDVD3::DenonDVD3(
   QObject *guiObject,
   unsigned int index)
   : PIRKeysetMetaData(
-      "DVD Keyset 3 (odd)",
+      "DVD Keyset 3",
       Denon_Make,
       index)
 {
   addControlledDevice(Denon_Make, "dvd-1000", DVD_Device);
 
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    275, 776,
-    275, 1829,
-    67389, true);
-
-  threadableProtocol = np;
-
-  np->setElevenBitToggle(true);
-
-  np->setTrailerPulse(275);
-
-//  np->setCarrierFrequency(32000);
-
-  addKey("power", Power_Key, 0x09CB, 15);
-  addKey("1", One_Key, 0x0AFB, 15);
-  addKey("2", Two_Key, 0x0B04, 15);
-  addKey("3", Three_Key, 0x0884, 15);
-  addKey("4", Four_Key, 0x097B, 15);
-  addKey("5", Five_Key, 0x0A7B, 15);
-  addKey("6", Six_Key, 0x0B84, 15);
-  addKey("7", Seven_Key, 0x0844, 15);
-  addKey("8", Eight_Key, 0x0A44, 15);
-  addKey("9", Nine_Key, 0x0ABB, 15);
-  addKey("0", Zero_Key, 0x09FB, 15);
-  addKey("10", Unmapped_Key, 0x0B3B, 15);
-  addKey("clear", Clear_Key, 0x08EB, 15);
-  addKey("skip-", Previous_Key, 0x099B, 15);
-  addKey("skip+", Next_Key, 0x0B9B, 15);
-  addKey("slow-", Unmapped_Key, 0x089B, 15);
-  addKey("slow+", Unmapped_Key, 0x0A9B, 15);
-  addKey("stop", Stop_Key, 0x09EB, 15);
-  addKey("pause", Pause_Key, 0x091B, 15);
-  addKey("play", Play_Key, 0x0814, 15);
-  addKey("title", DiscTitle_Key, 0x090B, 15);
-  addKey("menu", DiscMenu_Key, 0x09DB, 15);
-  addKey("return", Exit_Key, 0x0ADB, 15);
-  addKey("display", Info_Key, 0x086B, 15);
-  addKey("select", Select_Key, 0x088B, 15);
-  addKey("arrow-up", Up_Key, 0x0B2B, 15);
-  addKey("arrow-down", Down_Key, 0x092B, 15);
-  addKey("arrow-left", Left_Key, 0x082B, 15);
-  addKey("arrow-right", Right_Key, 0x0A2B, 15);
-  addKey("subtitle", Captions_Key, 0x093B, 15);
-  addKey("audio", Language_Key, 0x0A3B, 15);
-  addKey("angle", Unmapped_Key, 0x083B, 15);
-  addKey("setup", Menu_Key, 0x0B0B, 15);
-  addKey("repeat", Repeat_Key, 0x0B5B, 15);
-  addKey("repeat-ab", Unmapped_Key, 0x0A8B, 15);
-  addKey("random", Random_Key, 0x0AAB, 15);
-  addKey("call", Unmapped_Key, 0x0A0B, 15);
-  addKey("program", Program_Key, 0x0AEB, 15);
-  addKey("open-close", Eject_Key, 0x0BDB, 15);
-  addKey("ntsc-pal", Unmapped_Key, 0x084B, 15);
+  threadableProtocol = new SharpProtocol(guiObject, index, false);
+
+  addSharpKey("0", Zero_Key, 0x01, 0x81);
+  addSharpKey("1", One_Key, 0x01, 0x82);
+  addSharpKey("2", Two_Key, 0x01, 0x83);
+  addSharpKey("3", Three_Key, 0x01, 0x84);
+  addSharpKey("4", Four_Key, 0x01, 0x85);
+  addSharpKey("5", Five_Key, 0x01, 0x86);
+  addSharpKey("6", Six_Key, 0x01, 0x87);
+  addSharpKey("7", Seven_Key, 0x01, 0x88);
+  addSharpKey("8", Eight_Key, 0x01, 0x89);
+  addSharpKey("9", Nine_Key, 0x01, 0x8A);
+  addSharpKey("10", Unmapped_Key, 0x01, 0x8C);
+  addSharpKey("subtitle", Captions_Key, 0x01, 0x8D);
+  addSharpKey("audio", Audio_Key, 0x01, 0x8E);
+  addSharpKey("angle", Angle_Key, 0x01, 0x8F);
+  addSharpKey("open-close", Eject_Key, 0x01, 0x90);
+  addSharpKey("menu", DiscMenu_Key, 0x01, 0x91);
+  addSharpKey("return", Exit_Key, 0x01, 0x92);
+  addSharpKey("repeat", Repeat_Key, 0x01, 0x97);
+  addSharpKey("skip+", Next_Key, 0x01, 0x98);
+  addSharpKey("skip-", Previous_Key, 0x01, 0x99);
+  addSharpKey("slow+", SlowPlus_Key, 0x01, 0x9A);
+  addSharpKey("slow-", SlowMinus_Key, 0x01, 0x9B);
+  addSharpKey("pause", Pause_Key, 0x01, 0x9D);
+  addSharpKey("play", Play_Key, 0x01, 0xA0);
+  addSharpKey("stop", Stop_Key, 0x01, 0xA1);
+  addSharpKey("program", Program_Key, 0x01, 0xA2);
+  addSharpKey("clear", Clear_Key, 0x01, 0xA3);
+  addSharpKey("display", Info_Key, 0x01, 0xA4);
+  addSharpKey("random", Random_Key, 0x01, 0xAA);
+  addSharpKey("arrow-up", Up_Key, 0x01, 0xAC);
+  addSharpKey("arrow-down", Down_Key, 0x01, 0xAD);
+  addSharpKey("arrow-right", Right_Key, 0x01, 0xAE);
+  addSharpKey("arrow-left", Left_Key, 0x01, 0xAF);
+  addSharpKey("ntsc-pal", Unmapped_Key, 0x01, 0xB7);
+  addSharpKey("power", Power_Key, 0x01, 0xB1);
+  addSharpKey("repeat-ab", RepeatAB_Key, 0x01, 0xBA);
+  addSharpKey("select", Select_Key, 0x01, 0xBB);
+  addSharpKey("setup", Menu_Key, 0x01, 0xBC);
+  addSharpKey("title", DiscTitle_Key, 0x01, 0xBD);
+  addSharpKey("call", Unmapped_Key, 0x01, 0xBE);
 }
 
 
+// This one is messed up:
 DenonReceiver1::DenonReceiver1(
   QObject *guiObject,
   unsigned int index)
@@ -225,7 +204,8 @@ DenonReceiver1::DenonReceiver1(
     index,
     400, 700,
     400, 1700,
-    67000, true);
+    67000, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -233,8 +213,8 @@ DenonReceiver1::DenonReceiver1(
 
   np->setTrailerPulse(400);
 
-  addKey("On", Unmapped_Key, 0x221C, 15);
-  addKey("Off", Unmapped_Key, 0x211C, 15);
+  addKey("On", PowerOn_Key, 0x221C, 15);
+  addKey("Off", PowerOff_Key, 0x211C, 15);
   addKey("DVD_HDP", Unmapped_Key, 0x231C, 15); // "SRC_DVD"
   addKey("TV_CBL", Unmapped_Key, 0x224C, 15);
   addKey("VCR", Unmapped_Key, 0x22CC, 15);
@@ -292,8 +272,8 @@ DenonReceiver1a::DenonReceiver1a(
   addKey("BTN_PREV", Previous_Key, 0x1AAC, 15);
   addKey("BTN_NEXT", Next_Key, 0x19AC, 15);
   addKey("BTN_STD", Unmapped_Key, 0x2363, 15);
-  addKey("PAGE_DN", Unmapped_Key, 0x1813, 15);
-  addKey("PAGE_UP", Unmapped_Key, 0x21EC, 15);
+  addKey("PAGE_DN", PageDown_Key, 0x1813, 15);
+  addKey("PAGE_UP", PageUp_Key, 0x21EC, 15);
   addKey("BTN_STD_CINEMA", Unmapped_Key, 0x115B, 15);
   addKey("BTN_STD_MUSIC", Unmapped_Key, 0x125B, 15);
   addKey("BTN_SIMU", Unmapped_Key, 0x219C, 15);
@@ -371,54 +351,47 @@ DenonReceiver2::DenonReceiver2(
       Denon_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    315, 740,
-    315, 1812,
-    45920, false);
-
-  threadableProtocol = np;
-
-  np->setElevenBitToggle(true);
-
-  np->setTrailerPulse(315);
-
-  addKey("amp_power", Power_Key, 0x67D7, 15);
-  addKey("amp_vol-down", VolumeDown_Key, 0x6737, 15);
-  addKey("amp_vol-up", VolumeUp_Key, 0x6537, 15);
-  addKey("amp_tape", Unmapped_Key, 0x6517, 15);
-  addKey("amp_aux/video", Unmapped_Key, 0x6497, 15);
-  addKey("amp_tuner", Unmapped_Key, 0x6597, 15);
-  addKey("amp_cd", Unmapped_Key, 0x6697, 15);
-  addKey("amp_phono", Unmapped_Key, 0x6797, 15);
-  addKey("tun_1", Unmapped_Key, 0x66F7, 15);
-  addKey("tun_2", Unmapped_Key, 0x64F7, 15);
-  addKey("tun_3", Unmapped_Key, 0x6777, 15);
-  addKey("tun_4", Unmapped_Key, 0x6577, 15);
-  addKey("tun_5", Unmapped_Key, 0x6677, 15);
-  addKey("tun_6", Unmapped_Key, 0x6477, 15);
-  addKey("tun_7", Unmapped_Key, 0x67B7, 15);
-  addKey("tun_8", Unmapped_Key, 0x65B7, 15);
-  addKey("tun_shift", Unmapped_Key, 0x66B7, 15);
-  addKey("cd_pause", Pause_Key, 0x76E8, 15);
-  addKey("cd_stop", Stop_Key, 0x7617, 15);
-  addKey("cd_play", Play_Key, 0x7717, 15);
-  addKey("cd_rew", Rewind_Key, 0x7497, 15);
-  addKey("cd_ff", FastForward_Key, 0x7697, 15);
-  addKey("cd_prev", Previous_Key, 0x7597, 15);
-  addKey("cd_next", Next_Key, 0x7797, 15);
-  addKey("CD_RANDOM", Random_Key, 0x76A7, 15);
-  addKey("CD_REPEAT", Repeat_Key, 0x7757, 15);
-  addKey("CD_SKIP", Unmapped_Key, 0x74A7, 15);
-  addKey("tape_pause", Unmapped_Key, 0x6D17, 15);
-  addKey("tape_stop", Unmapped_Key, 0x6E17, 15);
-  addKey("tape_playrev", Unmapped_Key, 0x6C57, 15);
-  addKey("tape_play", Unmapped_Key, 0x6F17, 15);
-  addKey("tape_rec", Unmapped_Key, 0x6C17, 15);
-  addKey("tape_a/b", Unmapped_Key, 0x6CD7, 15);
-  addKey("tape_rew", Unmapped_Key, 0x6C97, 15);
-  addKey("tape_ff", Unmapped_Key, 0x6E97, 15);
+  threadableProtocol = new SharpProtocol(guiObject, index, false);
+
+  addSharpKey("tun_1", One_Key, 0x13, 0x42);
+  addSharpKey("tun_2", Two_Key, 0x13, 0x43);
+  addSharpKey("tun_3", Three_Key, 0x13, 0x44);
+  addSharpKey("tun_4", Four_Key, 0x13, 0x45);
+  addSharpKey("tun_5", Five_Key, 0x13, 0x46);
+  addSharpKey("tun_6", Six_Key, 0x13, 0x47);
+  addSharpKey("tun_7", Seven_Key, 0x13, 0x48);
+  addSharpKey("tun_8", Eight_Key, 0x13, 0x49);
+  addSharpKey("tun_shift", TunerBand_Key, 0x13, 0x4A);
+  addSharpKey("amp_vol-down", VolumeDown_Key, 0x13, 0x4C);
+  addSharpKey("amp_vol-up", VolumeUp_Key, 0x13, 0x4D);
+  addSharpKey("amp_power", Power_Key, 0x13, 0x50);
+  addSharpKey("amp_phono", Unmapped_Key, 0x13, 0x58);
+  addSharpKey("amp_tuner", Unmapped_Key, 0x13, 0x59);
+  addSharpKey("amp_aux/video", Unmapped_Key, 0x13, 0x5B);
+  addSharpKey("amp_cd", Unmapped_Key, 0x13, 0x5A);
+  addSharpKey("amp_tape", Unmapped_Key, 0x13, 0x5D);
+  addSharpKey("TUN_CH_DOWN", ChannelDown_Key, 0x13, 0xD5);
+  addSharpKey("TUN_CH_UP", ChannelUp_Key, 0x13, 0xD6);
+
+  addSharpKey("CD_REPEAT", Repeat_Key, 0x17, 0x54);
+  addSharpKey("cd_next", Next_Key, 0x17, 0x58);
+  addSharpKey("cd_prev", Previous_Key, 0x17, 0x59);
+  addSharpKey("cd_ff", FastForward_Key, 0x17, 0x5A);
+  addSharpKey("cd_rew", Rewind_Key, 0x17, 0x5B);
+  addSharpKey("cd_play", Play_Key, 0x17, 0x5C);
+  addSharpKey("cd_pause", Pause_Key, 0x17, 0x5D);
+  addSharpKey("cd_stop", Stop_Key, 0x17, 0x5E);
+  addSharpKey("CD_RANDOM", Random_Key, 0x17, 0x6A);
+  addSharpKey("CD_SKIP", Unmapped_Key, 0x17, 0x6B);
+
+  addSharpKey("tape_a/b", Unmapped_Key, 0x1B, 0x53);
+  addSharpKey("tape_playrev", Unmapped_Key, 0x1B, 0x57);
+  addSharpKey("tape_ff", Unmapped_Key, 0x1B, 0x5A);
+  addSharpKey("tape_rew", Unmapped_Key, 0x1B, 0x5B);
+  addSharpKey("tape_play", Unmapped_Key, 0x1B, 0x5C);
+  addSharpKey("tape_pause", Unmapped_Key, 0x1B, 0x5D);
+  addSharpKey("tape_stop", Unmapped_Key, 0x1B, 0x5E);
+  addSharpKey("tape_rec", Unmapped_Key, 0x1B, 0x5F);
 }
 
 
@@ -431,18 +404,16 @@ DenonReceiver2a::DenonReceiver2a(
 
   addControlledDevice(Denon_Make, "PMA-425R", Audio_Device);
 
-  addKey("AMP_TAPE2", Unmapped_Key, 0x5E9B, 15);
-  addKey("AMP_TAPE1", Unmapped_Key, 0x5D9B, 15);
-  addKey("AMP_AUX", Unmapped_Key, 0x5F7B, 15);
-  addKey("AMP_TUNER", Unmapped_Key, 0x5CE3, 15);
-  addKey("AMP_CD", Unmapped_Key, 0x5EFB, 15);
-  addKey("AMP_PHONO", Unmapped_Key, 0x5DFB, 15);
-  addKey("AMP_VOL_UP", VolumeUp_Key, 0x5D3B, 15);
-  addKey("AMP_VOL_DOWN", VolumeDown_Key, 0x5F3B, 15);
-  addKey("AMP_POWER", Power_Key, 0x5FDB, 15);
-  addKey("AMP_MUTE", Mute_Key, 0x5CBB, 15);
-  addKey("TUN_CH_UP", ChannelUp_Key, 0x6653, 15);
-  addKey("TUN_CH_DOWN", ChannelDown_Key, 0x6553, 15);
+  addSharpKey("AMP_TAPE2", Unmapped_Key, 0x1D, 0x9A);
+  addSharpKey("AMP_TAPE1", Unmapped_Key, 0x1D, 0x99);
+  addSharpKey("AMP_AUX", Unmapped_Key, 0x1D, 0x84);
+  addSharpKey("AMP_TUNER", Unmapped_Key, 0x1D, 0x73);
+  addSharpKey("AMP_CD", Unmapped_Key, 0x1D, 0x82);
+  addSharpKey("AMP_PHONO", Unmapped_Key, 0x1D, 0x81);
+  addSharpKey("AMP_VOL_UP", VolumeUp_Key, 0x1D, 0x8D);
+  addSharpKey("AMP_VOL_DOWN", VolumeDown_Key, 0x1D, 0x8C);
+  addSharpKey("AMP_POWER", Power_Key, 0x1D, 0x90);
+  addSharpKey("AMP_MUTE", Mute_Key, 0x1D, 0x8B);
 }
 
 
@@ -456,56 +427,51 @@ DenonReceiver3::DenonReceiver3(
 {
   addControlledDevice(Denon_Make, "PMA-480R", Audio_Device);
 
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    400, 600,
-    400, 1700,
-    67400, true);
-
-  threadableProtocol = np;
-
-  np->setElevenBitToggle(true);
-
-  np->setTrailerPulse(400);
-
-  addKey("TUNER", Unmapped_Key, 0x1AEC, 15);
-  addKey("DECK", Unmapped_Key, 0x12B8, 15);
-  addKey("CD", Unmapped_Key, 0x0B38, 15);
-  addKey("CD_PLAY", Play_Key, 0x08E8, 15);
-  addKey("CD_PAUSE", Pause_Key, 0x0AE8, 15);
-  addKey("CD_STOP", Stop_Key, 0x09E8, 15);
-  addKey("CD_REW", Rewind_Key, 0x0B68, 15);
-  addKey("CD_FF", FastForward_Key, 0x0968, 15);
-  addKey("CD_BACK", Previous_Key, 0x0A68, 15);
-  addKey("CD_NEXT", Next_Key, 0x0868, 15);
-  addKey("DISC1", Unmapped_Key, 0x0898, 15);
-  addKey("DISC2", Unmapped_Key, 0x0A98, 15);
-  addKey("DISC3", Unmapped_Key, 0x0998, 15);
-  addKey("DISC4", Unmapped_Key, 0x0B98, 15);
-  addKey("DISC5", Unmapped_Key, 0x0858, 15);
-  addKey("DISC6", Unmapped_Key, 0x0A58, 15);
-  addKey("REPEAT", Repeat_Key, 0x08A8, 15);
-  addKey("TAPE_A/B", Unmapped_Key, 0x1328, 15);
-  addKey("TAPE_PAUSE", Unmapped_Key, 0x12E8, 15);
-  addKey("TAPE_STOP", Unmapped_Key, 0x11E8, 15);
-  addKey("TAPE_REC", Unmapped_Key, 0x13E8, 15);
-  addKey("TAPE_REW", Unmapped_Key, 0x1368, 15);
-  addKey("TAPE_FF", Unmapped_Key, 0x1168, 15);
-  addKey("TAPE_PLAY_REV", Unmapped_Key, 0x13A8, 15);
-  addKey("TAPE_PLAY", Unmapped_Key, 0x10E8, 15);
-  addKey("TUNER_UP", ChannelUp_Key, 0x1AAC, 15);
-  addKey("TUNER_DOWN", ChannelDown_Key, 0x19AC, 15);
-  addKey("AMP_POWER", Power_Key, 0x2024, 15);
-  addKey("AMP_CD", Unmapped_Key, 0x2104, 15);
-  addKey("AMP_PHONO", Unmapped_Key, 0x2204, 15);
-  addKey("AMP_AUX", Unmapped_Key, 0x2084, 15);
-  addKey("AMP_TUNER", Unmapped_Key, 0x2304, 15);
-  addKey("AMP_TAPE-2", Unmapped_Key, 0x2164, 15);
-  addKey("AMP_TAPE-1", Unmapped_Key, 0x2264, 15);
-  addKey("AMP_MUTING", Mute_Key, 0x20BB, 15);
-  addKey("AMP_VOL_UP", VolumeUp_Key, 0x22C4, 15);
-  addKey("AMP_VOL_DOWN", VolumeDown_Key, 0x20C4, 15);
+  threadableProtocol = new SharpProtocol(guiObject, index, false);
+
+  addSharpKey("AMP_PHONO", Unmapped_Key, 0x02, 0x81);
+  addSharpKey("AMP_TUNER", Unmapped_Key, 0x02, 0x83);
+  addSharpKey("AMP_AUX", Unmapped_Key, 0x02, 0x84);
+  addSharpKey("AMP_MUTING", Mute_Key, 0x02, 0x8B);
+  addSharpKey("AMP_VOL_DOWN", VolumeDown_Key, 0x02, 0x8C);
+  addSharpKey("AMP_VOL_UP", VolumeUp_Key, 0x02, 0x8D);
+  addSharpKey("AMP_POWER", Power_Key, 0x02, 0x90);
+  addSharpKey("AMP_CD", Unmapped_Key, 0x02, 0x92);
+  addSharpKey("AMP_TAPE-1", Unmapped_Key, 0x02, 0x99);
+  addSharpKey("AMP_TAPE-2", Unmapped_Key, 0x02, 0x9A);
+
+  addSharpKey("TAPE_A/B", Unmapped_Key, 0x04, 0x53);
+  addSharpKey("TAPE_PLAY_REV", Unmapped_Key, 0x04, 0x57);
+  addSharpKey("TAPE_FF", Unmapped_Key, 0x04, 0x5A);
+  addSharpKey("TAPE_REW", Unmapped_Key, 0x04, 0x5B);
+  addSharpKey("TAPE_PLAY", Unmapped_Key, 0x04, 0x5C);
+  addSharpKey("TAPE_PAUSE", Unmapped_Key, 0x04, 0x5D);
+  addSharpKey("TAPE_STOP", Unmapped_Key, 0x04, 0x5E);
+  addSharpKey("TAPE_REC", Unmapped_Key, 0x04, 0x5F);
+  addSharpKey("DECK", Unmapped_Key, 0x04, 0x75);
+
+  addSharpKey("REPEAT", Repeat_Key, 0x08, 0x54);
+  addSharpKey("CD_NEXT", Next_Key, 0x08, 0x58);
+  addSharpKey("CD_BACK", Previous_Key, 0x08, 0x59);
+  addSharpKey("CD_FF", FastForward_Key, 0x08, 0x5A);
+  addSharpKey("CD_REW", Rewind_Key, 0x08, 0x5B);
+  addSharpKey("CD_PLAY", Play_Key, 0x08, 0x5C);
+  addSharpKey("CD_PAUSE", Pause_Key, 0x08, 0x5D);
+  addSharpKey("CD_STOP", Stop_Key, 0x08, 0x5E);
+  addSharpKey("DISC1", One_Key, 0x08, 0x64);
+  addSharpKey("DISC2", Two_Key, 0x08, 0x65);
+  addSharpKey("DISC3", Three_Key, 0x08, 0x66);
+  addSharpKey("DISC4", Four_Key, 0x08, 0x67);
+  addSharpKey("DISC5", Five_Key, 0x08, 0x68);
+  addSharpKey("DISC6", Six_Key, 0x08, 0x69);
+  addSharpKey("random", Random_Key, 0x08, 0x6A);
+  addSharpKey("CD", Unmapped_Key, 0x08, 0x73);
+  addSharpKey("disksk", DiscSelect_Key, 0x08, 0x6B);
+
+  addSharpKey("panel", Info_Key, 0x0C, 0x7E);
+  addSharpKey("TUNER_UP", ChannelUp_Key, 0x0C, 0xD5);
+  addSharpKey("TUNER_DOWN", ChannelDown_Key, 0x0C, 0xD6);
+  addSharpKey("TUNER", Unmapped_Key, 0x0C, 0xDD);
 }
 
 
@@ -518,21 +484,17 @@ DenonReceiver3a::DenonReceiver3a(
 
   addControlledDevice(Denon_Make, "DRA-385RD", Audio_Device);
 
-  addKey("random", Random_Key, 0x0958, 15);
-  addKey("repeat", Repeat_Key, 0x0B57, 15);
-  addKey("disksk", Unmapped_Key, 0x0B58, 15);
-  addKey("panel", Info_Key, 0x19F8, 15);
-  addKey("tape_mon", Unmapped_Key, 0x18E8, 15);
-  addKey("tape2", Unmapped_Key, 0x19E8, 15);
-  addKey("tape1", Unmapped_Key, 0x1AE8, 15);
-  addKey("video", Unmapped_Key, 0x1B28, 15);
-  addKey("tuner", Unmapped_Key, 0x1A68, 15);
-  addKey("cd", Unmapped_Key, 0x1968, 15);
-  addKey("phono", Unmapped_Key, 0x1868, 15);
-  addKey("preset+", Unmapped_Key, 0x1A37, 15);
-  addKey("preset-", Unmapped_Key, 0x1BC8, 15);
-  addKey("volup", VolumeUp_Key, 0x1937, 15);
-  addKey("voldwn", VolumeDown_Key, 0x18C8, 15);
+  addSharpKey("voldwn", VolumeDown_Key, 0x0C, 0x4C);
+  addSharpKey("volup", VolumeUp_Key, 0x0C, 0x4D);
+  addSharpKey("preset+", Unmapped_Key, 0x0C, 0x4E);
+  addSharpKey("preset-", Unmapped_Key, 0x0C, 0x4F);
+  addSharpKey("tape2", Unmapped_Key, 0x0C, 0x5E);
+  addSharpKey("video", Unmapped_Key, 0x0C, 0x53);
+  addSharpKey("phono", Unmapped_Key, 0x0C, 0x58);
+  addSharpKey("tuner", Unmapped_Key, 0x0C, 0x59);
+  addSharpKey("cd", Unmapped_Key, 0x0C, 0x5A);
+  addSharpKey("tape_mon", Unmapped_Key, 0x0C, 0x5C);
+  addSharpKey("tape1", Unmapped_Key, 0x0C, 0x5D);
 }
 
 
@@ -551,7 +513,8 @@ DenonReceiver4::DenonReceiver4(
     index,
     561, 489,
     561, 1543,
-    67329, true);
+    67329, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -592,55 +555,47 @@ DenonReceiver5::DenonReceiver5(
   addControlledDevice(Denon_Make, "AVR-700RD", Audio_Device);
   addControlledDevice(Denon_Make, "RC-841", Audio_Device);
 
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    336, 715,
-    336, 1769,
-    67376, true);
-
-  threadableProtocol = np;
-
-  np->setElevenBitToggle(true);
-
-  np->setTrailerPulse(337);
-
-  addKey("Power", Power_Key, 0x220C, 15);
-  addKey("CD_Disc_Skip_Plus", Unmapped_Key, 0x0B58, 15);
-  addKey("CD_Stop", Stop_Key, 0x09E8, 15);
-  addKey("CD_Play", Play_Key, 0x08E8, 15);
-  addKey("CD_Prev", Previous_Key, 0x0A68, 15);
-  addKey("CD_Pause", Pause_Key, 0x0AE8, 15);
-  addKey("CD_Next", Next_Key, 0x0868, 15);
-  addKey("Preset_Up", Unmapped_Key, 0x19AC, 15);
-  addKey("Preset_Down", Unmapped_Key, 0x1AAC, 15);
-  addKey("Shift", Unmapped_Key, 0x1ACC, 15);
-  addKey("Tuner", Unmapped_Key, 0x228C, 15);
-  addKey("CD", Unmapped_Key, 0x208C, 15);
-  addKey("Phono", Unmapped_Key, 0x230C, 15);
-  addKey("VCR", Unmapped_Key, 0x22CC, 15);
-  addKey("DVD_TV", Unmapped_Key, 0x214C, 15);
-  addKey("NoName1", Unmapped_Key, 0x20CC, 15);
-  addKey("DAT_Tape", Unmapped_Key, 0x212C, 15);
-  addKey("Stereo", Unmapped_Key, 0x239C, 15);
-  addKey("Mode", Unmapped_Key, 0x219C, 15);
-  addKey("Test_Tone", Unmapped_Key, 0x215C, 15);
-  addKey("Delay", Unmapped_Key, 0x225C, 15);
-  addKey("CenterVolumeUp", Unmapped_Key, 0x22BC, 15);
-  addKey("CenterVolumeDown", Unmapped_Key, 0x21BC, 15);
-  addKey("RearVolumeUp", Unmapped_Key, 0x233C, 15);
-  addKey("RearVolumeDown", Unmapped_Key, 0x20BC, 15);
-  addKey("Muting", Mute_Key, 0x203C, 15);
-  addKey("NoName2", Unmapped_Key, 0x23EC, 15);
-  addKey("Panel", Info_Key, 0x21EC, 15);
-  addKey("MasterVolumeUp", VolumeUp_Key, 0x223C, 15);
-  addKey("MasterVolumeDown", VolumeDown_Key, 0x213C, 15);
-  addKey("Deck_PlayLeft", Unmapped_Key, 0x13A8, 15);
-  addKey("Deck_Stop", Unmapped_Key, 0x11E8, 15);
-  addKey("Deck_PlayRight", Unmapped_Key, 0x10E8, 15);
-  addKey("Deck_Rewind", Unmapped_Key, 0x1368, 15);
-  addKey("Deck_A_B", Unmapped_Key, 0x1328, 15);
-  addKey("Deck_FastForward", Unmapped_Key, 0x1168, 15);
+  threadableProtocol = new SharpProtocol(guiObject, index, false);
+
+  addSharpKey("Power", Power_Key, 0x02, 0xC1);
+  addSharpKey("Phono", Unmapped_Key, 0x02, 0xC3);
+  addSharpKey("CD", Unmapped_Key, 0x02, 0xC4);
+  addSharpKey("Tuner", Unmapped_Key, 0x02, 0xC5);
+  addSharpKey("DVD_TV", Unmapped_Key, 0x02, 0xCA);
+  addSharpKey("NoName1", Unmapped_Key, 0x02, 0xCC);
+  addSharpKey("VCR", Unmapped_Key, 0x02, 0xCD);
+  addSharpKey("DAT_Tape", Unmapped_Key, 0x02, 0xD2);
+  addSharpKey("Panel", Info_Key, 0x02, 0xDE);
+  addSharpKey("NoName2", Unmapped_Key, 0x02, 0xDF);
+  addSharpKey("Mode", Unmapped_Key, 0x02, 0xE6);
+  addSharpKey("Stereo", Unmapped_Key, 0x02, 0xE7);
+  addSharpKey("Delay", Unmapped_Key, 0x02, 0xE9);
+  addSharpKey("Test_Tone", Unmapped_Key, 0x02, 0xEA);
+  addSharpKey("Muting", Mute_Key, 0x02, 0xF0);
+  addSharpKey("MasterVolumeUp", VolumeUp_Key, 0x02, 0xF1);
+  addSharpKey("MasterVolumeDown", VolumeDown_Key, 0x02, 0xF2);
+  addSharpKey("RearVolumeUp", Unmapped_Key, 0x02, 0xF3);
+  addSharpKey("RearVolumeDown", Unmapped_Key, 0x02, 0xF4);
+  addSharpKey("CenterVolumeUp", Unmapped_Key, 0x02, 0xF5);
+  addSharpKey("CenterVolumeDown", Unmapped_Key, 0x02, 0xF6);
+
+  addSharpKey("Deck_A_B", Unmapped_Key, 0x04, 0x53);
+  addSharpKey("Deck_PlayLeft", Unmapped_Key, 0x04, 0x57);
+  addSharpKey("Deck_FastForward", Unmapped_Key, 0x04, 0x5A);
+  addSharpKey("Deck_Rewind", Unmapped_Key, 0x04, 0x5B);
+  addSharpKey("Deck_PlayRight", Unmapped_Key, 0x04, 0x5C);
+  addSharpKey("Deck_Stop", Unmapped_Key, 0x04, 0x5E);
+
+  addSharpKey("CD_Next", Next_Key, 0x08, 0x58);
+  addSharpKey("CD_Prev", Previous_Key, 0x08, 0x59);
+  addSharpKey("CD_Pause", Pause_Key, 0x08, 0x5B);
+  addSharpKey("CD_Play", Play_Key, 0x08, 0x5C);
+  addSharpKey("CD_Stop", Stop_Key, 0x08, 0x5E);
+  addSharpKey("CD_Disc_Skip_Plus", DiscSelect_Key, 0x08, 0x6B);
+
+  addSharpKey("Preset_Down", ChannelDown_Key, 0x0C, 0xB5);
+  addSharpKey("Preset_Up", ChannelUp_Key, 0x0C, 0xB6);
+  addSharpKey("Shift", TunerBand_Key, 0x0C, 0xCD);
 }
 
 
@@ -658,96 +613,87 @@ DenonAudio1::DenonAudio1(
   addControlledDevice(Denon_Make, "DRA-275RD", Audio_Device);
   addControlledDevice(Denon_Make, "UD-M30", Audio_Device);
 
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    300, 750,
-    300, 1800,
-    67500, true);
-
-  threadableProtocol = np;
-
-  np->setElevenBitToggle(true);
-
-  np->setTrailerPulse(300);
-
-  addKey("KEY_POWER", Power_Key, 0x1828, 15); // "aus"
-  addKey("KEY_SLEEP", Sleep_Key, 0x1938, 15);
-  addKey("KEY_FN", Unmapped_Key, 0x1BE8, 15); // "func"
-  addKey("KEY_STOP", Stop_Key, 0x09E8, 15); // "CD_STOP"
-  addKey("KEY_PLAY", Play_Key, 0x08E8, 15); // "cdplay"
-  addKey("KEY_PAUSE", Pause_Key, 0x0AE8, 15); // "cdpause"
-  addKey("KEY_REWIND", Rewind_Key, 0x0B68, 15); // "cdfrew"
-  addKey("KEY_FORWARD", FastForward_Key, 0x0968, 15); // "cdffwd"
-  addKey("KEY_PREVIOUS", Previous_Key, 0x0A68, 15); // "cdrew", "cdprevtrack"
-  addKey("KEY_NEXT", Next_Key, 0x0868, 15); // "cdfwd", "cdnexttrack"
-  addKey("KEY_1", One_Key, 0x0908, 15);
-  addKey("KEY_2", Two_Key, 0x0B08, 15);
-  addKey("KEY_3", Three_Key, 0x0888, 15);
-  addKey("KEY_4", Four_Key, 0x0A88, 15);
-  addKey("KEY_5", Five_Key, 0x0988, 15);
-  addKey("KEY_6", Six_Key, 0x0B88, 15);
-  addKey("KEY_7", Seven_Key, 0x0BB7, 15);
-  addKey("KEY_8", Eight_Key, 0x0A48, 15);
-  addKey("KEY_9", Nine_Key, 0x0948, 15);
-  addKey("10", Zero_Key, 0x0B48, 15);
-  addKey("+10", DoubleDigit_Key, 0x08C8, 15);
-  addKey("DIRECT", Unmapped_Key, 0x0BA8, 15); // "direct"
-  addKey("KEY_PROGRAM", Program_Key, 0x0AC8, 15);
-  addKey("KEY_CANCEL", Clear_Key, 0x0A28, 15); // "cancel", "CD_CANCEL"
-  addKey("TUNER BAND", Unmapped_Key, 0x1BAC, 15);
-  addKey("TUNER KEY_DOWN", ChannelDown_Key, 0x196C, 15);
-  addKey("TUNER KEY_UP", ChannelUp_Key, 0x1A6C, 15);
-  addKey("CT", Unmapped_Key, 0x1B2C, 15); // "TUNER_CT"
-  addKey("RDS", Unmapped_Key, 0x192C, 15); // "TUNER_RDS"
-  addKey("PRESET DOWN", Down_Key, 0x1BC8, 15); // "dwn"
-  addKey("PRESET UP", Up_Key, 0x19C8, 15); // "up"
-  addKey("TAPE REW", Unmapped_Key, 0x13A8, 15); // "TAPE_PLAY_REV"
-  addKey("TAPE FWD", Unmapped_Key, 0x10E8, 15); // "TAPE_PLAY_FORW"
-  addKey("TAPE FAST REW", Unmapped_Key, 0x1368, 15); // "TAPE_REW"
-  addKey("TAPE FAST FWD", Unmapped_Key, 0x1168, 15); // "TAPE_FORW"
-  addKey("TAPE STOP", Unmapped_Key, 0x11E8, 15);
-  addKey("TAPE 2 REW", Unmapped_Key, 0x1398, 15);
-  addKey("TAPE 2 FWD", Unmapped_Key, 0x10D8, 15);
-  addKey("TAPE 2 FAST REW", Unmapped_Key, 0x1358, 15);
-  addKey("TAPE 2 FAST FWD", Unmapped_Key, 0x1158, 15);
-  addKey("TAPE 2 STOP", Unmapped_Key, 0x11D8, 15);
-  addKey("KEY_RECORD", Record_Key, 0x13D8, 15);
-  addKey("SDB", Unmapped_Key, 0x095C, 15);
-  addKey("KEY_VOLUMEDOWN", VolumeDown_Key, 0x18C8, 15);
-  addKey("KEY_VOLUMEUP", VolumeUp_Key, 0x1AC8, 15);
-  addKey("cdskip", Unmapped_Key, 0x0B58, 15);
-  addKey("tuner", Unmapped_Key, 0x1A68, 15);
-  addKey("repeat", Repeat_Key, 0x08A8, 15); // "CD_REPEAT"
-  addKey("random", Random_Key, 0x0958, 15); // "CD_RANDOM"
-  addKey("programm", Program_Key, 0x0AC8, 15);
-  addKey("edit", Unmapped_Key, 0x0838, 15); // "CD_EDIT"
-  addKey("time", Unmapped_Key, 0x0B28, 15); // "CD_TIME"
-  addKey("reset", Reset_Key, 0x10A8, 15);
-  addKey("remain", Unmapped_Key, 0x10B8, 15);
-  addKey("tapesize", Unmapped_Key, 0x1018, 15);
-  addKey("revmode", Unmapped_Key, 0x1118, 15);
-  addKey("memo", Unmapped_Key, 0x1A2C, 15);
-  addKey("pty", Unmapped_Key, 0x18AC, 15); // "TUNER_PTY"
-  addKey("panel", Info_Key, 0x19EC, 15);
-  addKey("eon", Unmapped_Key, 0x1BBC, 15);
-  addKey("auto_space", Unmapped_Key, 0x0A18, 15);
-  addKey("auto_edit", Unmapped_Key, 0x0B18, 15);
-  addKey("open_close", Eject_Key, 0x0828, 15);
-  addKey("fader", Unmapped_Key, 0x09B8, 15);
-  addKey("pitch-", Unmapped_Key, 0x0878, 15);
-  addKey("pitch+", Unmapped_Key, 0x0BB8, 15);
-  addKey("peak", Unmapped_Key, 0x0BD8, 15);
-  addKey("TAPE_AB", Unmapped_Key, 0x1328, 15);
-  addKey("TAPE_PAUSE", Unmapped_Key, 0x12E8, 15);
-  addKey("RCVR_PANEL", Info_Key, 0x19F8, 15);
-  addKey("RCVR_TAPE_MON", Unmapped_Key, 0x18E8, 15);
-  addKey("RCVR_TAPE2", Unmapped_Key, 0x19E8, 15);
-  addKey("RCVR_TAPE1", Unmapped_Key, 0x1AE8, 15);
-  addKey("RCVR_VIDEO", Unmapped_Key, 0x1B28, 15);
-  addKey("RCVR_TUNER", Unmapped_Key, 0x1A68, 15);
-  addKey("RCVR_CD", Unmapped_Key, 0x1A97, 15);
-  addKey("RCVR_PHONO", Unmapped_Key, 0x1868, 15);
+  threadableProtocol = new SharpProtocol(guiObject, index, false);
+
+  addSharpKey("reset", Reset_Key, 0x04, 0x54);
+  addSharpKey("TAPE REW", Unmapped_Key, 0x04, 0x57); // "TAPE_PLAY_REV"
+  addSharpKey("TAPE FAST FWD", Unmapped_Key, 0x04, 0x5A); // "TAPE_FORW"
+  addSharpKey("TAPE FAST REW", Unmapped_Key, 0x04, 0x5B); // "TAPE_REW"
+  addSharpKey("TAPE FWD", Unmapped_Key, 0x04, 0x5C); // "TAPE_PLAY_FORW"
+  addSharpKey("TAPE STOP", Unmapped_Key, 0x04, 0x5E);
+  addSharpKey("tapesize", Unmapped_Key, 0x04, 0x60);
+  addSharpKey("revmode", Unmapped_Key, 0x04, 0x62);
+  addSharpKey("TAPE_AB", Unmapped_Key, 0x04, 0x63);
+  addSharpKey("TAPE 2 REW", Unmapped_Key, 0x04, 0x67);
+  addSharpKey("TAPE 2 FAST FWD", Unmapped_Key, 0x04, 0x6A);
+  addSharpKey("TAPE 2 FAST REW", Unmapped_Key, 0x04, 0x6B);
+  addSharpKey("TAPE 2 FWD", Unmapped_Key, 0x04, 0x6C);
+  addSharpKey("TAPE_PAUSE", Unmapped_Key, 0x04, 0x6D);
+  addSharpKey("TAPE 2 STOP", Unmapped_Key, 0x04, 0x6E);
+  addSharpKey("KEY_RECORD", Record_Key, 0x04, 0x6F);
+  addSharpKey("remain", Unmapped_Key, 0x04, 0x74);
+
+  addSharpKey("KEY_1", One_Key, 0x08, 0x42);
+  addSharpKey("KEY_2", Two_Key, 0x08, 0x43);
+  addSharpKey("KEY_3", Three_Key, 0x08, 0x44);
+  addSharpKey("KEY_4", Four_Key, 0x08, 0x45);
+  addSharpKey("KEY_5", Five_Key, 0x08, 0x46);
+  addSharpKey("KEY_6", Six_Key, 0x08, 0x47);
+  addSharpKey("KEY_7", Seven_Key, 0x08, 0x48);
+  addSharpKey("KEY_8", Eight_Key, 0x08, 0x49);
+  addSharpKey("KEY_9", Nine_Key, 0x08, 0x4A);
+  addSharpKey("10", Zero_Key, 0x08, 0x4B);
+  addSharpKey("+10", DoubleDigit_Key, 0x08, 0x4C);
+  addSharpKey("KEY_PROGRAM", Program_Key, 0x08, 0x4D);
+  addSharpKey("open_close", Eject_Key, 0x08, 0x50);
+  addSharpKey("KEY_CANCEL", Clear_Key, 0x08, 0x51); // "cancel", "CD_CANCEL"
+  addSharpKey("time", Unmapped_Key, 0x08, 0x53); // "CD_TIME"
+  addSharpKey("repeat", Repeat_Key, 0x08, 0x54); // "CD_REPEAT"
+  addSharpKey("DIRECT", Unmapped_Key, 0x08, 0x57); // "direct"
+  addSharpKey("KEY_NEXT", Next_Key, 0x08, 0x58); // "cdfwd", "cdnexttrack"
+  addSharpKey("KEY_PREVIOUS", Previous_Key, 0x08, 0x59); // "cdrew", "cdprevtrack"
+  addSharpKey("KEY_FORWARD", FastForward_Key, 0x08, 0x5A); // "cdffwd"
+  addSharpKey("KEY_REWIND", Rewind_Key, 0x08, 0x5B); // "cdfrew"
+  addSharpKey("KEY_PLAY", Play_Key, 0x08, 0x5C); // "cdplay"
+  addSharpKey("KEY_PAUSE", Pause_Key, 0x08, 0x5D); // "cdpause"
+  addSharpKey("KEY_STOP", Stop_Key, 0x08, 0x5E); // "CD_STOP"
+  addSharpKey("auto_space", Unmapped_Key, 0x08, 0x61);
+  addSharpKey("auto_edit", Unmapped_Key, 0x08, 0x63);
+  addSharpKey("random", Random_Key, 0x08, 0x6A); // "CD_RANDOM"
+  addSharpKey("cdskip", Unmapped_Key, 0x08, 0x6B);
+  addSharpKey("DISC_SKIP+", DiscSelect_Key, 0x08, 0x6B); // "cdskip"
+  addSharpKey("DISC_SKIP-", Unmapped_Key, 0x08, 0x6E);
+  addSharpKey("peak", Unmapped_Key, 0x08, 0x6F);
+  addSharpKey("edit", Unmapped_Key, 0x08, 0x70); // "CD_EDIT"
+  addSharpKey("fader", Unmapped_Key, 0x08, 0x76);
+  addSharpKey("pitch+", Unmapped_Key, 0x08, 0x77);
+  addSharpKey("pitch-", Unmapped_Key, 0x08, 0x78);
+  addSharpKey("SDB", Unmapped_Key, 0x08, 0xEA);
+
+  addSharpKey("KEY_VOLUMEDOWN", VolumeDown_Key, 0x0C, 0x4C);
+  addSharpKey("KEY_VOLUMEUP", VolumeUp_Key, 0x0C, 0x4D);
+  addSharpKey("PRESET UP", Up_Key, 0x0C, 0x4E); // "up"
+  addSharpKey("PRESET DOWN", Down_Key, 0x0C, 0x4F); // "dwn"
+  addSharpKey("KEY_POWER", Power_Key, 0x0C, 0x50); // "aus"
+  addSharpKey("RCVR_VIDEO", Unmapped_Key, 0x0C, 0x53);
+  addSharpKey("RCVR_PHONO", Unmapped_Key, 0x0C, 0x58);
+  addSharpKey("tuner", Unmapped_Key, 0x0C, 0x59); // "RCVR_TUNER"
+  addSharpKey("RCVR_TAPE_MON", Unmapped_Key, 0x0C, 0x5C);
+  addSharpKey("RCVR_TAPE1", Unmapped_Key, 0x0C, 0x5D);
+  addSharpKey("RCVR_TAPE2", Unmapped_Key, 0x0C, 0x5E);
+  addSharpKey("KEY_FN", Unmapped_Key, 0x0C, 0x5F); // "func"
+  addSharpKey("RCVR_CD", Unmapped_Key, 0x0C, 0x6A);
+  addSharpKey("KEY_SLEEP", Sleep_Key, 0x0C, 0x72);
+//  addSharpKey("RCVR_PANEL", Info_Key, 0x0C, 0x7E);  // Either 0x7E or 0xDE here
+  addSharpKey("memo", Unmapped_Key, 0x0C, 0xD1);
+  addSharpKey("RDS", Unmapped_Key, 0x0C, 0xD2); // "TUNER_RDS"
+  addSharpKey("CT", Unmapped_Key, 0x0C, 0xD3); // "TUNER_CT"
+  addSharpKey("pty", Unmapped_Key, 0x0C, 0xD4); // "TUNER_PTY"
+  addSharpKey("TUNER BAND", Unmapped_Key, 0x0C, 0xD7);
+  addSharpKey("TUNER KEY_UP", ChannelUp_Key, 0x0C, 0xD9);
+  addSharpKey("TUNER KEY_DOWN", ChannelDown_Key, 0x0C, 0xDA);
+  addSharpKey("panel", Info_Key, 0x0C, 0xDE);
+  addSharpKey("eon", Unmapped_Key, 0x0C, 0xFE);
 }
 
 
@@ -762,9 +708,8 @@ DenonAudio1a::DenonAudio1a(
   addControlledDevice(Denon_Make, "UDR-F07", Audio_Device);
   addControlledDevice(Denon_Make, "UDRA-F07", Audio_Device);
 
-  addKey("rec", Record_Key, 0x13E8, 15);
-  addKey("side_a/b", Unmapped_Key, 0x0B28, 15);
-  addKey("cdstop", Stop_Key, 0x0A17, 15);
+  addSharpKey("rec", Record_Key, 0x04, 0x5F);
+  addSharpKey("side_a/b", Unmapped_Key, 0x08, 0x53);
 }
 
 
@@ -778,9 +723,9 @@ DenonAudio1b::DenonAudio1b(
   addControlledDevice(Denon_Make, "DCD-1015", Audio_Device);
   addControlledDevice(Denon_Make, "DCD-655", Audio_Device);
 
-  addKey("vol_down", VolumeDown_Key, 0x0BC8, 15);
-  addKey("vol_up", VolumeUp_Key, 0x09C8, 15);
-  addKey("display", Info_Key, 0x0AB8, 15);
+  addSharpKey("vol_up", VolumeUp_Key, 0x08, 0x4E);
+  addSharpKey("vol_down", VolumeDown_Key, 0x08, 0x4F);
+  addSharpKey("display", Info_Key, 0x08, 0x75);
 }
 
 
@@ -789,16 +734,11 @@ DenonAudio1c::DenonAudio1c(
   unsigned int index)
   : DenonAudio1b(guiObject, index)
 {
-  setKeysetName("Audio Keyset 1c (odd)");
+  setKeysetName("Audio Keyset 1c");
 
   addControlledDevice(Denon_Make, "DCM-260", Audio_Device);
 
-  addKey("RANDOM", Random_Key, 0x0AA7, 15);
-  addKey("2", Two_Key, 0x08F7, 15);
-  addKey("DISC_SELECT", Unmapped_Key, 0x0918, 15);
-//  addKey("DISC_SKIP+", Unmapped_Key, 0x0B58, 15); // already in parent...
-  addKey("DISC_SKIP-", Unmapped_Key, 0x0A27, 15); // not in parent
-  addKey("|<<", Previous_Key, 0x0997, 15);
+  addSharpKey("DISC_SELECT", DiscSelect_Key, 0x08, 0x62);
 }
 
 
@@ -816,12 +756,13 @@ DenonAudio1d::DenonAudio1d(
   addControlledDevice(Denon_Make, "UTU-F88", Audio_Device);
   addControlledDevice(Denon_Make, "RC-846", Audio_Device);
 
-  addKey("TAPE_REC", Record_Key, 0x13E8, 15);
-  addKey("MD_PLAY", Unmapped_Key, 0x311C, 15);
-  addKey("MD_STOP", Unmapped_Key, 0x321C, 15);
-  addKey("MD_REC", Unmapped_Key, 0x329C, 15);
-  addKey("MD_SEARCH_NEXT", Unmapped_Key, 0x325C, 15);
-  addKey("MD_SEARCH_PREVIOUS", Unmapped_Key, 0x315C, 15);
+  addSharpKey("TAPE_REC", Record_Key, 0x04, 0x5F);
+
+  addSharpKey("MD_STOP", Unmapped_Key, 0x06, 0xE1);
+  addSharpKey("MD_PLAY", Unmapped_Key, 0x06, 0xE2);
+  addSharpKey("MD_REC", Unmapped_Key, 0x06, 0xE5);
+  addSharpKey("MD_SEARCH_NEXT", Unmapped_Key, 0x06, 0xE9);
+  addSharpKey("MD_SEARCH_PREVIOUS", Unmapped_Key, 0x06, 0xEA);
 }
 
 
@@ -835,46 +776,47 @@ DenonAudio2::DenonAudio2(
 {
   addControlledDevice(Denon_Make, "D-C30", Audio_Device);
 
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0xDA25, 16);
-
-  addKey("Power", Power_Key, 0x00FF, 16);
-  addKey("Tuner_Band", Unmapped_Key, 0xE01F, 16);
-  addKey("EQ_Pattern", Unmapped_Key, 0x8877, 16);
-  addKey("Open/Close", Eject_Key, 0x18E7, 16);
-  addKey("1", One_Key, 0xB24D, 16);
-  addKey("2", Two_Key, 0x728D, 16);
-  addKey("3", Three_Key, 0xF20D, 16);
-  addKey("4", Four_Key, 0x0AF5, 16);
-  addKey("5", Five_Key, 0x8A75, 16);
-  addKey("6", Six_Key, 0x4AB5, 16);
-  addKey("7", Seven_Key, 0xCA35, 16);
-  addKey("8", Eight_Key, 0x2AD5, 16);
-  addKey("9", Nine_Key, 0xAA55, 16);
-  addKey("10", Unmapped_Key, 0x6A95, 16);
-  addKey("0/11", Zero_Key, 0xDA25, 16);
-  addKey("10+/12", DoubleDigit_Key, 0xEA15, 16);
-  addKey("Record_Pause", Unmapped_Key, 0xF807, 16);
-  addKey("Play_Backward", Unmapped_Key, 0x4B87, 16);
-  addKey("Stop", Unmapped_Key, 0xB847, 16);
-  addKey("Play_Forward", Unmapped_Key, 0x9867, 16);
-  addKey("A.Edit", Unmapped_Key, 0x20DF, 16);
-  addKey("Fast_Rewind", Unmapped_Key, 0x38C7, 16);
-  addKey("Fast_Forward", Unmapped_Key, 0xD827, 16);
-  addKey("Tape_1/2", Unmapped_Key, 0x906F, 16);
-  addKey("Remain", Unmapped_Key, 0xC03F, 16);
-  addKey("Random", Random_Key, 0x5AA5, 16);
-  addKey("Prog", Program_Key, 0x6897, 16);
-  addKey("Disc", Unmapped_Key, 0x7A85, 16);
-  addKey("Skip_Backward", Previous_Key, 0xA857, 16);
-  addKey("Skip_Forward", Next_Key, 0x28D7, 16);
-  addKey("CD_Stop", Stop_Key, 0xC837, 16);
-  addKey("CD_Play", Play_Key, 0x48B7, 16);
-  addKey("P.Mode", Unmapped_Key, 0xD02F, 16);
-  addKey("Repeat", Repeat_Key, 0xE817, 16);
-  addKey("Volume_Down", VolumeDown_Key, 0x40BF, 16);
-  addKey("Volume_Up", VolumeUp_Key, 0x807F, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0xDA25, 16);
+  setPreData(0x5B, 8);
+
+  addKey("Power", Power_Key, 0x00, 8);
+  addKey("Volume_Up", VolumeUp_Key, 0x01, 8);
+  addKey("Volume_Down", VolumeDown_Key, 0x02, 8);
+  addKey("Remain", Unmapped_Key, 0x03, 8);
+  addKey("A.Edit", Unmapped_Key, 0x04, 8);
+  addKey("Tuner_Band", TunerBand_Key, 0x07, 8);
+  addKey("Tape_1/2", Unmapped_Key, 0x09, 8);
+  addKey("P.Mode", Unmapped_Key, 0x0B, 8);
+  addKey("EQ_Pattern", Unmapped_Key, 0x11, 8);
+  addKey("CD_Play", Play_Key, 0x12, 8);
+  addKey("CD_Stop", Stop_Key, 0x13, 8);
+  addKey("Skip_Forward", Next_Key, 0x14, 8);
+  addKey("Skip_Backward", Previous_Key, 0x15, 8);
+  addKey("Prog", Program_Key, 0x16, 8);
+  addKey("Repeat", Repeat_Key, 0x17, 8);
+  addKey("Open/Close", Eject_Key, 0x18, 8);
+  addKey("Fast_Forward", FastForward_Key, 0x1B, 8);
+  addKey("Fast_Rewind", Rewind_Key, 0x1C, 8);
+  addKey("Stop", Unmapped_Key, 0x1D, 8);
+  addKey("Play_Forward", Unmapped_Key, 0x19, 8);
+  addKey("Record_Pause", Unmapped_Key, 0x1F, 8);
+  addKey("1", One_Key, 0x4D, 8);
+  addKey("2", Two_Key, 0x4E, 8);
+  addKey("3", Three_Key, 0x4F, 8);
+  addKey("4", Four_Key, 0x50, 8);
+  addKey("5", Five_Key, 0x51, 8);
+  addKey("6", Six_Key, 0x52, 8);
+  addKey("7", Seven_Key, 0x53, 8);
+  addKey("8", Eight_Key, 0x54, 8);
+  addKey("9", Nine_Key, 0x55, 8);
+  addKey("10", Unmapped_Key, 0x56, 8);
+  addKey("10+/12", DoubleDigit_Key, 0x57, 8);
+  addKey("Random", Random_Key, 0x5A, 8);
+  addKey("0/11", Zero_Key, 0x5B, 8);
+  addKey("Disc", Unmapped_Key, 0x5E, 8);
+  addKey("Play_Backward", Unmapped_Key, 0xD2, 8);
 }
 
 
@@ -891,7 +833,8 @@ DenonAudio3::DenonAudio3(
     index,
     336, 717,
     336, 1773,
-    67458, true);
+    67458, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -944,7 +887,8 @@ DenonAudio4::DenonAudio4(
     index,
     275, 775,
     275, 1900,
-    43000, false);
+    43000, false,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -996,63 +940,63 @@ DenonAudio5::DenonAudio5(
 {
   addControlledDevice(Denon_Make, "D-G1MD", Audio_Device);
 
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x4040, 16);
-
-  addKey("fm/am", Unmapped_Key, 0x00FF, 16);
-  addKey("tape", Unmapped_Key, 0x10EF, 16);
-  addKey("cd", Unmapped_Key, 0x08F7, 16);
-  addKey("md", Unmapped_Key, 0x02FD, 16);
-  addKey("aux", Unmapped_Key, 0x18E7, 16);
-  addKey("rds", Unmapped_Key, 0x807F, 16);
-  addKey("pty", Unmapped_Key, 0x906F, 16);
-  addKey("ct", Unmapped_Key, 0x8877, 16);
-  addKey("rt", Unmapped_Key, 0x9867, 16);
-  addKey("fmmode", Unmapped_Key, 0x827D, 16);
-  addKey("1", One_Key, 0x40BF, 16);
-  addKey("2", Two_Key, 0x50AF, 16);
-  addKey("3", Three_Key, 0x48B7, 16);
-  addKey("4", Four_Key, 0x58A7, 16);
-  addKey("5", Five_Key, 0x42BD, 16);
-  addKey("6", Six_Key, 0xC03F, 16);
-  addKey("7", Seven_Key, 0xD02F, 16);
-  addKey("8", Eight_Key, 0xC837, 16);
-  addKey("9", Nine_Key, 0xD827, 16);
-  addKey("0", Zero_Key, 0xC23D, 16);
-  addKey("+10", DoubleDigit_Key, 0x20DF, 16);
-  addKey("+100", PlusOneHundred_Key, 0x30CF, 16);
-  addKey("clock", Unmapped_Key, 0x28D7, 16);
-  addKey("timer", Unmapped_Key, 0x38C7, 16);
-  addKey("sleep", Sleep_Key, 0x22DD, 16);
-  addKey("set", Unmapped_Key, 0xA25D, 16);
-  addKey("mdrec", Unmapped_Key, 0xA05F, 16);
-  addKey("pickrec", Unmapped_Key, 0xB04F, 16);
-  addKey("checkspace", Unmapped_Key, 0xA857, 16);
-  addKey("clear", Clear_Key, 0xB847, 16);
-  addKey("enter", Enter_Key, 0x629D, 16);
-  addKey("recmute", Unmapped_Key, 0x609F, 16);
-  addKey("revmode", Unmapped_Key, 0x708F, 16);
-  addKey("dolby", Unmapped_Key, 0x6897, 16);
-  addKey("5modesrs", Surround_Key, 0xE21D, 16);
-  addKey("edit", Unmapped_Key, 0xE01F, 16);
-  addKey("editcancel", Unmapped_Key, 0xF00F, 16);
-  addKey("titleinput", Unmapped_Key, 0x7887, 16);
-  addKey("titlesearch", Unmapped_Key, 0x12ED, 16);
-  addKey("edit", Unmapped_Key, 0xE01F, 16);
-  addKey("repeat", Repeat_Key, 0x52AD, 16);
-  addKey("random", Random_Key, 0xD22D, 16);
-  addKey("prog", Program_Key, 0xE817, 16);
-  addKey("vol-", VolumeDown_Key, 0xF807, 16);
-  addKey("vol+", VolumeUp_Key, 0x926D, 16);
-  addKey("power", Power_Key, 0x32CD, 16);
-  addKey("mute", Mute_Key, 0xF20D, 16);
-  addKey("bass", Unmapped_Key, 0x0AF5, 16);
-  addKey("eqmode", Unmapped_Key, 0x728D, 16);
-  addKey("timedisp", Info_Key, 0xB24D, 16);
-  addKey("forward", FastForward_Key, 0x8A75, 16);
-  addKey("prev", Previous_Key, 0x4AB5, 16);
-  addKey("stop", Stop_Key, 0xEA15, 16);
-  addKey("next", Next_Key, 0xCA35, 16);
-  addKey("backward", Rewind_Key, 0x6A95, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Extended_NEC);
+
+//  setPreData(0x4040, 16);
+  setPreData(0x0202, 16);
+
+  addKey("fm/am", Unmapped_Key, 0x00, 8);
+  addKey("rds", Unmapped_Key, 0x01, 8);
+  addKey("1", One_Key, 0x02, 8);
+  addKey("6", Six_Key, 0x03, 8);
+  addKey("+10", DoubleDigit_Key, 0x04, 8);
+  addKey("mdrec", Unmapped_Key, 0x05, 8);
+  addKey("recmute", Unmapped_Key, 0x06, 8);
+  addKey("edit", Unmapped_Key, 0x07, 8);
+  addKey("tape", Unmapped_Key, 0x08, 8);
+  addKey("pty", Unmapped_Key, 0x09, 8);
+  addKey("2", Two_Key, 0x0A, 8);
+  addKey("7", Seven_Key, 0x0B, 8);
+  addKey("+100", PlusOneHundred_Key, 0x0C, 8);
+  addKey("pickrec", Unmapped_Key, 0x0D, 8);
+  addKey("revmode", Unmapped_Key, 0x0E, 8);
+  addKey("editcancel", Unmapped_Key, 0x0F, 8);
+  addKey("cd", Unmapped_Key, 0x10, 8);
+  addKey("ct", Unmapped_Key, 0x11, 8);
+  addKey("3", Three_Key, 0x12, 8);
+  addKey("8", Eight_Key, 0x13, 8);
+  addKey("clock", Unmapped_Key, 0x14, 8);
+  addKey("checkspace", Unmapped_Key, 0x15, 8);
+  addKey("dolby", Unmapped_Key, 0x16, 8);
+  addKey("prog", Program_Key, 0x17, 8);
+  addKey("aux", Unmapped_Key, 0x18, 8);
+  addKey("rt", Unmapped_Key, 0x19, 8);
+  addKey("4", Four_Key, 0x1A, 8);
+  addKey("9", Nine_Key, 0x1B, 8);
+  addKey("timer", Timer_Key, 0x1C, 8);
+  addKey("clear", Clear_Key, 0x1D, 8);
+  addKey("titleinput", Unmapped_Key, 0x1E, 8);
+  addKey("vol-", VolumeDown_Key, 0x1F, 8);
+  addKey("md", Unmapped_Key, 0x40, 8);
+  addKey("fmmode", Unmapped_Key, 0x41, 8);
+  addKey("5", Five_Key, 0x42, 8);
+  addKey("0", Zero_Key, 0x43, 8);
+  addKey("sleep", Sleep_Key, 0x44, 8);
+  addKey("set", Unmapped_Key, 0x45, 8);
+  addKey("enter", Enter_Key, 0x46, 8);
+  addKey("5modesrs", Surround_Key, 0x47, 8);
+  addKey("titlesearch", Unmapped_Key, 0x48, 8);
+  addKey("vol+", VolumeUp_Key, 0x49, 8);
+  addKey("repeat", Repeat_Key, 0x4A, 8);
+  addKey("random", Random_Key, 0x4B, 8);
+  addKey("power", Power_Key, 0x4C, 8);
+  addKey("timedisp", Info_Key, 0x4D, 8);
+  addKey("eqmode", Unmapped_Key, 0x4E, 8);
+  addKey("mute", Mute_Key, 0x4F, 8);
+  addKey("bass", Unmapped_Key, 0x50, 8);
+  addKey("forward", FastForward_Key, 0x51, 8);
+  addKey("prev", Previous_Key, 0x52, 8);
+  addKey("next", Next_Key, 0x53, 8);
+  addKey("backward", Rewind_Key, 0x56, 8);
+  addKey("stop", Stop_Key, 0x57, 8);
 }
index f0ea158..71f3ee8 100644 (file)
@@ -2,11 +2,11 @@
 #include "rc5protocol.h"
 
 // Based on LIRC Ei-TV90 config file
-EiKeyset::EiKeyset(
+EiTV1::EiTV1(
   QObject *guiObject,
   unsigned int index)
   : PIRKeysetMetaData(
-      "Ei-TV90",
+      "TV Keyset 1",
       Ei_Make,
       index)
 {
@@ -18,21 +18,7 @@ EiKeyset::EiKeyset(
 
   threadableProtocol = new RC5Protocol(guiObject, index, 0x40);
 
-  addKey("i", Unmapped_Key, 0x35, 6);
-  addKey("a", Unmapped_Key, 0x37, 6);
-  addKey("b", Unmapped_Key, 0x36, 6);
-  addKey("c", Unmapped_Key, 0x32, 6);
-  addKey("d", Unmapped_Key, 0x34, 6);
-  addKey("Page Down", Unmapped_Key, 0x0B, 6);
-  addKey("Page Up", Unmapped_Key, 0x0A, 6);
-  addKey("TV in TXT", Unmapped_Key, 0x2D, 6);
-  addKey("Stop TXT", Unmapped_Key, 0x29, 6);
-  addKey("Time TXT", Unmapped_Key, 0x2A, 6);
-  addKey("TV", Unmapped_Key, 0x3F, 6);
-  addKey("TXT On", Unmapped_Key, 0x3C, 6);
-  addKey("?", Unmapped_Key, 0x2C, 6);
-  addKey("Zoom", Unmapped_Key, 0x2B, 6);
-  addKey("Background TV", Unmapped_Key, 0x2E, 6);
+  addKey("0", Zero_Key, 0x00, 6);
   addKey("1", One_Key, 0x01, 6);
   addKey("2", Two_Key, 0x02, 6);
   addKey("3", Three_Key, 0x03, 6);
@@ -42,24 +28,38 @@ EiKeyset::EiKeyset(
   addKey("7", Seven_Key, 0x07, 6);
   addKey("8", Eight_Key, 0x08, 6);
   addKey("9", Nine_Key, 0x09, 6);
-  addKey("0", Zero_Key, 0x00, 6);
-  addKey("LIGHT-", Unmapped_Key, 0x13, 6);
+  addKey("-/--", DoubleDigit_Key, 0x0A, 6);
+  addKey("Page Up", TeletextUp_Key, 0x0A, 6);
+  addKey("Page Down", TeletextDown_Key, 0x0B, 6);
+  addKey("ON-OFF", Power_Key, 0x0C, 6);
+  addKey("MUTE", Mute_Key, 0x0D, 6);
+  addKey("->*<-PP", Unmapped_Key, 0x0E, 6);
+  addKey("TV_STATUS", Info_Key, 0x0F, 6);
+  addKey("VOLUME+", VolumeUp_Key, 0x10, 6);
+  addKey("VOLUME-", VolumeDown_Key, 0x11, 6);
   addKey("LIGHT+", Unmapped_Key, 0x12, 6);
-  addKey("COLOR-", Unmapped_Key, 0x15, 6);
+  addKey("LIGHT-", Unmapped_Key, 0x13, 6);
   addKey("COLOR+", Unmapped_Key, 0x14, 6);
-  addKey("CONTRAST-", Unmapped_Key, 0x1D, 6);
+  addKey("COLOR-", Unmapped_Key, 0x15, 6);
   addKey("CONTRAST+", Unmapped_Key, 0x1C, 6);
-  addKey("VOLUME-", VolumeDown_Key, 0x11, 6);
-  addKey("VOLUME+", VolumeUp_Key, 0x10, 6);
+  addKey("CONTRAST-", Unmapped_Key, 0x1D, 6);
   addKey("->*", Unmapped_Key, 0x1E, 6);
-  addKey("AV", Input_Key, 0x38, 6);
-  addKey("-/--", Unmapped_Key, 0x0A, 6);
-  addKey("TV_STATUS", Info_Key, 0x0F, 6);
-  addKey("SLEEP", Sleep_Key, 0x26, 6);
-  addKey("P<P", Unmapped_Key, 0x22, 6);
-  addKey("->*<-PP", Unmapped_Key, 0x0E, 6);
-  addKey("P-", ChannelDown_Key, 0x21, 6);
   addKey("P+", ChannelUp_Key, 0x20, 6);
-  addKey("MUTE", Mute_Key, 0x0D, 6);
-  addKey("ON-OFF", Power_Key, 0x0C, 6);
+  addKey("P-", ChannelDown_Key, 0x21, 6);
+  addKey("P<P", PrevChannel_Key, 0x22, 6);
+  addKey("SLEEP", Sleep_Key, 0x26, 6);
+  addKey("Stop TXT", TeletextHold_Key, 0x29, 6);
+  addKey("Time TXT", TeletextTime_Key, 0x2A, 6);
+  addKey("Zoom", TeletextSize_Key, 0x2B, 6);
+  addKey("?", TeletextReveal_Key, 0x2C, 6);
+  addKey("TV in TXT", TeletextAndTV_Key, 0x2D, 6);
+  addKey("Background TV", TeletextBackgroundTV_Key, 0x2E, 6);
+  addKey("c", Unmapped_Key, 0x32, 6);
+  addKey("d", Unmapped_Key, 0x34, 6);
+  addKey("i", Unmapped_Key, 0x35, 6);
+  addKey("b", Unmapped_Key, 0x36, 6);
+  addKey("a", Unmapped_Key, 0x37, 6);
+  addKey("AV", Input_Key, 0x38, 6);
+  addKey("TXT On", Teletext_Key, 0x3C, 6);
+  addKey("TV", TeletextOff_Key, 0x3F, 6);
 }
index 64aa32c..8956156 100644 (file)
@@ -5,10 +5,10 @@
 
 #include <QObject>
 
-class EiKeyset: public PIRKeysetMetaData
+class EiTV1: public PIRKeysetMetaData
 {
 public:
-  EiKeyset(
+  EiTV1(
     QObject *guiObject,
     unsigned int index);
 };
diff --git a/keysets/elgato.cpp b/keysets/elgato.cpp
new file mode 100644 (file)
index 0000000..6e0c298
--- /dev/null
@@ -0,0 +1,66 @@
+#include "elgato.h"
+#include "necprotocol.h"
+
+ElgatoEyeTV1::ElgatoEyeTV1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "EyeTV Keyset 1",
+      Elgato_Make,
+      index)
+{
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+  setPreData(0x45, 8);
+
+  addKey("KEY_POWER", Power_Key, 0x01, 8);
+  addKey("KEY_MUTE", Mute_Key, 0x02, 8);
+  addKey("KEY_1", One_Key, 0x03, 8);
+  addKey("KEY_2", Two_Key, 0x04, 8);
+  addKey("KEY_3", Three_Key, 0x05, 8);
+  addKey("KEY_4", Four_Key, 0x06, 8);
+  addKey("KEY_5", Five_Key, 0x07, 8);
+  addKey("KEY_6", Six_Key, 0x08, 8);
+  addKey("KEY_7", Seven_Key, 0x09, 8);
+  addKey("KEY_8", Eight_Key, 0x0A, 8);
+  addKey("KEY_9", Nine_Key, 0x0B, 8);
+  addKey("KEY_LAST", PrevChannel_Key, 0x0C, 8);
+  addKey("KEY_0", Zero_Key, 0x0D, 8);
+  addKey("KEY_ENTER", Enter_Key, 0x0E, 8);
+  addKey("KEY_RED", Red_Key, 0x0F, 8);
+  addKey("KEY_CHANNELUP", ChannelUp_Key, 0x10, 8);
+  addKey("KEY_CHANNELUP", Up_Key, 0x10, 8);
+  addKey("KEY_GREEN", Green_Key, 0x11, 8);
+  addKey("KEY_VOLUMEDOWN", VolumeDown_Key, 0x12, 8);
+  addKey("KEY_VOLUMEDOWN", Left_Key, 0x12, 8);
+  addKey("KEY_OK", Select_Key, 0x13, 8);
+  addKey("KEY_VOLUMEUP", VolumeUp_Key, 0x14, 8);
+  addKey("KEY_VOLUMEUP", Right_Key, 0x14, 8);
+  addKey("KEY_YELLOW", Yellow_Key, 0x15, 8);
+  addKey("KEY_CHANNELDOWN", ChannelDown_Key, 0x16, 8);
+  addKey("KEY_CHANNELDOWN", Down_Key, 0x16, 8);
+  addKey("KEY_BLUE", Blue_Key, 0x17, 8);
+  addKey("Replay", Replay_Key, 0x18, 8);
+  addKey("Play/Pause", Play_Key, 0x19, 8);
+  addKey("Play/Pause", Pause_Key, 0x19, 8);
+  addKey("Advance", Advance_Key, 0x1A, 8);
+  addKey("Rewind", Rewind_Key, 0x1B, 8);
+  addKey("L", LiveTV_Key, 0x1C, 8);
+  addKey("FastForward", FastForward_Key, 0x1D, 8);
+
+  // Dual function keys:
+  addKey("Stop", Stop_Key, 0x1E, 8);
+  addKey("Reveal", TeletextReveal_Key, 0x1E, 8);
+
+  addKey("Menu", Menu_Key, 0x1F, 8);
+  addKey("Txt", Teletext_Key, 0x1F, 8);
+
+  addKey("Record", Record_Key, 0x40, 8);
+  addKey("Size", TeletextSize_Key, 0x40, 8);
+
+  addKey("Screen", AspectRatio_Key, 0x41, 8);
+  addKey("Hold", TeletextHold_Key, 0x41, 8);
+
+  addKey("Select", Input_Key, 0x42, 8);
+  addKey("Select", TeletextSelect_Key, 0x42, 8);
+}
diff --git a/keysets/elgato.h b/keysets/elgato.h
new file mode 100644 (file)
index 0000000..a5a1baf
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef ELGATO_H
+#define ELGATO_H
+
+#include "pirkeysetmetadata.h"
+#include <QObject>
+
+class ElgatoEyeTV1: public PIRKeysetMetaData
+{
+public:
+  ElgatoEyeTV1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+#endif // ELGATO_H
index e7d7996..a72b57a 100644 (file)
@@ -12,39 +12,40 @@ GoldStarTV1::GoldStarTV1(
 {
   addControlledDevice(GoldStar_Make, "105-210A", TV_Device);
 
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x20DF, 16);
-
-  addKey("power", Power_Key, 0x10EF, 16);
-  addKey("mute", Mute_Key, 0x906F, 16);
-  addKey("1", One_Key, 0x8877, 16);
-  addKey("2", Two_Key, 0x48B7, 16);
-  addKey("3", Three_Key, 0xC837, 16);
-  addKey("4", Four_Key, 0x28D7, 16);
-  addKey("5", Five_Key, 0xA857, 16);
-  addKey("6", Six_Key, 0x6897, 16);
-  addKey("7", Seven_Key, 0xE817, 16);
-  addKey("8", Eight_Key, 0x18E7, 16);
-  addKey("9", Nine_Key, 0x9867, 16);
-  addKey("0", Zero_Key, 0x08F7, 16);
-  addKey("lowhigh", DoubleDigit_Key, 0x38C7, 16);
-  addKey("recall", PrevChannel_Key, 0xD827, 16);
-  addKey("prup", ChannelUp_Key, 0x00FF, 16);
-  addKey("prdown", ChannelDown_Key, 0x807F, 16);
-  addKey("volup", VolumeUp_Key, 0x40BF, 16);
-  addKey("voldown", VolumeDown_Key, 0xC03F, 16);
-  addKey("ok", Select_Key, 0x22DD, 16);
-  addKey("prup", Up_Key, 0x00FF, 16);
-  addKey("voldown", Left_Key, 0xC03F, 16);
-  addKey("volup", Right_Key, 0x40BF, 16);
-  addKey("prdown", Down_Key, 0x807F, 16);
-  addKey("tvav", Input_Key, 0xD02F, 16);
-  addKey("menu", Menu_Key, 0xC23D, 16);
-  addKey("psm", Unmapped_Key, 0xF20D, 16);
-  addKey("sleep", Sleep_Key, 0x708F, 16);
-  addKey("qview", Unmapped_Key, 0x58A7, 16);
-  addKey("picture", PictureMode_Key, 0x30CF, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0x20DF, 16);
+  setPreData(0x04, 8);
+
+  addKey("prup", ChannelUp_Key, 0x00, 8);
+  addKey("prup", Up_Key, 0x00, 8);
+  addKey("prdown", ChannelDown_Key, 0x01, 8);
+  addKey("prdown", Down_Key, 0x01, 16);
+  addKey("volup", VolumeUp_Key, 0x02, 8);
+  addKey("volup", Right_Key, 0x02, 8);
+  addKey("voldown", VolumeDown_Key, 0x03, 8);
+  addKey("voldown", Left_Key, 0x03, 8);
+  addKey("power", Power_Key, 0x08, 8);
+  addKey("mute", Mute_Key, 0x09, 8);
+  addKey("tvav", Input_Key, 0x0B, 8);
+  addKey("picture", PictureMode_Key, 0x0C, 8);
+  addKey("sleep", Sleep_Key, 0x0E, 8);
+  addKey("0", Zero_Key, 0x10, 8);
+  addKey("1", One_Key, 0x11, 8);
+  addKey("2", Two_Key, 0x12, 8);
+  addKey("3", Three_Key, 0x13, 8);
+  addKey("4", Four_Key, 0x14, 8);
+  addKey("5", Five_Key, 0x15, 8);
+  addKey("6", Six_Key, 0x16, 8);
+  addKey("7", Seven_Key, 0x17, 8);
+  addKey("8", Eight_Key, 0x18, 8);
+  addKey("9", Nine_Key, 0x19, 8);
+  addKey("qview", Unmapped_Key, 0x1A, 8);
+  addKey("recall", PrevChannel_Key, 0x1B, 8);
+  addKey("lowhigh", DoubleDigit_Key, 0x1C, 8);
+  addKey("menu", Menu_Key, 0x43, 8);
+  addKey("ok", Select_Key, 0x44, 8);
+  addKey("psm", Unmapped_Key, 0x4F, 8);
 }
 
 
@@ -68,34 +69,33 @@ GoldStarTV2::GoldStarTV2(
   addKey("7", Seven_Key, 0x07, 6);
   addKey("8", Eight_Key, 0x08, 6);
   addKey("9", Nine_Key, 0x09, 6);
-  addKey("MUTE", Mute_Key, 0x0D, 6);
-  addKey("POWER", Power_Key, 0x0C, 6);
-  addKey("TV", Unmapped_Key, 0x3F, 6);
-  addKey("AV", Unmapped_Key, 0x38, 6);
-  addKey("LOOP", Unmapped_Key, 0x22, 6);
   addKey("-/--", DoubleDigit_Key, 0x0A, 6);
-  addKey("PP", Unmapped_Key, 0x0E, 6);
-  addKey("MENU", Menu_Key, 0x3B, 6);
-  addKey("OK", Select_Key, 0x25, 6);
-  addKey("OK", Enter_Key, 0x25, 6);
-  addKey("VOL-", VolumeDown_Key, 0x11, 6);
+  addKey("<=", Unmapped_Key, 0x0B, 6);
+  addKey("POWER", Power_Key, 0x0C, 6);
+  addKey("MUTE", Mute_Key, 0x0D, 6);
+  addKey("PP", PrevChannel_Key, 0x0E, 6);
   addKey("VOL+", VolumeUp_Key, 0x10, 6);
-  addKey("PROG-", ChannelDown_Key, 0x21, 6);
+  addKey("VOL-", VolumeDown_Key, 0x11, 6);
   addKey("PROG+", ChannelUp_Key, 0x20, 6);
-  addKey("<=", Unmapped_Key, 0x0B, 6);
-  addKey("=", Unmapped_Key, 0x3C, 6);
-  addKey("RED", Red_Key, 0x37, 6);
-  addKey("GREEN", Green_Key, 0x36, 6);
-  addKey("YELLOW", Yellow_Key, 0x32, 6);
-  addKey("BLUE", Blue_Key, 0x34, 6);
-  addKey("=/", Unmapped_Key, 0x2E, 6);
+  addKey("PROG-", ChannelDown_Key, 0x21, 6);
+  addKey("LOOP", Unmapped_Key, 0x22, 6);
+  addKey("OK", Select_Key, 0x25, 6);
+  addKey(">=<", Unmapped_Key, 0x29, 6);
   addKey("=o", Unmapped_Key, 0x2A, 6);
-  addKey("=?", Unmapped_Key, 0x2C, 6);
-  addKey("=i", Unmapped_Key, 0x35, 6);
   addKey("=^", Unmapped_Key, 0x2B, 6);
-  addKey(">=<", Unmapped_Key, 0x29, 6);
+  addKey("=?", TeletextReveal_Key, 0x2C, 6);
   addKey("=X", Unmapped_Key, 0x2D, 6);
+  addKey("=/", Unmapped_Key, 0x2E, 6);
+  addKey("YELLOW", Yellow_Key, 0x32, 6);
+  addKey("BLUE", Blue_Key, 0x34, 6);
+  addKey("=i", Unmapped_Key, 0x35, 6);
+  addKey("GREEN", Green_Key, 0x36, 6);
+  addKey("RED", Red_Key, 0x37, 6);
+  addKey("AV", Unmapped_Key, 0x38, 6);
+  addKey("MENU", Menu_Key, 0x3B, 6);
+  addKey("=", Unmapped_Key, 0x3C, 6);
   addKey("=M", Unmapped_Key, 0x3E, 6);
+  addKey("TV", Unmapped_Key, 0x3F, 6);
 }
 
 
@@ -110,54 +110,57 @@ GoldStarVCR1::GoldStarVCR1(
   addControlledDevice(GoldStar_Make, "GSE-Q204P", VCR_Device);
   addControlledDevice(GoldStar_Make, "QUISY 500", VCR_Device);
 
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x7689, 16);
-
-  addKey("power", Power_Key, 0x28D7, 16);
-  addKey("eject", Eject_Key, 0x00FF, 16);
-  addKey("a_trk", AutoTracking_Key, 0xFA05, 16);
-  addKey("tracking+", TrackingPlus_Key, 0x22DD, 16);
-  addKey("tracking-", TrackingMinus_Key, 0xA25D, 16);
-  addKey("prog+", ChannelUp_Key, 0x18E7, 16);
-  addKey("prog-", ChannelDown_Key, 0x9867, 16);
-  addKey("child_lock", Unmapped_Key, 0xFC03, 16);
-  addKey("play", Play_Key, 0x10EF, 16);
-  addKey("<rew", Rewind_Key, 0x40BF, 16);
-  addKey("ff>", FastForward_Key, 0xC03F, 16);
-  addKey("pause||", Pause_Key, 0xD02F, 16);
-  addKey("stop", Stop_Key, 0x807F, 16);
-  addKey("record", Record_Key, 0x906F, 16);
-  addKey("reset", Reset_Key, 0xB24D, 16);
-  addKey("clock_count", Unmapped_Key, 0x32CD, 16); // "memory"
-  addKey("show_view", Unmapped_Key, 0xE21D, 16);
-  addKey("menu", Menu_Key, 0x6897, 16);
-  addKey("up", Up_Key, 0x41BE, 16);
-  addKey("down", Down_Key, 0x916E, 16);
-  addKey("right", Right_Key, 0x09F6, 16);
-  addKey("left", Left_Key, 0xC13E, 16);
-//  addKey("ok", Enter_Key, 0x718E, 16);
-  addKey("ok", Select_Key, 0x718E, 16);
-  addKey("clear", Clear_Key, 0xF807, 16);
-  addKey("display", Info_Key, 0x7887, 16);
-  addKey("1", One_Key, 0xA05F, 16);
-  addKey("2", Two_Key, 0x609F, 16);
-  addKey("3", Three_Key, 0xE01F, 16);
-  addKey("4", Four_Key, 0x30CF, 16);
-  addKey("5", Five_Key, 0xB04F, 16);
-  addKey("6", Six_Key, 0x708F, 16);
-  addKey("7", Seven_Key, 0xF00F, 16);
-  addKey("8", Eight_Key, 0x38C7, 16);
-  addKey("9", Nine_Key, 0xB847, 16);
-  addKey("0", Zero_Key, 0x20DF, 16);
-  addKey("preset", Unmapped_Key, 0x728D, 16);
-  addKey("viss", Unmapped_Key, 0x827D, 16);
-  addKey("vps", Unmapped_Key, 0x926D, 16);
-  addKey("tv_vcr", Input_Key, 0xA857, 16);
-  addKey("sp/lp", VHSSpeed_Key, 0x12ED, 16);
-  addKey("length", Unmapped_Key, 0xD22D, 16);
-  addKey("start", Unmapped_Key, 0x52AD, 16);
-  addKey("f/a", Unmapped_Key, 0x08F7, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0x7689, 16);
+  setPreData(0x6E, 8);
+
+  addKey("eject", Eject_Key, 0x00, 8);
+  addKey("stop", Stop_Key, 0x01, 8);
+  addKey("<rew", Rewind_Key, 0x02, 8);
+  addKey("ff>", FastForward_Key, 0x03, 8);
+  addKey("0", Zero_Key, 0x04, 16);
+  addKey("1", One_Key, 0x05, 8);
+  addKey("2", Two_Key, 0x06, 8);
+  addKey("3", Three_Key, 0x07, 8);
+  addKey("play", Play_Key, 0x08, 8);
+  addKey("record", Record_Key, 0x09, 8);
+  addKey("pause||", Pause_Key, 0x0B, 8);
+  addKey("4", Four_Key, 0x0C, 8);
+  addKey("5", Five_Key, 0x0D, 8);
+  addKey("6", Six_Key, 0x0E, 8);
+  addKey("7", Seven_Key, 0x0F, 8);
+  addKey("f/a", StepForward_Key, 0x10, 8); // frame advance?
+  addKey("slow", Slow_Key, 0x13, 8);
+  addKey("power", Power_Key, 0x14, 8);
+  addKey("tv_vcr", Input_Key, 0x15, 8);
+  addKey("menu", Menu_Key, 0x16, 8);
+  addKey("prog+", ChannelUp_Key, 0x18, 8);
+  addKey("prog-", ChannelDown_Key, 0x19, 8);
+  addKey("slow+", SlowPlus_Key, 0x1A, 8);
+  addKey("slow-", SlowMinus_Key, 0x1B, 8);
+  addKey("8", Eight_Key, 0x1C, 8);
+  addKey("9", Nine_Key, 0x1D, 8);
+  addKey("display", Info_Key, 0x1E, 8);
+  addKey("clear", Clear_Key, 0x1F, 8);
+  addKey("child_lock", Unmapped_Key, 0x3F, 8);
+  addKey("viss", Unmapped_Key, 0x41, 8);
+  addKey("tracking+", TrackingPlus_Key, 0x44, 8);
+  addKey("tracking-", TrackingMinus_Key, 0x45, 8);
+  addKey("show_view", Unmapped_Key, 0x47, 8);
+  addKey("sp/lp", VHSSpeed_Key, 0x48, 8);
+  addKey("vps", Unmapped_Key, 0x49, 8);
+  addKey("start", Unmapped_Key, 0x4A, 8);
+  addKey("length", Unmapped_Key, 0x4B, 8);
+  addKey("clock_count", Clock_Key, 0x4C, 8); // "memory"
+  addKey("reset", Reset_Key, 0x4D, 8);
+  addKey("preset", Unmapped_Key, 0x4E, 8);
+  addKey("a_trk", AutoTracking_Key, 0x5F, 8);
+  addKey("up", Up_Key, 0x82, 8);
+  addKey("left", Left_Key, 0x83, 8);
+  addKey("down", Down_Key, 0x89, 8);
+  addKey("ok", Select_Key, 0x8E, 8);
+  addKey("right", Right_Key, 0x90, 8);
 }
 
 
@@ -168,9 +171,7 @@ GoldStarVCR1a::GoldStarVCR1a(
 {
   setKeysetName("VCR Keyset 1a");
 
-  addKey("slow", Unmapped_Key, 0xC837, 16);
-  addKey("slow+", Unmapped_Key, 0x58A7, 16);
-  addKey("slow-", Unmapped_Key, 0xD827, 16);
+  addKey("TU_AV", Input_Key, 0x56, 16);
 }
 
 
@@ -181,7 +182,7 @@ GoldStarVCR1b::GoldStarVCR1b(
 {
   setKeysetName("VCR Keyset 1b");
 
-  addKey("BACK", Exit_Key, 0x32CD, 16);
+  addKey("BACK", Exit_Key, 0x4C, 8);
 }
 
 
@@ -192,21 +193,10 @@ GoldStarVCR1c::GoldStarVCR1c(
 {
   setKeysetName("VCR Keyset 1c");
 
-  addKey("trk+", TrackingPlus_Key, 0x7788, 16);
-  addKey("trk-", TrackingMinus_Key, 0xB748, 16);
-  addKey("a.trk", AutoTracking_Key, 0x17E8, 16);
-  addKey("a.repeart", Unmapped_Key, 0xAF50, 16);
-}
-
-
-GoldStarVCR1d::GoldStarVCR1d(
-  QObject *guiObject,
-  unsigned int index)
-  : GoldStarVCR1(guiObject, index)
-{
-  setKeysetName("VCR Keyset 1d");
-  
-  addKey("TU_AV", Input_Key, 0x6A95, 16);
+  addKey("trk-", TrackingMinus_Key, 0xED, 8);
+  addKey("trk+", TrackingPlus_Key, 0xEE, 8);
+  addKey("a.trk", AutoTracking_Key, 0xE8, 8);
+  addKey("a.repeart", Unmapped_Key, 0xF5, 8);
 }
 
 
@@ -226,7 +216,8 @@ GoldStarCD1::GoldStarCD1(
     index,
     600, 500,
     600, 1600,
-    108000, true);
+    108000, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -252,9 +243,9 @@ GoldStarCD1::GoldStarCD1(
   addKey("stop", Stop_Key, 0x502F, 15);
   addKey("prev", Previous_Key, 0x304F, 15);
   addKey("next", Next_Key, 0x700F, 15);
-  addKey("prog", Unmapped_Key, 0x5926, 15);
-  addKey("repeat", Replay_Key, 0x3946, 15);
-  addKey("random", Unmapped_Key, 0x057A, 15);
+  addKey("prog", Program_Key, 0x5926, 15);
+  addKey("repeat", Repeat_Key, 0x3946, 15);
+  addKey("random", Random_Key, 0x057A, 15);
   addKey("dskip", Unmapped_Key, 0x2956, 15);
   addKey("remain", Unmapped_Key, 0x453A, 15);
   addKey("eqpatt", Unmapped_Key, 0x017E, 15);
index e617611..e7a3914 100644 (file)
@@ -59,15 +59,6 @@ public:
 };
 
 
-class GoldStarVCR1d: public GoldStarVCR1
-{
-public:
-  GoldStarVCR1d(
-    QObject *guiObject,
-    unsigned int index);
-};
-
-
 class GoldStarCD1: public PIRKeysetMetaData
 {
 public:
index 988cbc3..7efc7c6 100644 (file)
@@ -13,35 +13,6 @@ HauppaugePCTV1::HauppaugePCTV1(
 
   threadableProtocol = new RC5Protocol(guiObject, index, 0x5E);
 
-  addKey("Power", Power_Key, 0x3D, 6);
-  addKey("Go", Unmapped_Key, 0x3B, 6);
-  addKey("TV", Unmapped_Key, 0x1C, 6);
-  addKey("Videos", Unmapped_Key, 0x18, 6);
-  addKey("Music", Unmapped_Key, 0x19, 6);
-  addKey("Pictures", Unmapped_Key, 0x1A, 6);
-  addKey("Guide", Unmapped_Key, 0x1B, 6);
-  addKey("Radio", Unmapped_Key, 0x0C, 6);
-  addKey("Up", Up_Key, 0x14, 6);
-  addKey("Down", Down_Key, 0x15, 6);
-  addKey("Left", Left_Key, 0x16, 6);
-  addKey("Right", Right_Key, 0x17, 6);
-  addKey("Ok", Select_Key, 0x25, 6);
-  addKey("Back/Exit", Exit_Key, 0x1F, 6);
-  addKey("Menu/i", Menu_Key, 0x0D, 6);
-  addKey("Vol+", VolumeUp_Key, 0x10, 6);
-  addKey("Vol-", VolumeDown_Key, 0x11, 6);
-  addKey("Prev.Ch", PrevChannel_Key, 0x12, 6);
-  addKey("Mute", Mute_Key, 0x0F, 6);
-  addKey("Ch+", ChannelUp_Key, 0x20, 6);
-  addKey("Ch-", ChannelDown_Key, 0x21, 6);
-  addKey("Record", Record_Key, 0x37, 6);
-  addKey("Stop", Stop_Key, 0x36, 6);
-  addKey("Rewind", Rewind_Key, 0x32, 6);
-  addKey("Play", Play_Key, 0x35, 6);
-  addKey("Forward", FastForward_Key, 0x34, 6);
-  addKey("Replay/SkipBackward", Replay_Key, 0x24, 6);
-  addKey("Pause", Pause_Key, 0x30, 6);
-  addKey("SkipForward", Advance_Key, 0x1E, 6);
   addKey("0", Zero_Key, 0x00, 6);
   addKey("1", One_Key, 0x01, 6);
   addKey("2", Two_Key, 0x02, 6);
@@ -53,11 +24,41 @@ HauppaugePCTV1::HauppaugePCTV1(
   addKey("8", Eight_Key, 0x08, 6);
   addKey("9", Nine_Key, 0x09, 6);
   addKey("Asterix", Unmapped_Key, 0x0A, 6);
-  addKey("sub/cc", Captions_Key, 0x0E, 6); // "Recordings"
   addKey("Red", Red_Key, 0x0B, 6);
+  addKey("Radio", Unmapped_Key, 0x0C, 6);
+  addKey("Menu/i", Menu_Key, 0x0D, 6);
+  addKey("sub/cc", Captions_Key, 0x0E, 6); // "Recordings"
+  addKey("Mute", Mute_Key, 0x0F, 6);
+  addKey("Vol+", VolumeUp_Key, 0x10, 6);
+  addKey("Vol-", VolumeDown_Key, 0x11, 6);
+  addKey("Prev.Ch", PrevChannel_Key, 0x12, 6);
+  addKey("Up", Up_Key, 0x14, 6);
+  addKey("Down", Down_Key, 0x15, 6);
+  addKey("Left", Left_Key, 0x16, 6);
+  addKey("Right", Right_Key, 0x17, 6);
+  addKey("Videos", Unmapped_Key, 0x18, 6);
+  addKey("Music", Unmapped_Key, 0x19, 6);
+  addKey("Pictures", Unmapped_Key, 0x1A, 6);
+  addKey("Guide", Unmapped_Key, 0x1B, 6);
+  addKey("TV", Unmapped_Key, 0x1C, 6);
+  addKey("SkipForward", Next_Key, 0x1E, 6);
+  addKey("Back/Exit", Exit_Key, 0x1F, 6);
+  addKey("Ch+", ChannelUp_Key, 0x20, 6);
+  addKey("Ch-", ChannelDown_Key, 0x21, 6);
+  addKey("Replay/SkipBackward", Previous_Key, 0x24, 6);
+  addKey("Ok", Select_Key, 0x25, 6);
+  addKey("minimize", Unmapped_Key, 0x26, 6);
+  addKey("Blue", Blue_Key, 0x29, 6);
   addKey("Green", Green_Key, 0x2E, 6);
+  addKey("Pause", Pause_Key, 0x30, 6);
+  addKey("Rewind", Rewind_Key, 0x32, 6);
+  addKey("Forward", FastForward_Key, 0x34, 6);
+  addKey("Play", Play_Key, 0x35, 6);
+  addKey("Stop", Stop_Key, 0x36, 6);
+  addKey("Record", Record_Key, 0x37, 6);
   addKey("Yellow", Yellow_Key, 0x38, 6);
-  addKey("Blue", Blue_Key, 0x29, 6);
+  addKey("Go", Unmapped_Key, 0x3B, 6);
+  addKey("Power", Power_Key, 0x3D, 6);
 }
 
 
@@ -103,7 +104,7 @@ HauppaugePCTV1c::HauppaugePCTV1c(
   setPreData(0x5F, 7);
 
   addKey("blank", Unmapped_Key, 0x0C, 6);
-  addKey("full", Unmapped_Key, 0x3C, 6);
+  addKey("full", AspectRatio_Key, 0x3C, 6);  // full screen?
 }
 
 
@@ -118,7 +119,7 @@ HauppaugePCTV2::HauppaugePCTV2(
 {
   addControlledDevice(Hauppauge_Make, "PVR-250", Computer_Device);
 
-  threadableProtocol = new RC5Protocol(guiObject, index, 0x54);
+  threadableProtocol = new RC5Protocol(guiObject, index);
 
   addKey("POWER", Power_Key, 0x150C, 13);
   addKey("1", One_Key, 0x1525, 13);
index bfbf2ef..72e6438 100644 (file)
@@ -9,58 +9,59 @@ HitachiTV1::HitachiTV1(
       Hitachi_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
 
-  setPreData(0x0AF5, 16);
+//  setPreData(0x0AF5, 16);
+  setPreData(0x50, 8);
 
-  addKey("1", One_Key, 0xB04F, 16);
-  addKey("2", Two_Key, 0x708F, 16);
-  addKey("3", Three_Key, 0xF00F, 16);
-  addKey("4", Four_Key, 0x38C7, 16);
-  addKey("5", Five_Key, 0xB847, 16);
-  addKey("6", Six_Key, 0x7887, 16);
-  addKey("7", Seven_Key, 0xF807, 16);
-  addKey("8", Eight_Key, 0x20DF, 16);
-  addKey("9", Nine_Key, 0xA05F, 16);
-  addKey("0", Zero_Key, 0x30CF, 16);
-  addKey("ch_down", ChannelDown_Key, 0x18E7, 16);
-  addKey("ch_up", ChannelUp_Key, 0x9867, 16);
-  addKey("recall", PrevChannel_Key, 0x08F7, 16);
-  addKey("tv/video", Input_Key, 0x906F, 16); // "AV"
-  addKey("power", Power_Key, 0xE817, 16);
-  addKey("vol_up", VolumeUp_Key, 0x48B7, 16);
-  addKey("vol_down", VolumeDown_Key, 0xA857, 16);
-  addKey("timer", Sleep_Key, 0x8877, 16);
-  addKey("return", Exit_Key, 0x22DD, 16);
-  addKey("mute", Mute_Key, 0xD02F, 16);
-  addKey("krasn", Unmapped_Key, 0xDA25, 16);
-  addKey("zelen", Unmapped_Key, 0x7A85, 16);
-  addKey("Reveal", Unmapped_Key, 0xBA45, 16); // "jolt"
-  addKey("zelen", Unmapped_Key, 0x3AC5, 16);
-  addKey("OK", Select_Key, 0xC23D, 16);
-  addKey("FWD", FastForward_Key, 0xF609, 16);
-  addKey("REV", Rewind_Key, 0xB649, 16);
-  addKey("PLAY", Play_Key, 0xD629, 16);
-  addKey("STOP", Stop_Key, 0x36C9, 16);
-  addKey("HELP", Info_Key, 0x58A7, 16);
-  addKey("CH", Unmapped_Key, 0xC837, 16);
-  addKey("MENU", Menu_Key, 0x02FD, 16);
-  addKey("PSCAN100HZ", Unmapped_Key, 0xB24D, 16);
-  addKey("X", Unmapped_Key, 0x2AD5, 16);
-  addKey("3D-SOUND", Surround_Key, 0xD827, 16);
-  addKey("UP", Up_Key, 0x0EF1, 16);
-  addKey("DOWN", Down_Key, 0x8E71, 16);
-  addKey("CH_I/II", Unmapped_Key, 0x10EF, 16);
-  addKey("TV/TEXT", Unmapped_Key, 0x6699, 16);
-  addKey("SOUND", SoundMode_Key, 0xF20D, 16);
-  addKey("Picture", PictureMode_Key, 0xE619, 16);
-  addKey("Red", Red_Key, 0x32CD, 16);
-  addKey("SUB", Unmapped_Key, 0xA25D, 16);
-  addKey("U.N.L", Unmapped_Key, 0x629D, 16);
-  addKey("HOLD", Unmapped_Key, 0xE21D, 16);
-  addKey("Cancel", Clear_Key, 0x16E9, 16);
-  addKey("Store", Unmapped_Key, 0x28D7, 16);
-  addKey("Language", Language_Key, 0x609F, 16);
+  addKey("8", Eight_Key, 0x04, 8);
+  addKey("9", Nine_Key, 0x05, 8);
+//  addKey("Language", Language_Key, 0x06, 8);
+  addKey("CH_I/II", Audio_Key, 0x08, 8);
+  addKey("tv/video", Input_Key, 0x09, 8); // "AV"
+  addKey("mute", Mute_Key, 0x0B, 8);
+  addKey("0", Zero_Key, 0x0C, 8);
+  addKey("1", One_Key, 0x0D, 8);
+  addKey("2", Two_Key, 0x0E, 8);
+  addKey("3", Three_Key, 0x0F, 8);
+  addKey("recall", PrevChannel_Key, 0x10, 8);
+  addKey("timer", Sleep_Key, 0x11, 8);
+  addKey("vol_up", VolumeUp_Key, 0x12, 8);
+  addKey("CH", Unmapped_Key, 0x13, 8);
+  addKey("Store", Unmapped_Key, 0x14, 8);
+  addKey("vol_down", VolumeDown_Key, 0x15, 8);
+  addKey("power", Power_Key, 0x17, 8);
+  addKey("ch_down", ChannelDown_Key, 0x18, 8);
+  addKey("ch_up", ChannelUp_Key, 0x19, 8);
+  addKey("HELP", Info_Key, 0x1A, 8);
+  addKey("3D-SOUND", Surround_Key, 0x1B, 8);
+  addKey("4", Four_Key, 0x1C, 8);
+  addKey("5", Five_Key, 0x1D, 8);
+  addKey("6", Six_Key, 0x1E, 8);
+  addKey("7", Seven_Key, 0x1F, 8);
+  addKey("MENU", Menu_Key, 0x40, 8);
+  addKey("OK", Select_Key, 0x43, 8);
+  addKey("return", Exit_Key, 0x44, 8);
+  addKey("SUB", Captions_Key, 0x45, 8);
+  addKey("U.N.L", Unmapped_Key, 0x46, 8);
+  addKey("HOLD", TeletextHold_Key, 0x47, 8);
+  addKey("Red", Red_Key, 0x4C, 8);
+  addKey("PSCAN100HZ", Unmapped_Key, 0x4D, 8);
+  addKey("SOUND", SoundMode_Key, 0x4F, 8);
+  addKey("X", Unmapped_Key, 0x54, 8);
+  addKey("krasn", Unmapped_Key, 0x5B, 8);
+  addKey("zelen", Unmapped_Key, 0x5C, 8);
+  addKey("Reveal", Unmapped_Key, 0x5D, 8); // "jolt"
+  addKey("zelen", Unmapped_Key, 0x5E, 8);
+  addKey("TV/TEXT", Teletext_Key, 0x66, 8);
+  addKey("Picture", PictureMode_Key, 0x67, 8);
+  addKey("Cancel", Clear_Key, 0x68, 8);
+  addKey("PLAY", Play_Key, 0x6B, 8);
+  addKey("STOP", Stop_Key, 0x6C, 8);
+  addKey("REV", Rewind_Key, 0x6D, 8);
+  addKey("FWD", FastForward_Key, 0x6F, 8);
+  addKey("UP", Up_Key, 0x70, 8);
+  addKey("DOWN", Down_Key, 0x71, 8);
 }
 
 
@@ -71,7 +72,7 @@ HitachiTV1a::HitachiTV1a(
 {
   setKeysetName("TV Keyset 1a");
 
-  addKey("menu", Menu_Key, 0xCA35, 16);
+  addKey("menu", Menu_Key, 0x53, 8);
 }
 
 HitachiTV1b::HitachiTV1b(
@@ -81,9 +82,9 @@ HitachiTV1b::HitachiTV1b(
 {
   setKeysetName("TV Keyset 1b");
 
-  addKey("Sound+", VolumeUp_Key, 0x4EB1, 16);
-  addKey("Sound-", VolumeDown_Key, 0xCE31, 16);
-  addKey("Timer", Sleep_Key, 0xD629, 16);
+  addKey("Sound+", VolumeUp_Key, 0x72, 8);
+  addKey("Sound-", VolumeDown_Key, 0x73, 8);
+  addKey("Timer", Sleep_Key, 0x6B, 8);
 }
 
 
@@ -96,45 +97,45 @@ HitachiTV1c::HitachiTV1c(
 
   addControlledDevice(Hitachi_Make, "57F510", TV_Device);
 
-  addKey("LastChannel", PrevChannel_Key, 0x50AF, 16);
-  addKey("Info", Info_Key, 0x08F7, 16);
-  addKey("Input1", Unmapped_Key, 0x847B, 16);
-  addKey("Input2", Unmapped_Key, 0x44BB, 16);
-  addKey("Input3", Unmapped_Key, 0xC43B, 16);
-  addKey("Input4", Unmapped_Key, 0x24DB, 16);
-  addKey("ChannelUp", Unmapped_Key, 0x14EB, 16); // these four are odd
-  addKey("ChannelDown", Unmapped_Key, 0x946B, 16); // duplicate?
-  addKey("VolumeDown", Unmapped_Key, 0x54AB, 16); // maybe pip?
-  addKey("VolumeUp", Unmapped_Key, 0xD42B, 16); // doesn't make sense
-  addKey("SELECT", Select_Key, 0x748B, 16);
-  addKey("CC", Captions_Key, 0xEC13, 16);
-  addKey("FavouriteChannel", Favorites_Key, 0x1CE3, 16);
-  addKey("1080i/540p", Unmapped_Key, 0x3CC3, 16);
-  addKey("Input5", Unmapped_Key, 0xBC43, 16);
-  addKey("PowerON", Unmapped_Key, 0x7C83, 16);
-  addKey("PowerOFF", Unmapped_Key, 0xFC03, 16);
-  addKey("Menu", Menu_Key, 0xCA35, 16);
-  addKey("PIP", PIP_Key, 0x1AE5, 16);
-  addKey("Day/Night", Unmapped_Key, 0x7A85, 16);
-  addKey("Freeze/Pause", Unmapped_Key, 0x8679, 16);
-  addKey("EXIT", Exit_Key, 0x26D9, 16);
-  addKey("16:9", Unmapped_Key, 0xA659, 16);
-  addKey("16:9Zoom", Unmapped_Key, 0x6699, 16);
-  addKey("4:3Standard", Unmapped_Key, 0xE619, 16);
-  addKey("4:3Expanded", Unmapped_Key, 0x16E9, 16);
-  addKey("4:3Zoom1", Unmapped_Key, 0x9669, 16);
-  addKey("4:3Zoom2", Unmapped_Key, 0x56A9, 16);
-  addKey("540p", Unmapped_Key, 0xD629, 16);
-  addKey("1080i", Unmapped_Key, 0x36C9, 16);
-  addKey("Aspect", AspectRatio_Key, 0xF609, 16);
-  addKey("ArrowRight", Right_Key, 0x4EB1, 16);
-  addKey("ArrowLeft", Left_Key, 0xCE31, 16);
-  addKey("DayMode", Unmapped_Key, 0x2ED1, 16);
-  addKey("NightMode", Unmapped_Key, 0xAE51, 16);
-  addKey("AntennaA", Unmapped_Key, 0x6E91, 16);
-  addKey("AntennaB", Unmapped_Key, 0xEE11, 16);
-  addKey("CC", Unmapped_Key, 0x1EE1, 16); // Another CC key?
-  addKey("Guide", Guide_Key, 0xAC53, 16);
+  addKey("LastChannel", PrevChannel_Key, 0x0A, 8);
+  addKey("Info", Info_Key, 0x10, 8);
+  addKey("Input1", Unmapped_Key, 0x21, 8);
+  addKey("Input2", Unmapped_Key, 0x22, 8);
+  addKey("Input3", Unmapped_Key, 0x23, 8);
+  addKey("Input4", Unmapped_Key, 0x24, 8);
+  addKey("ChannelUp", Unmapped_Key, 0x28, 8); // these four are odd
+  addKey("ChannelDown", Unmapped_Key, 0x29, 8); // duplicate?
+  addKey("VolumeDown", Unmapped_Key, 0x2A, 8); // maybe pip?
+  addKey("VolumeUp", Unmapped_Key, 0x2B, 8); // doesn't make sense
+  addKey("SELECT", Select_Key, 0x2E, 8);
+  addKey("Guide", Guide_Key, 0x35, 8);
+  addKey("CC", Captions_Key, 0x37, 8);
+  addKey("FavouriteChannel", Favorites_Key, 0x38, 8);
+  addKey("1080i/540p", Unmapped_Key, 0x3C, 8);
+  addKey("Input5", Unmapped_Key, 0x3D, 8);
+  addKey("PowerON", PowerOn_Key, 0x3E, 8);
+  addKey("PowerOFF", PowerOff_Key, 0x3F, 8);
+  addKey("Menu", Menu_Key, 0x53, 8);
+  addKey("PIP", PIP_Key, 0x58, 8);
+  addKey("Day/Night", Unmapped_Key, 0x5E, 8);
+  addKey("Freeze/Pause", Unmapped_Key, 0x61, 8);
+  addKey("EXIT", Exit_Key, 0x64, 8);
+  addKey("16:9", Unmapped_Key, 0x65, 8);
+  addKey("16:9Zoom", Unmapped_Key, 0x66, 8);
+  addKey("4:3Standard", Unmapped_Key, 0x67, 8);
+  addKey("4:3Expanded", Unmapped_Key, 0x68, 8);
+  addKey("4:3Zoom1", Unmapped_Key, 0x69, 8);
+  addKey("4:3Zoom2", Unmapped_Key, 0x6A, 8);
+  addKey("540p", Unmapped_Key, 0x6B, 8);
+  addKey("1080i", Unmapped_Key, 0x6C, 8);
+  addKey("Aspect", AspectRatio_Key, 0x6F, 8);
+  addKey("ArrowRight", Right_Key, 0x72, 8);
+  addKey("ArrowLeft", Left_Key, 0x73, 8);
+  addKey("DayMode", Unmapped_Key, 0x74, 8);
+  addKey("NightMode", Unmapped_Key, 0x75, 8);
+  addKey("AntennaA", Unmapped_Key, 0x76, 8);
+  addKey("AntennaB", Unmapped_Key, 0x77, 8);
+  addKey("CC", Unmapped_Key, 0x78, 8); // Another CC key?
   // Many more codes available in LIRC's hitachi/CLU4341UG2 config file
 }
 
@@ -147,36 +148,37 @@ HitachiProjector::HitachiProjector(
       Hitachi_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
+  threadableProtocol = new NECProtocol(guiObject, index, Extended_NEC);
 
-  setPreData(0xE1A2, 16);
+//  setPreData(0xE1A2, 16);
+  setPreData(0x4587, 16);
 
-  addKey("Power", Power_Key, 0xE817, 16);
-  addKey("PageUp", Unmapped_Key, 0x0BF4, 16);
-  addKey("PageDown", Unmapped_Key, 0x8B74, 16);
-  addKey("Home", Unmapped_Key, 0xAB54, 16);
-  addKey("End", Unmapped_Key, 0x6B94, 16);
-  addKey("Enter", Select_Key, 0x847B, 16);
-  addKey("Left", Left_Key, 0x748B, 16);
-  addKey("Right", Right_Key, 0x54AB, 16);
-  addKey("Up", Up_Key, 0x14EB, 16);
-  addKey("Down", Down_Key, 0x34CB, 16);
-  addKey("Menu", Menu_Key, 0x04FB, 16);
-  addKey("Reset", Reset_Key, 0x44BB, 16);
-  addKey("Esc", Unmapped_Key, 0x2BD4, 16);
-  addKey("Position", Unmapped_Key, 0x0CF3, 16);
-  addKey("Freeze", Unmapped_Key, 0x2DD2, 16);
-  addKey("Keystone", Unmapped_Key, 0x6D92, 16);
-  addKey("Search", Unmapped_Key, 0x58A7, 16);
-  addKey("RGB", PictureMode_Key, 0x18E7, 16);
-  addKey("Video", Unmapped_Key, 0x9867, 16);
-  addKey("Aspect", AspectRatio_Key, 0x5EA1, 16);
-  addKey("MagnifyOn", Unmapped_Key, 0x0DF2, 16);
-  addKey("MagnifyOff", Unmapped_Key, 0xCD32, 16);
-  addKey("Volume", Unmapped_Key, 0xCA35, 16);
-  addKey("Mute", Mute_Key, 0x4AB5, 16);
-  addKey("Auto", Unmapped_Key, 0x24DB, 16);
-  addKey("Blank", Unmapped_Key, 0x827D, 16);
+  addKey("Power", Power_Key, 0x17, 8);
+  addKey("RGB", PictureMode_Key, 0x18, 8);
+  addKey("Video", Unmapped_Key, 0x19, 8);
+  addKey("Search", Unmapped_Key, 0x1A, 8);
+  addKey("Menu", Menu_Key, 0x20, 8);
+  addKey("Enter", Select_Key, 0x21, 8);
+  addKey("Reset", Reset_Key, 0x22, 8);
+  addKey("Auto", Unmapped_Key, 0x24, 8);
+  addKey("Up", Up_Key, 0x28, 8);
+  addKey("Right", Right_Key, 0x2A, 8);
+  addKey("Down", Down_Key, 0x2C, 8);
+  addKey("Left", Left_Key, 0x2E, 8);
+  addKey("Position", Unmapped_Key, 0x30, 8);
+  addKey("Blank", Unmapped_Key, 0x41, 8);
+  addKey("Mute", Mute_Key, 0x52, 8);
+  addKey("Volume", Unmapped_Key, 0x53, 8);
+  addKey("Aspect", AspectRatio_Key, 0x7A, 8);
+  addKey("MagnifyOn", Unmapped_Key, 0xB0, 8);
+  addKey("MagnifyOff", Unmapped_Key, 0xB3, 8);
+  addKey("Freeze", Unmapped_Key, 0xB4, 8);
+  addKey("Keystone", Unmapped_Key, 0xB6, 8);
+  addKey("PageUp", PageUp_Key, 0xD0, 8);
+  addKey("PageDown", PageDown_Key, 0xD1, 8);
+  addKey("Esc", Unmapped_Key, 0xD4, 8);
+  addKey("Home", Unmapped_Key, 0xD5, 8);
+  addKey("End", Unmapped_Key, 0xD6, 8);
 }
 
 
@@ -188,51 +190,52 @@ HitachiDVD1::HitachiDVD1(
       Hitachi_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
+  threadableProtocol = new NECProtocol(guiObject, index, Extended_NEC);
 
-  setPreData(0x01C4, 16);
+//  setPreData(0x01C4, 16);
+  setPreData(0x2380, 16);
 
-  addKey("Power", Power_Key, 0x50AF, 16);
-  addKey("Surround", Surround_Key, 0xBA45, 16);
-  addKey("SearchMode", Unmapped_Key, 0x7C83, 16);
-  addKey("OpenClose", Eject_Key, 0x906F, 16);
-  addKey("ABRepeat", Unmapped_Key, 0x04FB, 16);
-  addKey("1", One_Key, 0xB04F, 16);
-  addKey("2", Two_Key, 0x708F, 16);
-  addKey("3", Three_Key, 0xF00F, 16);
-  addKey("4", Four_Key, 0x38C7, 16);
-  addKey("5", Five_Key, 0xB847, 16);
-  addKey("6", Six_Key, 0x7887, 16);
-  addKey("7", Seven_Key, 0xF807, 16);
-  addKey("8", Eight_Key, 0x20DF, 16);
-  addKey("9", Nine_Key, 0xA05F, 16);
-  addKey("0", Zero_Key, 0x30CF, 16);
-  addKey("Repeat", Unmapped_Key, 0x00FF, 16);
-  addKey("Mode", Unmapped_Key, 0xB44B, 16);
-  addKey("Zoom", Unmapped_Key, 0xDC23, 16);
-  addKey("Clear", Clear_Key, 0x9867, 16);
-  addKey("+10", DoubleDigit_Key, 0x08F7, 16);
-  addKey("Angle", Unmapped_Key, 0x54AB, 16);
-  addKey("Subtitle", Captions_Key, 0xD42B, 16);
-  addKey("Audio", Language_Key, 0x34CB, 16);
-  addKey("Display", Info_Key, 0xD02F, 16);
-  addKey("Menu", DiscMenu_Key, 0xE01F, 16);
-  addKey("TopMenu", DiscTitle_Key, 0x609F, 16);
-  addKey("Up", Up_Key, 0x44BB, 16);
-  addKey("Left", Left_Key, 0x24DB, 16);
-  addKey("Enter", Select_Key, 0x649B, 16);
-  addKey("Right", Right_Key, 0xA45B, 16);
-  addKey("Down", Down_Key, 0xC43B, 16);
-  addKey("Return", Exit_Key, 0xE41B, 16);
-  addKey("Setup", Menu_Key, 0x10EF, 16);
-  addKey("DiscNav", Guide_Key, 0x4CB3, 16);
-  addKey("Prev", Previous_Key, 0xC03F, 16);
-  addKey("Next", Next_Key, 0x40BF, 16);
-  addKey("Stop", Stop_Key, 0xD827, 16);
-  addKey("Play", Play_Key, 0x28D7, 16);
-  addKey("Rew", Rewind_Key, 0x48B7, 16);
-  addKey("Pause", Pause_Key, 0x58A7, 16);
-  addKey("FF", FastForward_Key, 0x8877, 16);
+  addKey("Repeat", Repeat_Key, 0x00, 8);
+  addKey("Next", Next_Key, 0x02, 8);
+  addKey("Prev", Previous_Key, 0x03, 8);
+  addKey("8", Eight_Key, 0x04, 8);
+  addKey("9", Nine_Key, 0x05, 8);
+  addKey("TopMenu", DiscTitle_Key, 0x06, 8);
+  addKey("Menu", DiscMenu_Key, 0x07, 8);
+  addKey("Setup", Menu_Key, 0x08, 8);
+  addKey("OpenClose", Eject_Key, 0x09, 8);
+  addKey("Power", Power_Key, 0x0A, 8);
+  addKey("Display", Info_Key, 0x0B, 8);
+  addKey("0", Zero_Key, 0x0C, 8);
+  addKey("1", One_Key, 0x0D, 8);
+  addKey("2", Two_Key, 0x0E, 8);
+  addKey("3", Three_Key, 0x0F, 8);
+  addKey("+10", DoubleDigit_Key, 0x10, 8);
+  addKey("FF", FastForward_Key, 0x11, 8);
+  addKey("Rew", Rewind_Key, 0x12, 8);
+  addKey("Play", Play_Key, 0x14, 8);
+  addKey("Clear", Clear_Key, 0x19, 8);
+  addKey("Pause", Pause_Key, 0x1A, 8);
+  addKey("Stop", Stop_Key, 0x1B, 8);
+  addKey("4", Four_Key, 0x1C, 8);
+  addKey("5", Five_Key, 0x1D, 8);
+  addKey("6", Six_Key, 0x1E, 8);
+  addKey("7", Seven_Key, 0x1F, 8);
+  addKey("ABRepeat", RepeatAB_Key, 0x20, 8);
+  addKey("Up", Up_Key, 0x22, 8);
+  addKey("Down", Down_Key, 0x23, 8);
+  addKey("Left", Left_Key, 0x24, 8);
+  addKey("Right", Right_Key, 0x25, 8);
+  addKey("Enter", Select_Key, 0x26, 8);
+  addKey("Return", Exit_Key, 0x27, 8);
+  addKey("Angle", Angle_Key, 0x2A, 8);
+  addKey("Subtitle", Captions_Key, 0x2B, 8);
+  addKey("Audio", Audio_Key, 0x2C, 8);
+  addKey("Mode", Unmapped_Key, 0x2D, 8);
+  addKey("DiscNav", Guide_Key, 0x32, 8);
+  addKey("Zoom", Zoom_Key, 0x3B, 8);
+  addKey("SearchMode", Unmapped_Key, 0x3E, 8);
+  addKey("Surround", Surround_Key, 0x5D, 8);
 }
 
 
@@ -247,39 +250,40 @@ HitachiAudio1::HitachiAudio1(
   addControlledDevice(Hitachi_Make, "FX-7", Audio_Device);
   addControlledDevice(Hitachi_Make, "FX-77", Audio_Device);
 
-  threadableProtocol = new NECProtocol(guiObject, index);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
 
-  setPreData(0xDA25, 16);
+//  setPreData(0xDA25, 16);
+  setPreData(0x5B, 8);
 
-  addKey("1", One_Key, 0xB24D, 16);
-  addKey("2", Two_Key, 0x728D, 16);
-  addKey("3", Three_Key, 0xF20D, 16);
-  addKey("4", Four_Key, 0x0AF5, 16);
-  addKey("5", Five_Key, 0x8A75, 16);
-  addKey("6", Six_Key, 0x4AB5, 16);
-  addKey("7", Seven_Key, 0xCA35, 16);
-  addKey("8", Eight_Key, 0x2AD5, 16);
-  addKey("9", Nine_Key, 0xAA55, 16);
-  addKey("10", Unmapped_Key, 0x6A95, 16);
-  addKey("0/11", Zero_Key, 0xDA25, 16);
-  addKey("10+/12", DoubleDigit_Key, 0xEA15, 16);
-  addKey("CD_SKIP_BACK", Previous_Key, 0xA857, 16);
-  addKey("CD_SKIP_FWD", Next_Key, 0x28D7, 16);
-  addKey("CD_STOP", Stop_Key, 0xC837, 16);
-  addKey("CD_PLAY/PAUSE", Play_Key, 0x48B7, 16);
-  addKey("CD_PLAY/PAUSE", Pause_Key, 0x48B7, 16);
-  addKey("CD_PROG", Program_Key, 0x6897, 16);
-  addKey("CASSETTE_PLAY_BACK", Unmapped_Key, 0x58A7, 16);
-  addKey("CASSETTE_STOP", Unmapped_Key, 0xB847, 16);
-  addKey("CASSETTE_PLAY_FORWARD", Unmapped_Key, 0x9867, 16);
-  addKey("CASSETTE_REC", Record_Key, 0xF807, 16);
-  addKey("CASSETTE_TAPE_1/2", Unmapped_Key, 0x906F, 16);
-  addKey("CASSETTE_REW", Unmapped_Key, 0x38C7, 16);
-  addKey("CASSETTE_FFW", Unmapped_Key, 0xD827, 16);
-  addKey("VOLUME_DOWN", VolumeDown_Key, 0x40BF, 16);
-  addKey("VOLUME_UP", VolumeUp_Key, 0x807F, 16);
-  addKey("TUNER_BAND", Input_Key, 0xE01F, 16);
-  addKey("POWER", Power_Key, 0x00FF, 16);
+  addKey("POWER", Power_Key, 0x00, 8);
+  addKey("VOLUME_UP", VolumeUp_Key, 0x01, 8);
+  addKey("VOLUME_DOWN", VolumeDown_Key, 0x02, 8);
+  addKey("TUNER_BAND", TunerBand_Key, 0x07, 8);
+  addKey("CASSETTE_TAPE_1/2", Unmapped_Key, 0x09, 8);
+  addKey("CD_PLAY/PAUSE", Play_Key, 0x12, 8);
+  addKey("CD_PLAY/PAUSE", Pause_Key, 0x12, 8);
+  addKey("CD_STOP", Stop_Key, 0x13, 8);
+  addKey("CD_SKIP_FWD", Next_Key, 0x14, 8);
+  addKey("CD_SKIP_BACK", Previous_Key, 0x15, 8);
+  addKey("CD_PROG", Program_Key, 0x16, 8);
+  addKey("CASSETTE_PLAY_FORWARD", Unmapped_Key, 0x19, 8);
+  addKey("CASSETTE_PLAY_BACK", Unmapped_Key, 0x1A, 8);
+  addKey("CASSETTE_FFW", Unmapped_Key, 0x1B, 8);
+  addKey("CASSETTE_REW", Unmapped_Key, 0x1C, 8);
+  addKey("CASSETTE_STOP", Unmapped_Key, 0x1D, 8);
+  addKey("CASSETTE_REC", Record_Key, 0x1F, 8);
+  addKey("1", One_Key, 0x4D, 8);
+  addKey("2", Two_Key, 0x4E, 8);
+  addKey("3", Three_Key, 0x4F, 8);
+  addKey("4", Four_Key, 0x50, 8);
+  addKey("5", Five_Key, 0x51, 8);
+  addKey("6", Six_Key, 0x52, 8);
+  addKey("7", Seven_Key, 0x53, 8);
+  addKey("8", Eight_Key, 0x54, 8);
+  addKey("9", Nine_Key, 0x55, 8);
+  addKey("10", Unmapped_Key, 0x56, 8);
+  addKey("10+/12", DoubleDigit_Key, 0x57, 8);
+  addKey("0/11", Zero_Key, 0x5B, 8);
 }
 
 
@@ -291,53 +295,55 @@ HitachiVCR1::HitachiVCR1(
       Hitachi_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
 
-  setPreData(0x06F9, 16);
+//  setPreData(0x06F9, 16);
+  setPreData(0x60, 8);
 
-  addKey("Power", Power_Key, 0xE817, 16);
-  addKey("Eject", Eject_Key, 0x9C63, 16);
-  addKey("VCR/TV", Input_Key, 0x6897, 16);
-  addKey("P+", ChannelUp_Key, 0x9867, 16);
-  addKey("P-", ChannelDown_Key, 0x18E7, 16);
-  addKey("Play", Play_Key, 0x28D7, 16);
-  addKey("FF", FastForward_Key, 0x906F, 16);
-  addKey("Rew", Rewind_Key, 0x50AF, 16);
-  addKey("Stop", Stop_Key, 0xD02F, 16);
-  addKey("Pause", Pause_Key, 0x58A7, 16);
-  addKey("Step", StepForward_Key, 0x08F7, 16);
-  addKey("SpinRight", Right_Key, 0xFE01, 16);
-  addKey("SpinLeft", Left_Key, 0x7E81, 16);
-  addKey("Enter", Select_Key, 0x22DD, 16);
-  addKey("TransAux", Unmapped_Key, 0x2CD3, 16); // "AVX"
-  addKey("1", One_Key, 0xB04F, 16);
-  addKey("2", Two_Key, 0x708F, 16);
-  addKey("3", Three_Key, 0xF00F, 16);
-  addKey("4", Four_Key, 0x38C7, 16);
-  addKey("5", Five_Key, 0xB847, 16);
-  addKey("6", Six_Key, 0x7887, 16);
-  addKey("7", Seven_Key, 0xF807, 16);
-  addKey("8", Eight_Key, 0x20DF, 16);
-  addKey("9", Nine_Key, 0xA05F, 16);
-  addKey("0", Zero_Key, 0x30CF, 16);
-  addKey("Menu", Menu_Key, 0x02FD, 16);
-  addKey("Disp", Info_Key, 0x42BD, 16);
-  addKey("Index", Unmapped_Key, 0xA25D, 16);
-  addKey("SP/LP", VHSSpeed_Key, 0x0CF3, 16);
-  addKey("Count/Clock", Unmapped_Key, 0x629D, 16);
-  addKey("CLEAR", Reset_Key, 0x827D, 16); // "reset", "0000"
-  addKey("Slow", Unmapped_Key, 0x8877, 16);
-  addKey("CH1/2", Unmapped_Key, 0xA857, 16); // "CHANNEL"
-  addKey("A.DUB", Unmapped_Key, 0x34CB, 16);
-  addKey("V.DUB", Unmapped_Key, 0x5CA3, 16);
-  addKey("Tracking+", TrackingPlus_Key, 0x00FF, 16);
-  addKey("Tracking-", TrackingMinus_Key, 0x807F, 16);
-  addKey("100/ENT", PlusOneHundred_Key, 0x609F, 16);
-  addKey("-", Unmapped_Key, 0xC03F, 16);
-  addKey("+", Unmapped_Key, 0x40BF, 16);
-  addKey("GO-TO", Unmapped_Key, 0x619E, 16);
-  addKey("FRAME+", Unmapped_Key, 0xBE41, 16); // This is for jog/shuttle!
-  addKey("FRAME-", Unmapped_Key, 0x7E81, 16); // I'll get the other j/s later
+  addKey("Tracking+", TrackingPlus_Key, 0x00, 8);
+  addKey("Tracking-", TrackingMinus_Key, 0x01, 8);
+  addKey("+", Unmapped_Key, 0x02, 8);
+  addKey("-", Unmapped_Key, 0x03, 8);
+  addKey("8", Eight_Key, 0x04, 8);
+  addKey("9", Nine_Key, 0x05, 8);
+  addKey("100/ENT", PlusOneHundred_Key, 0x06, 8);
+  addKey("FF", FastForward_Key, 0x09, 8);
+  addKey("Step", StepForward_Key, 0x10, 8);
+  addKey("Rew", Rewind_Key, 0x0A, 8);
+  addKey("Stop", Stop_Key, 0x0B, 8);
+  addKey("0", Zero_Key, 0x0C, 8);
+  addKey("1", One_Key, 0x0D, 8);
+  addKey("2", Two_Key, 0x0E, 8);
+  addKey("3", Three_Key, 0x0F, 8);
+  addKey("Slow", Slow_Key, 0x11, 8);
+  addKey("Play", Play_Key, 0x14, 8);
+  addKey("CH1/2", Unmapped_Key, 0x15, 8); // "CHANNEL"
+  addKey("VCR/TV", Input_Key, 0x16, 8);
+  addKey("Power", Power_Key, 0x17, 8);
+  addKey("P-", ChannelDown_Key, 0x18, 8);
+  addKey("P+", ChannelUp_Key, 0x19, 8);
+  addKey("Pause", Pause_Key, 0x1A, 8);
+  addKey("4", Four_Key, 0x1C, 8);
+  addKey("5", Five_Key, 0x1D, 8);
+  addKey("6", Six_Key, 0x1E, 8);
+  addKey("7", Seven_Key, 0x1F, 8);
+  addKey("A.DUB", Unmapped_Key, 0x2C, 8);
+  addKey("SP/LP", VHSSpeed_Key, 0x30, 8);
+  addKey("TransAux", Unmapped_Key, 0x34, 8); // "AVX"
+  addKey("Eject", Eject_Key, 0x39, 8);
+  addKey("V.DUB", Unmapped_Key, 0x3A, 8);
+  addKey("tracking_auto", AutoTracking_Key, 0x3E, 8);
+  addKey("Menu", Menu_Key, 0x40, 8);
+  addKey("CLEAR", Reset_Key, 0x41, 8); // "reset", "0000"
+  addKey("Disp", Info_Key, 0x42, 8);
+  addKey("Enter", Select_Key, 0x44, 8);
+  addKey("Index", Unmapped_Key, 0x45, 8);
+  addKey("Count/Clock", Clock_Key, 0x46, 8);
+  addKey("SpinRight", Right_Key, 0x7F, 8);
+  addKey("SpinLeft", Left_Key, 0x7E, 8);
+  addKey("GO-TO", Unmapped_Key, 0x86, 8);
+
+//  addKey("FRAME+", Unmapped_Key, 0x7D, 8); // This is for jog/shuttle!
+//  addKey("FRAME-", Unmapped_Key, 0x7E, 8); // I'll get the other j/s later
   // For more Jog/Shuttle see LIRC hitachi/VT-RM783E
-  addKey("tracking_auto", AutoTracking_Key, 0x7C83, 16);
 }
index 3b5c3e5..1879e54 100644 (file)
@@ -1,4 +1,5 @@
 #include "jvc.h"
+#include "jvcprotocol.h"
 #include "necprotocol.h"
 
 JVCSat1::JVCSat1(
@@ -14,7 +15,8 @@ JVCSat1::JVCSat1(
    index,
    624, 1500,
    624, 2600,
-   6000, false);
+   6000, false,
+   LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -29,8 +31,8 @@ JVCSat1::JVCSat1(
   addKey("power", Power_Key, 0x1EFC, 13);
   addKey("recent", Unmapped_Key, 0x16FC, 13);
   addKey("tvWeb", Unmapped_Key, 0x1A7C, 13);
-  addKey("scrollUp", Unmapped_Key, 0x137C, 13);
-  addKey("scrollDown", Unmapped_Key, 0x117C, 13);
+  addKey("scrollUp", PageUp_Key, 0x137C, 13);
+  addKey("scrollDown", PageDown_Key, 0x117C, 13);
   addKey("home", Unmapped_Key, 0x15FC, 13);
   addKey("back", Exit_Key, 0x1FFC, 13);
   addKey("up", Up_Key, 0x12FC, 13);
@@ -81,7 +83,8 @@ JVCSat2::JVCSat2(
     index,
     440, 2780,
     440, 1645,
-    6115, false);
+    6115, false,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -97,7 +100,7 @@ JVCSat2::JVCSat2(
   setPostData(0x000, 10);
 
   addKey("info", Info_Key, 0x0, 6);
-  addKey("power_on", Unmapped_Key, 0x1, 6);
+  addKey("power_on", PowerOn_Key, 0x1, 6);
   addKey("power", Power_Key, 0x2, 6);
   addKey("1", One_Key, 0x4, 6);
   addKey("2", Two_Key, 0x5, 6);
@@ -126,7 +129,7 @@ JVCSat2::JVCSat2(
   addKey("sys_info", Info_Key, 0x36, 6);
   addKey("asterisk", Unmapped_Key, 0x37, 6);
   addKey("pound", Unmapped_Key, 0x38, 6);
-  addKey("power_off", Unmapped_Key, 0x39, 6);
+  addKey("power_off", PowerOff_Key, 0x39, 6);
   addKey("sat", Unmapped_Key, 0x41, 6);
   addKey("dish_home", Unmapped_Key, 0x52, 6);
   addKey("sys_info2", Unmapped_Key, 0x54, 6);
@@ -142,88 +145,87 @@ JVCVCR1::JVCVCR1(
       JVC_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 500,
-    600, 1600,
-    45000, true);
-
-  threadableProtocol = np;
-
-  np->setTrailerPulse(600);
-
-  setPreData(0xC2, 8);
-
-  addKey("power", Power_Key, 0xD0, 8);
-  addKey("play", Play_Key, 0x30, 8);
-  addKey("forward", FastForward_Key, 0x60, 8);
-  addKey("backward", Rewind_Key, 0xE0, 8);
-  addKey("stop", Stop_Key, 0xC0, 8);
-  addKey("pause", Pause_Key, 0xB0, 8);
-  addKey("menu", Menu_Key, 0xEC, 8); // "PROG"
-  addKey("ok", Select_Key, 0x3C, 8);
-  addKey("CANCEL", Exit_Key, 0x6C, 8); // "zero4x", "reset"
-  addKey("CANCEL", Clear_Key, 0x6C, 8); // "zero4x", "reset"
-  addKey("RECORD", Record_Key, 0x33, 8); // "itr"
-  addKey("pr_up", ChannelUp_Key, 0x98, 8);
+  threadableProtocol = new JVCProtocol(guiObject, index);
+
+//  setPreData(0xC2, 8);
+  setPreData(0x43, 8);
+
+  addKey("av", Unmapped_Key, 0x01, 8);
+  addKey("stop", Stop_Key, 0x03, 8);
+  addKey("eject", Eject_Key, 0x04, 8);
+  addKey("forward", FastForward_Key, 0x06, 8);
+  addKey("backward", Rewind_Key, 0x07, 8);
+  addKey("power", Power_Key, 0x0B, 8);
+  addKey("pause", Pause_Key, 0x0D, 8);
+  addKey("play", Play_Key, 0x0E, 8);
+
+  addKey("input_1", Unmapped_Key, 0x11, 8);
+  addKey("tv_vcr", Input_Key, 0x13, 8); // "monitor"
+  addKey("right", Next_Key, 0x14, 8); // "JOG+"
+  addKey("left", Previous_Key, 0x15, 8); // "JOG-"
+  addKey("MUTE", Mute_Key, 0x17, 8);
   addKey("pr_dn", ChannelDown_Key, 0x18, 8);
-  addKey("right", Next_Key, 0x28, 8); // "JOG+"
-  addKey("left", Previous_Key, 0xA8, 8); // "JOG-"
-  addKey("pr_up", Up_Key, 0x98, 8);
-  addKey("pr_dn", Down_Key, 0x18, 8);
-  addKey("right", Right_Key, 0x28, 8); // "JOG+"
-  addKey("left", Left_Key, 0xA8, 8); // "JOG-"
-  addKey("eject", Eject_Key, 0x20, 8);
-  addKey("no_1", One_Key, 0x84, 8);
-  addKey("no_2", Two_Key, 0x44, 8);
-  addKey("no_3", Three_Key, 0xC4, 8);
+  addKey("pr_up", ChannelUp_Key, 0x19, 8);
+
+  addKey("no_1", One_Key, 0x21, 8);
+  addKey("no_2", Two_Key, 0x22, 8);
+  addKey("no_3", Three_Key, 0x23, 8);
   addKey("no_4", Four_Key, 0x24, 8);
-  addKey("no_5", Five_Key, 0xA4, 8);
-  addKey("no_6", Six_Key, 0x64, 8);
-  addKey("no_7", Seven_Key, 0xE4, 8);
-  addKey("no_8", Eight_Key, 0x14, 8);
-  addKey("no_9", Nine_Key, 0x94, 8);
-  addKey("no_0", Zero_Key, 0xCC, 8);
-  addKey("tv_vcr", Input_Key, 0xC8, 8); // "monitor"
-  addKey("av", Unmapped_Key, 0x80, 8);
-  addKey("ff_30sec", Advance_Key, 0x69, 8); // "skip"
-  addKey("die", Unmapped_Key, 0x5F, 8);
-  addKey("start", Unmapped_Key, 0x19, 8);
-  addKey("lock", Unmapped_Key, 0x0F, 8);
-  addKey("showview", Program_Key, 0x83, 8); // program
-  addKey("SOUND1", Unmapped_Key, 0xEB, 8);
-  addKey("SOUND2", Unmapped_Key, 0x27, 8);
-  addKey("SOUND3", Unmapped_Key, 0x3B, 8);
-  addKey("INDEX1", Unmapped_Key, 0xC9, 8);
-  addKey("INDEX2", Unmapped_Key, 0x29, 8);
-  addKey("DISPLAY", Info_Key, 0x1C, 8);
-  addKey("MUTE", Mute_Key, 0xE8, 8);
-  addKey("SPEED", VHSSpeed_Key, 0x8C, 8); // "I/II"
-  addKey("TIMER", Unmapped_Key, 0xAC, 8);
-  addKey("MIC+", Unmapped_Key, 0x8B, 8);
-  addKey("MIC-", Unmapped_Key, 0x4B, 8);
-  addKey("enter", Enter_Key, 0x7C, 8); // "store"
-  addKey("line", Unmapped_Key, 0x76, 8);
-  addKey("check", Unmapped_Key, 0xBC, 8); // "prog_check"
-  addKey("start+", Unmapped_Key, 0x13, 8);
-  addKey("start-", Unmapped_Key, 0x93, 8);
-  addKey("stop+", Unmapped_Key, 0x53, 8);
-  addKey("stop-", Unmapped_Key, 0xD3, 8);
-  addKey("date+", Unmapped_Key, 0x63, 8);
-  addKey("date-", Unmapped_Key, 0xE3, 8);
-  addKey("review", Replay_Key, 0xC3, 8);
-  addKey("IN/OUT", Unmapped_Key, 0x7B, 8);
-  addKey("3dphonic", Unmapped_Key, 0xA9, 8);
-  addKey("Red", Red_Key, 0x89, 8);
-  addKey("Green", Green_Key, 0xDC, 8);
-  addKey("Yellow", Yellow_Key, 0xE9, 8);
-  addKey("Blue", Blue_Key, 0x8C, 8);
+  addKey("no_5", Five_Key, 0x25, 8);
+  addKey("no_6", Six_Key, 0x26, 8);
+  addKey("no_7", Seven_Key, 0x27, 8);
+  addKey("no_8", Eight_Key, 0x28, 8);
+  addKey("no_9", Nine_Key, 0x29, 8);
+  addKey("SPEED", VHSSpeed_Key, 0x31, 8); // "I/II"
+  addKey("Blue", Blue_Key, 0x31, 8); // odd
+  addKey("no_0", Zero_Key, 0x33, 8);
+
+  addKey("TIMER", Timer_Key, 0x35, 8);
+  addKey("CANCEL", Exit_Key, 0x36, 8); // "zero4x", "reset"
+  addKey("CANCEL", Clear_Key, 0x36, 8); // "zero4x", "reset"
+  addKey("menu", Menu_Key, 0x37, 8); // "PROG"
+  addKey("DISPLAY", Info_Key, 0x38, 8);
+  addKey("clock", Clock_Key, 0x3A, 8);
+  addKey("Green", Green_Key, 0x3B, 8);
+  addKey("ok", Select_Key, 0x3C, 8);
+  addKey("check", Unmapped_Key, 0x3D, 8); // "prog_check"
+  addKey("enter", Enter_Key, 0x3E, 8); // "store"
+
   addKey("ch_set", Unmapped_Key, 0x66, 8);
-  addKey("clock", Unmapped_Key, 0x5C, 8);
-  addKey("mode", Unmapped_Key, 0x61, 8);
-  addKey("scene-finder", Unmapped_Key, 0xE9, 8);
-  addKey("input_1", Unmapped_Key, 0x88, 8);
+  addKey("line", Unmapped_Key, 0x6E, 8);
+  addKey("mode", Unmapped_Key, 0x81, 8);
+  addKey("Red", Red_Key, 0x91, 8);
+  addKey("INDEX1", Unmapped_Key, 0x93, 8);
+  addKey("INDEX2", Unmapped_Key, 0x94, 8);
+  addKey("3dphonic", Unmapped_Key, 0x95, 8);
+  addKey("ff_30sec", Advance_Key, 0x96, 8); // "skip"
+  addKey("scene-finder", Unmapped_Key, 0x97, 8);
+  addKey("Yellow", Yellow_Key, 0x97, 8);
+  addKey("start", Unmapped_Key, 0x98, 8);
+  addKey("showview", Program_Key, 0xC1, 8); // program
+  addKey("review", Replay_Key, 0xC3, 8);
+  addKey("SOUND2", Unmapped_Key, 0xC4, 8);
+  addKey("date+", Unmapped_Key, 0xC6, 8);
+  addKey("date-", Unmapped_Key, 0xC7, 8);
+  addKey("start+", Unmapped_Key, 0xC8, 8);
+  addKey("start-", Unmapped_Key, 0xC9, 8);
+  addKey("stop+", Unmapped_Key, 0xCA, 8);
+  addKey("stop-", Unmapped_Key, 0xCB, 8);
+  addKey("RECORD", Record_Key, 0xCC, 8); // "1tr"
+
+  addKey("MIC+", Unmapped_Key, 0xD1, 8);
+  addKey("MIC-", Unmapped_Key, 0xD2, 8);
+  addKey("SOUND1", Unmapped_Key, 0xD7, 8);
+  addKey("SOUND3", Unmapped_Key, 0xDC, 8);
+  addKey("IN/OUT", Unmapped_Key, 0xDE, 8);
+  addKey("lock", Unmapped_Key, 0xF0, 8);
+  addKey("die", Unmapped_Key, 0xFA, 8);
+
+  // Cursor keys duplicate some other keys:
+  addKey("right", Right_Key, 0x14, 8); // "JOG+"
+  addKey("left", Left_Key, 0x15, 8); // "JOG-"
+  addKey("pr_dn", Down_Key, 0x18, 8);
+  addKey("pr_up", Up_Key, 0x19, 8);
 }
 
 
@@ -234,174 +236,36 @@ JVCVCR1a::JVCVCR1a(
 {
   setKeysetName("VCR Keyset 1a");
 
-  addKey("red", Red_Key, 0xE0, 8);
-  addKey("green", Green_Key, 0xA8, 8);
-  addKey("yellow", Yellow_Key, 0x28, 8);
-  addKey("blue", Blue_Key, 0x60, 8);
-  addKey("menu", Menu_Key, 0xC8, 8);
-  addKey("last", Unmapped_Key, 0xA8, 8); // what is this?
-  addKey("suchl", Unmapped_Key, 0x69, 8); // ditto
+  addKey("red", Red_Key, 0x07, 8);
+  addKey("green", Green_Key, 0x51, 8);
+  addKey("yellow", Yellow_Key, 0x14, 8);
+  addKey("blue", Blue_Key, 0x06, 8);
+  addKey("menu", Menu_Key, 0x13, 8);
+  addKey("last", Unmapped_Key, 0x15, 8); // what is this?
+  addKey("suchl", Unmapped_Key, 0x96, 8); // ditto
 }
 
 
-// The 0xCA keyset appears to just be the 0xC2 keyset with a different preface,
-// to allow two VCRs in the same room to be controlled independently.
-// Note the hack below won't work with the other VCR keysets!!!
-JVCVCR1b::JVCVCR1b(
+// Setup keysets for use in B-mode:
+JVCVCRBmode1::JVCVCRBmode1(
   QObject *guiObject,
   unsigned int index)
   : JVCVCR1(guiObject, index)
 {
-  setKeysetName("VCR (alt) keyset 1b");
-
-  setPreData(0xCA, 8);
-}
-
-
-JVCVCR1c::JVCVCR1c(
-  QObject *guiObject,
-  unsigned int index)
-  : JVCVCR1(guiObject, index)
-{
-  setKeysetName("VCR keyset 1c");
-
-  addKey("tv", Input_Key, 0x08, 8);
-}
-
-
-// VCR keyset #2 is apparently identical to #1, but this one uses a header
-// pulse.  Dunno if this is a mistake, or if JVC messes with the fundamental
-// elements of their protocols this much...
-JVCVCR2::JVCVCR2(
-  QObject *guiObject,
-  unsigned int index)
-  : PIRKeysetMetaData(
-      "VCR Keyset 2",
-      JVC_Make,
-      index)
-{
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 500,
-    600, 1600,
-    46000, true);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(9000, 4500);
-  np->setTrailerPulse(600);
-  np->setFullHeadlessRepeat(true);
-
-  setPreData(0xC2, 8);
-
-  addKey("power", Power_Key, 0xD0, 8);
-  addKey("play", Play_Key, 0x30, 8);
-  addKey("forward", FastForward_Key, 0x60, 8);
-  addKey("backward", Rewind_Key, 0xE0, 8);
-  addKey("stop", Stop_Key, 0xC0, 8);
-  addKey("pause", Pause_Key, 0xB0, 8);
-  addKey("menu", Menu_Key, 0xEC, 8); // "PROG"
-  addKey("ok", Select_Key, 0x3C, 8);
-  addKey("CANCEL", Exit_Key, 0x6C, 8); // "zero4x", "reset"
-  addKey("CANCEL", Clear_Key, 0x6C, 8); // "zero4x", "reset"
-  addKey("RECORD", Record_Key, 0x33, 8); // "itr"
-  addKey("recpause", Unmapped_Key, 0xB3, 8);
-  addKey("pr_up", ChannelUp_Key, 0x98, 8);
-  addKey("pr_dn", ChannelDown_Key, 0x18, 8);
-  addKey("pr_up", Up_Key, 0x98, 8);
-  addKey("pr_dn", Down_Key, 0x18, 8);
-  addKey("right", Right_Key, 0x28, 8); // "JOG+"
-  addKey("left", Left_Key, 0xA8, 8); // "JOG-"
-  addKey("eject", Eject_Key, 0x20, 8);
-  addKey("no_1", One_Key, 0x84, 8);
-  addKey("no_2", Two_Key, 0x44, 8);
-  addKey("no_3", Three_Key, 0xC4, 8);
-  addKey("no_4", Four_Key, 0x24, 8);
-  addKey("no_5", Five_Key, 0xA4, 8);
-  addKey("no_6", Six_Key, 0x64, 8);
-  addKey("no_7", Seven_Key, 0xE4, 8);
-  addKey("no_8", Eight_Key, 0x14, 8);
-  addKey("no_9", Nine_Key, 0x94, 8);
-  addKey("no_0", Zero_Key, 0xCC, 8);
-  addKey("tv_vcr", Input_Key, 0xC8, 8); // "monitor"
-  addKey("av", Unmapped_Key, 0x80, 8);
-  addKey("ff_30sec", Advance_Key, 0x69, 8); // "skip"
-  addKey("die", Unmapped_Key, 0x5F, 8);
-  addKey("start", Unmapped_Key, 0x19, 8);
-  addKey("lock", Unmapped_Key, 0x0F, 8);
-  addKey("showview", Program_Key, 0x83, 8); // program
-  addKey("SOUND1", Unmapped_Key, 0xEB, 8);
-  addKey("SOUND2", Unmapped_Key, 0x27, 8);
-  addKey("SOUND3", Unmapped_Key, 0x3B, 8);
-  addKey("INDEX1", Unmapped_Key, 0xC9, 8);
-  addKey("INDEX2", Unmapped_Key, 0x29, 8);
-  addKey("DISPLAY", Info_Key, 0x1C, 8);
-  addKey("MUTE", Mute_Key, 0xE8, 8);
-  addKey("SPEED", VHSSpeed_Key, 0x8C, 8); // "I/II"
-  addKey("TIMER", Unmapped_Key, 0xAC, 8);
-  addKey("MIC+", Unmapped_Key, 0x8B, 8);
-  addKey("MIC-", Unmapped_Key, 0x4B, 8);
-  addKey("enter", Enter_Key, 0x7C, 8);
-  addKey("line", Unmapped_Key, 0x76, 8);
-  addKey("check", Unmapped_Key, 0xBC, 8); // "prog_check"
-  addKey("start+", Unmapped_Key, 0x13, 8);
-  addKey("start-", Unmapped_Key, 0x93, 8);
-  addKey("stop+", Unmapped_Key, 0x53, 8);
-  addKey("stop-", Unmapped_Key, 0xD3, 8);
-  addKey("date+", Unmapped_Key, 0x63, 8);
-  addKey("date-", Unmapped_Key, 0xE3, 8);
-  addKey("review", Replay_Key, 0xC3, 8);
-  addKey("IN/OUT", Unmapped_Key, 0x7B, 8);
-  addKey("3dphonic", Unmapped_Key, 0xA9, 8);
-  addKey("Red", Red_Key, 0x89, 8);
-  addKey("Green", Green_Key, 0xDC, 8);
-  addKey("Yellow", Yellow_Key, 0xE9, 8);
-  addKey("Blue", Blue_Key, 0x8C, 8);
-  addKey("ch_set", Unmapped_Key, 0x66, 8);
-  addKey("clock", Unmapped_Key, 0x5C, 8);
-  addKey("mode", Unmapped_Key, 0x61, 8);
-  addKey("scene-finder", Unmapped_Key, 0xE9, 8);
-  addKey("input_1", Unmapped_Key, 0x88, 8);
-}
-
-
-JVCVCR2a::JVCVCR2a(
-  QObject *guiObject,
-  unsigned int index)
-  : JVCVCR2(guiObject, index)
-{
-  setKeysetName("VCR Keyset 2a");
-
-  addKey("red", Red_Key, 0xE0, 8);
-  addKey("green", Green_Key, 0xA8, 8);
-  addKey("yellow", Yellow_Key, 0x28, 8);
-  addKey("blue", Blue_Key, 0x60, 8);
-  addKey("menu", Menu_Key, 0xC8, 8);
-  addKey("last", Unmapped_Key, 0xA8, 8); // what is this?
-  addKey("suchl", Unmapped_Key, 0x69, 8); // ditto
-}
-
+  setKeysetName("VCR (B Mode) keyset 1");
 
-JVCVCR2b::JVCVCR2b(
-  QObject *guiObject,
-  unsigned int index)
-  : JVCVCR2(guiObject, index)
-{
-  setKeysetName("VCR (alt) keyset 2b");
-
-  setPreData(0xCA, 8);
+  setPreData(0x53, 8);
 }
 
 
-JVCVCR2c::JVCVCR2c(
+JVCVCRBmode1a::JVCVCRBmode1a(
   QObject *guiObject,
   unsigned int index)
-  : JVCVCR2(guiObject, index)
+  : JVCVCR1a(guiObject, index)
 {
-  setKeysetName("VCR Keyset 2c");
+  setKeysetName("VCR (B Mode) keyset 1a");
 
-  addKey("tv", Input_Key, 0x08, 8);
+  setPreData(0x53, 8);
 }
 
 
@@ -413,82 +277,78 @@ JVCTV1::JVCTV1(
       JVC_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 500,
-    600, 1600,
-    45000, true);
-
-  threadableProtocol = np;
-
-  np->setTrailerPulse(600);
-
-  setPreData(0xC0, 8);
-
-  addKey("Power", Power_Key, 0xE8, 8);
-  addKey("Vol+", VolumeUp_Key, 0x78, 8);
-  addKey("Vol-", VolumeDown_Key, 0xF8, 8);
-  addKey("Prog+", ChannelUp_Key, 0x98, 8);
+  threadableProtocol = new JVCProtocol(guiObject, index);
+
+  setPreData(0x03, 8);
+
+  addKey("main/sap", Audio_Key, 0x00, 8); // "I/II"
+  addKey("info", Info_Key, 0x04, 8); // "display"
+  addKey("return", Unmapped_Key, 0x05, 8);
+  addKey("RESET", Reset_Key, 0x06, 8);
+  addKey("BROADCAST", Unmapped_Key, 0x0B, 8); // "ant/cable"
+  addKey("video_status", Unmapped_Key, 0x0D, 8);
+  addKey("cc", Captions_Key, 0x0E, 8);
+  addKey("input_s", Unmapped_Key, 0x0F, 8);
+
+  addKey("input_2", Unmapped_Key, 0x12, 8);
+  addKey("TV/VCR", Input_Key, 0x13, 8); // "input"
+  addKey("input_3", Unmapped_Key, 0x14, 8);
+  addKey("Power", Power_Key, 0x17, 8);
   addKey("Prog-", ChannelDown_Key, 0x18, 8);
-  addKey("TV/VCR", Input_Key, 0xC8, 8); // "input"
-  addKey("0", Zero_Key, 0x04, 8);
-  addKey("1", One_Key, 0x84, 8);
-  addKey("2", Two_Key, 0x44, 8);
-  addKey("3", Three_Key, 0xC4, 8);
+  addKey("Prog+", ChannelUp_Key, 0x19, 8);
+  addKey("LEVELUP", Unmapped_Key, 0x1A, 8);
+  addKey("LEVELDOWN", Unmapped_Key, 0x1B, 8);
+  addKey("AUDIO", Mute_Key, 0x1C, 8); // "mute"
+  addKey("Vol+", VolumeUp_Key, 0x1E, 8);
+  addKey("Vol-", VolumeDown_Key, 0x1F, 8);
+
+  addKey("0", Zero_Key, 0x20, 8);
+  addKey("1", One_Key, 0x21, 8);
+  addKey("2", Two_Key, 0x22, 8);
+  addKey("3", Three_Key, 0x23, 8);
   addKey("4", Four_Key, 0x24, 8);
-  addKey("5", Five_Key, 0xA4, 8);
-  addKey("6", Six_Key, 0x64, 8);
-  addKey("7", Seven_Key, 0xE4, 8);
-  addKey("8", Eight_Key, 0x14, 8);
-  addKey("9", Nine_Key, 0x94, 8);
-  addKey("X", Clear_Key, 0x0E, 8);
-  addKey("AUDIO", Mute_Key, 0x38, 8); // "mute"
-  addKey("Timer", Sleep_Key, 0x8E, 8);
-//  addKey("SP/LP", VHSSpeed_Key, 0xB9, 8); // "/_//"
-  addKey("-/--", DoubleDigit_Key, 0xB9, 8);
-//  addKey("Red", Red_Key, 0x89, 8);
-//  addKey("Green", Green_Key, 0xDC, 8);
-//  addKey("Yellow", Yellow_Key, 0xE9, 8);
-//  addKey("Blue", Blue_Key, 0x8C, 8);
-  addKey("info", Info_Key, 0x20, 8); // "display"
-  addKey("standard", PictureMode_Key, 0x9E, 8); // "picture_mode"
-  addKey("menu", Menu_Key, 0x5E, 8);
-  addKey("sound", Unmapped_Key, 0x42, 8); // "<>"
-  addKey("video_status", Unmapped_Key, 0xB0, 8);
-  addKey("theater_pro", Unmapped_Key, 0xAB, 8);
-  addKey("aspect", AspectRatio_Key, 0xC9, 8);
-  addKey("100+", PlusOneHundred_Key, 0xEE, 8);
-  addKey("return", Unmapped_Key, 0xA0, 8);
-  addKey("cc", Captions_Key, 0x70, 8);
-  addKey("exit", Exit_Key, 0x67, 8);
-  addKey("colour", Unmapped_Key, 0x49, 8); // "P/S"
-  addKey("sound", SoundMode_Key, 0x2D, 8);
-  addKey("up", Up_Key, 0x3E, 8);
-  addKey("down", Down_Key, 0xDE, 8);
-  addKey("left", Left_Key, 0xDA, 8);
-  addKey("right", Right_Key, 0x5A, 8);
-  addKey("BROADCAST", Unmapped_Key, 0xD0, 8); // "ant/cable"
+  addKey("5", Five_Key, 0x25, 8);
+  addKey("6", Six_Key, 0x26, 8);
+  addKey("7", Seven_Key, 0x27, 8);
+  addKey("8", Eight_Key, 0x28, 8);
+  addKey("9", Nine_Key, 0x29, 8);
+
+  addKey("br_up", Unmapped_Key, 0x30, 8);
+  addKey("br_down", Unmapped_Key, 0x31, 8);
+  addKey("col_up", Unmapped_Key, 0x32, 8);
+  addKey("col_down", Unmapped_Key, 0x33, 8);
+  addKey("con_up", Unmapped_Key, 0x36, 8);
+  addKey("con_down", Unmapped_Key, 0x37, 8);
+  addKey("FUNCTION", Unmapped_Key, 0x3B, 8);
   addKey("RECALL", PrevChannel_Key, 0x3C, 8);
-  addKey("RESET", Reset_Key, 0x60, 8);
-  addKey("FUNCTION", Unmapped_Key, 0xDC, 8);
-  addKey("LEVELDOWN", Unmapped_Key, 0xD8, 8);
-  addKey("LEVELUP", Unmapped_Key, 0x58, 8);
-  addKey("main/sap", Language_Key, 0x00, 8); // "I/II"
+  addKey("sound", Unmapped_Key, 0x42, 8); // "<>"
+  addKey("VNR", Unmapped_Key, 0x45, 8);
+  addKey("right", Right_Key, 0x55, 8);
+  addKey("left", Left_Key, 0x5B, 8);
+  addKey("X", Clear_Key, 0x70, 8);
+  addKey("Timer", Sleep_Key, 0x71, 8);
+  addKey("100+", PlusOneHundred_Key, 0x77, 8);
+  addKey("standard", PictureMode_Key, 0x79, 8); // "picture_mode"
+  addKey("menu", Menu_Key, 0x7A, 8);
+  addKey("down", Down_Key, 0x7B, 8);
+  addKey("up", Up_Key, 0x7C, 8);
+
+  addKey("tone", Unmapped_Key, 0x90, 8);
+  addKey("colour", Unmapped_Key, 0x92, 8); // "P/S"
+  addKey("aspect", AspectRatio_Key, 0x93, 8);
   addKey("CH_PRESET", Unmapped_Key, 0x99, 8);
-  addKey("MAX_CH", Unmapped_Key, 0xB9, 8);
-  addKey("C1/C2", Unmapped_Key, 0x5B, 8);
-  addKey("input_2", Unmapped_Key, 0x48, 8);
-  addKey("input_3", Unmapped_Key, 0x28, 8);
-  addKey("input_s", Unmapped_Key, 0xF0, 8);
-  addKey("tone", Unmapped_Key, 0x09, 8);
-  addKey("VNR", Unmapped_Key, 0xA2, 8);
-  addKey("br_down", Unmapped_Key, 0x8C, 8);
-  addKey("br_up", Unmapped_Key, 0x0C, 8);
-  addKey("con_down", Unmapped_Key, 0xEC, 8);
-  addKey("con_up", Unmapped_Key, 0x6C, 8);
-  addKey("col_down", Unmapped_Key, 0xCC, 8);
-  addKey("col_up", Unmapped_Key, 0x4C, 8);
+  addKey("MAX_CH", Unmapped_Key, 0x9D, 8);
+//  addKey("SP/LP", VHSSpeed_Key, 0x9D, 8); // "/_//"
+  addKey("-/--", DoubleDigit_Key, 0x9D, 8);
+  addKey("sound", SoundMode_Key, 0xB4, 8);
+  addKey("theater_pro", Unmapped_Key, 0xD5, 8);
+  addKey("C1/C2", Unmapped_Key, 0xDA, 8);
+  addKey("exit", Exit_Key, 0xE6, 8);
+
+//  addKey("Red", Red_Key, 0x91, 8);
+//  addKey("Green", Green_Key, 0x3B, 8);
+//  addKey("Yellow", Yellow_Key, 0x97, 8);
+//  addKey("Blue", Blue_Key, 0x31, 8);
 }
 
 
@@ -499,7 +359,7 @@ JVCTV1a::JVCTV1a(
 {
   setKeysetName("TV Keyset 1a");
 
-  addKey("+10", DoubleDigit_Key, 0x8E, 8);
+  addKey("+10", DoubleDigit_Key, 0x71, 8);
 }
 
 
@@ -510,7 +370,7 @@ JVCTV1b::JVCTV1b(
 {
   setKeysetName("TV Keyset 1b");
 
-  addKey("sleep_timer", Sleep_Key, 0xC0, 8);
+  addKey("sleep_timer", Sleep_Key, 0x03, 8);
 }
 
 
@@ -521,12 +381,12 @@ JVCTV1c::JVCTV1c(
 {
   setKeysetName("TV Keyset 1c");
 
-  addKey("REW", Rewind_Key, 0x4D, 8);
-  addKey("PLAY", Play_Key, 0x91, 8);
-  addKey("FF", FastForward_Key, 0x6B, 8);
-  addKey("REC", Record_Key, 0x20, 8);
   addKey("STOP", Stop_Key, 0x00, 8);
-  addKey("PAUSE", Pause_Key, 0xD0, 8);
+  addKey("REC", Record_Key, 0x04, 8);
+  addKey("PAUSE", Pause_Key, 0x0B, 8);
+  addKey("PLAY", Play_Key, 0x89, 8);
+  addKey("REW", Rewind_Key, 0xB2, 8);
+  addKey("FF", FastForward_Key, 0xD6, 8);
 }
 
 
@@ -538,149 +398,10 @@ JVCTV1d::JVCTV1d(
 {
   setKeysetName("TV Keyset 1d");
 
-  addKey("up", Up_Key, 0x98, 8);
-  addKey("down", Down_Key, 0x18, 8);
-  addKey("left", Left_Key, 0xF8, 8);
-  addKey("right", Right_Key, 0x78, 8);
-}
-
-
-// Same deal here, two different header specifications on top of the same
-// underlying keyset.
-JVCTV2::JVCTV2(
-  QObject *guiObject,
-  unsigned int index)
-  : PIRKeysetMetaData(
-      "TV Keyset 2",
-      JVC_Make,
-      index)
-{
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 500,
-    600, 1600,
-    46000, true);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(9000, 4500);
-  np->setTrailerPulse(600);
-  np->setFullHeadlessRepeat(true);
-
-  setPreData(0xC0, 8);
-
-  addKey("Power", Power_Key, 0xE8, 8);
-  addKey("Vol+", VolumeUp_Key, 0x78, 8);
-  addKey("Vol-", VolumeDown_Key, 0xF8, 8);
-  addKey("Prog+", ChannelUp_Key, 0x98, 8);
-  addKey("Prog-", ChannelDown_Key, 0x18, 8);
-  addKey("TV/VCR", Input_Key, 0xC8, 8);
-  addKey("0", Zero_Key, 0x04, 8);
-  addKey("1", One_Key, 0x84, 8);
-  addKey("2", Two_Key, 0x44, 8);
-  addKey("3", Three_Key, 0xC4, 8);
-  addKey("4", Four_Key, 0x24, 8);
-  addKey("5", Five_Key, 0xA4, 8);
-  addKey("6", Six_Key, 0x64, 8);
-  addKey("7", Seven_Key, 0xE4, 8);
-  addKey("8", Eight_Key, 0x14, 8);
-  addKey("9", Nine_Key, 0x94, 8);
-  addKey("X", Clear_Key, 0x0E, 8);
-  addKey("AUDIO", Mute_Key, 0x38, 8); // "mute"
-  addKey("Timer", Sleep_Key, 0x8E, 8);
-//  addKey("SP/LP", VHSSpeed_Key, 0xB9, 8);
-  addKey("-/--", DoubleDigit_Key, 0xB9, 8);
-  addKey("info", Info_Key, 0x20, 8);
-  addKey("standard", PictureMode_Key, 0x9E, 8); // "picture_mode"
-  addKey("menu", Menu_Key, 0x5E, 8);
-  addKey("sound", Unmapped_Key, 0x42, 8);
-  addKey("video_status", Unmapped_Key, 0xB0, 8);
-  addKey("theater_pro", Unmapped_Key, 0xAB, 8);
-  addKey("aspect", AspectRatio_Key, 0xC9, 8);
-  addKey("100+", PlusOneHundred_Key, 0xEE, 8);
-  addKey("return", Unmapped_Key, 0xA0, 8);
-  addKey("cc", Captions_Key, 0x70, 8);
-  addKey("exit", Exit_Key, 0x67, 8);
-  addKey("colour", Unmapped_Key, 0x49, 8);
-  addKey("sound", SoundMode_Key, 0x2D, 8);
-  addKey("up", Up_Key, 0x3E, 8);
-  addKey("down", Down_Key, 0xDE, 8);
-  addKey("left", Left_Key, 0xDA, 8);
-  addKey("right", Right_Key, 0x5A, 8);
-  addKey("BROADCAST", Unmapped_Key, 0xD0, 8);
-  addKey("RECALL", PrevChannel_Key, 0x3C, 8);
-  addKey("RESET", Reset_Key, 0x60, 8);
-  addKey("FUNCTION", Unmapped_Key, 0xDC, 8);
-  addKey("LEVELDOWN", Unmapped_Key, 0xD8, 8);
-  addKey("LEVELUP", Unmapped_Key, 0x58, 8);
-  addKey("main/sap", Language_Key, 0x00, 8);
-  addKey("CH_PRESET", Unmapped_Key, 0x99, 8);
-  addKey("MAX_CH", Unmapped_Key, 0xB9, 8);
-  addKey("C1/C2", Unmapped_Key, 0x5B, 8);
-  addKey("input_2", Unmapped_Key, 0x48, 8);
-  addKey("input_3", Unmapped_Key, 0x28, 8);
-  addKey("input_s", Unmapped_Key, 0xF0, 8);
-  addKey("tone", Unmapped_Key, 0x09, 8);
-  addKey("VNR", Unmapped_Key, 0xA2, 8);
-  addKey("br_down", Unmapped_Key, 0x8C, 8);
-  addKey("br_up", Unmapped_Key, 0x0C, 8);
-  addKey("con_down", Unmapped_Key, 0xEC, 8);
-  addKey("con_up", Unmapped_Key, 0x6C, 8);
-  addKey("col_down", Unmapped_Key, 0xCC, 8);
-  addKey("col_up", Unmapped_Key, 0x4C, 8);
-}
-
-
-JVCTV2a::JVCTV2a(
-  QObject *guiObject,
-  unsigned int index)
-  : JVCTV2(guiObject, index)
-{
-  setKeysetName("TV Keyset 2a");
-
-  addKey("+10", DoubleDigit_Key, 0x8E, 8);
-}
-
-
-JVCTV2b::JVCTV2b(
-  QObject *guiObject,
-  unsigned int index)
-  : JVCTV2(guiObject, index)
-{
-  setKeysetName("TV Keyset 2b");
-
-  addKey("sleep_timer", Sleep_Key, 0xC0, 8);
-}
-
-
-JVCTV2c::JVCTV2c(
-  QObject *guiObject,
-  unsigned int index)
-  : JVCTV2(guiObject, index)
-{
-  setKeysetName("TV Keyset 2c");
-
-  addKey("REW", Rewind_Key, 0x4D, 8);
-  addKey("PLAY", Play_Key, 0x91, 8);
-  addKey("FF", FastForward_Key, 0x6B, 8);
-  addKey("REC", Record_Key, 0x20, 8);
-  addKey("STOP", Stop_Key, 0x00, 8);
-  addKey("PAUSE", Pause_Key, 0xD0, 8);
-}
-
-
-JVCTV2d::JVCTV2d(
-  QObject *guiObject,
-  unsigned int index)
-  : JVCTV2(guiObject, index)
-{
-  setKeysetName("TV Keyset 2d");
-
-  addKey("up", Up_Key, 0x98, 8);
   addKey("down", Down_Key, 0x18, 8);
-  addKey("left", Left_Key, 0xF8, 8);
-  addKey("right", Right_Key, 0x78, 8);
+  addKey("up", Up_Key, 0x19, 8);
+  addKey("right", Right_Key, 0x1E, 8);
+  addKey("left", Left_Key, 0x1F, 8);
 }
 
 
@@ -692,50 +413,42 @@ JVCDAT1::JVCDAT1(
       JVC_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 500,
-    600, 1600,
-    46000, true);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(9000, 4500);
-  np->setTrailerPulse(600);
-
-  np->setFullHeadlessRepeat(true);
-
-  setPreData(0xC9, 8);
-
-  addKey("1", One_Key, 0x84, 8);
-  addKey("2", Two_Key, 0x44, 8);
-  addKey("3", Three_Key, 0xC4, 8);
-  addKey("4", Four_Key, 0x24, 8);
-  addKey("5", Five_Key, 0xA4, 8);
-  addKey("6", Six_Key, 0x64, 8);
-  addKey("7", Seven_Key, 0xE4, 8);
-  addKey("8", Eight_Key, 0x14, 8);
-  addKey("9", Nine_Key, 0x94, 8);
-  addKey("0", Zero_Key, 0x04, 8);
-  addKey("MEMORY", Unmapped_Key, 0x48, 8);
-  addKey("REPEAT", Unmapped_Key, 0xD8, 8);
-  addKey("DISPLAY", Info_Key, 0x28, 8);
-  addKey("CANCEL/RESET", Reset_Key, 0xB4, 8);
-  addKey("CALL", Unmapped_Key, 0xA8, 8);
-  addKey("RESERVE", Unmapped_Key, 0x54, 8);
-  addKey("INTRO", Unmapped_Key, 0x88, 8);
-  addKey("REC_MUTE", Unmapped_Key, 0x38, 8);
-  addKey("REC", Record_Key, 0x40, 8);
-  addKey("PAUSE", Pause_Key, 0xB0, 8);
+  threadableProtocol = new JVCProtocol(guiObject, index);
+
+//  setPreData(0xC9, 8);
+  setPreData(0x93, 8);
+
+  addKey("REC", Record_Key, 0x02, 8);
+  addKey("STOP", Stop_Key, 0x03, 8);
+  addKey("FF", FastForward_Key, 0x06, 8);
+  addKey("REW", Rewind_Key, 0x07, 8);
+  addKey("PLAY", Play_Key, 0x0C, 8);
+  addKey("PAUSE", Pause_Key, 0x0D, 8);
+
+  addKey("INTRO", Unmapped_Key, 0x11, 8);
+  addKey("MEMORY", Program_Key, 0x12, 8);
+  addKey("DISPLAY", Info_Key, 0x14, 8);
+  addKey("CALL", Unmapped_Key, 0x15, 8);
+  addKey("SEARCH->>", Unmapped_Key, 0x16, 8);
+  addKey("<<-SEARCH", Unmapped_Key, 0x17, 8);
   addKey("|<-SKIP", Previous_Key, 0x18, 8);
-  addKey("SKIP->|", Next_Key, 0x98, 8);
-  addKey("<<-SEARCH", Unmapped_Key, 0xE8, 8);
-  addKey("SEARCH->>", Unmapped_Key, 0x68, 8);
-  addKey("REW", Rewind_Key, 0xE0, 8);
-  addKey("FF", FastForward_Key, 0x60, 8);
-  addKey("STOP", Stop_Key, 0xC0, 8);
-  addKey("PLAY", Play_Key, 0x30, 8);
+  addKey("SKIP->|", Next_Key, 0x19, 8);
+  addKey("REPEAT", Repeat_Key, 0x1B, 8);
+  addKey("REC_MUTE", RecordMute_Key, 0x1C, 8);
+
+  addKey("0", Zero_Key, 0x20, 8);
+  addKey("1", One_Key, 0x21, 8);
+  addKey("2", Two_Key, 0x22, 8);
+  addKey("3", Three_Key, 0x23, 8);
+  addKey("4", Four_Key, 0x24, 8);
+  addKey("5", Five_Key, 0x25, 8);
+  addKey("6", Six_Key, 0x26, 8);
+  addKey("7", Seven_Key, 0x27, 8);
+  addKey("8", Eight_Key, 0x28, 8);
+  addKey("9", Nine_Key, 0x29, 8);
+
+  addKey("RESERVE", Unmapped_Key, 0x2A, 8);
+  addKey("CANCEL/RESET", Reset_Key, 0x2D, 8);
 }
 
 
@@ -747,37 +460,32 @@ JVCCarDeck1::JVCCarDeck1(
       JVC_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 500,
-    600, 1600,
-    46000, true);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(9000, 4500);
-  np->setTrailerPulse(600);
-
-  np->setFullHeadlessRepeat(true);
-
-  setPreData(0xF1, 8);
-
-  addKey("Power", Power_Key, 0x71, 8); // "Att"
-  addKey("Sound", Mute_Key, 0xB1, 8); // "SCM"
-  addKey("Source", Input_Key, 0x11, 8);  // "FUNC", "SRC"
-  addKey("DISC+", Up_Key, 0x29, 8);
-  addKey("DISC-", Down_Key, 0xA9, 8);
-  addKey("Vol+", VolumeUp_Key, 0x21, 8);
-  addKey("Vol-", VolumeDown_Key, 0xA1, 8);
-  addKey("Track+", Next_Key, 0x49, 8);
-  addKey("Track-", Previous_Key, 0xC9, 8);
-  addKey("FF", FastForward_Key, 0x49, 8);
-  addKey("Rew", Rewind_Key, 0xC9, 8);
+  threadableProtocol = new JVCProtocol(guiObject, index);
+
+//  setPreData(0xF1, 8);
+  setPreData(0x8F, 8);
+
+  addKey("Vol+", VolumeUp_Key, 0x84, 8);
+  addKey("Vol-", VolumeDown_Key, 0x85, 8);
+  addKey("Source", Input_Key, 0x88, 8);  // "FUNC", "SRC"
+  addKey("Sound", Mute_Key, 0x8D, 8); // "SCM"
+  addKey("Power", Power_Key, 0x8E, 8); // "Att"
+  addKey("DISC+", ChannelUp_Key, 0x94, 8);
+  addKey("DISC-", ChannelDown_Key, 0x95, 8);
+
+  // Can't be sure if either or both of these are true:
+  addKey("Track+", Next_Key, 0x92, 8);
+  addKey("Track-", Previous_Key, 0x93, 8);
+  addKey("FF", FastForward_Key, 0x92, 8);
+  addKey("Rew", Rewind_Key, 0x93, 8);
 }
 
 
-JVCPortableAudio1::JVCPortableAudio1(
+// Modern JVC audio devices are using a wide array of addresses, so I'm
+// smushing the address and command together.  Once you start mixing adresses
+// together, they might as well all be a single command anyway...
+
+JVCAudio1::JVCAudio1(
   QObject *guiObject,
   unsigned int index)
   : PIRKeysetMetaData(
@@ -785,147 +493,134 @@ JVCPortableAudio1::JVCPortableAudio1(
       JVC_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 500,
-    600, 1600,
-    46000, true);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(9000, 4500);
-  np->setTrailerPulse(600);
-
-  np->setFullHeadlessRepeat(true);
-
-  addKey("POWER", Power_Key, 0xC5E8, 16);
-  addKey("1", One_Key, 0xCD86, 16);
-  addKey("2", Two_Key, 0xCD46, 16);
-  addKey("3", Three_Key, 0xCDC6, 16);
-  addKey("4", Four_Key, 0xCD26, 16);
-  addKey("5", Five_Key, 0xCDA6, 16);
-  addKey("6", Six_Key, 0xCD66, 16);
-  addKey("7", Seven_Key, 0xCDE6, 16);
-  addKey("8", Eight_Key, 0xCD16, 16);
-  addKey("9", Nine_Key, 0xCD96, 16);
-  addKey("10", Zero_Key, 0xCD76, 16); // Ok, yeah, this one is a hack...
-  addKey("+10", DoubleDigit_Key, 0xCDF6, 16);
-  addKey("REPEAT", Unmapped_Key, 0xCDDA, 16);
-  addKey("RANDOM", Unmapped_Key, 0xCD4E, 16);
-  addKey("INTRO", Unmapped_Key, 0xCD12, 16);
-  addKey("MEMORY/CALL", Unmapped_Key, 0xCD56, 16);
-  addKey("REW", Rewind_Key, 0xCD1A, 16);
-  addKey("FF", FastForward_Key, 0xCD9A, 16); // "CD.Next"
-  addKey("STOP", Stop_Key, 0xCDC2, 16); // "CD.Stop"
-  addKey("PLAY", Play_Key, 0xCD32, 16); // "CD.Play"
-  addKey("VOL-", VolumeDown_Key, 0xC5F8, 16);
-  addKey("VOL+", VolumeUp_Key, 0xC578, 16);
-  addKey("SLEEP", Sleep_Key, 0xC5C0, 16);
-  addKey("DIMMER", Unmapped_Key, 0xCD4A, 16);
-  addKey("FM-MODE", Unmapped_Key, 0xC55A, 16);
-  addKey("MD-AUX", Unmapped_Key, 0xC57C, 16); // "TAPE-AUX"
-  addKey("AHB-PRO", Unmapped_Key, 0xC5AE, 16);
-  addKey("AUTO-PRESET", Unmapped_Key, 0xC5EE, 16);
-  addKey("CD-EJECT", Eject_Key, 0xCD22, 16);
-  addKey("PROGRAM", Program_Key, 0xCD56, 16);
-  addKey("RANDOM", Unmapped_Key, 0xCD4E, 16);
-  addKey("REPEAT", Unmapped_Key, 0xCDDA, 16);
-  addKey("BASS", Unmapped_Key, 0xF578, 16);
-  addKey("TREBLE", Unmapped_Key, 0xF574, 16);
-  addKey("CANCEL", Clear_Key, 0xCDB6, 16);
-  addKey("UP", Up_Key, 0xF500, 16);
-  addKey("DOWN", Down_Key, 0xF580, 16);
-  addKey("LEFT", Left_Key, 0xF5C0, 16);
-  addKey("RIGHT", Right_Key, 0xF540, 16);
-  addKey("PTY-EON", Unmapped_Key, 0xF5A1, 16);
-  addKey("DISPLAY-MODE", Info_Key, 0xF5C1, 16);
-  addKey("SET", Select_Key, 0xF589, 16);
-  addKey("TAPE", Unmapped_Key, 0xC5FC, 16);
-  addKey("TUNER-BAND", Unmapped_Key, 0xC5DA, 16);
-  addKey("PREV", Previous_Key, 0xF560, 16);
-  addKey("NEXT", Next_Key, 0xF5A0, 16);
-  addKey("EDIT-TITLE", Unmapped_Key, 0xFD91, 16);
-  addKey("CHARA", Unmapped_Key, 0xFD1D, 16);
+  threadableProtocol = new JVCProtocol(guiObject, index);
+
+  addKey("SLEEP", Sleep_Key, 0x03A3, 16);
+  addKey("POWER", Power_Key, 0x17A3, 16);
+  addKey("VOL+", VolumeUp_Key, 0x1EA3, 16);
+  addKey("VOL-", VolumeDown_Key, 0x1FA3, 16);
+  addKey("MD-AUX", Unmapped_Key, 0x3EA3, 16); // "TAPE-AUX"
+  addKey("TAPE", Unmapped_Key, 0x3FA3, 16);
+  addKey("FM-MODE", Unmapped_Key, 0x5AA3, 16);
+  addKey("TUNER-BAND", TunerBand_Key, 0x5BA3, 16);
+  addKey("AHB-PRO", Unmapped_Key, 0x75A3, 16);
+  addKey("AUTO-PRESET", Unmapped_Key, 0x77A3, 16);
+
+  addKey("STOP", Stop_Key, 0x43B3, 16); // "CD.Stop"
+  addKey("CD-EJECT", Eject_Key, 0x44B3, 16);
+  addKey("INTRO", Unmapped_Key, 0x48B3, 16);
+  addKey("PLAY", Play_Key, 0x4CB3, 16); // "CD.Play"
+  addKey("DIMMER", Unmapped_Key, 0x52B3, 16);
+  addKey("REW", Rewind_Key, 0x58B3, 16);
+  addKey("FF", FastForward_Key, 0x59B3, 16); // "CD.Next"
+  addKey("REPEAT", Repeat_Key, 0x5BB3, 16);
+  addKey("1", One_Key, 0x61B3, 16);
+  addKey("2", Two_Key, 0x62B3, 16);
+  addKey("3", Three_Key, 0x63B3, 16);
+  addKey("4", Four_Key, 0x64B3, 16);
+  addKey("5", Five_Key, 0x65B3, 16);
+  addKey("6", Six_Key, 0x66B3, 16);
+  addKey("7", Seven_Key, 0x67B3, 16);
+  addKey("8", Eight_Key, 0x68B3, 16);
+  addKey("9", Nine_Key, 0x69B3, 16);
+  addKey("MEMORY/CALL", Program_Key, 0x6AB3, 16); // "PROGRAM"
+  addKey("CANCEL", Clear_Key, 0x6DB3, 16);
+  addKey("10", Zero_Key, 0x6EB3, 16); // Treating "10" as "0" here
+  addKey("+10", DoubleDigit_Key, 0x6FB3, 16);
+  addKey("RANDOM", Random_Key, 0x72B3, 16);
+
+  addKey("UP", Up_Key, 0x00AF, 16);
+  addKey("DOWN", Down_Key, 0x01AF, 16);
+  addKey("RIGHT", Right_Key, 0x02AF, 16);
+  addKey("LEFT", Left_Key, 0x03AF, 16);
+  addKey("NEXT", Next_Key, 0x05AF, 16);
+  addKey("PREV", Previous_Key, 0x06AF, 16);
+  addKey("BASS", Unmapped_Key, 0x1EAF, 16);
+  addKey("TREBLE", Unmapped_Key, 0x2EAF, 16);
+  addKey("DISPLAY-MODE", Info_Key, 0x83AF, 16);
+  addKey("PTY-EON", Unmapped_Key, 0x85AF, 16);
+  addKey("SET", Select_Key, 0x91AF, 16);
+
+  addKey("EDIT-TITLE", Unmapped_Key, 0x89BF, 16);
+  addKey("CHARA", Unmapped_Key, 0xB8BF, 16);
 }
 
 
-JVCPortableAudio1a::JVCPortableAudio1a(
+JVCAudio1a::JVCAudio1a(
   QObject *guiObject,
   unsigned int index)
-  : JVCPortableAudio1(guiObject, index)
+  : JVCAudio1(guiObject, index)
 {
   setKeysetName("Audio Keyset 1a");
 
-  addKey("CD-PLAY-PAUSE", Play_Key, 0xC5BC, 16);
-  addKey("MD-PLAY-PAUSE", Unmapped_Key, 0xF50C, 16);
+  addKey("CD-PLAY-PAUSE", Play_Key, 0x3DA3, 16);
+  addKey("MD-PLAY-PAUSE", Unmapped_Key, 0x30AF, 16);
 }
 
 
-// This is not portable audio.  This is all sorts of audio devices.  I need
-// to do some work to clean this up!
-JVCPortableAudio1b::JVCPortableAudio1b(
+JVCAudio1b::JVCAudio1b(
   QObject *guiObject,
   unsigned int index)
-  : JVCPortableAudio1(guiObject, index)
+  : JVCAudio1(guiObject, index)
 {
   setKeysetName("Audio Keyset 1b");
 
-  addKey("0", Zero_Key, 0xCD06, 16); // What about "10" key here?
-  addKey("TUNER", Unmapped_Key, 0xC5D0, 16);
-  addKey("VCR", Unmapped_Key, 0xC224, 16);
-  addKey("CD", Unmapped_Key, 0xC5BC, 16);
-  addKey("PHONO", Unmapped_Key, 0xC53C, 16);
-  addKey("MONITOR/TAPE2", Unmapped_Key, 0xC5E0, 16);
-  addKey("STOP2", Unmapped_Key, 0xC1C2, 16);
-  addKey("STILL/PAUSE", Pause_Key, 0xC1B0, 16);
-  addKey("STOP", Stop_Key, 0xC1B0, 16);
-  addKey("REC+PLAY", Unmapped_Key, 0xC133, 16);
-  addKey("FORWARDS", FastForward_Key, 0xC160, 16); // "Deck.Right"
-  addKey("BACKWARDS", Rewind_Key, 0xC1E0, 16); // "Deck.Left"
-  addKey("PLAY", Play_Key, 0xC130, 16);
-  addKey("FADE_MUTING", Unmapped_Key, 0xC538, 16);
-  addKey("Disc 1", Unmapped_Key, 0xCD9E, 16);
-  addKey("Disc 2", Unmapped_Key, 0xCD5E, 16);
-  addKey("Disc 3", Unmapped_Key, 0xCDDE, 16);
-  addKey("Disc 4", Unmapped_Key, 0xCD3E, 16);
-  addKey("Disc 5", Unmapped_Key, 0xCDBE, 16);
-  addKey("Disc 6", Unmapped_Key, 0xCD7E, 16);
-  addKey("Disc continue", Unmapped_Key, 0xCDEE, 16);
-  addKey("Disc program", Unmapped_Key, 0xCD8E, 16);
-  addKey("Tuner 1", Unmapped_Key, 0xC584, 16);
-  addKey("Tuner 2", Unmapped_Key, 0xC544, 16);
-  addKey("Tuner 3", Unmapped_Key, 0xC5C4, 16);
-  addKey("Tuner 4", Unmapped_Key, 0xC524, 16);
-  addKey("Tuner 5", Unmapped_Key, 0xC5A4, 16);
-  addKey("Tuner 6", Unmapped_Key, 0xC564, 16);
-  addKey("Tuner 7", Unmapped_Key, 0xC5E4, 16);
-  addKey("Tuner 8", Unmapped_Key, 0xC514, 16);
-  addKey("Tuner 9", Unmapped_Key, 0xC594, 16);
-  addKey("Tuner 10", Unmapped_Key, 0xC554, 16);
-  addKey("Tuner +10", Unmapped_Key, 0xC5F4, 16);
-  addKey("Tuner 0", Unmapped_Key, 0xC504, 16);
-  addKey("tape-play", Unmapped_Key, 0xC130, 16);
-  addKey("tape-stop", Unmapped_Key, 0xC1C0, 16); // "Deck.Stop"
-  addKey("tuner-", Unmapped_Key, 0xC518, 16);
-  addKey("tuner+", Unmapped_Key, 0xC598, 16);
-  addKey("cd-play", Unmapped_Key, 0xC5BC, 16);
-  addKey("cd-stop", Unmapped_Key, 0xCDC2, 16);
-  addKey("cd-pause", Unmapped_Key, 0xCDB2, 16);
-  addKey("cd-prev", Unmapped_Key, 0xCD1A, 16);
-  addKey("cd-next", Unmapped_Key, 0xCD9A, 16);
-  addKey("cd-back", Unmapped_Key, 0xCD0E, 16);
-  addKey("cd-forw", Unmapped_Key, 0xCD6E, 16);
-  addKey("Deck.PlayLeft", Unmapped_Key, 0xC170, 16);
-  addKey("Deck.PlayRight", Unmapped_Key, 0xC1F0, 16);
-  addKey("Deck.A", Unmapped_Key, 0xC10B, 16);
-  addKey("Deck.B", Unmapped_Key, 0xC18B, 16);
-  addKey("RecPause", Unmapped_Key, 0xC1B3, 16);
-  addKey("SoundMode", Unmapped_Key, 0xC51C, 16);
+  addKey("VCR", Unmapped_Key, 0x2443, 16);
+
+  addKey("tape-stop", Unmapped_Key, 0x0383, 16); // "Deck.Stop"
+  addKey("FORWARDS", Unmapped_Key, 0x0683, 16); // "Deck.Right"
+  addKey("BACKWARDS", Unmapped_Key, 0x0783, 16); // "Deck.Left"
+  addKey("PLAY", Unmapped_Key, 0x0C83, 16); // "tape-play"
+  addKey("STILL/PAUSE", Unmapped_Key, 0x0D83, 16);
+  addKey("STOP", Unmapped_Key, 0x0D83, 16);
+  addKey("Deck.PlayLeft", Unmapped_Key, 0x0E83, 16);
+  addKey("Deck.PlayRight", Unmapped_Key, 0x0F83, 16);
+  addKey("STOP2", Unmapped_Key, 0x4383, 16);
+  addKey("REC+PLAY", Record_Key, 0xCC83, 16);
+  addKey("Deck.A", Unmapped_Key, 0xD083, 16);
+  addKey("Deck.B", Unmapped_Key, 0xD183, 16);
+  addKey("RecPause", RecordPause_Key, 0xED83, 16);
+
+  addKey("MONITOR/TAPE2", Unmapped_Key, 0x07A3, 16);
+  addKey("TUNER", Unmapped_Key, 0x0BA3, 16);
+  addKey("tuner-", ChannelDown_Key, 0x18A3, 16);
+  addKey("tuner+", ChannelUp_Key, 0x19A3, 16);
+  addKey("FADE_MUTING", Unmapped_Key, 0x1CA3, 16);
+  addKey("Tuner 0", Unmapped_Key, 0x20A3, 16);
+  addKey("Tuner 1", Unmapped_Key, 0x21A3, 16);
+  addKey("Tuner 2", Unmapped_Key, 0x22A3, 16);
+  addKey("Tuner 3", Unmapped_Key, 0x23A3, 16);
+  addKey("Tuner 4", Unmapped_Key, 0x24A3, 16);
+  addKey("Tuner 5", Unmapped_Key, 0x25A3, 16);
+  addKey("Tuner 6", Unmapped_Key, 0x26A3, 16);
+  addKey("Tuner 7", Unmapped_Key, 0x27A3, 16);
+  addKey("Tuner 8", Unmapped_Key, 0x28A3, 16);
+  addKey("Tuner 9", Unmapped_Key, 0x29A3, 16);
+  addKey("Tuner 10", Unmapped_Key, 0x2AA3, 16);
+  addKey("Tuner +10", Unmapped_Key, 0x2FA3, 16);
+  addKey("SoundMode", SoundMode_Key, 0x38A3, 16);
+  addKey("PHONO", Unmapped_Key, 0x3CA3, 16);
+  addKey("cd-play", Play_Key, 0x3DA3, 16); // "CD"
+
+  addKey("cd-stop", Stop_Key, 0x43B3, 16);
+  addKey("cd-pause", Pause_Key, 0x4DB3, 16);
+  addKey("cd-prev", Previous_Key, 0x58B3, 16);
+  addKey("cd-next", Next_Key, 0x59B3, 16);
+  addKey("0", Zero_Key, 0x60B3, 16);
+  addKey("cd-back", Rewind_Key, 0x70B3, 16);
+  addKey("Disc program", Unmapped_Key, 0x71B3, 16);
+  addKey("cd-forw", FastForward_Key, 0x76B3, 16);
+  addKey("Disc continue", Unmapped_Key, 0x77B3, 16);
+  addKey("Disc 1", Unmapped_Key, 0x79B3, 16);
+  addKey("Disc 2", Unmapped_Key, 0x7AB3, 16);
+  addKey("Disc 3", Unmapped_Key, 0x7BB3, 16);
+  addKey("Disc 4", Unmapped_Key, 0x7CB3, 16);
+  addKey("Disc 5", Unmapped_Key, 0x7DB3, 16);
+  addKey("Disc 6", Unmapped_Key, 0x7EB3, 16);
 }
 
 
-JVCPortableAudio2::JVCPortableAudio2(
+JVCAudio2::JVCAudio2(
   QObject *guiObject,
   unsigned int index)
   : PIRKeysetMetaData(
@@ -933,95 +628,86 @@ JVCPortableAudio2::JVCPortableAudio2(
       JVC_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 500,
-    600, 1600,
-    46000, true);
+  threadableProtocol = new JVCProtocol(guiObject, index);
 
-  threadableProtocol = np;
-
-  np->setHeaderPair(9000, 4500);
-  np->setTrailerPulse(600);
+//  setPreData(0xF9, 8);
+  setPreData(0x9F, 8);
 
-  np->setFullHeadlessRepeat(true);
+  addKey("power", Power_Key, 0x00, 8);
+  addKey("vol+", VolumeUp_Key, 0x01, 8);
+  addKey("vol-", VolumeDown_Key, 0x02, 8);
+  addKey("ACTIVE_HYPER_BASS", Unmapped_Key, 0x04, 8); // "bass"
+  addKey("band", TunerBand_Key, 0x0B, 8);  // "TUNER_BAND"
+  addKey("aux", Unmapped_Key, 0x0D, 8);
+
+  addKey("enter", Enter_Key, 0x11, 8);
+  addKey("PRESET_SCAN", Scan_Key, 0x12, 8);
+  addKey("auto_preset", Unmapped_Key, 0x13, 8);
+  addKey("presettuning", Unmapped_Key, 0x15, 8);
+  addKey("display-mode", Unmapped_Key, 0x16, 8);
+  addKey("pty-eon", Unmapped_Key, 0x17, 8);
+  addKey("right-select", Unmapped_Key, 0x18, 8);
+  addKey("left-select", Unmapped_Key, 0x19, 8);
+  addKey("display", Info_Key, 0x1C, 8); // "CLOCK"
+  addKey("auto_mono", Unmapped_Key, 0x1F, 8);  // "fmstereo", "mode"
 
-  setPreData(0xF9, 8);
-
-  addKey("stop", Stop_Key, 0x8E, 8); // "CD_STOP" "stop_clear"
-  addKey("stop", Clear_Key, 0x8E, 8); // "CD_STOP" "stop_clear"
-  addKey("vol+", VolumeUp_Key, 0x80, 8);
-  addKey("vol-", VolumeDown_Key, 0x40, 8);
-  addKey("play", Play_Key, 0x0E, 8); // "CD_PLAY_PAUSE"
-  addKey("play", Pause_Key, 0x0E, 8); // "CD_PLAY_PAUSE"
-  addKey("ff", FastForward_Key, 0xBC, 8); // "SEARCH_UP" "search_forward"
-  addKey("rew", Rewind_Key, 0x7C, 8);  // "SEARCH_DOWN" "search_back"
-  addKey("1", One_Key, 0x84, 8);
-  addKey("2", Two_Key, 0x44, 8);
-  addKey("3", Three_Key, 0xC4, 8);
+  addKey("1", One_Key, 0x21, 8);
+  addKey("2", Two_Key, 0x22, 8);
+  addKey("3", Three_Key, 0x23, 8);
   addKey("4", Four_Key, 0x24, 8);
-  addKey("5", Five_Key, 0xA4, 8);
-  addKey("6", Six_Key, 0x64, 8);
-  addKey("7", Seven_Key, 0xE4, 8);
-  addKey("8", Eight_Key, 0x14, 8);
-  addKey("9", Nine_Key, 0x94, 8);
-  addKey("10", Zero_Key, 0x54, 8); // Yeah, I know this is bad
-  addKey("10+", DoubleDigit_Key, 0x74, 8);
-  addKey("enter", Enter_Key, 0x88, 8);
-  addKey("repeat", Unmapped_Key, 0x1E, 8);
-  addKey("random", Unmapped_Key, 0xEE, 8);
-  addKey("intro", Unmapped_Key, 0x6E, 8);
-  addKey("memory", Program_Key, 0x2E, 8); // "MEMORY_CALL", "program"
-  addKey("call", Unmapped_Key, 0xFE, 8);
-  addKey("display", Info_Key, 0x38, 8); // "CLOCK"
-  addKey("sleep", Sleep_Key, 0x4C, 8);
-  addKey("power", Power_Key, 0x00, 8);
-  addKey("band", Unmapped_Key, 0xD0, 8);  // "TUNER_BAND"
-  addKey("PRESET_SCAN", Unmapped_Key, 0x48, 8);
-  addKey("SET", Select_Key, 0xCC, 8); // "clock"
-  addKey("TIMER_ON_OFF", Unmapped_Key, 0x6C, 8); // might be another sleep
-  addKey("TIMER_SET", Unmapped_Key, 0x0C, 8);
-  addKey("ACTIVE_HYPER_BASS", Unmapped_Key, 0x20, 8); // "bass"
-  addKey("FREQUENCY", Unmapped_Key, 0x01, 8);
-  addKey("NEXT_TRACK", Next_Key, 0x4E, 8);
-  addKey("PREV_TRACK", Previous_Key, 0xCE, 8);
-  addKey("auto_preset", Unmapped_Key, 0xC8, 8);
-  addKey("open_close", Eject_Key, 0xDE, 8); // "allcdeject"
-  addKey("auto_preset", Unmapped_Key, 0xC8, 8);
-  addKey("auto_mono", Unmapped_Key, 0xF8, 8);  // "fmstereo", "mode"
-  addKey("tone", Unmapped_Key, 0x61, 8);
-  addKey("revmode", Unmapped_Key, 0xFA, 8);
-  addKey("playcd1", Unmapped_Key, 0x8F, 8);
-  addKey("playcd2", Unmapped_Key, 0x4F, 8);
-  addKey("playcd3", Unmapped_Key, 0xCF, 8);
-  addKey("continue", Unmapped_Key, 0xBE, 8);
-  addKey("ejectcd1", Unmapped_Key, 0x2F, 8);
-  addKey("ejectcd2", Unmapped_Key, 0xAF, 8);
-  addKey("ejectcd2", Unmapped_Key, 0x6F, 8);
+  addKey("5", Five_Key, 0x25, 8);
+  addKey("6", Six_Key, 0x26, 8);
+  addKey("7", Seven_Key, 0x27, 8);
+  addKey("8", Eight_Key, 0x28, 8);
+  addKey("9", Nine_Key, 0x29, 8);
+  addKey("10", Zero_Key, 0x2A, 8); // treating "10" as "0" here
+  addKey("10+", DoubleDigit_Key, 0x2E, 8);
+
+  addKey("TIMER_SET", Timer_Key, 0x30, 8);
+  addKey("sleep", Sleep_Key, 0x32, 8);
+  addKey("SET", Select_Key, 0x33, 8); // "clock"
+  addKey("TIMER_ON_OFF", Unmapped_Key, 0x36, 8); // "onoff"
+  addKey("ff", FastForward_Key, 0x3D, 8); // "SEARCH_UP" "search_forward"
+  addKey("rew", Rewind_Key, 0x3E, 8);  // "SEARCH_DOWN" "search_back"
+  addKey("stop", Unmapped_Key, 0x41, 8); // "TAPESTOP"
   addKey("tape", Unmapped_Key, 0x42, 8);
-  addKey("aux", Unmapped_Key, 0xB0, 8);
-  addKey("deckab", Unmapped_Key, 0x1A, 8);
-  addKey("sound", Unmapped_Key, 0xF1, 8);
-  addKey("presettuning", Unmapped_Key, 0xA8, 8);
-  addKey("record", Record_Key, 0xD2, 8); // "TAPEREC"
-  addKey("reverseplay", Unmapped_Key, 0xB2, 8); // "TAPELEFT"
-  addKey("stop", Unmapped_Key, 0x82, 8); // "TAPESTOP"
-  addKey("play", Unmapped_Key, 0x32, 8); // "TAPERIGHT"
-  addKey("bass-", Unmapped_Key, 0x11, 8);
-  addKey("bass+", Unmapped_Key, 0xE1, 8);
-  addKey("treble-", Unmapped_Key, 0x51, 8);
-  addKey("treble+", Unmapped_Key, 0x91, 8);
-  addKey("onoff", Unmapped_Key, 0x6C, 8); // same keyset already has "power"?
-  addKey("edit", Unmapped_Key, 0xAE, 8);
-  addKey("synchrorec", Unmapped_Key, 0x6A, 8);
-  addKey("rewind", Unmapped_Key, 0xA2, 8); // "TAPEPREV"
-  addKey("ff", Unmapped_Key, 0x22, 8); // "TAPENEXT"
-  addKey("beat-cut", Unmapped_Key, 0x77, 8);
-  addKey("pty-eon", Unmapped_Key, 0xE8, 8);
-  addKey("left-select", Unmapped_Key, 0x98, 8);
-  addKey("right-select", Unmapped_Key, 0x18, 8);
-  addKey("display-mode", Unmapped_Key, 0x68, 8);
+  addKey("ff", Unmapped_Key, 0x44, 8); // "TAPENEXT"
+  addKey("rewind", Unmapped_Key, 0x45, 8); // "TAPEPREV"
+  addKey("record", Record_Key, 0x4B, 8); // "TAPEREC"
+  addKey("play", Unmapped_Key, 0x4C, 8); // "TAPERIGHT"
+  addKey("reverseplay", Unmapped_Key, 0x4D, 8); // "TAPELEFT"
+  addKey("synchrorec", Unmapped_Key, 0x56, 8);
+  addKey("deckab", Unmapped_Key, 0x58, 8);
+  addKey("revmode", Unmapped_Key, 0x5F, 8);
+
+  addKey("play", Play_Key, 0x70, 8); // "CD_PLAY_PAUSE"
+  addKey("play", Pause_Key, 0x70, 8); // "CD_PLAY_PAUSE"
+  addKey("stop", Stop_Key, 0x71, 8); // "CD_STOP" "stop_clear"
+  addKey("stop", Clear_Key, 0x71, 8); // "CD_STOP" "stop_clear"
+  addKey("NEXT_TRACK", Next_Key, 0x72, 8);
+  addKey("PREV_TRACK", Previous_Key, 0x73, 8);
+  addKey("memory", Program_Key, 0x74, 8); // "MEMORY_CALL", "program"
+  addKey("edit", Unmapped_Key, 0x75, 8);
+  addKey("intro", Unmapped_Key, 0x76, 8);
+  addKey("random", Random_Key, 0x77, 8);
+  addKey("repeat", Repeat_Key, 0x78, 8);
+  addKey("open_close", Eject_Key, 0x7B, 8); // "allcdeject"
+  addKey("continue", Unmapped_Key, 0x7D, 8);
+  addKey("call", Unmapped_Key, 0x7F, 8);
+  addKey("FREQUENCY", Unmapped_Key, 0x80, 8);
+  addKey("tone", Unmapped_Key, 0x86, 8);
+  addKey("bass+", Unmapped_Key, 0x87, 8);
+  addKey("bass-", Unmapped_Key, 0x88, 8);
+  addKey("treble+", Unmapped_Key, 0x89, 8);
+  addKey("treble-", Unmapped_Key, 0x8A, 8);
+  addKey("sound", Unmapped_Key, 0x8F, 8);
+  addKey("beat-cut", Unmapped_Key, 0xEE, 8);
+  addKey("playcd1", Unmapped_Key, 0xF1, 8);
+  addKey("playcd2", Unmapped_Key, 0xF2, 8);
+  addKey("playcd3", Unmapped_Key, 0xF3, 8);
+  addKey("ejectcd1", Unmapped_Key, 0xF4, 8);
+  addKey("ejectcd2", Unmapped_Key, 0xF5, 8);
+  addKey("ejectcd2", Unmapped_Key, 0xF6, 8);
 }
 
 
@@ -1033,66 +719,64 @@ JVCDVD1::JVCDVD1(
       JVC_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 500,
-    600, 1600,
-    46000, true);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(9000, 4500);
-  np->setTrailerPulse(600);
-  np->setFullHeadlessRepeat(true);
-
-  addKey("openclose", Eject_Key, 0xF722, 16);
-  addKey("1", One_Key, 0xF786, 16);
-  addKey("2", Two_Key, 0xF746, 16);
-  addKey("3", Three_Key, 0xF7C6, 16);
-  addKey("4", Four_Key, 0xF726, 16);
-  addKey("5", Five_Key, 0xF7A6, 16);
-  addKey("6", Six_Key, 0xF766, 16);
-  addKey("7", Seven_Key, 0xF7E6, 16);
-  addKey("8", Eight_Key, 0xF716, 16);
-  addKey("9", Nine_Key, 0xF796, 16);
-  addKey("10", Unmapped_Key, 0xF776, 16);
-  addKey("0", Zero_Key, 0xF706, 16);
-  addKey("+10", DoubleDigit_Key, 0xF7F6, 16);
-  addKey("return", Exit_Key, 0xF7AB, 16);
-  addKey("title/group", Unmapped_Key, 0xF777, 16);
-  addKey("cancel", Clear_Key, 0xF7B6, 16);
-  addKey("topmenu", DiscTitle_Key, 0xF743, 16);
-  addKey("up", Up_Key, 0xF70B, 16);
-  addKey("menu", Menu_Key, 0xF783, 16);
-  addKey("left", Left_Key, 0xF74B, 16);
-  addKey("enter", Select_Key, 0xF72B, 16);
-  addKey("right", Right_Key, 0xF7CB, 16);
-  addKey("choice", Unmapped_Key, 0xF7FE, 16);
-  addKey("down", Down_Key, 0xF78B, 16);
-  addKey("onscreen", Unmapped_Key, 0xF703, 16);
-  addKey("skip_back", Previous_Key, 0xF78D, 16); // "previous"
-  addKey("skip_forw", Next_Key, 0xF70D, 16); // "next"
-  addKey("stop", Stop_Key, 0xF7C2, 16);
-  addKey("play", Play_Key, 0xF732, 16);
-  addKey("pause", Pause_Key, 0xF7B2, 16);
-  addKey("back", Rewind_Key, 0xF70E, 16); // "SLOW_MINUS"
-  addKey("forw", FastForward_Key, 0xF76E, 16); // "SLOW_PLUS"
-  addKey("repeat", Unmapped_Key, 0xF7DA, 16);
-  addKey("subtitle", Captions_Key, 0xF7B3, 16);
-  addKey("audio", Unmapped_Key, 0xF713, 16);
-  addKey("vfp", Unmapped_Key, 0xF77D, 16); // "theaterposition"
-  addKey("digest", Unmapped_Key, 0xF79D, 16);
-  addKey("angle", Unmapped_Key, 0xF7D3, 16);
-  addKey("zoom-", Unmapped_Key, 0xF7F5, 16);
-  addKey("zoom+", Unmapped_Key, 0xF775, 16);
-  addKey("3dphonix", Unmapped_Key, 0xF7BD, 16);
-  addKey("voldown", VolumeDown_Key, 0xC5F8, 16);
-  addKey("volup", VolumeUp_Key, 0xC578, 16);
-  addKey("power", Power_Key, 0xF702, 16);
-  addKey("playmode", Unmapped_Key, 0xF7C1, 16);
-  addKey("zoom", Unmapped_Key, 0xF73D, 16);
-  addKey("display", Info_Key, 0xF7AD, 16);
-  addKey("SWOOP", Unmapped_Key, 0xF792, 16);
-  addKey("DIMMER", Unmapped_Key, 0xF78A, 16);
+  threadableProtocol = new JVCProtocol(guiObject, index);
+
+//  setPreData(0xF7, 8);
+  setPreData(0xEF, 8);
+
+  addKey("power", Power_Key, 0x40, 8);
+  addKey("stop", Stop_Key, 0x43, 8);
+  addKey("openclose", Eject_Key, 0x44, 8);
+  addKey("SWOOP", Unmapped_Key, 0x49, 8);
+  addKey("play", Play_Key, 0x4C, 8);
+  addKey("pause", Pause_Key, 0x4D, 8);
+  addKey("DIMMER", Unmapped_Key, 0x51, 8);
+  addKey("repeat", Repeat_Key, 0x5B, 8);
+
+  addKey("0", Zero_Key, 0x60, 8);
+  addKey("1", One_Key, 0x61, 8);
+  addKey("2", Two_Key, 0x62, 8);
+  addKey("3", Three_Key, 0x63, 8);
+  addKey("4", Four_Key, 0x64, 8);
+  addKey("5", Five_Key, 0x65, 8);
+  addKey("6", Six_Key, 0x66, 8);
+  addKey("7", Seven_Key, 0x67, 8);
+  addKey("8", Eight_Key, 0x68, 8);
+  addKey("9", Nine_Key, 0x69, 8);
+  addKey("cancel", Clear_Key, 0x6D, 8);
+  addKey("10", Unmapped_Key, 0x6E, 8);
+  addKey("+10", DoubleDigit_Key, 0x6F, 8);
+
+  addKey("back", Rewind_Key, 0x70, 8); // "SLOW_MINUS"
+  addKey("forw", FastForward_Key, 0x76, 8); // "SLOW_PLUS"
+  addKey("choice", Unmapped_Key, 0x7F, 8);
+  addKey("playmode", Unmapped_Key, 0x83, 8);
+
+  addKey("zoom+", Unmapped_Key, 0xAE, 8);
+  addKey("zoom-", Unmapped_Key, 0xAF, 8);
+  addKey("skip_forw", Next_Key, 0xB0, 8); // "next"
+  addKey("skip_back", Previous_Key, 0xB1, 8); // "previous"
+  addKey("display", Info_Key, 0xB5, 8);
+  addKey("digest", Unmapped_Key, 0xB9, 8);
+  addKey("zoom", Zoom_Key, 0xBC, 8);
+  addKey("3dphonix", Unmapped_Key, 0xBD, 8);
+  addKey("vfp", Unmapped_Key, 0xBE, 8); // "theaterposition"
+
+  addKey("onscreen", Unmapped_Key, 0xC0, 8);
+  addKey("menu", Menu_Key, 0xC1, 8);
+  addKey("topmenu", DiscTitle_Key, 0xC2, 8);
+  addKey("audio", Audio_Key, 0xC8, 8);
+  addKey("angle", Angle_Key, 0xCB, 8);
+  addKey("subtitle", Captions_Key, 0xCD, 8);
+
+  addKey("up", Up_Key, 0xD0, 8);
+  addKey("down", Down_Key, 0xD1, 8);
+  addKey("left", Left_Key, 0xD2, 8);
+  addKey("right", Right_Key, 0xD3, 8);
+  addKey("enter", Select_Key, 0xD4, 8);
+  addKey("return", Exit_Key, 0xD5, 8);
+  addKey("title/group", Unmapped_Key, 0xEE, 8);
+
+//  addKey("voldown", VolumeDown_Key, 0xC5F8, 16);
+//  addKey("volup", VolumeUp_Key, 0xC578, 16);
 }
index 6eefad7..ed0e75d 100644 (file)
@@ -37,50 +37,18 @@ public:
     unsigned int index);
 };
 
-class JVCVCR1b: public JVCVCR1
+class JVCVCRBmode1: public JVCVCR1
 {
 public:
-  JVCVCR1b(
+  JVCVCRBmode1(
     QObject *guiObject,
     unsigned int index);
 };
 
-class JVCVCR1c: public JVCVCR1
+class JVCVCRBmode1a: public JVCVCR1a
 {
 public:
-  JVCVCR1c(
-    QObject *guiObject,
-    unsigned int index);
-};
-
-class JVCVCR2: public PIRKeysetMetaData
-{
-public:
-  JVCVCR2(
-    QObject *guiObject,
-    unsigned int index);
-};
-
-class JVCVCR2a: public JVCVCR2
-{
-public:
-  JVCVCR2a(
-    QObject *guiObject,
-    unsigned int index);
-};
-
-class JVCVCR2b: public JVCVCR2
-{
-public:
-  JVCVCR2b(
-    QObject *guiObject,
-    unsigned int index);
-};
-
-class JVCVCR2c: public JVCVCR2
-{
-public:
-  JVCVCR2c(
+  JVCVCRBmode1a(
     QObject *guiObject,
     unsigned int index);
 };
@@ -125,46 +93,6 @@ public:
     unsigned int index);
 };
 
-class JVCTV2: public PIRKeysetMetaData
-{
-public:
-  JVCTV2(
-    QObject *guiObject,
-    unsigned int index);
-};
-
-class JVCTV2a: public JVCTV2
-{
-public:
-  JVCTV2a(
-    QObject *guiObject,
-    unsigned int index);
-};
-
-class JVCTV2b: public JVCTV2
-{
-public:
-  JVCTV2b(
-    QObject *guiObject,
-    unsigned int index);
-};
-
-class JVCTV2c: public JVCTV2
-{
-public:
-  JVCTV2c(
-    QObject *guiObject,
-    unsigned int index);
-};
-
-class JVCTV2d: public JVCTV2
-{
-public:
-  JVCTV2d(
-    QObject *guiObject,
-    unsigned int index);
-};
-
 class JVCDAT1: public PIRKeysetMetaData
 {
 public:
@@ -181,34 +109,34 @@ public:
     unsigned int index);
 };
 
-class JVCPortableAudio1: public PIRKeysetMetaData
+class JVCAudio1: public PIRKeysetMetaData
 {
 public:
-  JVCPortableAudio1(
+  JVCAudio1(
     QObject *guiObject,
     unsigned int index);
 };
 
-class JVCPortableAudio1a: public JVCPortableAudio1
+class JVCAudio1a: public JVCAudio1
 {
 public:
-  JVCPortableAudio1a(
+  JVCAudio1a(
     QObject *guiObject,
     unsigned int index);
 };
 
-class JVCPortableAudio1b: public JVCPortableAudio1
+class JVCAudio1b: public JVCAudio1
 {
 public:
-  JVCPortableAudio1b(
+  JVCAudio1b(
     QObject *guiObject,
     unsigned int index);
 };
 
-class JVCPortableAudio2: public PIRKeysetMetaData
+class JVCAudio2: public PIRKeysetMetaData
 {
 public:
-  JVCPortableAudio2(
+  JVCAudio2(
     QObject *guiObject,
     unsigned int index);
 };
index 68c7660..adb48cb 100644 (file)
@@ -11,74 +11,75 @@ LGTV1::LGTV1(
       LG_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x20DF, 16);
-
-  addKey("power", Power_Key, 0x10EF, 16);
-  addKey("input", Input_Key, 0xD02F, 16);
-  addKey("energy", Unmapped_Key, 0xA956, 16); // "EYEASTERISK"
-  addKey("tv/radio", Unmapped_Key, 0x0FF0, 16);
-  addKey("avmode", Unmapped_Key, 0x0CF3, 16); // "UPDATE"
-  addKey("1", One_Key, 0x8877, 16);
-  addKey("2", Two_Key, 0x48B7, 16);
-  addKey("3", Three_Key, 0xC837, 16);
-  addKey("4", Four_Key, 0x28D7, 16);
-  addKey("5", Five_Key, 0xA857, 16);
-  addKey("6", Six_Key, 0x6897, 16);
-  addKey("7", Seven_Key, 0xE817, 16);
-  addKey("8", Eight_Key, 0x18E7, 16);
-  addKey("9", Nine_Key, 0x9867, 16);
-  addKey("0", Zero_Key, 0x08F7, 16);
-  addKey("list", Unmapped_Key, 0xCA35, 16);
-  addKey("qview", Unmapped_Key, 0x58A7, 16);
-  addKey("vol+", VolumeUp_Key, 0x40BF, 16);
-  addKey("vol-", VolumeDown_Key, 0xC03F, 16);
-  addKey("mute", Mute_Key, 0x906F, 16);
-  addKey("p+", ChannelUp_Key, 0x00FF, 16);
-  addKey("p-", ChannelDown_Key, 0x807F, 16);
-  addKey("up", Up_Key, 0x02FD, 16);
-  addKey("down", Down_Key, 0x827D, 16);
-  addKey("left", Left_Key, 0xE01F, 16);
-  addKey("right", Right_Key, 0x609F, 16);
-  addKey("ok", Select_Key, 0x22DD, 16);
-  addKey("menu", Menu_Key, 0xC23D, 16);
-  addKey("return/exit", Exit_Key, 0x14EB, 16);
-  addKey("red", Red_Key, 0x4EB1, 16);
-  addKey("green", Green_Key, 0x8E71, 16);
-  addKey("yellow", Yellow_Key, 0xC639, 16);
-  addKey("blue", Blue_Key, 0x8679, 16);
-  addKey("green/stop", Stop_Key, 0x8E71, 16);
-  addKey("yellow/play", Play_Key, 0xC639, 16);
-  addKey("blue/pause", Pause_Key, 0x8679, 16);
-  addKey("text", Unmapped_Key, 0x04FB, 16);
-  addKey("topt", Unmapped_Key, 0x847B, 16);
-  addKey("topt/rev", Rewind_Key, 0x847B, 16);
-  addKey("subtitle", Captions_Key, 0x9C63, 16); // "cc"
-  addKey("subtitle/ffw", FastForward_Key, 0x9C63, 16);
-  addKey("rec", Record_Key, 0xBD42, 16);
-  addKey("simplink", Unmapped_Key, 0x7E81, 16);
-  addKey("qmenu", Unmapped_Key, 0xA25D, 16);
-  addKey("info", Info_Key, 0x55AA, 16);
-  addKey("guide", Guide_Key, 0xD52A, 16);
-  addKey("fav", Unmapped_Key, 0x7887, 16);
-  addKey("brt.w", Unmapped_Key, 0x7689, 16);
-  addKey("sound", Unmapped_Key, 0xB04F, 16);
-  addKey("auto", Unmapped_Key, 0x2AD5, 16);
-  addKey("comp-rgb-dvi", Unmapped_Key, 0x19E6, 16);
-  addKey("sleep", Sleep_Key, 0x708F, 16);
-  addKey("sap", Unmapped_Key, 0x50AF, 16);
-  addKey("ratio", AspectRatio_Key, 0x9E61, 16);
-  addKey("video", Unmapped_Key, 0xB24D, 16); // "apc", "PSM"
-  addKey("picture", Unmapped_Key, 0x30CF, 16);
-  addKey("review", Unmapped_Key, 0x58A7, 16);
-  addKey("memory/erase", Unmapped_Key, 0xAA55, 16);
-  addKey("sound", Unmapped_Key, 0x4AB5, 16); // "SSM"
-  addKey("INDEX", Unmapped_Key, 0xE41B, 16);
-  addKey("MIX", Unmapped_Key, 0x24DB, 16);
-  addKey("TIME", Unmapped_Key, 0x649B, 16);
-  addKey("TV/PC", Unmapped_Key, 0x0AF5, 16);
-  addKey("xstudio", Unmapped_Key, 0x3EC1, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0x20DF, 16);
+  setPreData(0x04, 8);
+
+  addKey("p+", ChannelUp_Key, 0x00, 8);
+  addKey("p-", ChannelDown_Key, 0x01, 8);
+  addKey("vol+", VolumeUp_Key, 0x02, 8);
+  addKey("vol-", VolumeDown_Key, 0x03, 8);
+  addKey("right", Right_Key, 0x06, 8);
+  addKey("left", Left_Key, 0x07, 8);
+  addKey("power", Power_Key, 0x08, 8);
+  addKey("mute", Mute_Key, 0x09, 8);
+  addKey("sap", Audio_Key, 0x0A, 8); // I/II
+  addKey("input", Input_Key, 0x0B, 8);
+  addKey("picture", PictureMode_Key, 0x0C, 8);
+  addKey("sound", SoundMode_Key, 0x0D, 8);
+  addKey("sleep", Sleep_Key, 0x0E, 8);
+  addKey("0", Zero_Key, 0x10, 8);
+  addKey("1", One_Key, 0x11, 8);
+  addKey("2", Two_Key, 0x12, 8);
+  addKey("3", Three_Key, 0x13, 8);
+  addKey("4", Four_Key, 0x14, 8);
+  addKey("5", Five_Key, 0x15, 8);
+  addKey("6", Six_Key, 0x16, 8);
+  addKey("7", Seven_Key, 0x17, 8);
+  addKey("8", Eight_Key, 0x18, 8);
+  addKey("9", Nine_Key, 0x19, 8);
+  addKey("qview", Unmapped_Key, 0x1A, 8); // "review"
+  addKey("fav", Unmapped_Key, 0x1E, 8);
+  addKey("text", Teletext_Key, 0x20, 8);
+  addKey("topt", Unmapped_Key, 0x21, 8);
+  addKey("topt/rev", Rewind_Key, 0x21, 8);
+  addKey("MIX", TeletextAndTV_Key, 0x24, 8);
+  addKey("TIME", TeletextTime_Key, 0x26, 8);
+  addKey("INDEX", Unmapped_Key, 0x27, 8);
+  addKey("return/exit", Exit_Key, 0x28, 8);
+  addKey("avmode", Unmapped_Key, 0x30, 8); // "UPDATE"
+  addKey("subtitle", Captions_Key, 0x39, 8); // "cc"
+  addKey("subtitle/ffw", FastForward_Key, 0x39, 8);
+  addKey("up", Up_Key, 0x40, 8);
+  addKey("down", Down_Key, 0x41, 8);
+  addKey("menu", Menu_Key, 0x43, 8);
+  addKey("ok", Select_Key, 0x44, 8);
+  addKey("qmenu", Unmapped_Key, 0x45, 8);
+  addKey("video", Unmapped_Key, 0x4D, 8); // "apc", "PSM"
+  addKey("TV/PC", Unmapped_Key, 0x50, 8);
+  addKey("sound", Unmapped_Key, 0x52, 8); // "SSM"
+  addKey("list", Unmapped_Key, 0x53, 8);
+  addKey("auto", Unmapped_Key, 0x54, 8);
+  addKey("memory/erase", Unmapped_Key, 0x55, 8);
+  addKey("pip", PIP_Key, 0x60, 8);
+  addKey("blue", Blue_Key, 0x61, 8);
+  addKey("blue/pause", Pause_Key, 0x61, 8);
+  addKey("yellow", Yellow_Key, 0x63, 8);
+  addKey("yellow/play", Play_Key, 0x63, 8);
+  addKey("brt.w", Unmapped_Key, 0x6E, 8);
+  addKey("red", Red_Key, 0x72, 8);
+  addKey("green", Green_Key, 0x71, 8);
+  addKey("green/stop", Stop_Key, 0x71, 8);
+  addKey("ratio", AspectRatio_Key, 0x79, 8);
+  addKey("xstudio", Unmapped_Key, 0x7C, 8);
+  addKey("simplink", Unmapped_Key, 0x7E, 8);
+  addKey("energy", Unmapped_Key, 0x95, 8); // "EYEASTERISK"
+  addKey("comp-rgb-dvi", Unmapped_Key, 0x98, 8);
+  addKey("info", Info_Key, 0xAA, 8);
+  addKey("guide", Guide_Key, 0xAB, 8);
+  addKey("rec", Record_Key, 0xBD, 8);
+  addKey("tv/radio", Unmapped_Key, 0xF0, 8);
 }
 
 
@@ -89,18 +90,17 @@ LGTV1a::LGTV1a(
 {
   setKeysetName("TV Keyset 1a");
 
-  addKey("exit", Exit_Key, 0xDA25, 16);
-  addKey("pip", PIP_Key, 0x06F9, 16);
-//  addKey("pop", Unmapped_Key, 0x8679, 16);
-  addKey("swap", PIPSwap_Key, 0xC639, 16);
-  addKey("*", Unmapped_Key, 0x9C63, 16);
-  addKey("pipch-", Unmapped_Key, 0x4EB1, 16);
-  addKey("pipch+", Unmapped_Key, 0x8E71, 16);
-  addKey("pipinput", Unmapped_Key, 0x8679, 16);
-  addKey("freeze", Unmapped_Key, 0xA659, 16);
-  addKey("zoom", Unmapped_Key, 0xDE21, 16);
-  addKey("signal", Unmapped_Key, 0x6996, 16);
-  addKey("adjust", Unmapped_Key, 0xD32C, 16);
+  addKey("*", Unmapped_Key, 0x39, 8);
+  addKey("exit", Exit_Key, 0x5B, 8);
+//  addKey("pop", Unmapped_Key, 0x61, 8);
+  addKey("pipinput", PIPSource_Key, 0x61, 8);
+  addKey("swap", PIPSwap_Key, 0x63, 8);
+  addKey("freeze", PIPPause_Key, 0x65, 8);
+  addKey("pipch+", PIPChannelUp_Key, 0x71, 8);
+  addKey("pipch-", PIPChannelDown_Key, 0x72, 8);
+  addKey("zoom", Zoom_Key, 0x7B, 8);
+  addKey("signal", Unmapped_Key, 0x96, 8);
+  addKey("adjust", Unmapped_Key, 0xCB, 8);
 }
 
 
@@ -111,15 +111,14 @@ LGTV1b::LGTV1b(
 {
   setKeysetName("TV Keyset 1b");
 
-  addKey("Vol-/Left_Arrow", Left_Key, 0xC03F, 16);
-  addKey("Vol+/Right_Arrow", Right_Key, 0x40BF, 16);
-  addKey("PR+/Up_Arrow", Up_Key, 0x00FF, 16);
-  addKey("PR-/Down_Arrow", Down_Key, 0x807F, 16);
-  addKey("I/II", DoubleDigit_Key, 0x50AF, 16);
-  addKey("orange", Red_Key, 0x03FC, 16);
-  addKey("green", Green_Key, 0xC33C, 16);
-  addKey("yellow", Yellow_Key, 0x837C, 16);
-  addKey("blue", Blue_Key, 0x43BC, 16);
+  addKey("PR+/Up_Arrow", Up_Key, 0x00, 8);
+  addKey("PR-/Down_Arrow", Down_Key, 0x01, 8);
+  addKey("Vol+/Right_Arrow", Right_Key, 0x02, 8);
+  addKey("Vol-/Left_Arrow", Left_Key, 0x03, 8);
+  addKey("orange", Red_Key, 0xC0, 8);
+  addKey("yellow", Yellow_Key, 0xC1, 8);
+  addKey("blue", Blue_Key, 0xC2, 8);
+  addKey("green", Green_Key, 0xC3, 8);
 }
 
 
@@ -130,13 +129,12 @@ LGTV1c::LGTV1c(
 {
   setKeysetName("TV Keyset 1c");
 
-  addKey("stop", Stop_Key, 0x8D72, 16);
-  addKey("play", Play_Key, 0x0DF2, 16);
-  addKey("pause", Pause_Key, 0x5DA2, 16);
-  addKey("rec", Record_Key, 0xBD42, 16);
-  addKey("backward", Rewind_Key, 0xF10E, 16);
-  addKey("forward", FastForward_Key, 0x718E, 16);
-  addKey("pip", PIP_Key, 0x06F9, 16);
+  addKey("backward", Rewind_Key, 0x80, 8);
+  addKey("forward", FastForward_Key, 0x8E, 8);
+  addKey("stop", Stop_Key, 0xB1, 8);
+  addKey("play", Play_Key, 0xB0, 8);
+  addKey("pause", Pause_Key, 0xBA, 8);
+  addKey("rec", Record_Key, 0xBD, 8);
 }
 
 
@@ -150,24 +148,7 @@ LGTV2::LGTV2(
 {
   threadableProtocol = new RC5Protocol(guiObject, index, 0x40);
 
-  addKey("POWER", Power_Key, 0x0C, 6);
-  addKey("DRP", Unmapped_Key, 0x14, 6);
-  addKey("TVAV", Unmapped_Key, 0x38, 6);
-  addKey("TURBOSOUND", Unmapped_Key, 0x24, 6);
-  addKey("TURBOPICTURE", Unmapped_Key, 0x13, 6);
-  addKey("PIP", PIP_Key, 0x3A, 6);
-  addKey("TEXT", Unmapped_Key, 0x3C, 6);
-  addKey("PR-MINUS", Unmapped_Key, 0x37, 6);
-  addKey("PR-PLUS", Unmapped_Key, 0x36, 6);
-  addKey("SWAP", PIPSwap_Key, 0x32, 6);
-  addKey("INPUT", Input_Key, 0x34, 6);
-  addKey("MENU", Menu_Key, 0x3B, 6);
-  addKey("MUTE", Mute_Key, 0x0D, 6);
-  addKey("PROGUP", ChannelUp_Key, 0x20, 6);
-  addKey("PROGDOWN", ChannelDown_Key, 0x21, 6);
-  addKey("VOLDOWN", VolumeDown_Key, 0x11, 6);
-  addKey("VOLUP", VolumeUp_Key, 0x10, 6);
-  addKey("OK", Select_Key, 0x25, 6);
+  addKey("0", Zero_Key, 0x00, 6);
   addKey("1", One_Key, 0x01, 6);
   addKey("2", Two_Key, 0x02, 6);
   addKey("3", Three_Key, 0x03, 6);
@@ -177,22 +158,39 @@ LGTV2::LGTV2(
   addKey("7", Seven_Key, 0x07, 6);
   addKey("8", Eight_Key, 0x08, 6);
   addKey("9", Nine_Key, 0x09, 6);
-  addKey("0", Zero_Key, 0x00, 6);
-  addKey("PSM", Unmapped_Key, 0x0E, 6); // preset picture
-  addKey("SSM", Unmapped_Key, 0x16, 6); // preset sound
-  addKey("POS", Unmapped_Key, 0x2D, 6); // position, "UPDATE"
-  addKey("2-12PIP", Unmapped_Key, 0x35, 6); // strobe, "KEY_SHOP"
-  addKey("STILL", Pause_Key, 0x29, 6); // "KEY_PAUSE", "HOLD"
-  addKey("SIZE", Unmapped_Key, 0x2B, 6);  // "KEY_SAVE"
-  addKey("TIME", Unmapped_Key, 0x2A, 6);
-  addKey("REVEAL", Unmapped_Key, 0x2C, 6); // "KEY_REDO"
-  addKey("MIX", Unmapped_Key, 0x2E, 6);  // "KEY_MAX"
-  addKey("SLEEP", Sleep_Key, 0x3E, 6);
+  addKey("POWER", Power_Key, 0x0C, 6);
+  addKey("MUTE", Mute_Key, 0x0D, 6);
+  addKey("PSM", PictureMode_Key, 0x0E, 6); // preset picture
   addKey("LIST", Unmapped_Key, 0x0F, 6);
-  addKey("I-II", DoubleDigit_Key, 0x23, 6);
-  addKey("ARC", AspectRatio_Key, 0x33, 6);
+  addKey("VOLUP", VolumeUp_Key, 0x10, 6);
+  addKey("VOLDOWN", VolumeDown_Key, 0x11, 6);
   addKey("EYE", Unmapped_Key, 0x12, 6);
+  addKey("TURBOPICTURE", Unmapped_Key, 0x13, 6);
+  addKey("DRP", Unmapped_Key, 0x14, 6);
   addKey("KEY_MEDIA", Unmapped_Key, 0x15, 6);
+  addKey("SSM", SoundMode_Key, 0x16, 6); // preset sound
+  addKey("PROGUP", ChannelUp_Key, 0x20, 6);
+  addKey("PROGDOWN", ChannelDown_Key, 0x21, 6);
+  addKey("I-II", Audio_Key, 0x23, 6);
+  addKey("TURBOSOUND", Unmapped_Key, 0x24, 6);
+  addKey("OK", Select_Key, 0x25, 6);
+  addKey("STILL", TeletextHold_Key, 0x29, 6); // "KEY_PAUSE", "HOLD"
+  addKey("TIME", TeletextTime_Key, 0x2A, 6);
+  addKey("SIZE", TeletextSize_Key, 0x2B, 6);  // "KEY_SAVE"
+  addKey("REVEAL", TeletextReveal_Key, 0x2C, 6); // "KEY_REDO"
+  addKey("POS", PIPMove_Key, 0x2D, 6); // position, "UPDATE"
+  addKey("MIX", TeletextAndTV_Key, 0x2E, 6);  // "KEY_MAX"
+  addKey("SWAP", PIPSwap_Key, 0x32, 6);
+  addKey("ARC", AspectRatio_Key, 0x33, 6);
+  addKey("INPUT", Input_Key, 0x34, 6);
+  addKey("2-12PIP", Unmapped_Key, 0x35, 6); // strobe, "KEY_SHOP"
+  addKey("PR-PLUS", Unmapped_Key, 0x36, 6);
+  addKey("PR-MINUS", Unmapped_Key, 0x37, 6);
+  addKey("TVAV", Unmapped_Key, 0x38, 6);
+  addKey("PIP", PIP_Key, 0x3A, 6);
+  addKey("MENU", Menu_Key, 0x3B, 6);
+  addKey("TEXT", Teletext_Key, 0x3C, 6);
+  addKey("SLEEP", Sleep_Key, 0x3E, 6);
 }
 
 
@@ -203,10 +201,10 @@ LGTV2a::LGTV2a(
 {
   setKeysetName("TV Keyset 2a");
 
-  addKey("KEY_RED", Red_Key, 0x37, 6);
-  addKey("KEY_GREEN", Green_Key, 0x36, 6);
   addKey("KEY_YELLOW", Yellow_Key, 0x32, 6);
   addKey("KEY_BLUE", Blue_Key, 0x34, 6);
+  addKey("KEY_GREEN", Green_Key, 0x36, 6);
+  addKey("KEY_RED", Red_Key, 0x37, 6);
 }
 
 
@@ -217,11 +215,11 @@ LGTV2b::LGTV2b(
 {
   setKeysetName("TV Keyset 2b");
 
-  addKey("EYE/*", Unmapped_Key, 0x37, 6);
-  addKey("I/II/*", DoubleDigit_Key, 0x36, 6);
+  addKey("sleep", Sleep_Key, 0x26, 6); // might need separate class
   addKey("Q.VIEW", Unmapped_Key, 0x32, 6);
   addKey("LIST", Unmapped_Key, 0x34, 6);
-  addKey("sleep", Sleep_Key, 0x26, 6); // might need separate class
+  addKey("I/II/*", Audio_Key, 0x36, 6);
+  addKey("EYE/*", Unmapped_Key, 0x37, 6);
 }
 
 
@@ -238,7 +236,8 @@ LGDisc1::LGDisc1(
     index,
     563, 559,
     563, 1681,
-    108234, true);
+    108234, true,
+    Extended_NEC);
 
   threadableProtocol = np;
 
@@ -247,70 +246,69 @@ LGDisc1::LGDisc1(
   np->setRepeatPair(531, 1710);
   np->setRepeatNeedsHeader(true);
 
-  setPreData(0x3434, 16);
-
-//  np->setMinimumRepetitions(1);
-
-  addKey("power", Power_Key, 0x7887, 16);
-  addKey("open-close", Eject_Key, 0x59A6, 16);
-  addKey("cd-dvd", Unmapped_Key, 0xC03F, 16);
-  addKey("band", Unmapped_Key, 0x9A65, 16);
-  addKey("aux", Unmapped_Key, 0x906F, 16);
-//  addKey("aux", Unmapped_Key, 0x51AE, 16);
-  addKey("1", One_Key, 0x827D, 16);
-  addKey("2", Two_Key, 0x42BD, 16);
-  addKey("3", Three_Key, 0xC23D, 16);
-  addKey("4", Four_Key, 0x22DD, 16);
-  addKey("5", Five_Key, 0xA25D, 16);
-  addKey("6", Six_Key, 0x629D, 16);
-  addKey("7", Seven_Key, 0xE21D, 16);
-  addKey("8", Eight_Key, 0x12ED, 16);
-  addKey("9", Nine_Key, 0x926D, 16);
-  addKey("0", Zero_Key, 0xD22D, 16);
-  addKey("sleep", Sleep_Key, 0x43BC, 16);
-  addKey("audio", Language_Key, 0x05FA, 16);
-  addKey("sound", Unmapped_Key, 0x857A, 16);
-  addKey("s-title", Unmapped_Key, 0xD52A, 16);
-  addKey("return", Exit_Key, 0x45BA, 16);
-  addKey("setup", Menu_Key, 0xA55A, 16);
-  addKey("display", Info_Key, 0xC53A, 16);
-  addKey("menu", DiscMenu_Key, 0x25DA, 16);
-  addKey("title", DiscTitle_Key, 0xF50A, 16);
-  addKey("up", Up_Key, 0xE51A, 16);
-  addKey("down", Down_Key, 0x659A, 16);
-  addKey("left", Left_Key, 0x15EA, 16);
-  addKey("right", Right_Key, 0x956A, 16);
-  addKey("enter", Select_Key, 0x55AA, 16);
-  addKey("plus", Unmapped_Key, 0xC837, 16); // "pr_preset_up"
-  addKey("minus", Unmapped_Key, 0x48B7, 16);  // "pr_preset_down"
-  addKey("<<", Rewind_Key, 0x8D72, 16);
-  addKey(">>", FastForward_Key, 0x4DB2, 16);
-  addKey("volume+", VolumeUp_Key, 0xE817, 16);
-  addKey("volume-", VolumeDown_Key, 0x6897, 16);
-  addKey("<<<", Unmapped_Key, 0x609F, 16);
-  addKey(">>>", Unmapped_Key, 0xE01F, 16);
-  addKey("stop", Stop_Key, 0xA05F, 16);
-  addKey("pause", Pause_Key, 0xF20D, 16);
-  addKey("play", Play_Key, 0x20DF, 16);
-  addKey("mute", Mute_Key, 0xF807, 16);
-  addKey("program", Program_Key, 0xB24D, 16);
-  addKey("clear", Clear_Key, 0x0DF2, 16);
-  addKey("repeat", Unmapped_Key, 0x728D, 16);
-  addKey("repeata-b", Unmapped_Key, 0xB54A, 16);
-  addKey("marker", Unmapped_Key, 0x2DD2, 16);
-  addKey("search", Unmapped_Key, 0xCD32, 16);
-  addKey("angle", Unmapped_Key, 0x35CA, 16);
-  addKey("zoom", Unmapped_Key, 0x758A, 16);
-  addKey("rds", Unmapped_Key, 0x06F9, 16);
-  addKey("pty", Unmapped_Key, 0x8E71, 16);
-  addKey("pty-search", Unmapped_Key, 0x9C63, 16);
-  addKey("dimmer", Unmapped_Key, 0x7A85, 16);
-  addKey("tv_radio", Unmapped_Key, 0x41BE, 16);
-  addKey("text", Unmapped_Key, 0xDE21, 16);
-  addKey("caption", Captions_Key, 0x56A9, 16);
-  addKey("guide", Guide_Key, 0xD629, 16);
-  addKey("i_ii", DoubleDigit_Key, 0x5EA1, 16);
-  addKey("exit_cancel", Unmapped_Key, 0x9669, 16);
+//  setPreData(0x3434, 16);
+  setPreData(0x2C2C, 16);
+
+  addKey("cd-dvd", Unmapped_Key, 0x03, 8);
+  addKey("play", Play_Key, 0x04, 8);
+  addKey("stop", Stop_Key, 0x05, 8);
+  addKey("<<<", Unmapped_Key, 0x06, 8);
+  addKey(">>>", Unmapped_Key, 0x07, 8);
+  addKey("aux", Unmapped_Key, 0x09, 8);
+  addKey("minus", Unmapped_Key, 0x12, 8);  // "pr_preset_down"
+  addKey("plus", Unmapped_Key, 0x13, 8); // "pr_preset_up"
+  addKey("volume-", VolumeDown_Key, 0x16, 8);
+  addKey("volume+", VolumeUp_Key, 0x17, 8);
+  addKey("power", Power_Key, 0x1E, 8);
+  addKey("mute", Mute_Key, 0x1F, 16);
+  addKey("pty-search", Unmapped_Key, 0x39, 8);
+  addKey("1", One_Key, 0x41, 8);
+  addKey("2", Two_Key, 0x42, 8);
+  addKey("3", Three_Key, 0x43, 8);
+  addKey("4", Four_Key, 0x44, 8);
+  addKey("5", Five_Key, 0x45, 8);
+  addKey("6", Six_Key, 0x46, 8);
+  addKey("7", Seven_Key, 0x47, 8);
+  addKey("8", Eight_Key, 0x48, 8);
+  addKey("9", Nine_Key, 0x49, 8);
+  addKey("0", Zero_Key, 0x4B, 8);
+  addKey("program", Program_Key, 0x4D, 8);
+  addKey("repeat", Repeat_Key, 0x4E, 8);
+  addKey("pause", Pause_Key, 0x4F, 8);
+  addKey("band", Unmapped_Key, 0x59, 8);
+  addKey("dimmer", Unmapped_Key, 0x5E, 8);
+  addKey("rds", Unmapped_Key, 0x60, 8);
+  addKey("exit_cancel", Unmapped_Key, 0x69, 8);
+  addKey("caption", Captions_Key, 0x6A, 8);
+  addKey("guide", Guide_Key, 0x6B, 8);
+  addKey("pty", Unmapped_Key, 0x71, 8);
+  addKey("i_ii", Unmapped_Key, 0x7A, 8);
+  addKey("text", Unmapped_Key, 0x7B, 8);
+  addKey("tv_radio", Unmapped_Key, 0x82, 8);
+//  addKey("aux", Unmapped_Key, 0x8A, 8);
+  addKey("open-close", Eject_Key, 0x9A, 8);
+  addKey("audio", Audio_Key, 0xA0, 8);
+  addKey("sound", SoundMode_Key, 0xA1, 8);
+  addKey("return", Exit_Key, 0xA2, 8);
+  addKey("display", Info_Key, 0xA3, 8);
+  addKey("menu", DiscMenu_Key, 0xA4, 8);
+  addKey("setup", Menu_Key, 0xA5, 8);
+  addKey("down", Down_Key, 0xA6, 8);
+  addKey("up", Up_Key, 0xA7, 8);
+  addKey("left", Left_Key, 0xA8, 8);
+  addKey("right", Right_Key, 0xA9, 8);
+  addKey("enter", Select_Key, 0xAA, 8);
+  addKey("s-title", Unmapped_Key, 0xAB, 8);
+  addKey("angle", Angle_Key, 0xAC, 8);
+  addKey("repeata-b", RepeatAB_Key, 0xAD, 8);
+  addKey("zoom", Zoom_Key, 0xAE, 8);
+  addKey("title", DiscTitle_Key, 0xAF, 8);
+  addKey("clear", Clear_Key, 0xB0, 8);
+  addKey("<<", Rewind_Key, 0xB1, 8);
+  addKey(">>", FastForward_Key, 0xB2, 8);
+  addKey("search", Unmapped_Key, 0xB3, 8);
+  addKey("marker", Unmapped_Key, 0xB4, 8);
+  addKey("sleep", Sleep_Key, 0xC2, 8);
 }
 
 
@@ -327,7 +325,8 @@ LGDisc2::LGDisc2(
     index,
     600, 550,
     600, 1650,
-    107000, true);
+    107000, true,
+    Extended_NEC);
 
   threadableProtocol = np;
 
@@ -336,56 +335,55 @@ LGDisc2::LGDisc2(
   np->setRepeatPair(600, 550);
   np->setRepeatNeedsHeader(true);
 
-  setPreData(0xB4B4, 16);
-
-//  np->setMinimumRepetitions(3);
-
-  addKey("POWER", Power_Key, 0x0CF3, 16);
-  addKey("OPEN/CLOSE", Eject_Key, 0x6C93, 16);
-  addKey("1", One_Key, 0xDC23, 16);
-  addKey("2", Two_Key, 0x3CC3, 16);
-  addKey("3", Three_Key, 0xBC43, 16);
-  addKey("4", Four_Key, 0x7C83, 16);
-  addKey("5", Five_Key, 0xFC03, 16);
-  addKey("6", Six_Key, 0x02FD, 16);
-  addKey("7", Seven_Key, 0x827D, 16);
-  addKey("8", Eight_Key, 0x42BD, 16);
-  addKey("9", Nine_Key, 0xC23D, 16);
-  addKey("0", Zero_Key, 0x22DD, 16);
-  addKey("CLEAR", Clear_Key, 0x629D, 16);
-  addKey("SCAN-BACK", Rewind_Key, 0x4CB3, 16); // <<
-  addKey("SCAN-FORWARD", FastForward_Key, 0xCC33, 16); // >>
-  addKey("SKIP-BACK", Previous_Key, 0xAC53, 16); // |<<
-  addKey("SKIP-FORWARD", Next_Key, 0x2CD3, 16);  // >>|
-  addKey("PAUSE", Pause_Key, 0x1CE3, 16);
-  addKey("PLAY", Play_Key, 0x8C73, 16);
-  addKey("STOP", Stop_Key, 0x9C63, 16);
-  addKey("DVD-MENU", DiscMenu_Key, 0xD22D, 16);
-  addKey("TITLE", DiscTitle_Key, 0x52AD, 16);
-  addKey("UP", Up_Key, 0xE21D, 16);
-  addKey("LEFT", Left_Key, 0x9A65, 16);
-  addKey("RIGHT", Right_Key, 0x5AA5, 16);
-  addKey("DOWN", Down_Key, 0x12ED, 16);
-  addKey("ENTER", Select_Key, 0x1AE5, 16); // "ok"
-  addKey("DISPLAY", Info_Key, 0x5CA3, 16);
-  addKey("RETURN", Exit_Key, 0xA25D, 16);
-  addKey("AUDIO", Unmapped_Key, 0xF20D, 16);
-  addKey("SUBTITLE", Captions_Key, 0x0AF5, 16);
-  addKey("ANGLE", Unmapped_Key, 0x32CD, 16);
-  addKey("SETUP", Menu_Key, 0x6A95, 16);
-  addKey("MARKER", Unmapped_Key, 0x8679, 16);
-  addKey("SEARCH", Unmapped_Key, 0x46B9, 16); // "random"
-  addKey("PROGRAM", Program_Key, 0xEA15, 16);
-  addKey("ZOOM", Unmapped_Key, 0x26D9, 16);
-  addKey("REPEAT", Unmapped_Key, 0xCA35, 16);
-  addKey("A-B", Unmapped_Key, 0xAA55, 16); // "lp"
-  addKey("RANDOM", Unmapped_Key, 0x8A75, 16); // "cm-skip"
-  addKey("STAR", Unmapped_Key, 0x7A85, 16);
-  addKey("DVD", Unmapped_Key, 0x8F70, 16);
-  addKey("KEY_PIP", PIP_Key, 0xFA05, 16);
-  addKey("KEY_RESOLUTION", AspectRatio_Key, 0xAF50, 16);
-  addKey("PowerOn", Unmapped_Key, 0xAE51, 16);
-  addKey("PowerOff", Unmapped_Key, 0x6E91, 16);
+//  setPreData(0xB4B4, 16);
+  setPreData(0x2D2D, 16);
+
+  addKey("POWER", Power_Key, 0x30, 8);
+  addKey("PLAY", Play_Key, 0x31, 8);
+  addKey("SCAN-BACK", Rewind_Key, 0x32, 8); // <<
+  addKey("SCAN-FORWARD", FastForward_Key, 0x33, 8); // >>
+  addKey("SKIP-FORWARD", Next_Key, 0x34, 16);  // >>|
+  addKey("SKIP-BACK", Previous_Key, 0x35, 16); // |<<
+  addKey("OPEN/CLOSE", Eject_Key, 0x36, 8);
+  addKey("PAUSE", Pause_Key, 0x38, 8);
+  addKey("STOP", Stop_Key, 0x39, 8);
+  addKey("DISPLAY", Info_Key, 0x3A, 8);
+  addKey("1", One_Key, 0x3B, 8);
+  addKey("2", Two_Key, 0x3C, 8);
+  addKey("3", Three_Key, 0x3D, 8);
+  addKey("4", Four_Key, 0x3E, 8);
+  addKey("5", Five_Key, 0x3F, 8);
+  addKey("6", Six_Key, 0x40, 8);
+  addKey("7", Seven_Key, 0x41, 8);
+  addKey("8", Eight_Key, 0x42, 8);
+  addKey("9", Nine_Key, 0x43, 8);
+  addKey("0", Zero_Key, 0x44, 8);
+  addKey("RETURN", Exit_Key, 0x45, 8);
+  addKey("CLEAR", Clear_Key, 0x46, 8);
+  addKey("UP", Up_Key, 0x47, 8);
+  addKey("DOWN", Down_Key, 0x48, 8);
+  addKey("TITLE", DiscTitle_Key, 0x4A, 8);
+  addKey("DVD-MENU", DiscMenu_Key, 0x4B, 8);
+  addKey("ANGLE", Angle_Key, 0x4C, 8);
+  addKey("AUDIO", Audio_Key, 0x4F, 8);
+  addKey("SUBTITLE", Captions_Key, 0x50, 8);
+  addKey("RANDOM", Random_Key, 0x51, 8); // "cm-skip"
+  addKey("REPEAT", Repeat_Key, 0x53, 8);
+  addKey("A-B", RepeatAB_Key, 0x55, 8); // "lp"
+  addKey("SETUP", Menu_Key, 0x56, 8);
+  addKey("PROGRAM", Program_Key, 0x57, 8);
+  addKey("ENTER", Select_Key, 0x58, 8); // "ok"
+  addKey("LEFT", Left_Key, 0x59, 8);
+  addKey("RIGHT", Right_Key, 0x5A, 8);
+  addKey("STAR", Unmapped_Key, 0x5E, 8);
+  addKey("KEY_PIP", PIP_Key, 0x5F, 8);
+  addKey("MARKER", Unmapped_Key, 0x61, 8);
+  addKey("SEARCH", Unmapped_Key, 0x62, 8); // "random"
+  addKey("ZOOM", Zoom_Key, 0x64, 8);
+  addKey("PowerOn", PowerOn_Key, 0x75, 8);
+  addKey("PowerOff", PowerOff_Key, 0x76, 8);
+  addKey("DVD", Unmapped_Key, 0xF1, 8);
+  addKey("KEY_RESOLUTION", AspectRatio_Key, 0xF5, 8);
 }
 
 
@@ -396,16 +394,12 @@ LGDisc2a::LGDisc2a(
 {
   setKeysetName("DVD/BD Keyset 2a");
 
-  addKey("KEY_CLEAR", Clear_Key, 0x3EC1, 16);
-  addKey("KEY_A", Unmapped_Key, 0x3EC1, 16);
-  addKey("KEY_RED", Red_Key, 0x3EC1, 16);
-  addKey("KEY_B", Unmapped_Key, 0xBE41, 16);
-  addKey("KEY_GREEN", Green_Key, 0xBE41, 16);
-  addKey("KEY_C", Unmapped_Key, 0x7E81, 16);
-  addKey("KEY_YELLOW", Yellow_Key, 0x7E81, 16);
-  addKey("KEY_D", Unmapped_Key, 0xFE01, 16);
-  addKey("KEY_BLUE", Blue_Key, 0xFE01, 16);
-  addKey("KEY_HOME", Menu_Key, 0xE619, 16);
+  addKey("KEY_HOME", Menu_Key, 0x67, 8);
+  addKey("KEY_CLEAR", Clear_Key, 0x7C, 8);
+  addKey("KEY_RED", Red_Key, 0x7C, 8);
+  addKey("KEY_GREEN", Green_Key, 0x7D, 8);
+  addKey("KEY_YELLOW", Yellow_Key, 0x7E, 8);
+  addKey("KEY_BLUE", Blue_Key, 0x7F, 8);
 }
 
 
@@ -417,59 +411,60 @@ LGVCR1::LGVCR1(
       LG_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x7689, 16);
-
-  addKey("power", Power_Key, 0x28D7, 16);
-  addKey("rew", Rewind_Key, 0x40BF, 16);
-  addKey("play", Play_Key, 0x10EF, 16);
-  addKey("ff", FastForward_Key, 0xC03F, 16);
-  addKey("rec", Record_Key, 0x906F, 16);
-  addKey("stop", Stop_Key, 0x807F, 16);
-  addKey("p/still", Pause_Key, 0xD02F, 16);
-  addKey("eject", Eject_Key, 0x00FF, 16);
-  addKey("1", One_Key, 0xA05F, 16);
-  addKey("2", Two_Key, 0x609F, 16);
-  addKey("3", Three_Key, 0xE01F, 16);
-  addKey("4", Four_Key, 0x30CF, 16);
-  addKey("5", Five_Key, 0xB04F, 16);
-  addKey("6", Six_Key, 0x708F, 16);
-  addKey("7", Seven_Key, 0xF00F, 16);
-  addKey("8", Eight_Key, 0x38C7, 16);
-  addKey("9", Nine_Key, 0xB847, 16);
-  addKey("0", Zero_Key, 0x20DF, 16);
-  addKey("mute", Mute_Key, 0xBA45, 16);
-  addKey("tv/av", Unmapped_Key, 0x6A95, 16);
-  addKey("menu", Menu_Key, 0x6897, 16);  // "setup", "I"
-  addKey("clear/reset", Clear_Key, 0xF807, 16);  // might be wrong
-  addKey("timer-prog", Program_Key, 0x5CA3, 16);
-  addKey("pr+", ChannelUp_Key, 0x18E7, 16);
-  addKey("pr-", ChannelDown_Key, 0x9867, 16);
-  addKey("vol+", VolumeUp_Key, 0x1AE5, 16);
-  addKey("vol-", VolumeDown_Key, 0x9A65, 16);
-  addKey("pr+", Up_Key, 0x18E7, 16);
-  addKey("vol-", Left_Key, 0x9A65, 16);
-  addKey("ok", Select_Key, 0x7887, 16);
-  addKey("vol+", Right_Key, 0x1AE5, 16);
-  addKey("pr-", Down_Key, 0x9867, 16);
-  addKey("sleep", Sleep_Key, 0x3AC5, 16);
-  addKey("system", Unmapped_Key, 0x3BC4, 16);
-  addKey("qview", Unmapped_Key, 0xEE11, 16);
-  addKey("auto", Unmapped_Key, 0xFA05, 16); // "A.TRK"
-  addKey("trk-", Unmapped_Key, 0x22DD, 16);
-  addKey("trk+", Unmapped_Key, 0xA25D, 16);
-  addKey("clock/count", Unmapped_Key, 0x32CD, 16);
-  addKey("viss", Unmapped_Key, 0x827D, 16); // "marker-search"
-  addKey("VCR", Unmapped_Key, 0x8F70, 16);
-  addKey("tv/vcr", Input_Key, 0xA857, 16);
-  addKey("audio", Unmapped_Key, 0x837C, 16);
-  addKey("c/lock", Unmapped_Key, 0xFC03, 16);
-  addKey("repeat", Unmapped_Key, 0x6D92, 16);
-  addKey("lp", VHSSpeed_Key, 0x12ED, 16);
-  addKey("cm-skip", Unmapped_Key, 0xBB44, 16);
-  addKey("ez_POWER_OFF", Unmapped_Key, 0x1DE2, 16);
-  addKey("*", Unmapped_Key, 0xE21D, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0x7689, 16);
+  setPreData(0x6E, 8);
+
+  addKey("eject", Eject_Key, 0x00, 8);
+  addKey("stop", Stop_Key, 0x01, 8);
+  addKey("rew", Rewind_Key, 0x02, 8);
+  addKey("ff", FastForward_Key, 0x03, 8);
+  addKey("0", Zero_Key, 0x04, 8);
+  addKey("1", One_Key, 0x05, 8);
+  addKey("2", Two_Key, 0x06, 8);
+  addKey("3", Three_Key, 0x07, 8);
+  addKey("play", Play_Key, 0x08, 8);
+  addKey("rec", Record_Key, 0x09, 8);
+  addKey("p/still", Pause_Key, 0x0B, 8);
+  addKey("4", Four_Key, 0x0C, 8);
+  addKey("5", Five_Key, 0x0D, 8);
+  addKey("6", Six_Key, 0x0E, 8);
+  addKey("7", Seven_Key, 0x0F, 8);
+  addKey("power", Power_Key, 0x14, 8);
+  addKey("tv/vcr", Input_Key, 0x15, 8);
+  addKey("menu", Menu_Key, 0x16, 8);  // "setup", "I"
+  addKey("pr+", ChannelUp_Key, 0x18, 8);
+  addKey("pr+", Up_Key, 0x18, 8);
+  addKey("pr-", ChannelDown_Key, 0x19, 8);
+  addKey("pr-", Down_Key, 0x19, 8);
+  addKey("8", Eight_Key, 0x1C, 8);
+  addKey("9", Nine_Key, 0x1D, 8);
+  addKey("ok", Select_Key, 0x1E, 8);
+  addKey("clear/reset", Clear_Key, 0x1F, 8);  // might be wrong
+  addKey("timer-prog", Program_Key, 0x3A, 8);
+  addKey("viss", Unmapped_Key, 0x41, 8); // "marker-search"
+  addKey("trk-", TrackingMinus_Key, 0x44, 8);
+  addKey("trk+", TrackingPlus_Key, 0x45, 8);
+  addKey("*", Unmapped_Key, 0x47, 8);
+  addKey("lp", VHSSpeed_Key, 0x48, 8);
+  addKey("clock/count", Clock_Key, 0x4C, 8);
+  addKey("tv/av", Unmapped_Key, 0x56, 8);
+  addKey("vol+", VolumeUp_Key, 0x58, 8);
+  addKey("vol+", Right_Key, 0x58, 8);
+  addKey("vol-", VolumeDown_Key, 0x59, 8);
+  addKey("vol-", Left_Key, 0x59, 8);
+  addKey("sleep", Sleep_Key, 0x5C, 8);
+  addKey("mute", Mute_Key, 0x5D, 8);
+  addKey("auto", AutoTracking_Key, 0x5F, 8); // "A.TRK"
+  addKey("qview", Unmapped_Key, 0x77, 8);
+  addKey("repeat", Repeat_Key, 0xB6, 8);
+  addKey("ez_POWER_OFF", PowerOff_Key, 0xB8, 8);
+  addKey("audio", Audio_Key, 0xC1, 8);
+  addKey("c/lock", Unmapped_Key, 0xCF, 8);
+  addKey("system", Unmapped_Key, 0xDC, 8);
+  addKey("VCR", Unmapped_Key, 0xF1, 8);
+  addKey("cm-skip", Unmapped_Key, 0xDD, 8);
 }
 
 
@@ -480,7 +475,7 @@ LGVCR1a::LGVCR1a(
 {
   setKeysetName("VCR Keyset 1a");
 
-  addKey("power", Power_Key, 0xBE41, 16);
+  addKey("power", Power_Key, 0x7D, 8);
 }
 
 
@@ -491,10 +486,10 @@ LGVCR1b::LGVCR1b(
 {
   setKeysetName("VCR Keyset 1b");
 
-  addKey("menu-left", Left_Key, 0xC13E, 16);
-  addKey("menu-right", Right_Key, 0x09F6, 16);
-  addKey("menu-up", Up_Key, 0x41BE, 16);
-  addKey("menu-down", Down_Key, 0x916E, 16);
-  addKey("ok", Select_Key, 0x718E, 16);
+  addKey("menu-up", Up_Key, 0x82, 8);
+  addKey("menu-left", Left_Key, 0x83, 8);
+  addKey("menu-down", Down_Key, 0x89, 8);
+  addKey("ok", Select_Key, 0x8E, 8);
+  addKey("menu-right", Right_Key, 0x90, 8);
 }
 
index cc0a4bd..42f589b 100644 (file)
@@ -15,7 +15,7 @@ MagnavoxDVD1::MagnavoxDVD1(
 
   threadableProtocol = new RC6Protocol(guiObject, index, 0x04);
 
-  addKey("power", Power_Key, 0x0C, 8);
+  addKey("0", Zero_Key, 0x00, 8);
   addKey("1", One_Key, 0x01, 8);
   addKey("2", Two_Key, 0x02, 8);
   addKey("3", Three_Key, 0x03, 8);
@@ -25,29 +25,29 @@ MagnavoxDVD1::MagnavoxDVD1(
   addKey("7", Seven_Key, 0x07, 8);
   addKey("8", Eight_Key, 0x08, 8);
   addKey("9", Nine_Key, 0x09, 8);
-  addKey("0", Zero_Key, 0x00, 8);
-  addKey("title", DiscTitle_Key, 0x83, 8);
+  addKey("power", Power_Key, 0x0C, 8);
+  addKey("mute", Mute_Key, 0x0D, 8);
   addKey("display", Info_Key, 0x0F, 8);
+  addKey("repeat", Repeat_Key, 0x1D, 8);
+  addKey(">>", FastForward_Key, 0x20, 8);
+  addKey("<<", Rewind_Key, 0x21, 8);
+  addKey("play", Play_Key, 0x2C, 8);
+  addKey("pause", Pause_Key, 0x30, 8);
+  addKey("stop", Stop_Key, 0x31, 8);
+  addKey("a-b", RepeatAB_Key, 0x3B, 8);
+  addKey("subtitle", Captions_Key, 0x4B, 8);
+  addKey("audio", Audio_Key, 0x4E, 8);
   addKey("disc_Menu", DiscMenu_Key, 0x54, 8);
-  addKey("system_menu", Menu_Key, 0x82, 8);
   addKey("^", Up_Key, 0x58, 8);
   addKey("<", Left_Key, 0x5A, 8);
   addKey(">", Right_Key, 0x5B, 8);
   addKey("v", Down_Key, 0x5C, 8);
   addKey("ok", Select_Key, 0x5D, 8);
-  addKey("<<", Rewind_Key, 0x21, 8);
-  addKey(">>", FastForward_Key, 0x20, 8);
-  addKey("stop", Stop_Key, 0x31, 8);
-  addKey("play", Play_Key, 0x2C, 8);
-  addKey("pause", Pause_Key, 0x30, 8);
-  addKey("subtitle", Captions_Key, 0x4B, 8);
-  addKey("angle", Unmapped_Key, 0x85, 8);
-  addKey("zoom", Unmapped_Key, 0xF7, 8);
-  addKey("audio", Unmapped_Key, 0x4E, 8);
-  addKey("repeat", Unmapped_Key, 0x1D, 8);
-  addKey("a-b", Unmapped_Key, 0x3B, 8);
+  addKey("system_menu", Menu_Key, 0x82, 8);
+  addKey("title", DiscTitle_Key, 0x83, 8);
+  addKey("angle", Angle_Key, 0x85, 8);
   addKey("preview", Unmapped_Key, 0xD5, 8);
-  addKey("mute", Mute_Key, 0x0D, 8);
+  addKey("zoom", Zoom_Key, 0xF7, 8);
 }
 
 
@@ -104,11 +104,11 @@ MagnavoxVCR1::MagnavoxVCR1(
   addKey("VcrChUp", Unmapped_Key, 0x1160, 13);
   addKey("VcrChDn", Unmapped_Key, 0x1161, 13);
   addKey("Menu", Menu_Key, 0x115D, 13);
-  addKey("Slow", Unmapped_Key, 0x1168, 13);
+  addKey("Slow", Slow_Key, 0x1168, 13);
   addKey("Status", Info_Key, 0x114F, 13);
   addKey("Clear", Clear_Key, 0x1171, 13);
-  addKey("VarSlowUp", Unmapped_Key, 0x1166, 13);
-  addKey("VarSlowDn", Unmapped_Key, 0x1165, 13);
+  addKey("VarSlowUp", SlowPlus_Key, 0x1166, 13);
+  addKey("VarSlowDn", SlowMinus_Key, 0x1165, 13);
   addKey("Qtr", Unmapped_Key, 0x1167, 13);
   addKey("TrackUp", TrackingPlus_Key, 0x014D, 13);
   addKey("TrackDn", TrackingMinus_Key, 0x014E, 13);
@@ -135,7 +135,8 @@ MagnavoxConverterBox1::MagnavoxConverterBox1(
     index,
     894, 795,
     894, 2537,
-    33751, false);
+    33751, false,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -181,15 +182,7 @@ MagnavoxTV1::MagnavoxTV1(
 {
   threadableProtocol = new RC5Protocol(guiObject, index, 0x40);
 
-  addKey("Power", Power_Key, 0x0C, 6);
-  addKey("Reset", Reset_Key, 0x0E, 6);
-  addKey("Sleep", Sleep_Key, 0x26, 6);
-  addKey("Mute", Mute_Key, 0x0D, 6);
-  addKey("VolUp", VolumeUp_Key, 0x10, 6);
-  addKey("VolDown", VolumeDown_Key, 0x11, 6);
-  addKey("ChUp", ChannelUp_Key, 0x20, 6);
-  addKey("ChDown", ChannelDown_Key, 0x21, 6);
-  addKey("PrevCh", PrevChannel_Key, 0x21, 6);
+  addKey("Zero", Zero_Key, 0x00, 6);
   addKey("One", One_Key, 0x01, 6);
   addKey("Two", Two_Key, 0x02, 6);
   addKey("Three", Three_Key, 0x03, 6);
@@ -199,14 +192,22 @@ MagnavoxTV1::MagnavoxTV1(
   addKey("Seven", Seven_Key, 0x07, 6);
   addKey("Eight", Eight_Key, 0x08, 6);
   addKey("Nine", Nine_Key, 0x09, 6);
-  addKey("Zero", Zero_Key, 0x00, 6);
-  addKey("Display", Info_Key, 0x2E, 6);
-  addKey("Plus", Right_Key, 0x2B, 6);
-  addKey("Minus", Left_Key, 0x2C, 6);
+  addKey("Power", Power_Key, 0x0C, 6);
+  addKey("Mute", Mute_Key, 0x0D, 6);
+  addKey("Reset", Reset_Key, 0x0E, 6);
   addKey("Status", Unmapped_Key, 0x0F, 6);
+  addKey("VolUp", VolumeUp_Key, 0x10, 6);
+  addKey("VolDown", VolumeDown_Key, 0x11, 6);
   addKey("Play", Play_Key, 0x1C, 6);
   addKey("Stop", Stop_Key, 0x1D, 6);
+  addKey("ChUp", ChannelUp_Key, 0x20, 6);
+  addKey("ChDown", ChannelDown_Key, 0x21, 6);
+  addKey("PrevCh", PrevChannel_Key, 0x22, 6);
+  addKey("Sleep", Sleep_Key, 0x26, 6);
+  addKey("Plus", Right_Key, 0x2B, 6);
   addKey("FF", FastForward_Key, 0x2B, 6);
+  addKey("Minus", Left_Key, 0x2C, 6);
   addKey("Rev", Rewind_Key, 0x2C, 6);
+  addKey("Display", Info_Key, 0x2E, 6);
   addKey("Pause", Pause_Key, 0x3B, 6);
 }
index a808ba9..44b1be5 100644 (file)
@@ -14,7 +14,8 @@ MitsubishiTV1::MitsubishiTV1(
     index,
     300, 900,
     300, 2100,
-    53715, true);
+    53715, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -64,11 +65,11 @@ MitsubishiTV1::MitsubishiTV1(
   addKey("GREEN", Green_Key, 0xEC, 8);
   addKey("YELLOW", Yellow_Key, 0xFC, 8);
   addKey("BLUE", Blue_Key, 0xE4, 8);
-  addKey("SIZE", Unmapped_Key, 0x34, 8);
+  addKey("SIZE", TeletextSize_Key, 0x34, 8);
   addKey("S****", Unmapped_Key, 0x74, 8);
-  addKey("REVEAL", Unmapped_Key, 0x7C, 8);
+  addKey("REVEAL", TeletextReveal_Key, 0x7C, 8);
   addKey("MODE", Unmapped_Key, 0xA4, 8);
-  addKey("STORE", Unmapped_Key, 0x78, 8);
+  addKey("STORE", TeletextStore_Key, 0x78, 8);
   addKey("STATUS", Unmapped_Key, 0xB0, 8);
   addKey("BROWSE", Unmapped_Key, 0x6C, 8);
   addKey("PIP", PIP_Key, 0xEE, 8);
@@ -118,7 +119,8 @@ MitsubishiVCR1::MitsubishiVCR1(
     index,
     300, 900,
     300, 2100,
-    53815, true);
+    53815, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -144,11 +146,11 @@ MitsubishiVCR1::MitsubishiVCR1(
   addKey("REC", Record_Key, 0x30, 8);
   addKey("PAUSE", Pause_Key, 0x38, 8);
   addKey("STOP", Stop_Key, 0x28, 8);
-  addKey("SLOW", Unmapped_Key, 0x2C, 8); // "UP"
+  addKey("SLOW", Slow_Key, 0x2C, 8); // "UP"
   addKey("REW", Rewind_Key, 0x34, 8);
   addKey("PLAY", Play_Key, 0x20, 8);
   addKey("FF", FastForward_Key, 0x24, 8);
-  addKey("REPEAT", Unmapped_Key, 0xE8, 8);
+  addKey("REPEAT", Repeat_Key, 0xE8, 8);
   addKey("SKIP_SEARCH", Advance_Key, 0xBC, 8);
   addKey("INDEX_SEARCH-", Previous_Key, 0x68, 8);
   addKey("INDEX_SEARCH+", Next_Key, 0x70, 8);
index 83aa5c9..675022c 100644 (file)
@@ -14,7 +14,8 @@ NokiaGenericVCR::NokiaGenericVCR(
     index,
     272, 737,
     272, 1711,
-    42100, false);
+    42100, false,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -35,7 +36,7 @@ NokiaGenericVCR::NokiaGenericVCR(
   addKey("8", Eight_Key, 0x042, 12);
   addKey("9", Nine_Key, 0x242, 12);
   addKey("0", Zero_Key, 0x142, 12);
-  addKey("Timer", Unmapped_Key, 0x262, 12);
+  addKey("Timer", Timer_Key, 0x262, 12);
   addKey("Clear", Clear_Key, 0x012, 12);
   addKey("P+", ChannelUp_Key, 0x222, 12);
   addKey("P-", ChannelDown_Key, 0x122, 12);
@@ -50,7 +51,7 @@ NokiaGenericVCR::NokiaGenericVCR(
   addKey("Yellow", Yellow_Key, 0x032, 12);
   addKey("Blue", Blue_Key, 0x3D2, 12);
   addKey("Rec", Record_Key, 0x052, 12);
-  addKey("Clock", Unmapped_Key, 0x1C2, 12);
-  addKey("Prog", Unmapped_Key, 0x066, 12);
+  addKey("Clock", Clock_Key, 0x1C2, 12);
+  addKey("Prog", Program_Key, 0x066, 12);
   addKey("PIP", PIP_Key, 0x0C6, 12);
 }
index ab0da88..e128f4a 100644 (file)
@@ -14,7 +14,8 @@ PanasonicAmp::PanasonicAmp(
     index,
     400, 400,
     400, 1200,
-    76000, false);
+    76000, false,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -48,23 +49,25 @@ PanasonicCarAudio::PanasonicCarAudio(
     index,
     665, 465,
     665, 1595,
-    108609, true);
+    108609, true,
+    Extended_NEC);
 
   threadableProtocol = np;
 
   np->setHeaderPair(9148, 4424);
   np->setTrailerPulse(667);
 
-  setPreData(0x8156, 16);
-
-  addKey("Power", Power_Key, 0x48B7, 16);
-  addKey("PRG", Unmapped_Key, 0x38C7, 16);
-  addKey("Mode", Unmapped_Key, 0x58A7, 16);
-  addKey("ATT", Unmapped_Key, 0x28D7, 16);
-  addKey("Vol_Up", VolumeUp_Key, 0xB847, 16);
-  addKey("Vol_Down", VolumeDown_Key, 0x9867, 16);
-  addKey("Tune/Track_Up", ChannelUp_Key, 0xF807, 16);
-  addKey("Tune/Track_Down", ChannelDown_Key, 0x7887, 16);
+//  setPreData(0x8156, 16);
+  setPreData(0x6A81, 16);
+
+  addKey("Power", Power_Key, 0x12, 8);
+  addKey("ATT", Unmapped_Key, 0x14, 8);
+  addKey("Vol_Down", VolumeDown_Key, 0x19, 8);
+  addKey("Mode", SoundMode_Key, 0x1A, 8);
+  addKey("PRG", Program_Key, 0x1C, 8);
+  addKey("Vol_Up", VolumeUp_Key, 0x1D, 8);
+  addKey("Tune/Track_Down", ChannelDown_Key, 0x1E, 8);
+  addKey("Tune/Track_Up", ChannelUp_Key, 0x1F, 8);
 }
 
 
@@ -81,7 +84,8 @@ PanasonicSat1::PanasonicSat1(
     index,
     500, 400,
     500, 1212,
-    74500, false);
+    74500, false,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -103,7 +107,7 @@ PanasonicSat1::PanasonicSat1(
   addKey("RIGHT", Right_Key, 0x7332, 16);
   addKey("UP", Up_Key, 0x5312, 16);
   addKey("DOWN", Down_Key, 0xD392, 16);
-  addKey("FAV", Unmapped_Key, 0x0B4A, 16);
+  addKey("FAV", Favorites_Key, 0x0B4A, 16);
   addKey("INFO", Info_Key, 0x9DDC, 16);
   addKey("1", One_Key, 0x0544, 16);
   addKey("2", Two_Key, 0x85C4, 16);
@@ -120,7 +124,7 @@ PanasonicSat1::PanasonicSat1(
   addKey("TV/DSS", Input_Key, 0x3D7C, 16);
   addKey("REC", Record_Key, 0x4302, 16);
   addKey("ACTION", Select_Key, 0xC382, 16);
-  addKey("PROG", Unmapped_Key, 0x5110, 16);
+  addKey("PROG", Program_Key, 0x5110, 16);
   addKey("TXT", Unmapped_Key, 0x7B3A, 16);
   addKey("STTL", Unmapped_Key, 0xFBBA, 16);
   addKey("GUIDE", Guide_Key, 0xCB8A, 16);
@@ -157,7 +161,8 @@ PanasonicTV1::PanasonicTV1(
     index,
     500, 400,
     500, 1250,
-    75000, false);
+    75000, false,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -204,7 +209,7 @@ PanasonicTV1::PanasonicTV1(
   addKey("MULTIWINDOW", Unmapped_Key, 0x006766, 24);
   addKey("N", Unmapped_Key, 0x003031, 24);
   addKey("STR", Unmapped_Key, 0x00ABAA, 24);
-  addKey("TIMER", Unmapped_Key, 0x00F0F1, 24);
+  addKey("TIMER", Timer_Key, 0x00F0F1, 24);
   addKey("HELP", Unmapped_Key, 0x003534, 24);
   addKey("R-TUNE", Unmapped_Key, 0x00ECED, 24);
   addKey("GAME", Unmapped_Key, 0x00DDDC, 24);
@@ -217,20 +222,20 @@ PanasonicTV1::PanasonicTV1(
   addKey("Return", Unmapped_Key, 0x002B2A, 24);
   addKey("MOOD_LIGHT", Unmapped_Key, 0x008584, 24);
 
-  addKey("ASPECT", Unmapped_Key, 0x207B5A, 24);
+  addKey("ASPECT", AspectRatio_Key, 0x207B5A, 24);
 
-  addKey("PROG", Unmapped_Key, 0x405110, 24);
-  addKey("MENU", Unmapped_Key, 0x402362, 24);
+  addKey("PROG", Program_Key, 0x405110, 24);
+  addKey("MENU", Menu_Key, 0x402362, 24);
   addKey("EXIT", Exit_Key, 0x406322, 24);
   addKey("GUIDE", Guide_Key, 0x40A3E2, 24);
   addKey("TV", Unmapped_Key, 0x400C4D, 24);
 
-  addKey("TV/TEXT", Unmapped_Key, 0x80C041, 24);
+  addKey("TV/TEXT", Teletext_Key, 0x80C041, 24);
   addKey("FP", Unmapped_Key, 0x80A021, 24);
   addKey("INDEX", Unmapped_Key, 0x801091, 24);
-  addKey("HOLD", Unmapped_Key, 0x809011, 24);
-  addKey("TIMETEXT", Unmapped_Key, 0x80D051, 24);
-  addKey("REVEAL", Unmapped_Key, 0x8038B9, 24);
+  addKey("HOLD", TeletextHold_Key, 0x809011, 24);
+  addKey("TIMETEXT", TeletextTime_Key, 0x80D051, 24);
+  addKey("REVEAL", TeletextReveal_Key, 0x8038B9, 24);
   addKey("FTB", Unmapped_Key, 0x8030B1, 24);
   addKey("Display_Cancel", Unmapped_Key, 0x8020A1, 24);
   addKey("List/F.Text", Unmapped_Key, 0x80B839, 24);
@@ -288,7 +293,8 @@ PanasonicVCR1::PanasonicVCR1(
     index,
     550, 330,
     550, 1200,
-    75000, false);
+    75000, false,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -319,9 +325,9 @@ PanasonicVCR1::PanasonicVCR1(
   addKey("0", Zero_Key, 0x009891, 24);
   addKey("100", PlusOneHundred_Key, 0x00A7AE, 24);
   addKey("TV-SAT", Input_Key, 0x006C65, 24);
-  addKey("TRACKING_MINUS", Unmapped_Key, 0x004D44, 24);
-  addKey("TRACKING_PLUS", Unmapped_Key, 0x008D84, 24);
-  addKey("TRACKING_AUTO", Unmapped_Key, 0x000D04, 24);
+  addKey("TRACKING_MINUS", TrackingMinus_Key, 0x004D44, 24);
+  addKey("TRACKING_PLUS", TrackingPlus_Key, 0x008D84, 24);
+  addKey("TRACKING_AUTO", AutoTracking_Key, 0x000D04, 24);
   addKey("STILL", StepForward_Key, 0x003039, 24);  // also "ADV"
   addKey("INDEXL", Unmapped_Key, 0x00929B, 24);
   addKey("INDEXR", Unmapped_Key, 0x00525B, 24);
@@ -331,20 +337,20 @@ PanasonicVCR1::PanasonicVCR1(
   addKey("DIRECT_TV_REC", Unmapped_Key, 0x00434A, 24);
   addKey("TIMERREC", Timer_Key, 0x002D24, 24);
   addKey("COUNTER_RESET", Unmapped_Key, 0x002A23, 24);
-  addKey("AUDIO", Unmapped_Key, 0x00CCC5, 24);
-  addKey("SLOW", Unmapped_Key, 0x00F0F9, 24);
+  addKey("AUDIO", Audio_Key, 0x00CCC5, 24);
+  addKey("SLOW", Slow_Key, 0x00F0F9, 24);
   addKey("INDEX", Unmapped_Key, 0x00020B, 24);
   addKey("+", Unmapped_Key, 0x007178, 24);
   addKey("-", Unmapped_Key, 0x00F1F8, 24);
   addKey("mem_rep", Unmapped_Key, 0x00CAC3, 24);
   addKey("time_search", Unmapped_Key, 0x00222B, 24);
   addKey("monitor", Unmapped_Key, 0x008980, 24);
-  addKey("repeat", Unmapped_Key, 0x000F06, 24);
-  addKey("memory", Unmapped_Key, 0x008F86, 24);
+  addKey("repeat", Repeat_Key, 0x000F06, 24);
+  addKey("memory", Program_Key, 0x008F86, 24);
   addKey("sleep", Sleep_Key, 0x004F46, 24);
   addKey("rew2", Unmapped_Key, 0x00CFC6, 24);
   addKey("cm-zero", Unmapped_Key, 0x001F16, 24);
-  addKey("CLOCK/COUNTER", Unmapped_Key, 0x006A63, 24);
+  addKey("CLOCK/COUNTER", Clock_Key, 0x006A63, 24);
   addKey("TAPE_REMAIN", Unmapped_Key, 0x00AAA3, 24);
   addKey("mesecam", Unmapped_Key, 0x00939A, 24);
   addKey("zerostop", Unmapped_Key, 0x00AFA6, 24);
@@ -371,7 +377,7 @@ PanasonicVCR1::PanasonicVCR1(
   addKey("ADD/DELETE", Unmapped_Key, 0x808C05, 24);
   addKey("RADIO_TUNE", Unmapped_Key, 0x801C95, 24);
   addKey("VPS/PDC", Unmapped_Key, 0x8060E9, 24);
-  addKey("OffTimer", Unmapped_Key, 0x801099, 24);
+  addKey("OffTimer", Sleep_Key, 0x801099, 24);
   addKey("rotate", Unmapped_Key, 0x8040C9, 24);
   addKey("rotatedown", Unmapped_Key, 0x80C049, 24);
   addKey("set", Unmapped_Key, 0x8020A9, 24);
@@ -410,7 +416,7 @@ PanasonicVCR1b::PanasonicVCR1b(
 
   addKey("clear", Clear_Key, 0x8050D9, 24);
   addKey("prog", Program_Key, 0x00FFF6, 24);
-  addKey("repeat", Unmapped_Key, 0x009F96, 24);
+  addKey("repeat", Repeat_Key, 0x009F96, 24);
 }
 
 
@@ -441,7 +447,8 @@ PanasonicDVD1::PanasonicDVD1(
     index,
     500, 400,
     500, 1200,
-    75000, false);
+    75000, false,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -480,25 +487,25 @@ PanasonicDVD1::PanasonicDVD1(
   addKey("+10", DoubleDigit_Key, 0x919C, 16);
   addKey("inputselect", Input_Key, 0x919C, 16);
 //  addKey("R-TUNE", Unmapped_Key, 0xD9D4, 16);
-  addKey("TOP_MENU", Unmapped_Key, 0xD9D4, 16);
+  addKey("TOP_MENU", DiscTitle_Key, 0xD9D4, 16);
   addKey("OPEN/CLOSE", Eject_Key, 0x808D, 16);
 //  addKey("TV-SAT", Input_Key, 0x808D, 16);
   addKey("CH_DOWN", ChannelDown_Key, 0xE0ED, 16);
   addKey("CH_UP", ChannelUp_Key, 0xF0FD, 16);
   addKey("SLEEP", Sleep_Key, 0xD7DA, 16);
   addKey("SUBTITLE", Captions_Key, 0x8984, 16);
-  addKey("AUDIO", Unmapped_Key, 0xCCC1, 16);
-  addKey("ANGLE", Unmapped_Key, 0x0904, 16);
+  addKey("AUDIO", Audio_Key, 0xCCC1, 16);
+  addKey("ANGLE", Angle_Key, 0x0904, 16);
   addKey("QUICK_REPLAY", Replay_Key, 0xD1DC, 16);
   addKey("PROGRAM", Program_Key, 0x515C, 16);
-  addKey("RANDOM", Unmapped_Key, 0xB2BF, 16);
-  addKey("REPEAT", Unmapped_Key, 0x313C, 16);
-  addKey("A-B_REPEAT", Unmapped_Key, 0x121F, 16);
+  addKey("RANDOM", Random_Key, 0xB2BF, 16);
+  addKey("REPEAT", Repeat_Key, 0x313C, 16);
+  addKey("A-B_REPEAT", RepeatAB_Key, 0x121F, 16);
   addKey("A.SRD", Unmapped_Key, 0x7974, 16);
   addKey("BASS", Unmapped_Key, 0x2B26, 16);
   addKey("CINEMA", Unmapped_Key, 0x030E, 16);
   addKey("D.ENH", Unmapped_Key, 0xABA6, 16);
-  addKey("ZOOM", Unmapped_Key, 0x838E, 16);
+  addKey("ZOOM", Zoom_Key, 0x838E, 16);
   addKey("POSITION_MEMORY", Unmapped_Key, 0x626F, 16);
   addKey("ONETOUCH_MEMORY", Unmapped_Key, 0x6B66, 16);
   addKey("GROUP", Unmapped_Key, 0x070A, 16);
@@ -516,7 +523,7 @@ PanasonicDVD1::PanasonicDVD1(
   addKey("rec", Record_Key, 0x101D, 16);
   addKey("recmode", Unmapped_Key, 0x8A87, 16);
   addKey("extlink", Unmapped_Key, 0xC4C9, 16);
-  addKey("timer", Unmapped_Key, 0x1E13, 16);
+  addKey("timer", Timer_Key, 0x1E13, 16);
   addKey("createchapter", Unmapped_Key, 0x1A17, 16);
   addKey("erase", Unmapped_Key, 0x222F, 16);
   addKey("frec", Unmapped_Key, 0xE3EE, 16);
@@ -560,7 +567,8 @@ PanasonicAudio1::PanasonicAudio1(
     index,
     400, 400,
     400, 1200,
-    76000, false);
+    76000, false,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -586,11 +594,11 @@ PanasonicAudio1::PanasonicAudio1(
   addKey("10/0", Zero_Key, 0x99DF, 16);
   addKey("cancel", Clear_Key, 0xB1F7, 16);
   addKey("program", Program_Key, 0xD197, 16); // "MEMORY"
-  addKey("tuner-band", Unmapped_Key, 0x1D5B, 16);
-  addKey("tuning-", Unmapped_Key, 0x5711, 16);
-  addKey("tuning+", Unmapped_Key, 0x97D1, 16);
-  addKey("TUNER_PRESET_TUNE_DOWN", ChannelDown_Key, 0x1751, 16);
-  addKey("TUNER_PRESET_TUNE_UP", ChannelUp_Key, 0xE7A1, 16);
+  addKey("tuner-band", TunerBand_Key, 0x1D5B, 16);
+  addKey("tuning-", ChannelDown_Key, 0x5711, 16);
+  addKey("tuning+", ChannelUp_Key, 0x97D1, 16);
+  addKey("TUNER_PRESET_TUNE_DOWN", Unmapped_Key, 0x1751, 16);
+  addKey("TUNER_PRESET_TUNE_UP", Unmapped_Key, 0xE7A1, 16);
   addKey("fm-mode", Unmapped_Key, 0x2761, 16); // "st-mono"
   addKey("cd", Unmapped_Key, 0x6D2B, 16);
   addKey("prev", Previous_Key, 0x2167, 16);
@@ -598,7 +606,7 @@ PanasonicAudio1::PanasonicAudio1(
   addKey("stop-clear", Stop_Key, 0x0147, 16);
   addKey("play-pause", Play_Key, 0xE1A7, 16);
   addKey("play-pause", Pause_Key, 0xE1A7, 16);
-  addKey("repeat", Unmapped_Key, 0x81C7, 16);
+  addKey("repeat", Repeat_Key, 0x81C7, 16);
   addKey("xbs", Unmapped_Key, 0x6B2D, 16);
   addKey("vol-", VolumeDown_Key, 0x8DCB, 16);
   addKey("vol+", VolumeUp_Key, 0x0D4B, 16);
@@ -613,7 +621,7 @@ PanasonicAudio1::PanasonicAudio1(
   addKey("ff", FastForward_Key, 0xC583, 16);
   addKey("tape_play", Unmapped_Key, 0x6523, 16);
   addKey("tape_stop", Unmapped_Key, 0x0543, 16);
-  addKey("random", Unmapped_Key, 0x4107, 16);
+  addKey("random", Random_Key, 0x4107, 16);
   addKey("TAPE_DECK", Unmapped_Key, 0xB5F3, 16);
   addKey("TAPE_PLAY_REWIND", Unmapped_Key, 0xA5E3, 16);
   addKey("TAPE_PLAY_FORWARD", Unmapped_Key, 0x6523, 16);
index 24eb176..4e1c711 100644 (file)
@@ -40,8 +40,8 @@ PhilipsTV1::PhilipsTV1(
   addKey("RIGHT", Right_Key, 0x0016, 13);
   addKey("AV", Input_Key, 0x1038, 13); // "EXT", "SOURCE"
   addKey("TIMER", Sleep_Key, 0x1026, 13); // "POWER-OFF", "sleep"
-  addKey("TELETEXT", Unmapped_Key, 0x0017, 13);
-  addKey("I/II", Language_Key, 0x1023, 13); // "TEXT_REVEAL", "Stereo"
+  addKey("TELETEXT", Teletext_Key, 0x0017, 13);
+  addKey("I/II", Audio_Key, 0x1023, 13); // "TEXT_REVEAL", "Stereo"
   addKey("RED", Red_Key, 0x00C8, 13);
   addKey("GREEN", Green_Key, 0x00FB, 13);
   addKey("YELLOW", Yellow_Key, 0x00F1, 13); // "radio"
@@ -52,8 +52,8 @@ PhilipsTV1::PhilipsTV1(
   addKey("INFO", Info_Key, 0x100F, 13); // "+", "OSD"
   addKey("TEXT_TV", Unmapped_Key, 0x103C, 13); // "TELETEXT"
   addKey("SURF", Unmapped_Key, 0x1022, 13);
-  addKey("TEXT_CLOCK", Unmapped_Key, 0x102A, 13); // "time"
-  addKey("TEXT_ENLARGE", Unmapped_Key, 0x102B, 13); // "Reduce_Teletext"
+  addKey("TEXT_CLOCK", TeletextTime_Key, 0x102A, 13); // "time"
+  addKey("TEXT_ENLARGE", TeletextSize_Key, 0x102B, 13); // "Reduce_Teletext"
   addKey("PICTURE_SETTINGS", PictureMode_Key, 0x002B, 13);
   addKey("SOUND_SETTINGS", SoundMode_Key, 0x002C, 13);
   addKey("GAME", Unmapped_Key, 0x002E, 13);
@@ -148,9 +148,9 @@ PhilipsTV1c::PhilipsTV1c(
 {
   setKeysetName("TV Keyset 1c");
 
-  addKey("spatial", Unmapped_Key, 0x1024, 13);
-  addKey("stereo", Surround_Key, 0x1023, 13);
-  addKey("dbb", Unmapped_Key, 0x1016, 13);
+  addKey("spatial", Surround_Key, 0x1024, 13);
+  addKey("stereo", Audio_Key, 0x1023, 13);
+  addKey("dbb", Unmapped_Key, 0x1016, 13); // dynamic bass boost?
 }
 
 
@@ -247,7 +247,7 @@ PhilipsTV2::PhilipsTV2(
   addKey("Power", Power_Key, 0x0C, 8);
   addKey("TV", Unmapped_Key, 0x9F, 8);
   addKey("SUBTITLE", Captions_Key, 0x4B, 8);
-  addKey("TELETEXT", Unmapped_Key, 0x3C, 8);
+  addKey("TELETEXT", Teletext_Key, 0x3C, 8);
   addKey("SOURCE", Input_Key, 0x38, 8); // "inputselect", "external"
   addKey("red", Red_Key, 0x6D, 8);
   addKey("green", Green_Key, 0x6E, 8);
@@ -291,9 +291,9 @@ PhilipsTV2::PhilipsTV2(
   addKey("ActiveControl", Unmapped_Key, 0x96, 8);
   addKey("Dual_Screen", PIP_Key, 0x5D, 8); // "splitdisplay"
   addKey("Previous_channel", PrevChannel_Key, 0x0A, 8); // "PP", "AB"
-  addKey("1st/2nd_language", Language_Key, 0x4E, 8); // "monostereo"
+  addKey("1st/2nd_language", Audio_Key, 0x4E, 8); // "monostereo"
   addKey("freeze", Pause_Key, 0x67, 8); // "pause"
-  addKey("zoom", Unmapped_Key, 0xE7, 8);
+  addKey("zoom", Zoom_Key, 0xE7, 8);
 }
 
 
@@ -412,7 +412,7 @@ PhilipsDVD1::PhilipsDVD1(
   addKey("Return", Exit_Key, 0x83, 8);
   addKey("Skip_Right", Next_Key, 0x20, 8); // "next"
   addKey("Skip_Left", Previous_Key, 0x21, 8); // "prev"
-  addKey("Audio", Language_Key, 0x4E, 8);
+  addKey("Audio", Audio_Key, 0x4E, 8);
   addKey("1", One_Key, 0x01, 8);
   addKey("2", Two_Key, 0x02, 8);
   addKey("3", Three_Key, 0x03, 8);
@@ -424,12 +424,12 @@ PhilipsDVD1::PhilipsDVD1(
   addKey("9", Nine_Key, 0x09, 8);
   addKey("0", Zero_Key, 0x00, 8);
   addKey("Display", Info_Key, 0x0F, 8);
-  addKey("Angle", Unmapped_Key, 0x85, 8);
-  addKey("Zoom", Unmapped_Key, 0xF7, 8);
+  addKey("Angle", Angle_Key, 0x85, 8);
+  addKey("Zoom", Zoom_Key, 0xF7, 8);
   addKey("Repeat", Repeat_Key, 0x1D, 8);
-  addKey("Repeat_AB", Unmapped_Key, 0x3B, 8);
-  addKey("Shuffle", Unmapped_Key, 0x1C, 8);
-  addKey("Scan", Unmapped_Key, 0x2A, 8);
+  addKey("Repeat_AB", RepeatAB_Key, 0x3B, 8);
+  addKey("Shuffle", Random_Key, 0x1C, 8);
+  addKey("Scan", Scan_Key, 0x2A, 8);
   addKey("Secret", Unmapped_Key, 0xEB, 8);
   addKey("Preview", Unmapped_Key, 0xB5, 8);
   addKey("Mute", Mute_Key, 0x0D, 8);
@@ -554,7 +554,7 @@ PhilipsDVD2::PhilipsDVD2(
   addKey("9", Nine_Key, 0x09, 8);
   addKey("0", Zero_Key, 0x00, 8);
   addKey("subtitle", Captions_Key, 0x4B, 8);
-  addKey("audio", Language_Key, 0x4E, 8);
+  addKey("audio", Audio_Key, 0x4E, 8);
 }
 
 
@@ -572,7 +572,7 @@ PhilipsDVD3::PhilipsDVD3(
 
   addKey("Power", Power_Key, 0x0C, 8);
   addKey("Edit", Unmapped_Key, 0xF1, 8);
-  addKey("LiveTV", Unmapped_Key, 0xEE, 8);
+  addKey("LiveTV", LiveTV_Key, 0xEE, 8);
   addKey("Disc", DiscMenu_Key, 0xD1, 8);
   addKey("Select", Unmapped_Key, 0xC9, 8);
   addKey("Cam", Unmapped_Key, 0xC3, 8);
@@ -591,7 +591,7 @@ PhilipsDVD3::PhilipsDVD3(
   addKey("Left", Left_Key, 0x5A, 8);
   addKey("Down", Down_Key, 0x59, 8);
   addKey("Up", Up_Key, 0x58, 8);
-  addKey("Audio", Language_Key, 0x4E, 8);
+  addKey("Audio", Audio_Key, 0x4E, 8);
   addKey("Subtitle", Captions_Key, 0x4B, 8);
   addKey("Scart", Unmapped_Key, 0x43, 8);
   addKey("Rec", Record_Key, 0x37, 8);
@@ -636,7 +636,7 @@ PhilipsDVD4::PhilipsDVD4(
   addKey("PLAY", Play_Key, 0x2C, 8);
   addKey("REWIND", Rewind_Key, 0x29, 8);
   addKey("PAUSE", Pause_Key, 0x30, 8);
-  addKey("SLOW", Unmapped_Key, 0x22, 8);
+  addKey("SLOW", Slow_Key, 0x22, 8);
   addKey("FORWARD", FastForward_Key, 0x28, 8);
   addKey("PREVIOUS", Previous_Key, 0x21, 8);
   addKey("NEXT", Next_Key, 20, 8);
@@ -648,7 +648,7 @@ PhilipsDVD4::PhilipsDVD4(
   addKey("LEFT", Left_Key, 0x5A, 8);
   addKey("RIGHT", Right_Key, 0x5B, 8);
   addKey("CLEAR", Clear_Key, 0x41, 8);
-  addKey("TIMER", Unmapped_Key, 0xFE, 8);
+  addKey("TIMER", Timer_Key, 0xFE, 8);
   addKey("SELECT", Select_Key, 0xFA, 8);
   addKey("PROGPLUS", ChannelUp_Key, 0x1E, 8);
   addKey("PROGMINUS", ChannelDown_Key, 0x1F, 8);
@@ -664,14 +664,14 @@ PhilipsDVD4::PhilipsDVD4(
   addKey("0", Zero_Key, 0x00, 8);
   addKey("TC", Unmapped_Key, 0xC8, 8);
   addKey("TUNER", Unmapped_Key, 0xEE, 8);
-  addKey("ZOOM", Unmapped_Key, 0xF7, 8);
-  addKey("ANGLE", Unmapped_Key, 0x85, 8);
+  addKey("ZOOM", Zoom_Key, 0xF7, 8);
+  addKey("ANGLE", Angle_Key, 0x85, 8);
   addKey("SUBTITLE", Captions_Key, 0x4B, 8);
-  addKey("AUDIO", Language_Key, 0x4E, 8);
+  addKey("AUDIO", Audio_Key, 0x4E, 8);
   addKey("DIM", Unmapped_Key, 0x13, 8);
   addKey("REPEAT", Repeat_Key, 0x1D, 8);
-  addKey("REPEATAB", Unmapped_Key, 0x3B, 8);
-  addKey("SCAN", Unmapped_Key, 0x2A, 8);
+  addKey("REPEATAB", RepeatAB_Key, 0x3B, 8);
+  addKey("SCAN", Scan_Key, 0x2A, 8);
 }
 
 
@@ -692,7 +692,7 @@ PhilipsVCR1::PhilipsVCR1(
   addKey("Rewind", Rewind_Key, 0x1172, 13);
   addKey("Stop", Stop_Key, 0x1176, 13);
   addKey("Play", Play_Key, 0x1175, 13);
-  addKey("Timer", Unmapped_Key, 0x115D, 13);
+  addKey("Timer", Timer_Key, 0x115D, 13);
   addKey("OSD", Info_Key, 0x114F, 13);
   addKey("Menu", Menu_Key, 0x0152, 13);
   addKey("OK", Select_Key, 0x0157, 13);
@@ -702,7 +702,7 @@ PhilipsVCR1::PhilipsVCR1(
   addKey("Down", Down_Key, 0x0151, 13);
   addKey("Program+", ChannelUp_Key, 0x1160, 13);
   addKey("Program-", ChannelDown_Key, 0x1161, 13);
-  addKey("Audio", Language_Key, 0x1163, 13);
+  addKey("Audio", Audio_Key, 0x1163, 13);
   addKey("Still", Pause_Key, 0x1169, 13); // "PAUSE"
   addKey("1", One_Key, 0x1141, 13);
   addKey("2", Two_Key, 0x1142, 13);
@@ -729,8 +729,8 @@ PhilipsVCR1::PhilipsVCR1(
   addKey("F_ADV", StepForward_Key, 0x016B, 13);
   addKey("G_CODE", Unmapped_Key, 0x0145, 13);
   addKey("GO_TO", Unmapped_Key, 0x1173, 13);
-  addKey("SLOW", Unmapped_Key, 0x1168, 13);
-  addKey("memory", Unmapped_Key, 0x117B, 13);
+  addKey("SLOW", Slow_Key, 0x1168, 13);
+  addKey("memory", Program_Key, 0x117B, 13);
   addKey("VCR_TV", Unmapped_Key, 0x117E, 13);
   addKey("track_up", TrackingPlus_Key, 0x014D, 13);
   addKey("track_down", TrackingMinus_Key, 0x14E, 13);
@@ -832,7 +832,7 @@ PhilipsSat1::PhilipsSat1(
   addKey("Down", Down_Key, 0x0211, 13);
   addKey("Program+", ChannelUp_Key, 0x1220, 13);
   addKey("Program-", ChannelDown_Key, 0x1221, 13);
-  addKey("Audio", Language_Key, 0x1223, 13); // I-II
+  addKey("Audio", Audio_Key, 0x1223, 13); // I-II
   addKey("1", One_Key, 0x1201, 13);
   addKey("2", Two_Key, 0x1202, 13);
   addKey("3", Three_Key, 0x1203, 13);
@@ -862,7 +862,7 @@ PhilipsSat1::PhilipsSat1(
   addKey("TV_P-", Unmapped_Key, 0x1021, 13);
   addKey("TV_P+", Unmapped_Key, 0x1020, 13);
   addKey("Install", Unmapped_Key, 0x023A, 13);
-  addKey("Clock", Unmapped_Key, 0x122A, 13);
+  addKey("Clock", Clock_Key, 0x122A, 13);
   addKey("Clock_dotted", Unmapped_Key, 0x1226, 13);
 }
 
@@ -926,14 +926,14 @@ PhilipsSat2a::PhilipsSat2a(
 
   addKey("ch+", ChannelUp_Key, 0x58, 8);
   addKey("ch-", ChannelDown_Key, 0x59, 8);
-  addKey("language", Language_Key, 0x49, 8);
+  addKey("language", Audio_Key, 0x49, 8);
   addKey("txt", Captions_Key, 0x4B, 8);
   addKey("favorites", Favorites_Key, 0x84, 8);
   addKey("themes", Unmapped_Key, 0xCD, 8);
   addKey("opts", Unmapped_Key, 0xBD, 8);
   addKey("pp", PrevChannel_Key, 0x0A, 8);
-  addKey("page+", Unmapped_Key, 0xCE, 8);
-  addKey("page-", Unmapped_Key, 0xCF, 8);
+  addKey("page+", PageUp_Key, 0xCE, 8);
+  addKey("page-", PageDown_Key, 0xCF, 8);
 }
 
 
@@ -1012,7 +1012,7 @@ PhilipsAudio1::PhilipsAudio1(
   addKey("tuner_next", Next_Key, 0x1460, 13); // "presetUp"
   addKey("tuner_previous", Previous_Key, 0x1461, 13); // "presetDown"
   addKey("tuner_program", Program_Key, 0x047A, 13); // Create Preset
-  addKey("tuner", Input_Key, 0x147F, 13);
+  addKey("tuner", TunerBand_Key, 0x147F, 13);
   addKey("tape_power", Unmapped_Key, 0x148C, 13);
   addKey("tape_next", Unmapped_Key, 0x14A0, 13);
   addKey("tape_previous", Unmapped_Key, 0x14A1, 13);
@@ -1050,10 +1050,10 @@ PhilipsAudio1::PhilipsAudio1(
   addKey("osm", Unmapped_Key, 0x042C, 13);
   addKey("vec", Unmapped_Key, 0x042B, 13);
   addKey("TIME", Info_Key, 0x150B, 13); // "CD_DISPLAY"
-  addKey("SCAN", Unmapped_Key, 0x152B, 13);
+  addKey("SCAN", Scan_Key, 0x152B, 13);
   addKey("OPEN/CLOSE", Eject_Key, 0x152D, 13);
   addKey("Side", Unmapped_Key, 0x14AF, 13);  // "TAPE_SIDE"
-  addKey("TIMER", Unmapped_Key, 0x142A, 13);
+  addKey("TIMER", Timer_Key, 0x142A, 13);
   addKey("FLAT", Unmapped_Key, 0x1434, 13);
   addKey("LOUDNESS", Unmapped_Key, 0x1432, 13);
   addKey("BASS_UP", Unmapped_Key, 0x1416, 13);
@@ -1127,59 +1127,60 @@ PhilipsAudio2::PhilipsAudio2(
 {
   addControlledDevice(Philips_Make, "FW2104", Audio_Device);
 
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x61CA, 16);
-
-  addKey("POWER", Power_Key, 0x807F, 16);
-  addKey("SLEEP", Sleep_Key, 0x30CF, 16);
-  addKey("TIMER", Unmapped_Key, 0xB04F, 16);
-  addKey("SNOOZE", Unmapped_Key, 0xD02F, 16);
-  addKey("AUX", Unmapped_Key, 0xA05F, 16);
-  addKey("1", One_Key, 0xE817, 16);
-  addKey("2", Two_Key, 0x18E7, 16);
-  addKey("3", Three_Key, 0x9867, 16);
-  addKey("4", Four_Key, 0x58A7, 16);
-  addKey("5", Five_Key, 0xD827, 16);
-  addKey("6", Six_Key, 0x38C7, 16);
-  addKey("7", Seven_Key, 0xB847, 16);
-  addKey("8", Eight_Key, 0x7887, 16);
-  addKey("9", Nine_Key, 0xF807, 16);
-  addKey("0", Zero_Key, 0x6897, 16);
-  addKey("TUN_UP", ChannelUp_Key, 0x906F, 16);
-  addKey("TUN_DOWN", ChannelDown_Key, 0x50AF, 16);
-  addKey("TAPE", Unmapped_Key, 0x40BF, 16);
-  addKey("TUNER", Unmapped_Key, 0x20DF, 16);
-  addKey("CD", Unmapped_Key, 0xC03F, 16);
-  addKey("EJECT", Eject_Key, 0x02FD, 16);
-  addKey("CANCEL", Clear_Key, 0xA857, 16);
-  addKey("MEMORY", Unmapped_Key, 0x28D7, 16);
-  addKey("CD_STOP", Stop_Key, 0x42BD, 16);
-  addKey("CD_PLAY", Play_Key, 0x827D, 16);
-  addKey("CD_REW", Rewind_Key, 0x22DD, 16);
-  addKey("CD_FW", FastForward_Key, 0xC23D, 16);
-  addKey("EDIT", Unmapped_Key, 0x12ED, 16);
-  addKey("WARP", Unmapped_Key, 0x926D, 16);
-  addKey("TIME", Unmapped_Key, 0xA25D, 16);
-  addKey("CHAIN", Unmapped_Key, 0xD22D, 16);
-  addKey("SPACE", Unmapped_Key, 0x52AD, 16);
-  addKey("INTRO", Unmapped_Key, 0xE21D, 16);
-  addKey("REP_ALL_PRG", Repeat_Key, 0x629D, 16);
-  addKey("REP_A_B", Unmapped_Key, 0xC837, 16);
-  addKey("TAPE1_REW", Unmapped_Key, 0xDA25, 16);
-  addKey("TAPE1_BACKPLAY", Unmapped_Key, 0x9A65, 16);
-  addKey("TAPE1_STOP", Unmapped_Key, 0x3AC5, 16);
-  addKey("TAPE1_PLAY", Unmapped_Key, 0x1AE5, 16);
-  addKey("TAPE1_FW", Unmapped_Key, 0x5AA5, 16);
-  addKey("TAPE2_REW", Unmapped_Key, 0x2AD5, 16);
-  addKey("TAPE2_BACKPLAY", Unmapped_Key, 0x4AB5, 16);
-  addKey("TAPE2_STOP", Unmapped_Key, 0xAA55, 16);
-  addKey("TAPE2_PLAY", Unmapped_Key, 0x8A75, 16);
-  addKey("TAPE2_FW", Unmapped_Key, 0x0AF5, 16);
-  addKey("PAUSE_RECORD", Unmapped_Key, 0x0AF5, 16);
-  addKey("MUTE", Mute_Key, 0x609F, 16);
-  addKey("VOL_UP", VolumeUp_Key, 0xE01F, 16);
-  addKey("VOL_DOWN", VolumeDown_Key, 0x10EF, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Extended_NEC);
+
+//  setPreData(0x61CA, 16);
+  setPreData(0x5386, 16);
+
+  addKey("POWER", Power_Key, 0x01, 8);
+  addKey("TAPE", Unmapped_Key, 0x02, 8);
+  addKey("CD", Unmapped_Key, 0x03, 8);
+  addKey("TUNER", TunerBand_Key, 0x04, 8);
+  addKey("MUTE", Mute_Key, 0x06, 8);
+  addKey("VOL_UP", VolumeUp_Key, 0x07, 8);
+  addKey("VOL_DOWN", VolumeDown_Key, 0x08, 8);
+  addKey("TUN_UP", ChannelUp_Key, 0x09, 8);
+  addKey("TUN_DOWN", ChannelDown_Key, 0x0A, 8);
+  addKey("SNOOZE", Unmapped_Key, 0x0B, 8);
+  addKey("SLEEP", Sleep_Key, 0x0C, 8);
+  addKey("TIMER", Timer_Key, 0x0D, 8);
+  addKey("AUX", Unmapped_Key, 0x05, 8);
+  addKey("REP_A_B", RepeatAB_Key, 0x13, 8);
+  addKey("MEMORY", Program_Key, 0x14, 8);
+  addKey("CANCEL", Clear_Key, 0x15, 8);
+  addKey("0", Zero_Key, 0x16, 8);
+  addKey("1", One_Key, 0x17, 8);
+  addKey("2", Two_Key, 0x18, 8);
+  addKey("3", Three_Key, 0x19, 8);
+  addKey("4", Four_Key, 0x1A, 8);
+  addKey("5", Five_Key, 0x1B, 8);
+  addKey("6", Six_Key, 0x1C, 8);
+  addKey("7", Seven_Key, 0x1D, 8);
+  addKey("8", Eight_Key, 0x1E, 8);
+  addKey("9", Nine_Key, 0x1F, 8);
+  addKey("EJECT", Eject_Key, 0x40, 8);
+  addKey("CD_PLAY", Play_Key, 0x41, 8);
+  addKey("CD_STOP", Stop_Key, 0x42, 8);
+  addKey("CD_FW", FastForward_Key, 0x43, 8);
+  addKey("CD_REW", Rewind_Key, 0x44, 8);
+  addKey("TIME", Unmapped_Key, 0x45, 8);
+  addKey("REP_ALL_PRG", Repeat_Key, 0x46, 8);
+  addKey("INTRO", Unmapped_Key, 0x47, 8);
+  addKey("EDIT", Unmapped_Key, 0x48, 8);
+  addKey("WARP", Unmapped_Key, 0x49, 8);
+  addKey("SPACE", Unmapped_Key, 0x4A, 8);
+  addKey("CHAIN", Unmapped_Key, 0x4B, 8);
+  addKey("TAPE1_REW", Unmapped_Key, 0x5B, 8);
+  addKey("TAPE1_BACKPLAY", Unmapped_Key, 0x59, 8);
+  addKey("TAPE1_STOP", Unmapped_Key, 0x5C, 8);
+  addKey("TAPE1_PLAY", Unmapped_Key, 0x58, 8);
+  addKey("TAPE1_FW", Unmapped_Key, 0x5A, 8);
+  addKey("TAPE2_REW", Unmapped_Key, 0x54, 8);
+  addKey("TAPE2_BACKPLAY", Unmapped_Key, 0x52, 8);
+  addKey("TAPE2_STOP", Unmapped_Key, 0x55, 8);
+  addKey("TAPE2_PLAY", Unmapped_Key, 0x51, 8);
+  addKey("TAPE2_FW", Unmapped_Key, 0x50, 8);
+//  addKey("PAUSE_RECORD", RecordPause_Key, 0x50, 8);
 }
 
 
index cf49c53..599bd95 100644 (file)
@@ -30,7 +30,7 @@ PinnaclePCTV1::PinnaclePCTV1(
   addKey("btn_8", Eight_Key, 0x21, 6);
   addKey("btn_9", Nine_Key, 0x12, 6);
   addKey("btn_0", Zero_Key, 0x27, 6);
-  addKey("key_screen", Unmapped_Key, 0x24, 6);
+  addKey("key_screen", AspectRatio_Key, 0x24, 6);
   addKey("key_t", Unmapped_Key, 0x2A, 6);
   addKey("key_rewind", Rewind_Key, 0x2D, 6);
   addKey("key_playpause", Play_Key, 0x30, 6);
@@ -58,7 +58,7 @@ PinnaclePCTV2::PinnaclePCTV2(
   addKey("play-pause", Pause_Key, 0x06, 6);
   addKey("stop", Stop_Key, 0x05, 6);
   addKey("exit", Exit_Key, 0x03, 6);
-  addKey("screen", Unmapped_Key, 0x02, 6);
+  addKey("screen", AspectRatio_Key, 0x02, 6);
   addKey("rew", Rewind_Key, 0x04, 6);
   addKey("ff", FastForward_Key, 0x07, 6);
   addKey("mute", Mute_Key, 0x00, 6);
index 2f7fdff..4219293 100644 (file)
@@ -9,51 +9,52 @@ RaiteDVD1::RaiteDVD1(
       Raite_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
 
-  setPreData(0x04FB, 16);
+//  setPreData(0x04FB, 16);
+  setPreData(0x20, 8);
 
-  addKey("mute", Mute_Key, 0xC03F, 16);
-  addKey("1", One_Key, 0xC837, 16);
-  addKey("2", Two_Key, 0x08F7, 16);
-  addKey("3", Three_Key, 0x8877, 16);
-  addKey("4", Four_Key, 0xF00F, 16);
-  addKey("5", Five_Key, 0x30CF, 16);
-  addKey("6", Six_Key, 0xB04F, 16);
-  addKey("7", Seven_Key, 0xD02F, 16);
-  addKey("8", Eight_Key, 0x10EF, 16);
-  addKey("9", Nine_Key, 0x906F, 16);
-  addKey("0", Zero_Key, 0x926D, 16);
-  addKey("+10", DoubleDigit_Key, 0xB24D, 16);
-  addKey("stop", Stop_Key, 0x8A75, 16);
-  addKey("+v", VolumeUp_Key, 0xAA55, 16); // might be wrong
-  addKey("-v", VolumeDown_Key, 0xA857, 16); // also might be wrong
-  addKey("a-b", Unmapped_Key, 0xE817, 16);
-  addKey("1/all", Unmapped_Key, 0x28D7, 16);
-  addKey("rew", Rewind_Key, 0xD827, 16);
-  addKey("ff", FastForward_Key, 0x18E7, 16);
-  addKey("back", Previous_Key, 0x9867, 16);
-  addKey("forward", Next_Key, 0x9A65, 16);
-  addKey("slow", Unmapped_Key, 0xF807, 16);
-  addKey("pause", Pause_Key, 0xBA45, 16);
-  addKey("play", Play_Key, 0x3AC5, 16);
-  addKey("up", Up_Key, 0x22DD, 16);
-  addKey("down", Down_Key, 0xB847, 16);
-  addKey("right", Right_Key, 0x12ED, 16);
-  addKey("left", Left_Key, 0x38C7, 16);
-  addKey("menu", DiscMenu_Key, 0x609F, 16); // "Menu/Return"
-  addKey("zoom", Unmapped_Key, 0x7887, 16);
-  addKey("setup", Menu_Key, 0x40BF, 16);
-  addKey("title", DiscTitle_Key, 0x02FD, 16);
-  addKey("resume", Unmapped_Key, 0x50AF, 16);
-  addKey("sub-title", Captions_Key, 0x48B7, 16);
-  addKey("t/c_search", Unmapped_Key, 0x0AF5, 16);
-  addKey("angle", Unmapped_Key, 0x2AD5, 16);
-  addKey("language", Language_Key, 0x6897, 16);
-  addKey("power", Power_Key, 0x708F, 16);
-  addKey("pbc", Unmapped_Key, 0x32CD, 16);
-  addKey("display", Info_Key, 0x1AE5, 16);
-  addKey("open/close", Eject_Key, 0x58A7, 16);
-  addKey("program", Program_Key, 0x827D, 16);
-  addKey("vocal-assist", Unmapped_Key, 0x807F, 16);
+  addKey("vocal-assist", Unmapped_Key, 0x01, 8);
+  addKey("setup", Menu_Key, 0x02, 8);
+  addKey("mute", Mute_Key, 0x03, 8);
+  addKey("menu", DiscMenu_Key, 0x06, 8); // "Menu/Return"
+  addKey("8", Eight_Key, 0x08, 8);
+  addKey("9", Nine_Key, 0x09, 8);
+  addKey("resume", Unmapped_Key, 0x0A, 8);
+  addKey("7", Seven_Key, 0x0B, 8);
+  addKey("5", Five_Key, 0x0C, 8);
+  addKey("6", Six_Key, 0x0D, 8);
+  addKey("power", Power_Key, 0x0E, 8);
+  addKey("4", Four_Key, 0x0F, 8);
+  addKey("2", Two_Key, 0x10, 8);
+  addKey("3", Three_Key, 0x11, 8);
+  addKey("sub-title", Captions_Key, 0x12, 8);
+  addKey("1", One_Key, 0x13, 8);
+  addKey("1/all", Repeat_Key, 0x14, 8);
+  addKey("-v", VolumeDown_Key, 0x15, 8); // also might be wrong
+  addKey("language", Audio_Key, 0x16, 8);
+  addKey("a-b", RepeatAB_Key, 0x17, 8);
+  addKey("ff", FastForward_Key, 0x18, 8);
+  addKey("back", Previous_Key, 0x19, 8);
+  addKey("open/close", Eject_Key, 0x1A, 8);
+  addKey("rew", Rewind_Key, 0x1B, 8);
+  addKey("down", Down_Key, 0x1D, 8);
+  addKey("left", Left_Key, 0x1C, 8);
+  addKey("zoom", Zoom_Key, 0x1E, 8);
+  addKey("slow", Slow_Key, 0x1F, 8);
+  addKey("title", DiscTitle_Key, 0x40, 8);
+  addKey("program", Program_Key, 0x41, 8);
+  addKey("up", Up_Key, 0x44, 8);
+  addKey("right", Right_Key, 0x48, 8);
+  addKey("0", Zero_Key, 0x49, 8);
+  addKey("pbc", Unmapped_Key, 0x4C, 8);
+  addKey("+10", DoubleDigit_Key, 0x4D, 8);
+  addKey("t/c_search", Unmapped_Key, 0x50, 8);
+  addKey("stop", Stop_Key, 0x51, 8);
+  addKey("angle", Angle_Key, 0x54, 8);
+  addKey("+v", VolumeUp_Key, 0x55, 8); // might be wrong
+  addKey("display", Info_Key, 0x58, 8);
+  addKey("forward", Next_Key, 0x59, 8);
+  addKey("play", Play_Key, 0x5C, 8);
+  addKey("pause", Pause_Key, 0x5D, 8);
 }
index 9d6189d..9be27dd 100644 (file)
@@ -14,7 +14,8 @@ RCATV1::RCATV1(
     index,
     500, 1000,
     500, 2000,
-    64500, true);
+    64500, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -82,7 +83,7 @@ RCATV1a::RCATV1a(
 {
   setKeysetName("TV Keyset 1a");
 
-  addKey("repeat", Unmapped_Key, 0x050FA, 20);
+  addKey("repeat", Repeat_Key, 0x050FA, 20);
   addKey("pip", PIP_Key, 0x1B0E4, 20);
   addKey("swap", PIPSwap_Key, 0xC303C, 20);
   addKey("aspect", AspectRatio_Key, 0x9006F, 20);
@@ -102,7 +103,8 @@ RCATV2::RCATV2(
     index,
     500, 1000,
     500, 2000,
-    12390, false);
+    12390, false,
+    LIRC_NEC);
 
   threadableProtocol = np;
   np->setHeaderPair(17355, 3978);
@@ -110,8 +112,8 @@ RCATV2::RCATV2(
 
   setPreData(0xF, 4);
 
-  addKey("off", Unmapped_Key, 0x3B0C4, 20);
-  addKey("on", Unmapped_Key, 0x3A0C5, 20);
+  addKey("off", PowerOff_Key, 0x3B0C4, 20);
+  addKey("on", PowerOn_Key, 0x3A0C5, 20);
   addKey("display", Info_Key, 0x3C0C3, 20);
   addKey("reset", Reset_Key, 0x120ED, 20);
   addKey("pc", PrevChannel_Key, 0x270D8, 20);
@@ -150,7 +152,8 @@ RCAAux1::RCAAux1(
     index,
     500, 1000,
     500, 2000,
-    64500, true);
+    64500, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -212,7 +215,8 @@ RCAAux2::RCAAux2(
     index,
     500, 1000,
     500, 2000,
-    64500, true);
+    64500, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -290,7 +294,8 @@ RCAVCR1::RCAVCR1(
     index,
     500, 1000,
     500, 2000,
-    64500, true);
+    64500, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -356,7 +361,8 @@ RCAVCR2::RCAVCR2(
     index,
     500, 1000,
     500, 2000,
-    64500, true);
+    64500, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -416,7 +422,8 @@ RCADVD1::RCADVD1(
     index,
     500, 1000,
     500, 2000,
-    64500, true);
+    64500, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -460,9 +467,9 @@ RCADVD1::RCADVD1(
   addKey("dvd-stop", Stop_Key, 0x1FAE0, 20);
   addKey("dvd-pause", Pause_Key, 0x19AE6, 20);
   addKey("skip", Advance_Key, 0x53AAC, 20);
-  addKey("dvd_again", Unmapped_Key, 0xBAA45, 20);
+  addKey("dvd_again", Replay_Key, 0xBAA45, 20);
   addKey("dvd_open_close", Eject_Key, 0x40ABF, 20);
-  addKey("dvd_zoom", Unmapped_Key, 0x90A6F, 20);
+  addKey("dvd_zoom", Zoom_Key, 0x90A6F, 20);
   addKey("dvd_preset", Unmapped_Key, 0x12AED, 20);
   addKey("dvd", Unmapped_Key, 0x3AAC5, 20);
 }
@@ -493,7 +500,8 @@ RCASat1::RCASat1(
     index,
     500, 1000,
     500, 2000,
-    64500, true);
+    64500, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -558,7 +566,8 @@ RCASat2::RCASat2(
     index,
     440, 2780,
     440, 1645,
-    6115, false);
+    6115, false,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -574,7 +583,7 @@ RCASat2::RCASat2(
   setPostData(0x000, 10);
 
   addKey("info", Info_Key, 0x0, 6);
-  addKey("power_on", Unmapped_Key, 0x1, 6);
+  addKey("power_on", PowerOn_Key, 0x1, 6);
   addKey("power", Power_Key, 0x2, 6);
   addKey("1", One_Key, 0x4, 6);
   addKey("2", Two_Key, 0x5, 6);
@@ -603,7 +612,7 @@ RCASat2::RCASat2(
   addKey("sys_info", Info_Key, 0x36, 6);
   addKey("asterisk", Unmapped_Key, 0x37, 6);
   addKey("pound", Unmapped_Key, 0x38, 6);
-  addKey("power_off", Unmapped_Key, 0x39, 6);
+  addKey("power_off", PowerOff_Key, 0x39, 6);
   addKey("sat", Unmapped_Key, 0x41, 6);
   addKey("dish_home", Unmapped_Key, 0x52, 6);
   addKey("sys_info2", Unmapped_Key, 0x54, 6);
index 87d1db8..99e37a9 100644 (file)
@@ -9,49 +9,49 @@ SagemTVBox1::SagemTVBox1(
       Sagem_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
+  threadableProtocol = new NECProtocol(guiObject, index, Extended_NEC);
 
-  setPreData(0xE17A, 16);
+//  setPreData(0xE17A, 16);
+  setPreData(0x5E87, 16);
 
-  addKey("Power", Power_Key, 0x48B7, 16);
-  addKey("P+", ChannelUp_Key, 0x08F7, 16);
-  addKey("P-", ChannelDown_Key, 0x58A7, 16);
-  addKey("Vol+", VolumeUp_Key, 0xB04F, 16);
-  addKey("Vol-", VolumeDown_Key, 0x708F, 16);
-  addKey("Red_A", Red_Key, 0x6897, 16);
-  addKey("Green_B", Green_Key, 0xE817, 16);
-  addKey("Yellow_C", Yellow_Key, 0x18E7, 16);
-  addKey("Blue_D", Blue_Key, 0x9867, 16);
-  addKey("Up", Up_Key, 0xD02F, 16);
-  addKey("Right", Right_Key, 0x38C7, 16);
-  addKey("Down", Down_Key, 0x30CF, 16);
-  addKey("Left", Left_Key, 0xD827, 16);
-  addKey("OK", Select_Key, 0xA857, 16);
-  addKey("INFO", Info_Key, 0x7887, 16); // "Menu"
-  addKey("MENU", Menu_Key, 0x8877, 16);
-  addKey("Head", Unmapped_Key, 0xC837, 16); // "FREEZE", "satdtt"
-  addKey("Q", Unmapped_Key, 0x8877, 16);
-  addKey("LeftArr", Unmapped_Key, 0x14AB, 16);
-  addKey("RightArr", Unmapped_Key, 0x649B, 16); // "LIST", "hd"
-  addKey("EPG", Guide_Key, 0xA45B, 16); // "Navigator"
-  addKey("INPUT", Input_Key, 0x24DB, 16); // "i"
-  addKey("Tone", SoundMode_Key, 0x847B, 16); // "SOUND"
-  addKey("Text", Unmapped_Key, 0xB847, 16); // "TELETEXT"
-  addKey("SUBTITLE", Captions_Key, 0xF807, 16); // "swap"
-  addKey("Interface", Language_Key, 0x04FB, 16); // "AUDIO"
-  addKey("Mute", Mute_Key, 0xF00F, 16);
-  addKey("1", One_Key, 0x807F, 16);
-  addKey("2", Two_Key, 0x40BF, 16);
-  addKey("3", Three_Key, 0xC03F, 16);
-  addKey("4", Four_Key, 0x20DF, 16);
-  addKey("5", Five_Key, 0xA05F, 16);
-  addKey("6", Six_Key, 0x609F, 16);
-  addKey("7", Seven_Key, 0xE01F, 16);
-  addKey("8", Eight_Key, 0x10EF, 16);
-  addKey("9", Nine_Key, 0x906F, 16);
-  addKey("0", Zero_Key, 0x00FF, 16);
-  addKey("EXIT", Exit_Key, 0x50AF, 16); // "Key"
-  addKey("BACK", PrevChannel_Key, 0x28D7, 16); // "R"
+  addKey("0", Zero_Key, 0x00, 8);
+  addKey("1", One_Key, 0x01, 8);
+  addKey("2", Two_Key, 0x02, 8);
+  addKey("3", Three_Key, 0x03, 8);
+  addKey("4", Four_Key, 0x04, 8);
+  addKey("5", Five_Key, 0x05, 8);
+  addKey("6", Six_Key, 0x06, 8);
+  addKey("7", Seven_Key, 0x07, 8);
+  addKey("8", Eight_Key, 0x08, 8);
+  addKey("9", Nine_Key, 0x09, 8);
+  addKey("EXIT", Exit_Key, 0x0A, 8); // "Key"
+  addKey("Up", Up_Key, 0x0B, 8);
+  addKey("Down", Down_Key, 0x0C, 8);
+  addKey("Vol+", VolumeUp_Key, 0x0D, 8);
+  addKey("Vol-", VolumeDown_Key, 0x0E, 8);
+  addKey("Mute", Mute_Key, 0x0F, 8);
+  addKey("P+", ChannelUp_Key, 0x10, 8);
+  addKey("MENU", Menu_Key, 0x11, 8); // "Q"
+  addKey("Power", Power_Key, 0x12, 8);
+  addKey("Head", Unmapped_Key, 0x13, 8); // "FREEZE", "satdtt"
+  addKey("BACK", PrevChannel_Key, 0x14, 8); // "R"
+  addKey("OK", Select_Key, 0x15, 8);
+  addKey("Red_A", Red_Key, 0x16, 8);
+  addKey("Green_B", Green_Key, 0x17, 8);
+  addKey("Yellow_C", Yellow_Key, 0x18, 8);
+  addKey("Blue_D", Blue_Key, 0x19, 8);
+  addKey("P-", ChannelDown_Key, 0x1A, 8);
+  addKey("Left", Left_Key, 0x1B, 8);
+  addKey("Right", Right_Key, 0x1C, 8);
+  addKey("Text", Teletext_Key, 0x1D, 8); // "TELETEXT"
+  addKey("INFO", Info_Key, 0x1E, 8); // "Menu"
+  addKey("SUBTITLE", Captions_Key, 0x1F, 8); // "swap"
+  addKey("Interface", Audio_Key, 0x20, 8); // "AUDIO"
+  addKey("Tone", SoundMode_Key, 0x21, 8); // "SOUND"
+  addKey("INPUT", Input_Key, 0x24, 8); // "i"
+  addKey("EPG", Guide_Key, 0x25, 8); // "Navigator"
+  addKey("RightArr", Unmapped_Key, 0x26, 8); // "LIST", "hd"
+  addKey("LeftArr", Unmapped_Key, 0x28, 8);
 }
 
 
@@ -62,15 +62,15 @@ SagemTVBox1a::SagemTVBox1a(
 {
   setKeysetName("DVB-T/Cable Box Keyset 1a");
 
-  addKey("epg", Guide_Key, 0x8877, 16);
-  addKey("menu", Menu_Key, 0x9867, 16);
-  addKey("v-", VolumeDown_Key, 0x6897, 16);
-  addKey("v+", VolumeUp_Key, 0xB847, 16);
-  addKey("mute", Mute_Key, 0xE817, 16);
-  addKey("p+", ChannelUp_Key, 0xA45B, 16);
-  addKey("p-", ChannelDown_Key, 0x18E7, 16);
-  addKey("note", Unmapped_Key, 0x847B, 16);
-  addKey("teletext6", Unmapped_Key, 0x04FB, 16);
-  addKey("tria2", Unmapped_Key, 0xF00F, 16);
-  addKey("ext", Unmapped_Key, 0x24DB, 16);
+  addKey("tria2", Unmapped_Key, 0x0F, 8);
+  addKey("epg", Guide_Key, 0x11, 8);
+  addKey("v-", VolumeDown_Key, 0x16, 8);
+  addKey("mute", Mute_Key, 0x17, 8);
+  addKey("p-", ChannelDown_Key, 0x18, 8);
+  addKey("menu", Menu_Key, 0x19, 8);
+  addKey("v+", VolumeUp_Key, 0x1D, 8);
+  addKey("teletext6", Unmapped_Key, 0x20, 8);
+  addKey("note", Unmapped_Key, 0x21, 8);
+  addKey("ext", Unmapped_Key, 0x24, 8);
+  addKey("p+", ChannelUp_Key, 0x25, 8);
 }
index c3f4edc..d4a262f 100644 (file)
@@ -19,92 +19,94 @@ SamsungTV1::SamsungTV1(
     index,
     600, 500,
     600, 1600,
-    107500, true);
+    107500, true,
+    Extended_NEC);
 
   threadableProtocol = np;
 
   np->setHeaderPair(4500, 4500);
   np->setTrailerPulse(600);
 
-  setPreData(0xE0E0, 16);
-
-  addKey("Power", Power_Key, 0x40BF, 16);
-  addKey("Channel Up", ChannelUp_Key, 0x48B7, 16);
-  addKey("Channel Down", ChannelDown_Key, 0x08F7, 16);
-  addKey("Volume Up", VolumeUp_Key, 0xE01F, 16);
-  addKey("Volume Down", VolumeDown_Key, 0xD02F, 16);
-  addKey("TV/Video", Input_Key, 0x807F, 16);
-  addKey("1", One_Key, 0x20DF, 16);
-  addKey("2", Two_Key, 0xA05F, 16);
-  addKey("3", Three_Key, 0x609F, 16);
-  addKey("4", Four_Key, 0x10EF, 16);
-  addKey("5", Five_Key, 0x906F, 16);
-  addKey("6", Six_Key, 0x50AF, 16);
-  addKey("7", Seven_Key, 0x30CF, 16);
-  addKey("8", Eight_Key, 0xB04F, 16);
-  addKey("9", Nine_Key, 0x708F, 16);
-  addKey("0", Zero_Key, 0x8877, 16);
-  addKey("-/--", DoubleDigit_Key, 0xC43B, 16);
-  addKey("+100", PlusOneHundred_Key, 0xC43B, 16);
-  addKey("DASH", Dash_Key, 0xC43B, 16);
-  addKey("Sleep", Sleep_Key, 0xC03F, 16);
-  addKey("PrevCh", PrevChannel_Key, 0xC837, 16);
-  addKey("Mute", Mute_Key, 0xF00F, 16);
-  addKey("Display", Info_Key, 0xF807, 16);
-  addKey("Menu", Menu_Key, 0x58A7, 16);
-  addKey("Red", Red_Key, 0x36C9, 16);
-  addKey("Green", Green_Key, 0x28D7, 16);
-  addKey("Yellow", Yellow_Key, 0xA857, 16);
-  addKey("Blue", Blue_Key, 0x6897, 16);
-  addKey("Up", Up_Key, 0x06F9, 16);
-  addKey("Down", Down_Key, 0x8679, 16);
-  addKey("Left", Left_Key, 0xA659, 16);
-  addKey("Right", Right_Key, 0x46B9, 16);
-//  addKey("Enter", Enter_Key, 0x16E9, 16);
-  addKey("Enter", Select_Key, 0x16E9, 16);
-  addKey("Exit", Exit_Key, 0xB44B, 16);
-  addKey("PIP", PIP_Key, 0x04FB, 16);
-  addKey("Swap", PIPSwap_Key, 0x847B, 16);
-  addKey("Closed Captions", Captions_Key, 0xA45B, 16); // "SUBTITLE"
-  addKey("Guide", Guide_Key, 0xF20D, 16);
-  addKey("Play", Play_Key, 0xE21D, 16);
-  addKey("PLAY-PAUSE", Pause_Key, 0xE21D, 16);
-  addKey("Stop", Stop_Key, 0x629D, 16);
-  addKey("Fast Forward", FastForward_Key, 0x12ED, 16);
-  addKey("Rewind", Rewind_Key, 0xA25D, 16);
-  addKey("Record", Record_Key, 0x926D, 16);
-  addKey("PMode", PictureMode_Key, 0x14EB, 16); // "p.std"
-  addKey("SMode", SoundMode_Key, 0xD42B, 16);
-  addKey("PSize", AspectRatio_Key, 0x7C83, 16);
-  addKey("ch.scan", Scan_Key, 0x8C73, 16);  // "h.scan"
-  addKey("surf", Unmapped_Key, 0xBC43, 16); // "r.surf"
-  addKey("turbo", Unmapped_Key, 0xA659, 16);
-  addKey("ttx/mix", Unmapped_Key, 0x34CB, 16); // "teletext"
-  addKey("tv", Unmapped_Key, 0xD827, 16);
-  addKey("mts", Language_Key, 0x00FF, 16); // "dual"
-  addKey("PIP.SOURCE", PIPSource_Key, 0x24DB, 16);
-  addKey("ch-mgr", Unmapped_Key, 0xD629, 16); // "CH_LIST"
-  addKey("srs", Surround_Key, 0x7689, 16);
-  addKey("size", Unmapped_Key, 0xF40B, 16); // PIP size?
-  addKey("PIP.chan+", Unmapped_Key, 0x4CB3, 16); // "AUDCH_UP"
-  addKey("position", PIPMove_Key, 0x44BB, 16);
-  addKey("PIP.chan-", Unmapped_Key, 0xCC33, 16); // "AUDCH_DOWN"
-  addKey("pc", Unmapped_Key, 0x9669, 16);
-  addKey("TV-DTV", Unmapped_Key, 0xC23D, 16);
-  addKey("D.MENU", DiscMenu_Key, 0x718E, 16);
-  addKey("STILL", Unmapped_Key, 0x42BD, 16);
-  addKey("WISELINK", Unmapped_Key, 0x31CE, 16); // "W.Link", "Media.P"
-  addKey("ANTENNA", Unmapped_Key, 0x6C93, 16);
-  addKey("ANYNET", Unmapped_Key, 0xE916, 16);
-  addKey("FAV-CH", Favorites_Key, 0x22DD, 16);
-  addKey("RETURN", Unmapped_Key, 0x1AE5, 16);
-  addKey("E.SAVING", Unmapped_Key, 0xEE11, 16);
-  addKey("Tools", Unmapped_Key, 0xD22D, 16);
-  addKey("E.Mode", Unmapped_Key, 0x29D6, 16);
-  addKey("HDMI", Unmapped_Key, 0xD12E, 16);
-  addKey("Content", Unmapped_Key, 0x9E61, 16);
-  addKey("Internet", Unmapped_Key, 0xC936, 16);
-  addKey("AD", Unmapped_Key, 0xE41B, 16);
+//  setPreData(0xE0E0, 16);
+  setPreData(0x0707, 16);
+
+  addKey("mts", Audio_Key, 0x00, 8); // "dual"
+  addKey("TV/Video", Input_Key, 0x01, 8);
+  addKey("Power", Power_Key, 0x02, 8);
+  addKey("Sleep", Sleep_Key, 0x03, 8);
+  addKey("1", One_Key, 0x04, 8);
+  addKey("2", Two_Key, 0x05, 8);
+  addKey("3", Three_Key, 0x06, 8);
+  addKey("Volume Up", VolumeUp_Key, 0x07, 8);
+  addKey("4", Four_Key, 0x08, 8);
+  addKey("5", Five_Key, 0x09, 8);
+  addKey("6", Six_Key, 0x0A, 8);
+  addKey("Volume Down", VolumeDown_Key, 0x0B, 8);
+  addKey("7", Seven_Key, 0x0C, 8);
+  addKey("8", Eight_Key, 0x0D, 8);
+  addKey("9", Nine_Key, 0x0E, 8);
+  addKey("Mute", Mute_Key, 0x0F, 8);
+  addKey("Channel Down", ChannelDown_Key, 0x10, 8);
+  addKey("0", Zero_Key, 0x11, 8);
+  addKey("Channel Up", ChannelUp_Key, 0x12, 8);
+  addKey("PrevCh", PrevChannel_Key, 0x13, 8);
+  addKey("Green", Green_Key, 0x14, 8);
+  addKey("Yellow", Yellow_Key, 0x15, 8);
+  addKey("Blue", Blue_Key, 0x16, 8);
+  addKey("Menu", Menu_Key, 0x1A, 8);
+  addKey("tv", Unmapped_Key, 0x1B, 8);
+  addKey("Display", Info_Key, 0x1F, 8);
+  addKey("PIP", PIP_Key, 0x20, 8);
+  addKey("Swap", PIPSwap_Key, 0x21, 8);
+  addKey("position", PIPMove_Key, 0x22, 8);
+  addKey("-/--", DoubleDigit_Key, 0x23, 8);
+  addKey("+100", PlusOneHundred_Key, 0x23, 8);
+  addKey("DASH", Dash_Key, 0x23, 8);
+  addKey("PIP.SOURCE", PIPSource_Key, 0x24, 8);
+  addKey("Closed Captions", Captions_Key, 0x25, 8); // "SUBTITLE"
+  addKey("AD", Unmapped_Key, 0x27, 8);
+  addKey("PMode", PictureMode_Key, 0x28, 8); // "p.std"
+  addKey("SMode", SoundMode_Key, 0x2B, 8);
+  addKey("ttx/mix", Teletext_Key, 0x2C, 8); // "teletext"
+  addKey("Exit", Exit_Key, 0x2D, 8);
+  addKey("size", AspectRatio_Key, 0x2F, 8);
+  addKey("ch.scan", PIPScan_Key, 0x31, 8);  // "h.scan"
+  addKey("PIP.chan+", PIPChannelUp_Key, 0x32, 8); // "AUDCH_UP"
+  addKey("PIP.chan-", PIPChannelDown_Key, 0x33, 8); // "AUDCH_DOWN"
+  addKey("ANTENNA", Unmapped_Key, 0x36, 8);
+  addKey("surf", Unmapped_Key, 0x3D, 8); // "r.surf"
+  addKey("PSize", PIPSize_Key, 0x3E, 8);
+  addKey("STILL", PIPPause_Key, 0x42, 8);
+  addKey("TV-DTV", Unmapped_Key, 0x43, 8);
+  addKey("FAV-CH", Favorites_Key, 0x44, 8);
+  addKey("Rewind", Rewind_Key, 0x45, 8);
+  addKey("Stop", Stop_Key, 0x46, 8);
+  addKey("Play/Pause", Play_Key, 0x47, 8);
+  addKey("Play/Pause", Pause_Key, 0x47, 8);
+  addKey("Fast Forward", FastForward_Key, 0x48, 8);
+  addKey("Record", Record_Key, 0x49, 8);
+  addKey("Tools", Unmapped_Key, 0x4B, 8);
+  addKey("Guide", Guide_Key, 0x4F, 8);
+  addKey("RETURN", Unmapped_Key, 0x58, 8);
+  addKey("Up", Up_Key, 0x60, 8);
+  addKey("Down", Down_Key, 0x61, 8);
+  addKey("Right", Right_Key, 0x62, 8);
+  addKey("Left", Left_Key, 0x65, 8);
+  addKey("Enter", Select_Key, 0x68, 8);
+  addKey("pc", Unmapped_Key, 0x69, 8);
+  addKey("ch-mgr", Unmapped_Key, 0x6B, 8); // "CH_LIST"
+  addKey("Red", Red_Key, 0x6C, 8);
+  addKey("srs", Surround_Key, 0x6E, 8);
+  addKey("E.SAVING", Unmapped_Key, 0x77, 8);
+  addKey("Content", Unmapped_Key, 0x79, 8);
+  addKey("HDMI", Unmapped_Key, 0x8B, 8);
+  addKey("WISELINK", Unmapped_Key, 0x8C, 8); // "W.Link", "Media.P"
+  addKey("D.MENU", DiscMenu_Key, 0x8E, 8);
+  addKey("Internet", Unmapped_Key, 0x93, 8);
+  addKey("E.Mode", Unmapped_Key, 0x94, 8);
+  addKey("ANYNET", Unmapped_Key, 0x97, 8);
+
+//  addKey("turbo", Unmapped_Key, 0xA659, 16);
 }
 
 
@@ -115,10 +117,10 @@ SamsungTV1a::SamsungTV1a(
 {
   setKeysetName("TV Keyset 1a");
 
-  addKey("turbo", Unmapped_Key, 0xC837, 16);
-  addKey("s.menu", SoundMode_Key, 0x28D7, 16);
-  addKey("s.std", Unmapped_Key, 0xA857, 16);
-  addKey("p.std", Unmapped_Key, 0x6897, 16);
+  addKey("turbo", Unmapped_Key, 0x13, 8);
+  addKey("s.menu", SoundMode_Key, 0x14, 8);
+  addKey("s.std", Unmapped_Key, 0x15, 8);
+  addKey("p.std", Unmapped_Key, 0x16, 8);
 }
 
 
@@ -129,8 +131,8 @@ SamsungTV1b::SamsungTV1b(
 {
   setKeysetName("TV Keyset 1b");
 
-  addKey("Red", Red_Key, 0x847B, 16);
-  addKey("Exit", Exit_Key, 0x34CB, 16);
+  addKey("Red", Red_Key, 0x21, 8);
+  addKey("Exit", Exit_Key, 0x2C, 8);
 }
 
 
@@ -142,11 +144,11 @@ SamsungTV1c::SamsungTV1c(
   setKeysetName("TV Keyset 1c");
 
   // Some remotes apparently use channel and volume keys for navigation:
-  addKey("up", Up_Key, 0x48B7, 16);
-  addKey("down", Down_Key, 0x08F7, 16);
-  addKey("left", Left_Key, 0xD02F, 16);
-  addKey("right", Right_Key, 0xE01F, 16);
-  addKey("center", Unmapped_Key, 0x58A7, 16);
+  addKey("right", Right_Key, 0x07, 8);
+  addKey("left", Left_Key, 0x0B, 8);
+  addKey("down", Down_Key, 0x10, 8);
+  addKey("up", Up_Key, 0x12, 8);
+  addKey("center", Unmapped_Key, 0x1A, 8);
 }
 
 
@@ -157,7 +159,7 @@ SamsungTV1d::SamsungTV1d(
 {
   setKeysetName("TV Keyset 1d");
 
-  addKey("turbo", Unmapped_Key, 0x26D9, 16);
+  addKey("turbo", Unmapped_Key, 0x64, 8);
 }
 
 
@@ -168,7 +170,7 @@ SamsungTV1e::SamsungTV1e(
 {
   setKeysetName("TV Keyset 1e");
 
-  addKey("p.mode", PictureMode_Key, 0x6897, 16);
+  addKey("p.mode", PictureMode_Key, 0x16, 8);
 }
 
 
@@ -180,10 +182,10 @@ SamsungTV1f::SamsungTV1f(
 {
   setKeysetName("TV Keyset 1f");
 
-  addKey("p-mode", PictureMode_Key, 0x36C9, 16);
-  addKey("s-mode", SoundMode_Key, 0x28D7, 16);
-  addKey("still", Unmapped_Key, 0xA857, 16);
-  addKey("p-size", AspectRatio_Key, 0x6897, 16);
+  addKey("p-mode", PictureMode_Key, 0x6C, 8);
+  addKey("s-mode", SoundMode_Key, 0x14, 8);
+  addKey("still", PIPPause_Key, 0x15, 8);
+  addKey("p-size", PIPSize_Key, 0x16, 8);
 }
 
 
@@ -192,7 +194,7 @@ SamsungTV2::SamsungTV2(
   QObject *guiObject,
   unsigned int index)
   : PIRKeysetMetaData(
-      "TV Keyset 2 (dubious)",
+      "TV Keyset 2",
       Samsung_Make,
       index)
 {
@@ -222,7 +224,7 @@ SamsungTV2::SamsungTV2(
   addKey("CH/P_UP", ChannelUp_Key, 0x0010, 13);
   addKey("CH/P_DOWN", ChannelDown_Key, 0x0011, 13);
   addKey("Menu", Menu_Key, 0x0012, 13);
-  addKey("TTX/MIX", Unmapped_Key, 0x103C, 13);
+  addKey("TTX/MIX", Teletext_Key, 0x103C, 13);
   addKey("Red", Red_Key, 0x002B, 13);
   addKey("Green", Green_Key, 0x002C, 13);
   addKey("Yellow", Yellow_Key, 0x002D, 13);
@@ -264,7 +266,8 @@ SamsungVCR1::SamsungVCR1(
     index,
     600, 500,
     600, 1650,
-    113837, true);
+    113837, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -286,7 +289,7 @@ SamsungVCR1::SamsungVCR1(
   addKey("Eight", Eight_Key, 0xB04F, 16);
   addKey("Nine", Nine_Key, 0x708F, 16);
   addKey("Zero", Zero_Key, 0x8877, 16);
-  addKey("Clear", Clear_Key, 0xB847, 16); // "CNT.RESET"
+  addKey("Clear", Reset_Key, 0xB847, 16); // "CNT.RESET"
   addKey("Rewind", Rewind_Key, 0x18E7, 16);
   addKey("Stop", Stop_Key, 0xA857, 16);
   addKey("Play", Play_Key, 0x9867, 16);
@@ -295,7 +298,7 @@ SamsungVCR1::SamsungVCR1(
   addKey("Menu", Menu_Key, 0xF807, 16);
   addKey("Captions", Captions_Key, 0x44BB, 16);
   addKey("Info", Info_Key, 0x7887, 16); // "display"
-  addKey("Exit", Exit_Key, 0xB847, 16);
+//  addKey("Exit", Exit_Key, 0xB847, 16);
   addKey("Up", Up_Key, 0xF40B, 16);
   addKey("Down", Down_Key, 0x946B, 16);
   addKey("Left", Left_Key, 0xBE41, 16);
@@ -323,8 +326,8 @@ SamsungVCR1::SamsungVCR1(
   addKey("BAND", Unmapped_Key, 0x621D, 16);
   addKey("Q_PRO", Unmapped_Key, 0x5E21, 16);
   addKey("SHOWVIEW", Unmapped_Key, 0x0679, 16);
-  addKey("SLOW_DOWN", Unmapped_Key, 0x740B, 16);
-  addKey("SLOW_UP", Unmapped_Key, 0x641B, 16);
+  addKey("SLOW_DOWN", SlowMinus_Key, 0x740B, 16);
+  addKey("SLOW_UP", SlowPlus_Key, 0x641B, 16);
   addKey("PRESET", Unmapped_Key, 0x5629, 16);
 }
 
@@ -338,10 +341,10 @@ SamsungVCR1a::SamsungVCR1a(
 
   addKey("power", Power_Key, 0x12ED, 16);
   addKey("clear", Clear_Key, 0x8C73, 16);
-  addKey("audio", Language_Key, 0xBC43, 16);
+  addKey("audio", Audio_Key, 0xBC43, 16);
   addKey("dvd", Unmapped_Key, 0xAA55, 16);
   addKey("vcr", Unmapped_Key, 0x14EB, 16);
-  addKey("input_sel", Unmapped_Key, 0x9A65, 16);
+  addKey("input_sel", Input_Key, 0x9A65, 16);
   addKey("menu", Menu_Key, 0x16E9, 16);
   addKey("up", Up_Key, 0x34CB, 16);
   addKey("down", Down_Key, 0xB44B, 16);
@@ -361,12 +364,12 @@ SamsungVCR1b::SamsungVCR1b(
 {
   setKeysetName("VCR(DVD) Keyset 1b");
 
-  addKey("audio", Language_Key, 0x44BB, 16); // "output"
+  addKey("audio", Audio_Key, 0x44BB, 16); // "output"
   addKey("Input", Input_Key, 0x24DB, 16);
   addKey("+", Unmapped_Key, 0x649B, 16);
   addKey("-", Unmapped_Key, 0x14EB, 16);
-  addKey("slowup", Unmapped_Key, 0xC837, 16);
-  addKey("slowdown", Unmapped_Key, 0xE817, 16);
+  addKey("slowup", SlowPlus_Key, 0xC837, 16);
+  addKey("slowdown", SlowMinus_Key, 0xE817, 16);
   addKey("reset", Clear_Key, 0xB847, 16); // "CLR/RST"
   addKey("pause", Pause_Key, 0x6897, 16); // "P/S"
   addKey("shuttle<", Unmapped_Key, 0xBE41, 16);
@@ -429,7 +432,7 @@ SamsungVCR1d::SamsungVCR1d(
   addKey("VOL-", VolumeDown_Key, 0xD02F, 16);
   addKey("PRE-CH", PrevChannel_Key, 0x54AB, 16);
   addKey("P./STILL", Pause_Key, 0x6897, 16);
-  addKey("REPEAT", Unmapped_Key, 0xEC13, 16);
+  addKey("REPEAT", Repeat_Key, 0xEC13, 16);
   addKey("TRK+", TrackingPlus_Key, 0xB44B, 16);
   addKey("TRK-", TrackingMinus_Key, 0x34CB, 16);
 }
@@ -443,15 +446,15 @@ SamsungVCR1e::SamsungVCR1e(
   setKeysetName("VCR(DVD) Keyset 1e");
 
   addKey("OPEN/CLOSE", Eject_Key, 0x4CB3, 16);
-  addKey("AUDIO", Unmapped_Key, 0x16E9, 16);
-  addKey("MODE/REPEAT", Unmapped_Key, 0x6699, 16);
-  addKey("ZOOM", Unmapped_Key, 0x5CA3, 16);
-  addKey("CLOCK/COUNTER", Unmapped_Key, 0x8C73, 16);
-  addKey("ANGLE", Unmapped_Key, 0x2AD5, 16);
+  addKey("AUDIO", Audio_Key, 0x16E9, 16);
+  addKey("MODE/REPEAT", Repeat_Key, 0x6699, 16);
+  addKey("ZOOM", Zoom_Key, 0x5CA3, 16);
+  addKey("CLOCK/COUNTER", Clock_Key, 0x8C73, 16);
+  addKey("ANGLE", Angle_Key, 0x2AD5, 16);
   addKey("3D_SOUND", Surround_Key, 0x649B, 16);
   addKey("DVD", Unmapped_Key, 0xAA55, 16);
   addKey("VCR", Unmapped_Key, 0x14EB, 16);
-  addKey("INPUT_SEL", Unmapped_Key, 0x9A65, 16);
+  addKey("INPUT_SEL", Input_Key, 0x9A65, 16);
   addKey("DIGEST", Unmapped_Key, 0x00FF, 16);
   addKey("TRK_UP", TrackingPlus_Key, 0xC639, 16);
   addKey("TRK_DOWN", TrackingMinus_Key, 0x02FD, 16);
@@ -480,7 +483,8 @@ SamsungDVD1::SamsungDVD1(
     index,
     600, 500,
     600, 1600,
-    108000, true);
+    108000, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -525,10 +529,10 @@ SamsungDVD1::SamsungDVD1(
   addKey("enter", Select_Key, 0xD926, 16);
   addKey("ez_view", Unmapped_Key, 0xF50A, 16); // s.fit
   addKey("subtitle", Captions_Key, 0x09F6, 16);
-  addKey("audio", Language_Key, 0x718E, 16);
-  addKey("angle", Unmapped_Key, 0x49B6, 16);
-  addKey("repeat", Unmapped_Key, 0xB946, 16);
-  addKey("repeat_A-B", Unmapped_Key, 0x15EA, 16);
+  addKey("audio", Audio_Key, 0x718E, 16);
+  addKey("angle", Angle_Key, 0x49B6, 16);
+  addKey("repeat", Repeat_Key, 0xB946, 16);
+  addKey("repeat_A-B", RepeatAB_Key, 0x15EA, 16);
   addKey("step_r", StepForward_Key, 0xEB14, 16);
   addKey("step_l", StepBack_Key, 0x1BE4, 16);
   addKey("jog_r", Unmapped_Key, 0x936C, 16);
@@ -537,12 +541,12 @@ SamsungDVD1::SamsungDVD1(
   addKey("bookmark", Unmapped_Key, 0x956A, 16);
   addKey("index_pre", Unmapped_Key, 0x837C, 16);
   addKey("index_next", Unmapped_Key, 0x639C, 16);
-  addKey("page_pre", Unmapped_Key, 0x23DC, 16);
-  addKey("page_next", Unmapped_Key, 0x639C, 16);
-  addKey("zoom", Unmapped_Key, 0x35CA, 16);
+  addKey("page_pre", PageUp_Key, 0x23DC, 16);
+  addKey("page_next", PageDown_Key, 0x639C, 16);
+  addKey("zoom", Zoom_Key, 0x35CA, 16);
   addKey("hdmi_sel", Unmapped_Key, 0xE41B, 16);
   addKey("video_sel", Unmapped_Key, 0x44BB, 16);
-  addKey("3D_Sound", Unmapped_Key, 0xD52A, 16);
+  addKey("3D_Sound", Surround_Key, 0xD52A, 16);
   addKey("TopMenu", DiscTitle_Key, 0xC936, 16);
 }
 
@@ -565,7 +569,7 @@ SamsungDVD1b::SamsungDVD1b(
 {
   setKeysetName("DVD Keyset 1b");
 
-  addKey("Zoom", Unmapped_Key, 0x55AA, 16);
+  addKey("Zoom", Zoom_Key, 0x55AA, 16);
   addKey("i.replay", Replay_Key, 0xB54A, 16);
   addKey("Volume_Con", Unmapped_Key, 0x35CA, 16);
 }
@@ -584,7 +588,8 @@ SamsungDVD2::SamsungDVD2(
     index,
     600, 500,
     600, 1600,
-    108000, true);
+    108000, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -629,9 +634,9 @@ SamsungDVD2::SamsungDVD2(
   addKey("SUBTITLE", Captions_Key, 0x708F, 16);
   addKey("MENU", Menu_Key, 0x6C93, 16);
   addKey("INFO", Info_Key, 0x649B, 16);
-  addKey("AUDIO", Language_Key, 0x609F, 16);
+  addKey("AUDIO", Audio_Key, 0x609F, 16);
   addKey("RETURN", Exit_Key, 0x38C7, 16);
-  addKey("ZOOM", Unmapped_Key, 0xF00F, 16);
+  addKey("ZOOM", Zoom_Key, 0xF00F, 16);
   addKey("MUSIC", Unmapped_Key, 0x24DB, 16);
   addKey("MOVIE", Unmapped_Key, 0x16E9, 16);
   addKey("ASC", Unmapped_Key, 0x9669, 16);
@@ -640,9 +645,9 @@ SamsungDVD2::SamsungDVD2(
   addKey("PLII-MODE", Unmapped_Key, 0x20DF, 16);
   addKey("PLII-EFFECT", Unmapped_Key, 0x30CF, 16);
   addKey("SOUND-EDIT", SoundMode_Key, 0x28D7, 16);
-  addKey("STEP", Unmapped_Key, 0xBC43, 16);
-  addKey("REPEAT", Unmapped_Key, 0x6699, 16);
-  addKey("SLOW", Unmapped_Key, 0xAC53, 16);
+  addKey("STEP", StepForward_Key, 0xBC43, 16);
+  addKey("REPEAT", Repeat_Key, 0x6699, 16);
+  addKey("SLOW", Slow_Key, 0xAC53, 16);
   addKey("LOGO", Unmapped_Key, 0x1CE3, 16);
   addKey("HDMI-AUDIO", Unmapped_Key, 0x0EF1, 16);
   addKey("SD-HD", AspectRatio_Key, 0x9A65, 16);
@@ -663,7 +668,8 @@ SamsungAC1::SamsungAC1(
     index,
     600, 500,
     600, 1600,
-    60000, true);
+    60000, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -674,16 +680,16 @@ SamsungAC1::SamsungAC1(
 
 //  np->setMinimumRepetitions(1);
 
-  addKey("TIMER", Unmapped_Key, 0xA4, 8);
+  addKey("TIMER", Timer_Key, 0xA4, 8);
   addKey("SLEEP", Sleep_Key, 0xE4, 8);
-  addKey("TEMP+", Unmapped_Key, 0x4C, 8);
-  addKey("TEMP-", Unmapped_Key, 0x8C, 8);
-  addKey("FAN", Unmapped_Key, 0x9C, 8);
-  addKey("COOL", Unmapped_Key, 0x3C, 8);
-  addKey("HEAT", Unmapped_Key, 0x5C, 8);
-  addKey("FAN_HIGH", Unmapped_Key, 0xEC, 8);
-  addKey("FAN_MED", Unmapped_Key, 0x6C, 8);
-  addKey("FAN_LOW", Unmapped_Key, 0xAC, 8);
-  addKey("SWING", Unmapped_Key, 0x94, 8);
+  addKey("TEMP+", VolumeUp_Key, 0x4C, 8);
+  addKey("TEMP-", VolumeDown_Key, 0x8C, 8);
+  addKey("FAN", One_Key, 0x9C, 8);
+  addKey("COOL", Two_Key, 0x3C, 8);
+  addKey("HEAT", Three_Key, 0x5C, 8);
+  addKey("FAN_HIGH", Four_Key, 0xEC, 8);
+  addKey("FAN_MED", Five_Key, 0x6C, 8);
+  addKey("FAN_LOW", Six_Key, 0xAC, 8);
+  addKey("SWING", Seven_Key, 0x94, 8);
   addKey("POWER", Power_Key, 0xFC, 8);
 }
index bd70260..aca49c2 100644 (file)
@@ -13,55 +13,56 @@ SanyoVCR1::SanyoVCR1(
   addControlledDevice(Sanyo_Make, "DVW-5000", VCR_Device);
   addControlledDevice(Sanyo_Make, "DVW-5000", DVD_Device);
 
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x8C73, 16);
-
-  addKey("Power", Power_Key, 0xDA25, 16);
-  addKey("1", One_Key, 0x20DF, 16);
-  addKey("2", Two_Key, 0xA05F, 16);
-  addKey("3", Three_Key, 0x609F, 16);
-  addKey("4", Four_Key, 0xE01F, 16);
-  addKey("5", Five_Key, 0x30CF, 16);
-  addKey("6", Six_Key, 0xB04F, 16);
-  addKey("7", Seven_Key, 0x708F, 16);
-  addKey("8", Eight_Key, 0xF00F, 16);
-  addKey("9", Nine_Key, 0x38C7, 16);
-  addKey("0", Zero_Key, 0xB847, 16);
-  addKey("Cancel", Clear_Key, 0x52AD, 16);
-  addKey("Ch Up", ChannelUp_Key, 0x807F, 16);
-  addKey("Ch Down", ChannelDown_Key, 0x40BF, 16);
-  addKey("Rew", Rewind_Key, 0x48B7, 16);
-  addKey("Play", Play_Key, 0x28D7, 16);
-  addKey("FF", FastForward_Key, 0xC837, 16);
-  addKey("Rec", Record_Key, 0xA857, 16);
-  addKey("Stop", Stop_Key, 0x08F7, 16);
-  addKey("Pause", Pause_Key, 0x8877, 16);
-  addKey("TV/VCR", Input_Key, 0x10EF, 16);
-  addKey("Menu", Menu_Key, 0x53AC, 16);
-  addKey("Up", Up_Key, 0xE916, 16);
-  addKey("Down", Down_Key, 0x6996, 16);
-  addKey("Left", Left_Key, 0xA956, 16);
-  addKey("Right", Right_Key, 0x29D6, 16);
-  addKey("Ok", Select_Key, 0xD22D, 16);
-  addKey("Clock", Clock_Key, 0x6A95, 16);
-  addKey("Reset", Reset_Key, 0x22DD, 16);
-  addKey("Display", Info_Key, 0x32CD, 16);
-  addKey("Memory", Unmapped_Key, 0xC23D, 16); // "->0<-"
-  addKey("PROG", Program_Key, 0x629D, 16);
-  addKey("BLANK", Unmapped_Key, 0x0BF4, 16);
-  addKey("Monitor", Unmapped_Key, 0x8A75, 16);
-  addKey("ShowView", Unmapped_Key, 0x31CE, 16);
-  addKey("ATR", Unmapped_Key, 0xF807, 16);
-  addKey("Slow", Unmapped_Key, 0x58A7, 16);
-  addKey("SP/LP", VHSSpeed_Key, 0x7A85, 16);
-  addKey("VPS", Unmapped_Key, 0xF20D, 16); // "vps/pdc", "dpc"
-  addKey("Preset", Unmapped_Key, 0x7986, 16);
-  addKey("Input", Unmapped_Key, 0x7887, 16);  // need a subclass for this?
-  addKey("Audio", Language_Key, 0xC03F, 16);
-  addKey("Index", Unmapped_Key, 0x9867, 16);
-  addKey("+100", PlusOneHundred_Key, 0xD827, 16);
-  addKey("x2", Unmapped_Key, 0xD02F, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0x8C73, 16);
+  setPreData(0x31, 8);
+
+  addKey("Ch Up", ChannelUp_Key, 0x01, 8);
+  addKey("Ch Down", ChannelDown_Key, 0x02, 8);
+  addKey("Audio", Audio_Key, 0x03, 8);
+  addKey("1", One_Key, 0x04, 8);
+  addKey("2", Two_Key, 0x05, 8);
+  addKey("3", Three_Key, 0x06, 8);
+  addKey("4", Four_Key, 0x07, 8);
+  addKey("TV/VCR", Input_Key, 0x08, 8);
+  addKey("x2", Unmapped_Key, 0x0B, 8);
+  addKey("5", Five_Key, 0x0C, 8);
+  addKey("6", Six_Key, 0x0D, 8);
+  addKey("7", Seven_Key, 0x0E, 8);
+  addKey("8", Eight_Key, 0x0F, 8);
+  addKey("Stop", Stop_Key, 0x10, 8);
+  addKey("Pause", Pause_Key, 0x11, 8);
+  addKey("Rew", Rewind_Key, 0x12, 8);
+  addKey("FF", FastForward_Key, 0x13, 8);
+  addKey("Play", Play_Key, 0x14, 8);
+  addKey("Rec", Record_Key, 0x15, 8);
+  addKey("Index", Unmapped_Key, 0x19, 8);
+  addKey("Slow", Slow_Key, 0x1A, 8);
+  addKey("+100", PlusOneHundred_Key, 0x1B, 8);
+  addKey("9", Nine_Key, 0x1C, 8);
+  addKey("0", Zero_Key, 0x1D, 8);
+  addKey("Input", Unmapped_Key, 0x1E, 8);  // need a subclass for this?
+  addKey("ATR", Unmapped_Key, 0x1F, 8);
+  addKey("Memory", Unmapped_Key, 0x43, 8); // "->0<-"
+  addKey("Reset", Reset_Key, 0x44, 8);
+  addKey("PROG", Program_Key, 0x46, 8);
+  addKey("Cancel", Clear_Key, 0x4A, 8);
+  addKey("Ok", Select_Key, 0x4B, 8);
+  addKey("Display", Info_Key, 0x4C, 8);
+  addKey("VPS", Unmapped_Key, 0x4F, 8); // "vps/pdc", "dpc"
+  addKey("Monitor", Unmapped_Key, 0x51, 8);
+  addKey("Clock", Clock_Key, 0x56, 8);
+  addKey("Power", Power_Key, 0x5B, 8);
+  addKey("SP/LP", VHSSpeed_Key, 0x5E, 8);
+  addKey("ShowView", Unmapped_Key, 0x8C, 8);
+  addKey("Right", Right_Key, 0x94, 8);
+  addKey("Left", Left_Key, 0x95, 8);
+  addKey("Down", Down_Key, 0x96, 8);
+  addKey("Up", Up_Key, 0x97, 8);
+  addKey("Preset", Unmapped_Key, 0x9E, 8);
+  addKey("Menu", Menu_Key, 0xCA, 8);
+  addKey("BLANK", Unmapped_Key, 0xD0, 8);
 }
 
 
@@ -75,54 +76,55 @@ SanyoDVD1::SanyoDVD1(
 {
   addControlledDevice(Sanyo_Make, "DVD-SL25", DVD_Device);
 
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x3C23, 16);
-
-  addKey("On", Power_Key, 0x00FF, 16);
-  addKey("LastMemo", Unmapped_Key, 0xF40B, 16);
-  addKey("PictureMode", PictureMode_Key, 0x5CA3, 16);
-  addKey("OpenClose", Eject_Key, 0x807F, 16);
-  addKey("ProgramRandom", Random_Key, 0x9C63, 16);
-  addKey("Repeat", Repeat_Key, 0xAC53, 16);
-  addKey("ABRepeat", Unmapped_Key, 0x6C93, 16);
-  addKey("OnScreen", Unmapped_Key, 0xC03F, 16);
-  addKey("Zoom", Unmapped_Key, 0xDC23, 16);
-  addKey("Angle", Unmapped_Key, 0x10EF, 16);
-  addKey("AngleReplay", Unmapped_Key, 0x906F, 16);
-  addKey("SubtitleChange", Unmapped_Key, 0xA05F, 16);
-  addKey("Setup", Menu_Key, 0x40BF, 16);
-  addKey("Menu", DiscMenu_Key, 0xE01F, 16);
-  addKey("SubtitleOnOff", Captions_Key, 0x52AD, 16);
-  addKey("Audio", Language_Key, 0x50AF, 16);
-  addKey("Up", Up_Key, 0xD02F, 16);
-  addKey("Down", Down_Key, 0x30CF, 16);
-  addKey("Left", Left_Key, 0xB04F, 16);
-  addKey("Right", Right_Key, 0x708F, 16);
-  addKey("Enter", Select_Key, 0xF00F, 16);
-  addKey("TopMenu", DiscTitle_Key, 0x609F, 16);
-  addKey("Return", Exit_Key, 0x08F7, 16);
-  addKey("RevSlow", StepBack_Key, 0x34CB, 16);
-  addKey("FwdSlow", StepForward_Key, 0x946B, 16);
-  addKey("PauseStep", Pause_Key, 0x04FB, 16);
-  addKey("Stop", Stop_Key, 0x7887, 16);
-  addKey("Play", Play_Key, 0xF807, 16);
-  addKey("Prev", Previous_Key, 0x44BB, 16);
-  addKey("Next", Next_Key, 0x847B, 16);
-  addKey("Rev", Rewind_Key, 0x649B, 16);
-  addKey("Fwd", FastForward_Key, 0xC43B, 16);
-  addKey("1", One_Key, 0x8877, 16);
-  addKey("2", Two_Key, 0x48B7, 16);
-  addKey("3", Three_Key, 0xC837, 16);
-  addKey("4", Four_Key, 0x28D7, 16);
-  addKey("5", Five_Key, 0xA857, 16);
-  addKey("6", Six_Key, 0x6897, 16);
-  addKey("7", Seven_Key, 0xE817, 16);
-  addKey("8", Eight_Key, 0x18E7, 16);
-  addKey("9", Nine_Key, 0x9867, 16);
-  addKey("0", Zero_Key, 0x58A7, 16);
-  addKey("Clear", Clear_Key, 0x38C7, 16);
-  addKey("SearchMode", Unmapped_Key, 0x1CE3, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Extended_NEC);
+
+//  setPreData(0x3C23, 16);
+  setPreData(0xC43C, 16);
+
+  addKey("On", Power_Key, 0x00, 8);
+  addKey("OpenClose", Eject_Key, 0x01, 8);
+  addKey("Setup", Menu_Key, 0x02, 8);
+  addKey("OnScreen", Unmapped_Key, 0x03, 8);
+  addKey("SubtitleChange", Unmapped_Key, 0x05, 8);
+  addKey("TopMenu", DiscTitle_Key, 0x06, 8);
+  addKey("Menu", DiscMenu_Key, 0x07, 8);
+  addKey("Angle", Angle_Key, 0x08, 8);
+  addKey("AngleReplay", Unmapped_Key, 0x09, 8);
+  addKey("Audio", Audio_Key, 0x0A, 8);
+  addKey("Up", Up_Key, 0x0B, 8);
+  addKey("Down", Down_Key, 0x0C, 8);
+  addKey("Left", Left_Key, 0x0D, 8);
+  addKey("Right", Right_Key, 0x0E, 8);
+  addKey("Enter", Select_Key, 0x0F, 8);
+  addKey("Return", Exit_Key, 0x10, 8);
+  addKey("1", One_Key, 0x11, 8);
+  addKey("2", Two_Key, 0x12, 8);
+  addKey("3", Three_Key, 0x13, 8);
+  addKey("4", Four_Key, 0x14, 8);
+  addKey("5", Five_Key, 0x15, 8);
+  addKey("6", Six_Key, 0x16, 8);
+  addKey("7", Seven_Key, 0x17, 8);
+  addKey("8", Eight_Key, 0x18, 8);
+  addKey("9", Nine_Key, 0x19, 8);
+  addKey("0", Zero_Key, 0x1A, 8);
+  addKey("Clear", Clear_Key, 0x1C, 8);
+  addKey("Stop", Stop_Key, 0x1E, 8);
+  addKey("Play", Play_Key, 0x1F, 8);
+  addKey("PauseStep", Pause_Key, 0x20, 8);
+  addKey("Next", Next_Key, 0x21, 8);
+  addKey("Prev", Previous_Key, 0x22, 8);
+  addKey("Fwd", FastForward_Key, 0x23, 8);
+  addKey("Rev", Rewind_Key, 0x26, 8);
+  addKey("FwdSlow", StepForward_Key, 0x29, 8);
+  addKey("RevSlow", StepBack_Key, 0x2C, 8);
+  addKey("LastMemo", Unmapped_Key, 0x2F, 8);
+  addKey("Repeat", Repeat_Key, 0x35, 8);
+  addKey("ABRepeat", RepeatAB_Key, 0x36, 8);
+  addKey("SearchMode", Unmapped_Key, 0x38, 8);
+  addKey("ProgramRandom", Random_Key, 0x39, 8);
+  addKey("PictureMode", PictureMode_Key, 0x3A, 8);
+  addKey("Zoom", Zoom_Key, 0x3B, 8);
+  addKey("SubtitleOnOff", Captions_Key, 0x4A, 8);
 }
 
 
@@ -134,46 +136,40 @@ SanyoTV1::SanyoTV1(
       Sanyo_Make,
       index)
 {
-  addControlledDevice(Sanyo_Make, "CTP-6791P", TV_Device);
-
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x1CE3, 16);
-
-  addKey("Power", Power_Key, 0x48B7, 16);
-  addKey("audio_mode", SoundMode_Key, 0x38C7, 16); // "auto"
-  addKey("video_mode", PictureMode_Key, 0xC837, 16);
-  addKey("1", One_Key, 0x807F, 16);
-  addKey("2", Two_Key, 0x40BF, 16);
-  addKey("3", Three_Key, 0xC03F, 16);
-  addKey("4", Four_Key, 0x20DF, 16);
-  addKey("5", Five_Key, 0xA05F, 16);
-  addKey("6", Six_Key, 0x609F, 16);
-  addKey("7", Seven_Key, 0xE01F, 16);
-  addKey("8", Eight_Key, 0x10EF, 16);
-  addKey("9", Nine_Key, 0x906F, 16);
-  addKey("0", Zero_Key, 0x00FF, 16);
-  addKey("Channel Up", ChannelUp_Key, 0x50AF, 16);
-  addKey("Channel Down", ChannelDown_Key, 0xD02F, 16);
-  addKey("Volume Up", VolumeUp_Key, 0x708F, 16);
-  addKey("Volume Down", VolumeDown_Key, 0xF00F, 16);
-  addKey("Mute", Mute_Key, 0x18E7, 16);
-  addKey("Display", Info_Key, 0x30CF, 16);
-  addKey("image", AspectRatio_Key, 0x8877, 16);
-  addKey("Menu", Menu_Key, 0xE817, 16); // "setup"
-  addKey("Enter", Select_Key, 0x58A7, 16); // "F/OK"
-  addKey("Sleep", Sleep_Key, 0xB04F, 16);
-  addKey("Recall", PrevChannel_Key, 0x9867, 16);
-  addKey("PIP", PIP_Key, 0xDA25, 16);
-  addKey("Swap", PIPSwap_Key, 0xBA45, 16);
-  addKey("Red", Red_Key, 0x926D, 16);
-  addKey("Green", Green_Key, 0x52AD, 16);
-  addKey("Yellow", Yellow_Key, 0xD22D, 16);
-  addKey("Blue", Blue_Key, 0x32CD, 16);
-  addKey("Menu +", Up_Key, 0x7887, 16);
-  addKey("Menu -", Down_Key, 0xF807, 16);
-  addKey("Digicon", Guide_Key, 0xB847, 16);
-  addKey("TV", Input_Key, 0x28D7, 16); // tv/video
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0x1CE3, 16);
+  setPreData(0x38, 8);
+
+  addKey("0", Zero_Key, 0x00, 8);
+  addKey("1", One_Key, 0x01, 8);
+  addKey("2", Two_Key, 0x02, 8);
+  addKey("3", Three_Key, 0x03, 8);
+  addKey("4", Four_Key, 0x04, 8);
+  addKey("5", Five_Key, 0x05, 8);
+  addKey("6", Six_Key, 0x06, 8);
+  addKey("7", Seven_Key, 0x07, 8);
+  addKey("8", Eight_Key, 0x08, 8);
+  addKey("9", Nine_Key, 0x09, 8);
+  addKey("Channel Up", ChannelUp_Key, 0x0A, 8);
+  addKey("Channel Down", ChannelDown_Key, 0x0B, 8);
+  addKey("Display", Info_Key, 0x0C, 8);
+  addKey("Sleep", Sleep_Key, 0x0D, 8);
+  addKey("Volume Up", VolumeUp_Key, 0x0E, 8);
+  addKey("Volume Down", VolumeDown_Key, 0x0F, 8);
+  addKey("image", Unmapped_Key, 0x11, 8);
+  addKey("Power", Power_Key, 0x12, 8);
+  addKey("video_mode", PictureMode_Key, 0x13, 8);
+  addKey("TV", Input_Key, 0x14, 8); // tv/video
+  addKey("Menu", Menu_Key, 0x17, 8); // "setup"
+  addKey("Recall", PrevChannel_Key, 0x19, 8);
+  addKey("Enter", Select_Key, 0x1A, 8); // "F/OK"
+  addKey("Red", Red_Key, 0x49, 8);
+  addKey("Green", Green_Key, 0x4A, 8);
+  addKey("Yellow", Yellow_Key, 0x4B, 8);
+  addKey("Blue", Blue_Key, 0x4C, 8);
+  addKey("PIP", PIP_Key, 0x5B, 8);
+  addKey("Swap", PIPSwap_Key, 0x5D, 8);
 }
 
 
@@ -193,28 +189,28 @@ SanyoTV1a::SanyoTV1a(
 //  addControlledDevice(Sanyo_Make, "CEM6011PV", TV_Device);
 //  addControlledDevice(Sanyo_Make, "DP32746", TV_Device);
 
-  addKey("POWER", Power_Key, 0x38C7, 16);
-  addKey("WIDE", AspectRatio_Key, 0xC23D, 16);
-  addKey("-/--", DoubleDigit_Key, 0x50AF, 16);
-  addKey("CS", Unmapped_Key, 0xD02F, 16); // 2-
-  addKey("OSD", Info_Key, 0x18E7, 16); // "SYMBOL_1
-  addKey("NORMAL", Unmapped_Key, 0x8877, 16); // "SYMBOL_2"
-  addKey("MUTE", Mute_Key, 0xA857, 16);
-  addKey("P--P", Unmapped_Key, 0xB847, 16); // "ALTERNATE"
-  addKey("MENU", Menu_Key, 0x8A75, 16);
-  addKey("P+", ChannelUp_Key, 0x30CF, 16);
-  addKey("UP", Up_Key, 0x30CF, 16);
-  addKey("P-", ChannelDown_Key, 0xB04F, 16);
-  addKey("DOWN", Down_Key, 0xB04F, 16);
-  addKey("VOL-", VolumeDown_Key, 0xE817, 16);
-  addKey("LEFT", Left_Key, 0xE817, 16);
-  addKey("VOL+", VolumeUp_Key, 0x6897, 16);
-  addKey("RIGHT", Right_Key, 0x6897, 16);
-  addKey("CLOCK", Sleep_Key, 0x9867, 16); // "SLEEP/ON-TIMER/TEXT_CANCEL"
-  addKey("EXPAND", Unmapped_Key, 0x6A95, 16); // "SYMBOL_4" teletext
-  addKey("SHRINK", Unmapped_Key, 0x728D, 16); // "SYMBOL_5" teletext
-  addKey("TXT/TV", Unmapped_Key, 0x629D, 16); // teletext
-  addKey("A-B", Language_Key, 0x02FD, 16); //?
+  addKey("-/--", DoubleDigit_Key, 0x0A, 8);
+  addKey("CS", Unmapped_Key, 0x0B, 8); // 2-
+  addKey("P+", ChannelUp_Key, 0x0C, 8);
+  addKey("UP", Up_Key, 0x0C, 8);
+  addKey("P-", ChannelDown_Key, 0x0D, 8);
+  addKey("DOWN", Down_Key, 0x0D, 8);
+  addKey("NORMAL", Unmapped_Key, 0x11, 8); // "SYMBOL_2"
+  addKey("MUTE", Mute_Key, 0x15, 8);
+  addKey("VOL+", VolumeUp_Key, 0x16, 8);
+  addKey("RIGHT", Right_Key, 0x16, 8);
+  addKey("VOL-", VolumeDown_Key, 0x17, 8);
+  addKey("LEFT", Left_Key, 0x17, 8);
+  addKey("OSD", Info_Key, 0x18, 8); // "SYMBOL_1
+  addKey("CLOCK", Sleep_Key, 0x19, 8); // "SLEEP/ON-TIMER/TEXT_CANCEL"
+  addKey("POWER", Power_Key, 0x1C, 8);
+  addKey("P--P", PrevChannel_Key, 0x1D, 8); // "ALTERNATE"
+  addKey("A-B", Unmapped_Key, 0x40, 8); //?
+  addKey("WIDE", Unmapped_Key, 0x43, 8);
+  addKey("TXT/TV", Teletext_Key, 0x46, 8); // teletext
+  addKey("SHRINK", Unmapped_Key, 0x4E, 8); // "SYMBOL_5" teletext
+  addKey("EXPAND", Unmapped_Key, 0x56, 8); // "SYMBOL_4" teletext
+  addKey("MENU", Menu_Key, 0x51, 8);
 }
 
 
@@ -225,8 +221,9 @@ SanyoTV1b::SanyoTV1b(
 {
   setKeysetName("TV Keyset 1b");
 
-  addKey("Reset", Reset_Key, 0x38C7, 16);
-  addKey("Closed Captions", Captions_Key, 0x8877, 16);
+  addKey("Mute", Mute_Key, 0x18, 8);
+  addKey("Reset", Reset_Key, 0x1C, 8);
+  addKey("Closed Captions", Captions_Key, 0x11, 8);
 }
 
 
@@ -237,7 +234,9 @@ SanyoTV1c::SanyoTV1c(
 {
   setKeysetName("TV Keyset 1c");
 
-  addKey("tv/vid", Input_Key, 0xC837, 16);
+  addKey("Mute", Mute_Key, 0x18, 8);
+  addKey("tv/vid", Input_Key, 0x13, 8);
+  addKey("Reset", Reset_Key, 0x1C, 8);
 }
 
 
@@ -248,16 +247,33 @@ SanyoTV1d::SanyoTV1d(
 {
   setKeysetName("TV Keyset 1d");
 
-  addKey("prg_scan", Scan_Key, 0x08F7, 16);
-  addKey("tuning_<", ChannelDown_Key, 0xC837, 16);
-  addKey("tuning_>", ChannelUp_Key, 0x48B7, 16);
-  addKey("colour_<", Unmapped_Key, 0xD827, 16);
-  addKey("colour_>", Unmapped_Key, 0x58A7, 16);
-  addKey("bright_<", Unmapped_Key, 0xF807, 16);
-  addKey("bright_>", Unmapped_Key, 0x7887, 16);
-  addKey("contrast_<", Unmapped_Key, 0xF00F, 16);
-  addKey("contrast_>", Unmapped_Key, 0x708F, 16);
-  addKey("clear_screen", Unmapped_Key, 0x18E7, 16);
+  addKey("contrast_>", Unmapped_Key, 0x0E, 8);
+  addKey("contrast_<", Unmapped_Key, 0x0F, 8);
+  addKey("prg_scan", Scan_Key, 0x10, 8);
+  addKey("tuning_>", ChannelUp_Key, 0x12, 8);
+  addKey("tuning_<", ChannelDown_Key, 0x13, 8);
+  addKey("clear_screen", Unmapped_Key, 0x18, 8);
+  addKey("colour_>", Unmapped_Key, 0x1A, 8);
+  addKey("colour_<", Unmapped_Key, 0x1B, 8);
+  addKey("bright_>", Unmapped_Key, 0x1E, 8);
+  addKey("bright_<", Unmapped_Key, 0x1F, 8);
+}
+
+
+SanyoTV1e::SanyoTV1e(
+  QObject *guiObject,
+  unsigned int index)
+  : SanyoTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1e");
+
+  addControlledDevice(Sanyo_Make, "CTP-6791P", TV_Device);
+
+  addKey("Mute", Mute_Key, 0x18, 8);
+  addKey("audio_mode", SoundMode_Key, 0x1C, 8); // "auto"
+  addKey("Digicon", PictureMode_Key, 0x1D, 8);
+  addKey("Menu +", Right_Key, 0x1E, 8);
+  addKey("Menu -", Left_Key, 0x1F, 8);
 }
 
 
@@ -271,32 +287,33 @@ SanyoProjector::SanyoProjector(
 {
   addControlledDevice(Sanyo_Make, "PLV-Z1", Other_Device);
 
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x0C, 8);
-
-  addKey("ONOFF0", Power_Key, 0xF300FF, 24);
-  addKey("ONOFF1", Unmapped_Key, 0x73FF00, 24);
-  addKey("AUTO_PC_ADJ", Unmapped_Key, 0xF3916E, 24);
-  addKey("MENU", Menu_Key, 0xF338C7, 24);
-  addKey("SCREEN", Unmapped_Key, 0xF341BE, 24);
-  addKey("INPUT", Input_Key, 0xF3A05F, 24);
-  addKey("IMAGE", Unmapped_Key, 0xF330CF, 24);
-  addKey("AUTO", Unmapped_Key, 0xF3FC03, 24);
-  addKey("COMPOSITE", Unmapped_Key, 0xF3BC43, 24);
-  addKey("S-VIDEO", Unmapped_Key, 0xF37C83, 24);
-  addKey("COMPONENT", Unmapped_Key, 0xF3C13E, 24);
-  addKey("NOSHOW", Unmapped_Key, 0xF3D12E, 24);
-  addKey("KEYSTONE_UP", Unmapped_Key, 0xF3718E, 24);
-  addKey("KEYSTONE_DOWN", Unmapped_Key, 0xF3F10E, 24);
-  addKey("IMAGE_1", One_Key, 0xF30AF5, 24);
-  addKey("IMAGE_2", Two_Key, 0xF38A75, 24);
-  addKey("IMAGE_3", Three_Key, 0xF36A95, 24);
-  addKey("IMAGE_4", Four_Key, 0xF3EA15, 24);
-  addKey("SELECT", Select_Key, 0xF3F00F, 24);
-  addKey("LEFT", Left_Key, 0xF37887, 24);
-  addKey("RIGHT", Right_Key, 0xF3B847, 24);
-  addKey("UP", Up_Key, 0xF331CE, 24);
-  addKey("DOWN", Down_Key, 0xF3B14E, 24);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0x0CF3, 16);
+  setPreData(0x30, 16);
+
+  addKey("ONOFF0", Power_Key, 0x00, 8);
+  addKey("INPUT", Input_Key, 0x05, 8);
+  addKey("IMAGE", Unmapped_Key, 0x0C, 8);
+  addKey("SELECT", Select_Key, 0x0F, 8);
+  addKey("MENU", Menu_Key, 0x1C, 8);
+  addKey("RIGHT", Right_Key, 0x1D, 8);
+  addKey("LEFT", Left_Key, 0x1E, 8);
+  addKey("AUTO", Unmapped_Key, 0x3C, 8);
+  addKey("COMPOSITE", Unmapped_Key, 0x3D, 8);
+  addKey("S-VIDEO", Unmapped_Key, 0x3E, 8);
+  addKey("IMAGE_1", One_Key, 0x50, 8);
+  addKey("IMAGE_2", Two_Key, 0x51, 8);
+  addKey("IMAGE_3", Three_Key, 0x56, 8);
+  addKey("IMAGE_4", Four_Key, 0x57, 8);
+  addKey("SCREEN", Unmapped_Key, 0x82, 8);
+  addKey("COMPONENT", Unmapped_Key, 0x83, 8);
+  addKey("AUTO_PC_ADJ", Unmapped_Key, 0x89, 8);
+  addKey("NOSHOW", Unmapped_Key, 0x8B, 8);
+  addKey("UP", Up_Key, 0x8C, 8);
+  addKey("DOWN", Down_Key, 0x8D, 8);
+  addKey("KEYSTONE_UP", Unmapped_Key, 0x8E, 8);
+  addKey("KEYSTONE_DOWN", Unmapped_Key, 0x8F, 8);
+//  addKey("ONOFF1", Unmapped_Key, 0x0C73FF00, 32);
 }
 
index 45bece9..21cace1 100644 (file)
@@ -61,6 +61,14 @@ public:
     unsigned int index);
 };
 
+class SanyoTV1e: public SanyoTV1
+{
+public:
+  SanyoTV1e(
+    QObject *guiObject,
+    unsigned int index);
+};
+
 class SanyoProjector: public PIRKeysetMetaData
 {
 public:
index 2c0199c..ba2855f 100644 (file)
@@ -1,6 +1,5 @@
 #include "sharp.h"
-#include "necprotocol.h"
-//#include "pirmakenames.h"
+#include "sharpprotocol.h"
 
 SharpTV1::SharpTV1(
   QObject *guiObject,
@@ -10,114 +9,105 @@ SharpTV1::SharpTV1(
       Sharp_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    350, 650,
-    350, 1650,
-    64000, true);
-
-  threadableProtocol = np;
-
-  np->setElevenBitToggle(true);
-
-  np->setTrailerPulse(350);
-
-//  np->setMinimumRepetitions(1);
-
-//  np->setToggleMask(0x3FF);
-
-  addKey("POWER", Power_Key, 0x41A2, 15);
-  addKey("TV/VIDEO", Input_Key, 0x4322, 15);
-  addKey("10+", Unmapped_Key, 0x43D2, 15);
-  addKey("20+", Unmapped_Key, 0x4032, 15);
-  addKey("30+", Unmapped_Key, 0x4232, 15);
-  addKey("40+", Unmapped_Key, 0x43C2, 15);
-  addKey("1", One_Key, 0x4202, 15);
-  addKey("2", Two_Key, 0x4102, 15);
-  addKey("3", Three_Key, 0x4302, 15);
-  addKey("4", Four_Key, 0x4082, 15);
-  addKey("5", Five_Key, 0x4282, 15);
-  addKey("6", Six_Key, 0x4242, 15);
-  addKey("7", Seven_Key, 0x4382, 15);
-  addKey("8", Eight_Key, 0x4042, 15);
-  addKey("9", Nine_Key, 0x4242, 15);
-  addKey("0", Zero_Key, 0x4142, 15);
-  addKey("CH_DOWN", ChannelDown_Key, 0x4122, 15);
-  addKey("CH_UP", ChannelUp_Key, 0x4222, 15);
-  addKey("TIMER", Sleep_Key, 0x4162, 15);
-  addKey("INFO", Info_Key, 0x4362, 15); // "disp_del" "TEXT"
-  addKey("CH_SWAP", PrevChannel_Key, 0x4392, 15); // "FLASHBACK", "ret"
-  addKey("MUTE", Mute_Key, 0x43A2, 15);  // "VOLUME_KILL"
-  addKey("VOL_DOWN", VolumeDown_Key, 0x42A2, 15);
-  addKey("VOL_UP", VolumeUp_Key, 0x40A2, 15);
-  addKey("stereo", Unmapped_Key, 0x40C2, 15); // "VpsPds"
-  addKey("AmPm", Unmapped_Key, 0x40BD, 15);
-  addKey("PROG", Program_Key, 0x42E2, 15);
-  addKey("MONO", Unmapped_Key, 0x40D2, 15);
-  addKey("SOUND_MODE", Unmapped_Key, 0x4062, 15); // I/II/I+II
-//  addKey("SINGLE_DOUBLE", DoubleDigit_Key, 0x42B2, 15);
-  addKey("TELETEXT", Unmapped_Key, 0x40B2, 15);
-  addKey("PICTURE", Unmapped_Key, 0x4132, 15);
-  addKey("REVEAL", Unmapped_Key, 0x4072, 15);
-  addKey("TOP_BOTTOM_FULL", Unmapped_Key, 0x43B2, 15);
-  addKey("HOLD", Unmapped_Key, 0x4332, 15);
-  addKey("TIME", Unmapped_Key, 0x40E2, 15);
-  addKey("RESET", Unmapped_Key, 0x412A, 15);
-  addKey("INDEX", Unmapped_Key, 0x40CA, 15);
-  addKey("COLOR_RED", Red_Key, 0x404A, 15);
-  addKey("COLOR_GREEN", Green_Key, 0x424A, 15);
-  addKey("COLOR_YELLOW", Yellow_Key, 0x414A, 15);
-  addKey("COLOR_BLUE", Blue_Key, 0x434A, 15);
-  addKey("BROWSE", Unmapped_Key, 0x43D2, 15);
-  addKey("BALANCE_LEFT", Unmapped_Key, 0x435A, 15);
-  addKey("BALANCE_RIGHT", Unmapped_Key, 0x40DA, 15);
-  addKey("TREBLE_DOWN", Unmapped_Key, 0x431A, 15);
-  addKey("TREBLE_UP", Unmapped_Key, 0x411A, 15);
-  addKey("BASS_DOWN", Unmapped_Key, 0x429A, 15);
-  addKey("BASS_UP", Unmapped_Key, 0x409A, 15);
-  addKey("WOOFER_DOWN", Unmapped_Key, 0x439A, 15);
-  addKey("WOOFER_UP", Unmapped_Key, 0x419A, 15);
-  addKey("PICTURE_NORMALIZE", Unmapped_Key, 0x4212, 15);
-  addKey("SOUND_NORMALIZE", Unmapped_Key, 0x4192, 15);
-  addKey("COLOR_DOWN", Unmapped_Key, 0x4292, 15);
-  addKey("COLOR_UP", Unmapped_Key, 0x4092, 15);
-  addKey("CONTRAST_DOWN", Unmapped_Key, 0x4312, 15);
-  addKey("CONTRAST_UP", Unmapped_Key, 0x4112, 15);
-  addKey("BRIGHTNESS_DOWN", Unmapped_Key, 0x4152, 15);
-  addKey("BRIGHTNESS_UP", Unmapped_Key, 0x4252, 15);
-  addKey("PROGRAM", Program_Key, 0x41B2, 15);
-  addKey("calendar", Unmapped_Key, 0x41BA, 15);
-  addKey("program_timer", Unmapped_Key, 0x4262, 15); // "on_timer"
-  addKey("message", Unmapped_Key, 0x4372, 15);
-  addKey("language", Language_Key, 0x407A, 15);
-  addKey("100", PlusOneHundred_Key, 0x4342, 15);
-  addKey("p/c", Unmapped_Key, 0x42F2, 15);
-  addKey("pr", Unmapped_Key, 0x420A, 15);
-  addKey("PICTURE", PictureMode_Key, 0x401A, 15);
-  addKey("SOUND", SoundMode_Key, 0x421A, 15);
-  addKey("FUNCTIONS", Unmapped_Key, 0x43EA, 15);
-  addKey("MENU", Menu_Key, 0x42CA, 15);
-  addKey("LOCK", Unmapped_Key, 0x422A, 15);
-  addKey("./..", DoubleDigit_Key, 0x40F2, 15); // "dual"
-  addKey("NR", Unmapped_Key, 0x4022, 15);
-  addKey("BACKLIGHT", Unmapped_Key, 0x3F46, 15); // "OPC"
-  addKey("ROTATE", Unmapped_Key, 0x3CC6, 15);
-  addKey("AV-", Unmapped_Key, 0x473A, 15); // reverse-direction input 
-  addKey("BT_END", Unmapped_Key, 0x42BE, 15);
-  addKey("SUBTITLE", Captions_Key, 0x3FE6, 15);
-  addKey("SUBPAGE", Unmapped_Key, 0x3ECE, 15);
-  addKey("DTV", Unmapped_Key, 0x4416, 15);
-  addKey("EPG", Guide_Key, 0x44E9, 15);
-  addKey("ESG", Unmapped_Key, 0x4796, 15);
-  addKey("RADIO", Unmapped_Key, 0x4496, 15);
-  addKey("AV_MODE", Unmapped_Key, 0x407E, 15);
-  addKey("SURROUND", Surround_Key, 0x41DA, 15);
-  addKey("DTV_MENU", Unmapped_Key, 0x4616, 15);
-  addKey("LIST", Unmapped_Key, 0x4516, 15);
-  addKey("TRUD", Unmapped_Key, 0x46EE, 15);
-  addKey("WIDE_MODES", AspectRatio_Key, 0x444E, 15);
-  addKey("ACTION", Unmapped_Key, 0x467E, 15);
+  threadableProtocol = new SharpProtocol(guiObject, index, true);
+
+  addSharpKey("1", One_Key, 0x01, 0x01);
+  addSharpKey("2", Two_Key, 0x01, 0x02);
+  addSharpKey("3", Three_Key, 0x01, 0x03);
+  addSharpKey("4", Four_Key, 0x01, 0x04);
+  addSharpKey("5", Five_Key, 0x01, 0x05);
+  addSharpKey("6", Six_Key, 0x01, 0x06);
+  addSharpKey("7", Seven_Key, 0x01, 0x07);
+  addSharpKey("8", Eight_Key, 0x01, 0x08);
+  addSharpKey("9", Nine_Key, 0x01, 0x09);
+  addSharpKey("0", Zero_Key, 0x01, 0x0A);
+  addSharpKey("100", PlusOneHundred_Key, 0x01, 0x0B);
+  addSharpKey("stereo", Unmapped_Key, 0x01, 0x0C); // "VpsPds"
+  addSharpKey("40+", Unmapped_Key, 0x01, 0x0F); // odd!
+
+  addSharpKey("NR", Unmapped_Key, 0x01, 0x10);
+  addSharpKey("CH_UP", ChannelUp_Key, 0x01, 0x11);
+  addSharpKey("CH_DOWN", ChannelDown_Key, 0x01, 0x12);
+  addSharpKey("TV/VIDEO", Input_Key, 0x01, 0x13);
+  addSharpKey("VOL_UP", VolumeUp_Key, 0x01, 0x14);
+  addSharpKey("VOL_DOWN", VolumeDown_Key, 0x01, 0x15);
+  addSharpKey("POWER", Power_Key, 0x01, 0x16);
+  addSharpKey("MUTE", Mute_Key, 0x01, 0x17); // "VOLUME_KILL"
+  addSharpKey("SOUND_MODE", Audio_Key, 0x01, 0x18); // I/II/I+II
+  addSharpKey("program_timer", Timer_Key, 0x01, 0x19); // "on_timer"
+  addSharpKey("TIMER", Sleep_Key, 0x01, 0x1A);
+  addSharpKey("INFO", Info_Key, 0x01, 0x1B); // "disp_del" "TEXT"
+  addSharpKey("TIME", TeletextTime_Key, 0x01, 0x1C);
+  addSharpKey("PROG", Program_Key, 0x01, 0x1D);
+
+  addSharpKey("PICTURE_NORMALIZE", Unmapped_Key, 0x01, 0x21);
+  addSharpKey("CONTRAST_UP", Unmapped_Key, 0x01, 0x22);
+  addSharpKey("CONTRAST_DOWN", Unmapped_Key, 0x01, 0x23);
+  addSharpKey("COLOR_UP", Unmapped_Key, 0x01, 0x24);
+  addSharpKey("COLOR_DOWN", Unmapped_Key, 0x01, 0x25);
+  addSharpKey("SOUND_NORMALIZE", Unmapped_Key, 0x01, 0x26);
+  addSharpKey("BRIGHTNESS_UP", Unmapped_Key, 0x01, 0x28);
+  addSharpKey("BRIGHTNESS_DOWN", Unmapped_Key, 0x01, 0x29);
+  addSharpKey("CH_SWAP", PrevChannel_Key, 0x01, 0x27); // "FLASHBACK", "ret"
+  addSharpKey("MONO", Unmapped_Key, 0x01, 0x2C);
+  addSharpKey("BROWSE", Unmapped_Key, 0x01, 0x2F);
+  addSharpKey("10+", Unmapped_Key, 0x01, 0x2F);
+
+  addSharpKey("20+", Unmapped_Key, 0x01, 0x30);
+  addSharpKey("30+", Unmapped_Key, 0x01, 0x31);
+  addSharpKey("PICTURE", Unmapped_Key, 0x01, 0x32);
+  addSharpKey("HOLD", TeletextHold_Key, 0x01, 0x33);
+  addSharpKey("TELETEXT", Teletext_Key, 0x01, 0x34);
+//  addSharpKey("SINGLE_DOUBLE", DoubleDigit_Key, 0x01, 0x35);
+  addSharpKey("PROGRAM", Program_Key, 0x01, 0x36);
+  addSharpKey("TOP_BOTTOM_FULL", TeletextSize_Key, 0x01, 0x37);
+  addSharpKey("REVEAL", TeletextReveal_Key, 0x01, 0x38);
+  addSharpKey("message", Unmapped_Key, 0x01, 0x3B);
+  addSharpKey("./..", DoubleDigit_Key, 0x01, 0x3C);
+  addSharpKey("p/c", Unmapped_Key, 0x01, 0x3D);
+
+  addSharpKey("pr", Unmapped_Key, 0x01, 0x41);
+  addSharpKey("COLOR_RED", Red_Key, 0x01, 0x48);
+  addSharpKey("COLOR_GREEN", Green_Key, 0x01, 0x49);
+  addSharpKey("COLOR_YELLOW", Yellow_Key, 0x01, 0x4A);
+  addSharpKey("COLOR_BLUE", Blue_Key, 0x01, 0x4B);
+  addSharpKey("INDEX", Unmapped_Key, 0x01, 0x4C);
+  addSharpKey("MENU", Menu_Key, 0x01, 0x4D);
+  addSharpKey("LOCK", Unmapped_Key, 0x01, 0x51);
+  addSharpKey("RESET", Reset_Key, 0x01, 0x52);
+  addSharpKey("FUNCTIONS", Unmapped_Key, 0x01, 0x5F);
+
+  addSharpKey("PICTURE", PictureMode_Key, 0x01, 0x60);
+  addSharpKey("SOUND", SoundMode_Key, 0x01, 0x61);
+  addSharpKey("TREBLE_UP", Unmapped_Key, 0x01, 0x62);
+  addSharpKey("TREBLE_DOWN", Unmapped_Key, 0x01, 0x63);
+  addSharpKey("BASS_UP", Unmapped_Key, 0x01, 0x64);
+  addSharpKey("BASS_DOWN", Unmapped_Key, 0x01, 0x65);
+  addSharpKey("WOOFER_UP", Unmapped_Key, 0x01, 0x66);
+  addSharpKey("WOOFER_DOWN", Unmapped_Key, 0x01, 0x67);
+  addSharpKey("BALANCE_LEFT", Unmapped_Key, 0x01, 0x6B);
+  addSharpKey("BALANCE_RIGHT", Unmapped_Key, 0x01, 0x6C);
+  addSharpKey("SURROUND", Surround_Key, 0x01, 0x6E);
+
+  addSharpKey("calendar", Unmapped_Key, 0x01, 0x76);
+  addSharpKey("language", Audio_Key, 0x01, 0x78);
+  addSharpKey("BT_END", Unmapped_Key, 0x01, 0xF5);
+  addSharpKey("AV_MODE", Unmapped_Key, 0x01, 0xF8);
+
+  addSharpKey("AV-", Unmapped_Key, 0x11, 0x73); // reverse-direction input 
+  addSharpKey("DTV", Unmapped_Key, 0x11, 0xA0);
+  addSharpKey("DTV_MENU", Unmapped_Key, 0x11, 0xA1);
+  addSharpKey("LIST", Unmapped_Key, 0x11, 0xA2);
+  addSharpKey("RADIO", Unmapped_Key, 0x11, 0xA4);
+  addSharpKey("ESG", Unmapped_Key, 0x11, 0xA7);
+  addSharpKey("WIDE_MODES", AspectRatio_Key, 0x11, 0xC8);
+  addSharpKey("TRUD", Unmapped_Key, 0x11, 0xDD);
+  addSharpKey("ACTION", Unmapped_Key, 0x11, 0xF9);
+
+  addSharpKey("BACKLIGHT", Unmapped_Key, 0x1E, 0x8B); // "OPC"
+  addSharpKey("ROTATE", Unmapped_Key, 0x1E, 0x8C);
+  addSharpKey("SUBTITLE", Captions_Key, 0x1E, 0x9F);
+  addSharpKey("SUBPAGE", Unmapped_Key, 0x1E, 0xCD);
 }
 
 
@@ -128,22 +118,23 @@ SharpTV1a::SharpTV1a(
 {
   setKeysetName("TV Keyset 1a");
 
-  addKey("Input", Input_Key, 0x40B2, 15);
-  addKey("Time", Sleep_Key, 0x41C2, 15);
-  addKey("Stop", Stop_Key, 0x4392, 15);
-  addKey("REC", Record_Key, 0x4052, 15);
-  addKey("Pause", Pause_Key, 0x4292, 15);
-  addKey("Play", Play_Key, 0x4112, 15);
-  addKey("REW", Rewind_Key, 0x4312, 15);
-  addKey("FF", FastForward_Key, 0x4212, 15);
-  addKey("TapeSpeed", VHSSpeed_Key, 0x43E2, 15);
-  addKey("ZeroBack", Unmapped_Key, 0x4306, 15);
-  addKey("Replay", Replay_Key, 0x43DD, 15);
-  addKey("SkipSearch", Advance_Key, 0x4026, 15);
-  addKey("Slow", Unmapped_Key, 0x4252, 15);
-  addKey("DPSS-", Unmapped_Key, 0x4032, 15);
-  addKey("DPSS+", Unmapped_Key, 0x43D2, 15);
-  addKey("Key", Unmapped_Key, 0x42C2, 15);
+  addSharpKey("Key", Unmapped_Key, 0x01, 0x0D);
+  addSharpKey("Time", Sleep_Key, 0x01, 0x0E);
+  addSharpKey("Replay", Replay_Key, 0x01, 0x10);
+  addSharpKey("TapeSpeed", VHSSpeed_Key, 0x01, 0x1F);
+  addSharpKey("FF", FastForward_Key, 0x01, 0x21);
+  addSharpKey("Play", Play_Key, 0x01, 0x22);
+  addSharpKey("REW", Rewind_Key, 0x01, 0x23);
+  addSharpKey("Pause", Pause_Key, 0x01, 0x25);
+  addSharpKey("Stop", Stop_Key, 0x01, 0x27);
+  addSharpKey("REC", Record_Key, 0x01, 0x28);
+  addSharpKey("Slow", Slow_Key, 0x01, 0x29);
+  addSharpKey("DPSS+", Unmapped_Key, 0x01, 0x2F);
+
+  addSharpKey("DPSS-", Unmapped_Key, 0x01, 0x30);
+  addSharpKey("Input", Input_Key, 0x01, 0x34);
+  addSharpKey("ZeroBack", Unmapped_Key, 0x01, 0x83);
+  addSharpKey("SkipSearch", Advance_Key, 0x01, 0x90);
 }
 
 
@@ -154,18 +145,18 @@ SharpTV1b::SharpTV1b(
 {
   setKeysetName("TV Keyset 1b");
 
-  addKey("chScan", Scan_Key, 0x40E2, 15);
-  addKey("video", Input_Key, 0x424A, 15);
-  addKey("minus", Down_Key, 0x402A, 15); // "DOWN"
-  addKey("plus", Up_Key, 0x43CA, 15); // "UP"
-  addKey("setup", Menu_Key, 0x4012, 15);
-  addKey("fback_clr", Unmapped_Key, 0x43D2, 15);
-  addKey("FINE_TUNING", Unmapped_Key, 0x41C2, 15);
-  addKey("TIMER", Unmapped_Key, 0x432A, 15);
-  addKey("BLUE_BACK", Unmapped_Key, 0x4372, 15);
-  addKey("SKIP", Unmapped_Key, 0x438A, 15);
-  addKey("SYSTEM_SOUND", Unmapped_Key, 0x43DA, 15);
-  addKey("SYSTEM_COLOUR", Unmapped_Key, 0x423A, 15);
+  addSharpKey("FINE_TUNING", Unmapped_Key, 0x01, 0x0E);
+  addSharpKey("chScan", Scan_Key, 0x01, 0x1C);
+  addSharpKey("setup", Menu_Key, 0x01, 0x20);
+  addSharpKey("fback_clr", Unmapped_Key, 0x01, 0x2F);
+  addSharpKey("BLUE_BACK", Unmapped_Key, 0x01, 0x3B);
+  addSharpKey("SKIP", Unmapped_Key, 0x01, 0x47);
+  addSharpKey("video", Input_Key, 0x01, 0x49);
+  addSharpKey("plus", Up_Key, 0x01, 0x4F); // "UP"
+  addSharpKey("minus", Down_Key, 0x01, 0x50); // "DOWN"
+  addSharpKey("TIMER", Timer_Key, 0x01, 0x53);
+  addSharpKey("SYSTEM_SOUND", SoundMode_Key, 0x01, 0x6F);
+  addSharpKey("SYSTEM_COLOUR", PictureMode_Key, 0x01, 0x71);
 }
 
 
@@ -176,8 +167,8 @@ SharpTV1c::SharpTV1c(
 {
   setKeysetName("TV Keyset 1c");
 
-  addKey("save_ch", Unmapped_Key, 0x420A, 15);
-  addKey("del_ch", Unmapped_Key, 0x42F2, 15);
+  addSharpKey("save_ch", Unmapped_Key, 0x01, 0x41);
+  addSharpKey("del_ch", Unmapped_Key, 0x01, 0x3D);
 }
 
 
@@ -188,8 +179,8 @@ SharpTV1d::SharpTV1d(
 {
   setKeysetName("TV Keyset 1d");
 
-  addKey("P-MODE", PictureMode_Key, 0x42CA, 15);
-  addKey("S-MODE", SoundMode_Key, 0x4192, 15);
+  addSharpKey("P-MODE", PictureMode_Key, 0x01, 0x4D);
+  addSharpKey("S-MODE", SoundMode_Key, 0x01, 0x26);
 }
 
 
@@ -200,13 +191,14 @@ SharpTV1e::SharpTV1e(
 {
   setKeysetName("TV Keyset 1e");
 
-  addKey("UP", Up_Key, 0x43AA, 15);
-  addKey("LEFT", Left_Key, 0x43AE, 15);
-  addKey("OK", Select_Key, 0x412A, 15);
-  addKey("RIGHT", Right_Key, 0x406E, 15);
-  addKey("DOWN", Down_Key, 0x4012, 15);
-  addKey("MENU", Menu_Key, 0x458E, 15);
-  addKey("RETURN", Exit_Key, 0x409E, 15);
+  addSharpKey("DOWN", Down_Key, 0x01, 0x20);
+  addSharpKey("OK", Select_Key, 0x01, 0x52);
+  addSharpKey("UP", Up_Key, 0x01, 0x57);
+  addSharpKey("LEFT", Left_Key, 0x01, 0xD7);
+  addSharpKey("RIGHT", Right_Key, 0x01, 0xD8);
+  addSharpKey("RETURN", Exit_Key, 0x01, 0xE4);
+
+  addSharpKey("MENU", Menu_Key, 0x11, 0xC6);
 }
 
 
@@ -218,89 +210,73 @@ SharpVCR1::SharpVCR1(
       Sharp_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    400, 600,
-    400, 1700,
-    64000, true);
-
-  threadableProtocol = np;
-
-  np->setElevenBitToggle(true);
-
-  np->setTrailerPulse(400);
-
-//  np->setMinimumRepetitions(1);
-
-//  np->setToggleMask(0x3FF);
-
-  addKey("Power", Power_Key, 0x61A2, 15);
-  addKey("1", One_Key, 0x6202, 15);
-  addKey("2", Two_Key, 0x6102, 15);
-  addKey("3", Three_Key, 0x6302, 15);
-  addKey("4", Four_Key, 0x6082, 15);
-  addKey("5", Five_Key, 0x6282, 15);
-  addKey("6", Six_Key, 0x6182, 15);
-  addKey("7", Seven_Key, 0x6382, 15);
-  addKey("8", Eight_Key, 0x6042, 15);
-  addKey("9", Nine_Key, 0x6242, 15);
-  addKey("0", Zero_Key, 0x6142, 15);
-  addKey("Play", Play_Key, 0x6112, 15);
-  addKey("Stop", Stop_Key, 0x6392, 15);
-  addKey("Rec", Record_Key, 0x6052, 15);
-  addKey("Pause", Pause_Key, 0x6292, 15);
-  addKey("FF", FastForward_Key, 0x6212, 15);
-  addKey("Rew", Rewind_Key, 0x6312, 15);
-  addKey("./..", DoubleDigit_Key, 0x6342, 15);
-  addKey("InputSelect", Input_Key, 0x60B2, 15); // "simul"
-  addKey("ChnUp", ChannelUp_Key, 0x6222, 15);
-  addKey("ChnDn", ChannelDown_Key, 0x6122, 15);
-  addKey("Display", Info_Key, 0x60C6, 15);
-  addKey("ModeOsd", Unmapped_Key, 0x62C6, 15);
-  addKey("TV/VCR", Unmapped_Key, 0x6322, 15);
-  addKey("Menu", Menu_Key, 0x6066, 15);
-  addKey("Set", Select_Key, 0x6166, 15);
-  addKey("SV/V+/Timer", Unmapped_Key, 0x600E, 15);
-  addKey("Clear", Clear_Key, 0x6012, 15);
-  addKey("TimerOn/Off", Unmapped_Key, 0x6262, 15);
-  addKey("AudioOut", Surround_Key, 0x6062, 15);
-  addKey("SkipSearch", Unmapped_Key, 0x6026, 15);
-  addKey("ZeroBack", Unmapped_Key, 0x6306, 15);  // "MEMORY"
-  addKey("TapeSpeed", VHSSpeed_Key, 0x63E2, 15);
-  addKey("Slow", Unmapped_Key, 0x6252, 15);
-  addKey("DPSS-", Unmapped_Key, 0x6032, 15); // "slow-"
-  addKey("DPSS+", Unmapped_Key, 0x63D2, 15); // "slow+"
-  addKey("Key", Unmapped_Key, 0x62C2, 15);  // "C-LOCK", "tamper_proof"
-  addKey("Left", Left_Key, 0x62E6, 15);
-  addKey("Right", Right_Key, 0x6366, 15);
-  addKey("Up", Up_Key, 0x6266, 15);
-  addKey("Dn", Down_Key, 0x60E6, 15);
-  addKey("EJECT", Eject_Key, 0x6332, 15);
-  addKey("MUTE", Mute_Key, 0x63A2, 15);
-  addKey("PROG", Program_Key, 0x62E2, 15);
-  addKey("TRACKING_DOWN", TrackingMinus_Key, 0x6186, 15);
-  addKey("TRACKING_UP", TrackingPlus_Key, 0x6286, 15);
-  addKey("CLOCK", Unmapped_Key, 0x60D2, 15);
-  addKey("SEARCH", Unmapped_Key, 0x63B2, 15);
-  addKey("TIME", Unmapped_Key, 0x61C2, 15);
-  addKey("REC_TIME", Unmapped_Key, 0x63C2, 15); // "TIME-0"
-  addKey("F.ADV", Unmapped_Key, 0x6092, 15);
-  addKey("SHUTTLE0", Unmapped_Key, 0x61D6, 15);
-  addKey("SHUTTLE-1", Unmapped_Key, 0x6256, 15);
-  addKey("SHUTTLE-2", Unmapped_Key, 0x6356, 15);
-  addKey("SHUTTLE+1", Unmapped_Key, 0x6016, 15);
-  addKey("SHUTTLE+2", Unmapped_Key, 0x6116, 15);
-  addKey("SHUTTLE+3", Unmapped_Key, 0x6096, 15);
-  addKey("SHUTTLE+4", Unmapped_Key, 0x6196, 15);
-  addKey("SHUTTLE+5", Unmapped_Key, 0x6056, 15);
-  addKey("SHUTTLE+6", Unmapped_Key, 0x6156, 15);
-  addKey("repeat", Unmapped_Key, 0x6022, 15);
-  addKey("osp", Unmapped_Key, 0x60E2, 15);
-  addKey("vps", Unmapped_Key, 0x60C2, 15);
-  addKey("x2", Unmapped_Key, 0x6232, 15);
-  addKey("100", PlusOneHundred_Key, 0x6046, 15);
-  addKey("cancel", Unmapped_Key, 0x6086, 15);  // could be exit key
+  threadableProtocol = new SharpProtocol(guiObject, index, true);
+
+  addSharpKey("1", One_Key, 0x03, 0x01);
+  addSharpKey("2", Two_Key, 0x03, 0x02);
+  addSharpKey("3", Three_Key, 0x03, 0x03);
+  addSharpKey("4", Four_Key, 0x03, 0x04);
+  addSharpKey("5", Five_Key, 0x03, 0x05);
+  addSharpKey("6", Six_Key, 0x03, 0x06);
+  addSharpKey("7", Seven_Key, 0x03, 0x07);
+  addSharpKey("8", Eight_Key, 0x03, 0x08);
+  addSharpKey("9", Nine_Key, 0x03, 0x09);
+  addSharpKey("0", Zero_Key, 0x03, 0x0A);
+  addSharpKey("./..", DoubleDigit_Key, 0x03, 0x0B);
+  addSharpKey("Display", Info_Key, 0x03, 0x0C); // "vps"
+  addSharpKey("Key", Unmapped_Key, 0x03, 0x0D);  // "C-LOCK", "tamper_proof"
+  addSharpKey("TIME", Unmapped_Key, 0x03, 0x0E);
+  addSharpKey("REC_TIME", Unmapped_Key, 0x03, 0x0F); // "TIME-0"
+  addSharpKey("repeat", Repeat_Key, 0x03, 0x10);
+  addSharpKey("ChnUp", ChannelUp_Key, 0x03, 0x11);
+  addSharpKey("ChnDn", ChannelDown_Key, 0x03, 0x12);
+  addSharpKey("TV/VCR", Unmapped_Key, 0x03, 0x13);
+  addSharpKey("Power", Power_Key, 0x03, 0x16);
+  addSharpKey("MUTE", Mute_Key, 0x03, 0x17);
+  addSharpKey("AudioOut", Surround_Key, 0x03, 0x18);
+  addSharpKey("TimerOn/Off", Unmapped_Key, 0x03, 0x19);
+  addSharpKey("osp", Unmapped_Key, 0x03, 0x1C);
+  addSharpKey("PROG", Program_Key, 0x03, 0x1D);
+  addSharpKey("TapeSpeed", VHSSpeed_Key, 0x03, 0x1F);
+  addSharpKey("Clear", Clear_Key, 0x03, 0x20);
+  addSharpKey("FF", FastForward_Key, 0x03, 0x21);
+  addSharpKey("Play", Play_Key, 0x03, 0x22);
+  addSharpKey("Rew", Rewind_Key, 0x03, 0x23);
+  addSharpKey("F.ADV", StepForward_Key, 0x03, 0x24);
+  addSharpKey("Pause", Pause_Key, 0x03, 0x25);
+  addSharpKey("Stop", Stop_Key, 0x03, 0x27);
+  addSharpKey("Rec", Record_Key, 0x03, 0x28);
+  addSharpKey("Slow", Slow_Key, 0x03, 0x29);
+  addSharpKey("CLOCK", Clock_Key, 0x03, 0x2C);
+  addSharpKey("DPSS+", SlowPlus_Key, 0x03, 0x2F); // "slow+"
+  addSharpKey("DPSS-", SlowMinus_Key, 0x03, 0x30); // "slow-"
+  addSharpKey("x2", Unmapped_Key, 0x03, 0x31);
+  addSharpKey("EJECT", Eject_Key, 0x03, 0x33);
+  addSharpKey("InputSelect", Input_Key, 0x03, 0x34); // "simul"
+  addSharpKey("SEARCH", Unmapped_Key, 0x03, 0x37);
+  addSharpKey("ZeroBack", Unmapped_Key, 0x03, 0x83);  // "MEMORY"
+  addSharpKey("cancel", Unmapped_Key, 0x03, 0x84);  // could be exit key
+  addSharpKey("TRACKING_UP", TrackingPlus_Key, 0x03, 0x85);
+  addSharpKey("TRACKING_DOWN", TrackingMinus_Key, 0x03, 0x86);
+  addSharpKey("100", PlusOneHundred_Key, 0x03, 0x88);
+  addSharpKey("ModeOsd", Unmapped_Key, 0x03, 0x8D);
+  addSharpKey("SkipSearch", Unmapped_Key, 0x03, 0x90);
+  addSharpKey("Menu", Menu_Key, 0x03, 0x98);
+  addSharpKey("Up", Up_Key, 0x03, 0x99);
+  addSharpKey("Set", Select_Key, 0x03, 0x9A);
+  addSharpKey("Right", Right_Key, 0x03, 0x9B);
+  addSharpKey("Dn", Down_Key, 0x03, 0x9C);
+  addSharpKey("Left", Left_Key, 0x03, 0x9D);
+  addSharpKey("SHUTTLE+1", Unmapped_Key, 0x03, 0xA0);
+  addSharpKey("SHUTTLE+2", Unmapped_Key, 0x03, 0xA2);
+  addSharpKey("SHUTTLE+3", Unmapped_Key, 0x03, 0xA4);
+  addSharpKey("SHUTTLE+4", Unmapped_Key, 0x03, 0xA6);
+  addSharpKey("SHUTTLE+5", Unmapped_Key, 0x03, 0xA8);
+  addSharpKey("SHUTTLE-1", Unmapped_Key, 0x03, 0xA9);
+  addSharpKey("SHUTTLE+6", Unmapped_Key, 0x03, 0xAA);
+  addSharpKey("SHUTTLE-2", Unmapped_Key, 0x03, 0xAB);
+  addSharpKey("SHUTTLE0", Unmapped_Key, 0x03, 0xAE);
+  addSharpKey("SV/V+/Timer", Timer_Key, 0x03, 0xC0);
 }
 
 
@@ -312,57 +288,45 @@ SharpReceiver1::SharpReceiver1(
       Sharp_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    350, 650,
-    350, 1650,
-    67000, true);
-
-  threadableProtocol = np;
-
-  np->setElevenBitToggle(true);
-
-  np->setTrailerPulse(350);
-
-//  np->setMinimumRepetitions(9);
-
-  addKey("POWER", Power_Key, 0x25A2, 15);
-  addKey("X-BASS", Unmapped_Key, 0x25D2, 15);
-  addKey("VOL-", VolumeDown_Key, 0x26A2, 15);
-  addKey("VOL+", VolumeUp_Key, 0x24A2, 15);
-  addKey("CD", Unmapped_Key, 0x2762, 15);
-  addKey("TUNER", Unmapped_Key, 0x2662, 15);
-  addKey("TAPE", Unmapped_Key, 0x2562, 15);
-  addKey("PHONO", Unmapped_Key, 0x26E2, 15);
-  addKey("FM", Unmapped_Key, 0x2532, 15);
-  addKey("MW", Unmapped_Key, 0x24B2, 15);
-  addKey("SW", Unmapped_Key, 0x254E, 15);
-  addKey("LW", Unmapped_Key, 0x2732, 15);
-  addKey("PRESET-", Unmapped_Key, 0x2522, 15);
-  addKey("PRESET+", Unmapped_Key, 0x2622, 15);
-  addKey("1", One_Key, 0x1602, 15);
-  addKey("2", Two_Key, 0x1502, 15);
-  addKey("3", Three_Key, 0x1702, 15);
-  addKey("4", Four_Key, 0x1482, 15);
-  addKey("5", Five_Key, 0x1682, 15);
-  addKey("6", Six_Key, 0x1582, 15);
-  addKey("7", Seven_Key, 0x1782, 15);
-  addKey("8", Eight_Key, 0x1442, 15);
-  addKey("9", Nine_Key, 0x1642, 15);
-  addKey("0", Zero_Key, 0x1542, 15);
-  addKey("+10", DoubleDigit_Key, 0x1472, 15);
-  addKey("MEMORY", Unmapped_Key, 0x1722, 15);
-  addKey("REPEAT", Unmapped_Key, 0x15B2, 15);
-  addKey("STOP", Stop_Key, 0x146D, 15);
-  addKey("PAUSE", Pause_Key, 0x1692, 15);
-  addKey("PLAY", Play_Key, 0x1512, 15);
-  addKey("REVIEW", Rewind_Key, 0x1562, 15);
-  addKey("CUE", FastForward_Key, 0x1662, 15);
-  addKey("APSS-", Unmapped_Key, 0x1712, 15);
-  addKey("APSS+", Unmapped_Key, 0x1612, 15);
-  addKey("CLEAR", Clear_Key, 0x1522, 15);
-  addKey("CALL", Unmapped_Key, 0x1622, 15);
-  addKey("TIME_DISPLAY", Unmapped_Key, 0x1762, 15);
-  addKey("RANDOM", Unmapped_Key, 0x15E2, 15);
+  threadableProtocol = new SharpProtocol(guiObject, index, true);
+
+  addSharpKey("PRESET+", ChannelUp_Key, 0x12, 0x11);
+  addSharpKey("PRESET-", ChannelDown_Key, 0x12, 0x12);
+  addSharpKey("VOL+", VolumeUp_Key, 0x12, 0x14);
+  addSharpKey("VOL-", VolumeDown_Key, 0x12, 0x15);
+  addSharpKey("POWER", Power_Key, 0x12, 0x16);
+  addSharpKey("TUNER", Unmapped_Key, 0x12, 0x19);
+  addSharpKey("TAPE", Unmapped_Key, 0x12, 0x1A);
+  addSharpKey("CD", Unmapped_Key, 0x12, 0x1B);
+  addSharpKey("PHONO", Unmapped_Key, 0x12, 0x1D);
+  addSharpKey("X-BASS", Unmapped_Key, 0x12, 0x2E);
+  addSharpKey("FM", Unmapped_Key, 0x12, 0x32);
+  addSharpKey("LW", Unmapped_Key, 0x12, 0x33);
+  addSharpKey("MW", Unmapped_Key, 0x12, 0x34);
+  addSharpKey("SW", Unmapped_Key, 0x12, 0xCA);
+
+  addSharpKey("1", One_Key, 0x14, 0x01);
+  addSharpKey("2", Two_Key, 0x14, 0x02);
+  addSharpKey("3", Three_Key, 0x14, 0x03);
+  addSharpKey("4", Four_Key, 0x14, 0x04);
+  addSharpKey("5", Five_Key, 0x14, 0x05);
+  addSharpKey("6", Six_Key, 0x14, 0x06);
+  addSharpKey("7", Seven_Key, 0x14, 0x07);
+  addSharpKey("8", Eight_Key, 0x14, 0x08);
+  addSharpKey("9", Nine_Key, 0x14, 0x09);
+  addSharpKey("0", Zero_Key, 0x14, 0x0A);
+  addSharpKey("CALL", Unmapped_Key, 0x14, 0x11);
+  addSharpKey("CLEAR", Clear_Key, 0x14, 0x12);
+  addSharpKey("MEMORY", Program_Key, 0x14, 0x13);
+  addSharpKey("CUE", FastForward_Key, 0x14, 0x19);
+  addSharpKey("REVIEW", Rewind_Key, 0x14, 0x1A);
+  addSharpKey("TIME_DISPLAY", Info_Key, 0x14, 0x1B);
+  addSharpKey("RANDOM", Random_Key, 0x14, 0x1E);
+  addSharpKey("APSS+", Unmapped_Key, 0x14, 0x21);
+  addSharpKey("PLAY", Play_Key, 0x14, 0x22);
+  addSharpKey("APSS-", Unmapped_Key, 0x14, 0x23);
+  addSharpKey("PAUSE", Pause_Key, 0x14, 0x25);
+  addSharpKey("STOP", Stop_Key, 0x14, 0x27);
+  addSharpKey("REPEAT", Repeat_Key, 0x14, 0x36);
+  addSharpKey("+10", DoubleDigit_Key, 0x14, 0x38);
 }
index 8d103a2..bab2747 100644 (file)
@@ -1,5 +1,5 @@
 #include "sony.h"
-#include "necprotocol.h"
+#include "sircprotocol.h"
 
 
 SonyTV1::SonyTV1(
@@ -10,139 +10,6 @@ SonyTV1::SonyTV1(
       Sony_Make,
       index)
 {
-  addControlledDevice(Sony_Make, "Trinitron KDW-25", TV_Device);
-
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 600,
-    1200, 600,
-    45000, true);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(2400, 600);
-
-//  np->setMinimumRepetitions(2);
-
-  //np->setCarrierFrequency(40000);
-  //np->setDutyCycle(33);
-
-  addKey("MUTE", Mute_Key, 0x290, 12); // 0x148
-  addKey("POWER", Power_Key, 0xA90, 12); // 0x548
-  addKey("TV-RETURN", Unmapped_Key, 0x1D0, 12); // teletext 0x0E8, also "analog"
-  addKey("TELETXT", Unmapped_Key, 0xFD0, 12);   // teletext 0x7E8
-  addKey("tv/video", Input_Key, 0xA50, 12); // 0x528
-  addKey("1", One_Key, 0x010, 12);   // 0x008
-  addKey("2", Two_Key, 0x810, 12);   // 0x408
-  addKey("3", Three_Key, 0x410, 12); // 0x208
-  addKey("4", Four_Key, 0xC10, 12);  // 0x608
-  addKey("5", Five_Key, 0x210, 12);  // 0x108
-  addKey("6", Six_Key, 0xA10, 12);   // 0x508
-  addKey("7", Seven_Key, 0x610, 12); // 0x308
-  addKey("8", Eight_Key, 0xE10, 12); // 0x708
-  addKey("9", Nine_Key, 0x110, 12);  // 0x088
-  addKey("0", Zero_Key, 0x910, 12);  // 0x488
-  addKey("?/INFO", Info_Key, 0x5D0, 12); // 0x2E8
-  addKey("-/--", DoubleDigit_Key, 0xB90, 12); // 0x5C8
-  addKey("OK", Select_Key, 0xA70, 12); // 0x538
-//  addKey("OK", Enter_Key, 0xA70, 12); // 0x538
-  addKey("MENU", Menu_Key, 0x070, 12); //0x038
-  addKey("UP/GREEN", Up_Key, 0xB38, 12); // 0x59C
-  addKey("DOWN/BLUE", Down_Key, 0xF38, 12); // 0x79C
-  addKey("RIGHT/+/YELLOW", Right_Key, 0x738, 12); // 0x39C
-  addKey("LEFT/-/RED", Left_Key, 0x338, 12); // 0x19C
-  addKey("LEFT/-/RED", Red_Key, 0x338, 12); // 0x19C
-  addKey("UP/GREEN", Green_Key, 0xB38, 12); // 0x59C
-  addKey("RIGHT/+/YELLOW", Yellow_Key, 0x738, 12); //0x39C
-  addKey("DOWN/BLUE", Blue_Key, 0xF38, 12); // 0x79C
-  addKey("VOLUME+", VolumeUp_Key, 0x490, 12); // 0x248
-  addKey("VOLUME-", VolumeDown_Key, 0xC90, 12); // 0x648
-  addKey("CHANNEL/PAGE+", ChannelUp_Key, 0x090, 12); // 0x048
-  addKey("CHANNEL/PAGE-", ChannelDown_Key, 0x890, 12); // 0x448
-  addKey("prev_ch", PrevChannel_Key, 0xDD0, 12); // 0x6E8 "jump", "refresh", "toggle"
-  addKey("1-", Unmapped_Key, 0x310, 12);
-  addKey("2-", Unmapped_Key, 0xB10, 12);
-  addKey("sleep", Sleep_Key, 0x6D0, 12); // 0x368
-  addKey("select", Unmapped_Key, 0x3F0, 12); // 0x1F8
-  addKey("normalise", Unmapped_Key, 0x690, 12); // 0x348 "reset"
-  addKey("C", Clear_Key, 0x710, 12); // 0x388
-  addKey("output", Unmapped_Key, 0x670, 12);  // 0x338
-  addKey("a/b", Language_Key, 0xE90, 12); // 0x748  "mts", "sap", "audio", "language"
-  addKey("stereo", Surround_Key, 0x950, 12); // Might be wrong
-  addKey("subtitles", Captions_Key, 0xD38, 12);
-  addKey("expand", Unmapped_Key, 0x938, 12);
-  addKey("shrink", Unmapped_Key, 0x538, 12);
-  addKey("favourite", Unmapped_Key, 0x530, 12);
-  addKey("setup", Program_Key, 0x370, 12);
-  addKey("tune_down", Unmapped_Key, 0xF70, 12);
-  addKey("tune_up", Unmapped_Key, 0x770, 12);
-  addKey("diamond", Unmapped_Key, 0x1F0, 12); // 0x0F8 "add"
-  addKey("asterisk", Unmapped_Key, 0x170, 12);
-  addKey("C00", Unmapped_Key, 0xF10, 12);
-  addKey("bucket", Unmapped_Key, 0x150, 12);
-  addKey("vt_inf", Unmapped_Key, 0x138, 12); // teletext info
-//  addKey("vt_dots", Unmapped_Key, 0xD38, 12); // teletext
-  addKey("time", Unmapped_Key, 0xD50, 12); // 0x6A8 teletext?
-  addKey("timer/block", Unmapped_Key, 0x0D0, 12); // 0x068
-  addKey("off/repeat", Unmapped_Key, 0x3D0, 12); // 0x1E8
-  addKey("cable", Unmapped_Key, 0x730, 12); // 0x398
-  addKey("auto_program", Unmapped_Key, 0xD70, 12); // 0x6B8
-  addKey("erase", Unmapped_Key, 0x9F0, 12); // 0x4F8
-  addKey("picture_up", Unmapped_Key, 0x190, 12); // 0x0C8
-  addKey("picture_down", Unmapped_Key, 0x990, 12); // 0x4C8
-  addKey("PIP", PIP_Key, 0xDB0, 12); // 0x6D8
-  addKey("PIP_SWAP", PIPSwap_Key, 0xFB0, 12); // 0x7D8
-  addKey("PIP_POSITION", PIPMove_Key, 0x7B0, 12); // 0x3D8
-  addKey("PIP_SOURCE", PIPSource_Key, 0xE70, 12); // 0x738
-  addKey("pip_ch+", PIPChannelUp_Key, 0x1B0, 12);
-  addKey("pip_ch-", PIPChannelDown_Key, 0x9B0, 12);
-  addKey("pipfreeze", Unmapped_Key, 0x3B0, 12);
-  addKey("piptv_video", Unmapped_Key, 0x5B0, 12);
-  addKey("Sat", Unmapped_Key, 0x8B0, 12); // 0x458
-  addKey("Settup_V", Unmapped_Key, 0x870, 12); // 0x438
-  addKey("Settup_A", Unmapped_Key, 0x470, 12); // 0x238
-  addKey("EXIT", Exit_Key, 0xC70, 12);
-  addKey("enter", Enter_Key, 0xD10, 12); // 0x688
-  addKey("picturemode", Unmapped_Key, 0x270, 12); // 0x138
-  addKey("ANT", Unmapped_Key, 0x550, 12);
-
-  addKey("16:9", AspectRatio_Key, 0x5E25, 15); // "WIDE"
-  addKey("DIGITAL", Unmapped_Key, 0x25EE, 15);
-  addKey("EPG", Guide_Key, 0x6D25, 15);
-  addKey("RETURN", Unmapped_Key, 0x62E9, 15);
-  addKey("TOOLS", Unmapped_Key, 0x36E9, 15);
-  addKey("theatre", Unmapped_Key, 0x03EE, 15);
-  addKey("SYNC_MENU", Unmapped_Key, 0x0D58, 15);
-  addKey("PREVIOUS", Previous_Key, 0x1EE9, 15);
-  addKey("STOP", Stop_Key, 0x0CE9, 15);
-  addKey("NEXT", Next_Key, 0x5EE9, 15);
-  addKey("I-MANUAL", Unmapped_Key, 0x6F58, 15);
-  addKey("SCENE", Unmapped_Key, 0x0F58, 15);
-  addKey("DIGITAL_ANALOG", Unmapped_Key, 0x58EE, 15);
-  addKey("FBACKWARD", Rewind_Key, 0x6CE9, 15);
-  addKey("PLAY", Play_Key, 0x2CE9, 15);
-  addKey("FFORWARD", FastForward_Key, 0x1CE9, 15);
-  addKey("INTERNET_VIDEO", Unmapped_Key, 0x4F58, 15);
-  addKey("FAVORITES", Unmapped_Key, 0x37EE, 15);
-  addKey("OPTIONS", Unmapped_Key, 0x36E9, 15);
-  addKey("PIP_Audio", Unmapped_Key, 0x1F25, 15);
-  addKey("Surround_Mode", Unmapped_Key, 0x7C25, 15);
-  addKey("DOT", Unmapped_Key, 0x5CE9, 15);
-  addKey("SOUND", Unmapped_Key, 0x6FE9, 15);
-  addKey("REPLAY", Replay_Key, 0x4FE9, 15);
-  addKey("ADVANCE", Advance_Key, 0x0FE9, 15);
-  addKey("PAUSE", Pause_Key, 0x4CE9, 15);
-}
-
-
-SonyTV1a::SonyTV1a(
-  QObject *guiObject,
-  unsigned int index)
-  : SonyTV1(guiObject, index)
-{
-  setKeysetName("TV Keyset 1a");
-
   addControlledDevice(Sony_Make, "Trinitron KV-2184MT", TV_Device);
   addControlledDevice(Sony_Make, "KV-M1420D", TV_Device);
   addControlledDevice(Sony_Make, "KV-20FV10", TV_Device);
@@ -154,141 +21,171 @@ SonyTV1a::SonyTV1a(
   addControlledDevice(Sony_Make, "KDL-46X2000", TV_Device);
   addControlledDevice(Sony_Make, "KDL-40X2000", TV_Device);
 
-  // Overwrite directional keys:
-  addKey("up", Up_Key, 0x2F0, 12); // 0x178
-  addKey("down", Down_Key, 0xAF0, 12); // 0x578
-  addKey("left", Left_Key, 0x2D0, 12); // 0x168
-  addKey("right", Right_Key, 0xCD0, 12); // 0x668
+  threadableProtocol = new SIRCProtocol(guiObject, index);
+
+  addSIRC12Key("1", One_Key, 0x01, 0x0);
+  addSIRC12Key("2", Two_Key, 0x01, 0x1);
+  addSIRC12Key("3", Three_Key, 0x01, 0x2);
+  addSIRC12Key("4", Four_Key, 0x01, 0x3);
+  addSIRC12Key("5", Five_Key, 0x01, 0x4);
+  addSIRC12Key("6", Six_Key, 0x01, 0x5);
+  addSIRC12Key("7", Seven_Key, 0x01, 0x6);
+  addSIRC12Key("8", Eight_Key, 0x01, 0x7);
+  addSIRC12Key("9", Nine_Key, 0x01, 0x8);
+  addSIRC12Key("0", Zero_Key, 0x01, 0x9);
+  addSIRC12Key("enter", Enter_Key, 0x01, 0x0B);
+  addSIRC12Key("1-", Unmapped_Key, 0x01, 0x0C);
+  addSIRC12Key("2-", Unmapped_Key, 0x01, 0x0D);
+  addSIRC12Key("C", Clear_Key, 0x01, 0x0E); // "C00"
+  addSIRC12Key("CHANNEL/PAGE+", ChannelUp_Key, 0x01, 0x10);
+  addSIRC12Key("CHANNEL/PAGE-", ChannelDown_Key, 0x01, 0x11);
+  addSIRC12Key("VOLUME+", VolumeUp_Key, 0x01, 0x12);
+  addSIRC12Key("VOLUME-", VolumeDown_Key, 0x01, 0x13);
+  addSIRC12Key("MUTE", Mute_Key, 0x01, 0x14);
+  addSIRC12Key("POWER", Power_Key, 0x01, 0x15);
+  addSIRC12Key("normalise", Reset_Key, 0x01, 0x16); // "reset"
+  addSIRC12Key("a/b", Audio_Key, 0x01, 0x17); // "mts", "sap", "language"
+  addSIRC12Key("picture_up", Unmapped_Key, 0x01, 0x18); // "Contrast Up"
+  addSIRC12Key("picture_down", Unmapped_Key, 0x1, 0x19); // "Contrast Down"
+  addSIRC12Key("-/--", DoubleDigit_Key, 0x01, 0x1D);
+  addSIRC12Key("tv/video", Input_Key, 0x01, 0x25);
+  addSIRC12Key("bucket", Unmapped_Key, 0x01, 0x28);
+  addSIRC12Key("stereo", Surround_Key, 0x01, 0x29);
+  addSIRC12Key("ANT", Unmapped_Key, 0x01, 0x2A);
+  addSIRC12Key("time", Clock_Key, 0x01, 0x2B);
+  addSIRC12Key("timer/block", Timer_Key, 0x01, 0x30);
+  addSIRC12Key("right", Right_Key, 0x01, 0x33);
+  addSIRC12Key("left", Left_Key, 0x01, 0x34);
+  addSIRC12Key("sleep", Sleep_Key, 0x01, 0x36);
+  addSIRC12Key("TV-RETURN", Unmapped_Key, 0x01, 0x38); // "analog"
+  addSIRC12Key("?/INFO", Info_Key, 0x01, 0x3A); // Teletext Index
+  addSIRC12Key("prev_ch", PrevChannel_Key, 0x01, 0x3B); // "jump"
+  addSIRC12Key("off/repeat", Repeat_Key, 0x01, 0x3C);
+  addSIRC12Key("TELETXT", Teletext_Key, 0x01, 0x3F);
+  addSIRC12Key("favourite", Unmapped_Key, 0x01, 0x4A); // separate keyset?
+  addSIRC12Key("cable", Unmapped_Key, 0x01, 0x4E);
+  addSIRC12Key("pip_ch+", PIPChannelUp_Key, 0x01, 0x58);
+  addSIRC12Key("pip_ch-", PIPChannelDown_Key, 0x01, 0x59);
+  addSIRC12Key("piptv_video", PIPSource_Key, 0x01, 0x5A);
+  addSIRC12Key("PIP", PIP_Key, 0x01, 0x5B);
+  addSIRC12Key("pipfreeze", PIPPause_Key, 0x01, 0x5C);
+  addSIRC12Key("PIP_POSITION", PIPMove_Key, 0x01, 0x5E);
+  addSIRC12Key("PIP_SWAP", PIPSwap_Key, 0x01, 0x5F);
+  addSIRC12Key("PIP_SOURCE", Unmapped_Key, 0x01, 0x67); // separate keyset?
+  addSIRC12Key("Sat", Unmapped_Key, 0x01, 0x51);
+  addSIRC12Key("MENU", Menu_Key, 0x01, 0x60);
+  addSIRC12Key("Settup_V", Unmapped_Key, 0x01, 0x61); // alternate pic mode
+  addSIRC12Key("Settup_A", Unmapped_Key, 0x01, 0x62); // alternate sound mode
+  addSIRC12Key("EXIT", Exit_Key, 0x01, 0x63);
+  addSIRC12Key("picturemode", PictureMode_Key, 0x01, 0x64);
+  addSIRC12Key("OK", Select_Key, 0x01, 0x65); // "return", "select", "enter"
+  addSIRC12Key("output", Unmapped_Key, 0x01, 0x66);
+  addSIRC12Key("asterisk", Unmapped_Key, 0x01, 0x68); // "TV System"
+  addSIRC12Key("auto_program", Unmapped_Key, 0x01, 0x6B);
+  addSIRC12Key("setup", Program_Key, 0x01, 0x6C);
+  addSIRC12Key("tune_down", Unmapped_Key, 0x01, 0x6F); // "search -"
+  addSIRC12Key("tune_up", Unmapped_Key, 0x01, 0x6E); // "search +"
+  addSIRC12Key("up", Up_Key, 0x01, 0x74);
+  addSIRC12Key("down", Down_Key, 0x01, 0x75);
+  addSIRC12Key("diamond", Unmapped_Key, 0x01, 0x78); // "add"
+  addSIRC12Key("erase", Unmapped_Key, 0x01, 0x79);
+  addSIRC12Key("select", Unmapped_Key, 0x01, 0x7C); // PictureMode_Key?
+
+  addSIRC12Key("vt_inf", TeletextIndex_Key, 0x03, 0x48); // "Teletext Home"
+  addSIRC12Key("expand", TeletextSize_Key, 0x03, 0x49);
+  addSIRC12Key("Teletext Hold", TeletextHold_Key, 0x03, 0x4A); // "shrink"
+  addSIRC12Key("subtitles", Unmapped_Key, 0x03, 0x4B); // Teletext subtitles
+  addSIRC12Key("LEFT/-/RED", Red_Key, 0x03, 0x4C);
+  addSIRC12Key("UP/GREEN", Green_Key, 0x03, 0x4D);
+  addSIRC12Key("RIGHT/+/YELLOW", Yellow_Key, 0x03, 0x4E);
+  addSIRC12Key("DOWN/BLUE", Blue_Key, 0x03, 0x4F);
+
+  addSIRC15Key("SYNC_MENU", Unmapped_Key, 0x1A, 0x58);
+  addSIRC15Key("SCENE", Unmapped_Key, 0x1A, 0x78);
+  addSIRC15Key("INTERNET_VIDEO", Unmapped_Key, 0x1A, 0x79);
+  addSIRC15Key("I-MANUAL", Unmapped_Key, 0x1A, 0x7B);
+
+  addSIRC15Key("DIGITAL_ANALOG", Unmapped_Key, 0x77, 0x0D);
+  addSIRC15Key("DIGITAL", Unmapped_Key, 0x77, 0x52);
+  addSIRC15Key("theatre", Unmapped_Key, 0x77, 0x60); // "Home Theater"
+  addSIRC15Key("FAVORITES", Favorites_Key, 0x77, 0x76);
+
+  addSIRC15Key("STOP", Stop_Key, 0x97, 0x18);
+  addSIRC15Key("PAUSE", Pause_Key, 0x97, 0x19);
+  addSIRC15Key("PLAY", Play_Key, 0x97, 0x1A);
+  addSIRC15Key("FBACKWARD", Rewind_Key, 0x97, 0x1B);
+  addSIRC15Key("FFORWARD", FastForward_Key, 0x97, 0x1C);
+  addSIRC15Key("DOT", Unmapped_Key, 0x97, 0x1D);
+  addSIRC15Key("RETURN", Unmapped_Key, 0x97, 0x23); // exit?
+  addSIRC15Key("TOOLS", Unmapped_Key, 0x97, 0x36); // "OPTIONS"
+  addSIRC15Key("PREVIOUS", Previous_Key, 0x97, 0x3C);
+  addSIRC15Key("NEXT", Next_Key, 0x97, 0x3D);
+  addSIRC15Key("REPLAY", Replay_Key, 0x97, 0x79);
+  addSIRC15Key("ADVANCE", Advance_Key, 0x97, 0x78);
+  addSIRC15Key("SOUND", Unmapped_Key, 0x97, 0x7B);
+
+  addSIRC15Key("Surround_Mode", Unmapped_Key, 0xA4, 0x1F); // "Music"
+  addSIRC15Key("16:9", AspectRatio_Key, 0xA4, 0x3D); // "WIDE"
+  addSIRC15Key("EPG", Guide_Key, 0xA4, 0x5B);
+  addSIRC15Key("PIP_Audio", Unmapped_Key, 0xA4, 0x7C);
 }
 
 
-SonyTV1b::SonyTV1b(
+SonyTV1a::SonyTV1a(
   QObject *guiObject,
   unsigned int index)
   : SonyTV1(guiObject, index)
 {
-  setKeysetName("TV Keyset 1b");
-
-  addKey("clear", Unmapped_Key, 0x2D0, 12); // 0x168
-  addKey("level_plus", Unmapped_Key, 0x2F0, 12); // 0x178
-  addKey("level_minus", Unmapped_Key, 0xAF0, 12); // 0x578
-  addKey("am/pm", Unmapped_Key, 0xCD0, 12); // 0x668
-}
-
+  setKeysetName("TV Keyset 1a");
 
-/*
-SonyTV1c::SonyTV1c(
-  QObject *guiObject,
-  unsigned int index)
-  : SonyTV1(guiObject, index)
-{
-  setKeysetName("TV Keyset 1c");
+  addControlledDevice(Sony_Make, "Trinitron KDW-25", TV_Device);
 
-  addKey("pip_move", PIPPosition_Key, 0x7B0, 12);
-  addKey("pip_swap", PIPSwap_Key, 0xFB0, 12);
-  addKey("pip_ch+", PIPChannelUp_Key, 0x1B0, 12);
-  addKey("pip_ch-", PIPChannelDown_Key, 0x9B0, 12);
+  addSIRC12Key("LEFT/-/RED", Left_Key, 0x03, 0x4C);
+  addSIRC12Key("UP/GREEN", Up_Key, 0x03, 0x4D);
+  addSIRC12Key("RIGHT/+/YELLOW", Right_Key, 0x03, 0x4E);
+  addSIRC12Key("DOWN/BLUE", Down_Key, 0x03, 0x4F);
 }
-*/
 
 
-// Note, deeper inheritance on this one:
-SonyTV1d::SonyTV1d(
+SonyTV1b::SonyTV1b(
   QObject *guiObject,
   unsigned int index)
   : SonyTV1a(guiObject, index)
 {
-  setKeysetName("TV Keyset 1d");
-
-  addKey("play", Play_Key, 0xFB0, 12);
-  addKey("<<", Rewind_Key, 0x9B0, 12);
-  addKey(">>", FastForward_Key, 0x1B0, 12);
-  addKey("pause", Pause_Key, 0x3B0, 12);
-  addKey("stop", Stop_Key, 0x7B0, 12);
-  addKey("rec", Record_Key, 0x5B0, 12);
-
-  addKey("RED", Red_Key, 0x52E9, 15);
-  addKey("GREEN", Green_Key, 0x32E9, 15);
-  addKey("YELLOW", Yellow_Key, 0x72E9, 15);
-  addKey("BLUE", Blue_Key, 0x12E9, 15);
-  addKey("SUBTITLES", Captions_Key, 0x0AE9, 15); // this might be wrong
+  setKeysetName("TV Keyset 1b");
+
+  addSIRC12Key("clear", Unmapped_Key, 0x01, 0x34); // "Clock Clear"
+  addSIRC12Key("level_plus", Unmapped_Key, 0x01, 0x74);
+  addSIRC12Key("level_minus", Unmapped_Key, 0x01, 0x75);
+  addSIRC12Key("am/pm", Unmapped_Key, 0x01, 0x33);
 }
 
 
-/*
-SonyTV2::SonyTV2(
+// Not sure about these codes:
+SonyTV1c::SonyTV1c(
   QObject *guiObject,
   unsigned int index)
-  : PIRKeysetMetaData(
-      "TV Keyset 2",
-      Sony_Make,
-      index)
+  : SonyTV1(guiObject, index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    1262, 515,
-    661, 515,
-    26187, false);
-
-  threadableProtocl = np;
-
-  np->setHeaderPair(2470, 515);
-  np->setTrailer(661);
-
-  addKey("MUTE", Mute_Key, 0x6B7, 11);
-  addKey("ON/STANDBY", Power_Key, 0x2B7, 11);
-  addKey("TV", Unmapped_Key, 0x717, 11); // teletext
-  addKey("TELETEXT", Unmapped_Key, 0x017, 11); // teletext
-  addKey("INPUT", Input_Key, 0x2D7, 11);
-  addKey("OUTPUT", Unmapped_Key, 0x4C7, 11);
-  addKey("1", One_Key, 0x7F7, 11);
-  addKey("2", Two_Key, 0x3F7, 11);
-  addKey("3", Three_Key, 0x5F7, 11);
-  addKey("4", Four_Key, 0x1F7, 11);
-  addKey("5", Five_Key, 0x6F7, 11);
-  addKey("6", Six_Key, 0x2F7, 11);
-  addKey("7", Seven_Key, 0x4F7, 11);
-  addKey("8", Eight_Key, 0x0F7, 11);
-  addKey("9", Nine_Key, 0x777, 11);
-  addKey("0", Zero_Key, 0x377, 11);
-  addKey("-/--", DoubleDigit_Key, 0x237, 11);
-  addKey("C", Clear_Key, 0x477, 11);
-  addKey("PIP", PIP_Key, 0x127, 11);
-  addKey("PIP_POSITION", PIPPosition_Key, 0x427, 11);
-  addKey("PIP_SWAP", PIPSwap_Key, 0x027, 11);
-  addKey("PIP_SOURCE", PIPSource_Key, 0x0C7, 11);
-  addKey("RED", Red_Key, 0x663, 11);
-  addKey("GREEN", Green_Key, 0x263, 11);
-  addKey("YELLOW", Yellow_Key, 0x463, 11);
-  addKey("BLUE", Blue_Key, 0x063, 11);
-  addKey("TELETEXT_HOLD", Unmapped_Key, 0x563, 11);
-  addKey("INFO", Info_Key, 0x517, 11);
-  addKey("SAT", Unmapped_Key, 0x3A7, 11);
-  addKey("VOLUME+", VolumeUp_Key, 0x5B7, 11);
-  addKey("VOLUME-", VolumeDown_Key, 0x1B7, 11);
-  addKey("PROGR+", ChannelUp_Key, 0x7B7, 11);
-  addKey("PROGR-", ChannelDown_Key, 0x3B7, 11);
-  addKey("PICTURE", Unmapped_Key, 0x3C7, 11);
-  addKey("SOUND", Unmapped_Key, 0x5C7, 11);
-  addKey("MENU", Menu_Key, 0x7C7, 11);
-  addKey("BACK", Left_Key, 0x697, 11);
-  addKey("UP", Up_Key, 0x687, 11);
-  addKey("DOWN", Down_Key, 0x287, 11);
-  addKey("OK", Enter_Key, 0x2C7, 11);
-  addKey("OK", Select_Key, 0x2C7, 11);
-  addKey("RGB1", Unmapped_Key, 0x1E7, 11);
-  addKey("RGB2", Unmapped_Key, 0x6E7, 11);
-  addKey("Line", Unmapped_Key, 0x7E7, 11);
-  addKey("Y-C", Unmapped_Key, 0x267, 11);
-  addKey("MTS-MPX", Unmapped_Key, 0x0B7, 11);
-  addKey("Still", Unmapped_Key, 0x627, 11);
-  addKey("PowerOn", Unmapped_Key, 0x457, 11);
-  addKey("PowerOff", Unmapped_Key, 0x057, 11);
+  setKeysetName("TV Keyset 1c");
+
+  addSIRC12Key(">>", FastForward_Key, 0x01, 0x58);
+  addSIRC12Key("<<", Rewind_Key, 0x01, 0x59);
+  addSIRC12Key("rec", Record_Key, 0x01, 0x5A);
+  addSIRC12Key("pause", Pause_Key, 0x01, 0x5C);
+  addSIRC12Key("stop", Stop_Key, 0x01, 0x5E);
+  addSIRC12Key("play", Play_Key, 0x01, 0x5F);
+
+  addSIRC15Key("BLUE", Blue_Key, 0x97, 0x24);
+  addSIRC15Key("RED", Red_Key, 0x97, 0x25);
+  addSIRC15Key("GREEN", Green_Key, 0x97, 0x26);
+  addSIRC15Key("YELLOW", Yellow_Key, 0x97, 0x27);
+  addSIRC15Key("SUBTITLES", Captions_Key, 0x97, 0x28);
 }
-*/
 
 
+// These controls don't quite match other SIRC data.  (some do, some don't)
+// This all taken from LIRC "AMPIR" config file.
 SonyAmp1::SonyAmp1(
   QObject *guiObject,
   unsigned int index)
@@ -297,56 +194,44 @@ SonyAmp1::SonyAmp1(
       Sony_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 600,
-    1200, 600,
-    25000, false);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(2400, 600);
-
-//  np->setMinimumRepetitions(2);
-
-  setPostData(0xC, 6);
-
-  addKey("VIDEO1", Unmapped_Key, 0x22, 7);
-  addKey("VIDEO2", Unmapped_Key, 0x3C, 7);
-  addKey("VIDEO3", Unmapped_Key, 0x21, 7);
-  addKey("VIDEO4", Unmapped_Key, 0x61, 7);
-  addKey("DVD", Unmapped_Key, 0x5F, 7);
-  addKey("LD", Unmapped_Key, 0x4C, 7);
-  addKey("TV2", Unmapped_Key, 0x2B, 7);
-  addKey("TV", Unmapped_Key, 0x0C, 7);
-  addKey("MD", Unmapped_Key, 0x4B, 7);
-  addKey("TAPE", Unmapped_Key, 0x62, 7);
-  addKey("DAT", Unmapped_Key, 0x31, 7);
-  addKey("CD", Unmapped_Key, 0x52, 7);
-  addKey("TUNER", Unmapped_Key, 0x42, 7);
-  addKey("PHONO", Unmapped_Key, 0x02, 7);
-  addKey("DIGITAL", Unmapped_Key, 0x11, 7);
-  addKey("5.1CH", Unmapped_Key, 0x27, 7);
-  addKey("VOL+", VolumeUp_Key, 0x24, 7);
-  addKey("VOL-", VolumeDown_Key, 0x64, 7);
-  addKey("MUTE", Mute_Key, 0x14, 7);
-  addKey("POWER", Power_Key, 0x54, 7);
-  addKey("SLEEP", Sleep_Key, 0x03, 7);
-  addKey("1", One_Key, 0x00, 7);
-  addKey("2", Two_Key, 0x40, 7);
-  addKey("3", Three_Key, 0x20, 7);
-  addKey("4", Four_Key, 0x60, 7);
-  addKey("5", Five_Key, 0x10, 7);
-  addKey("6", Six_Key, 0x50, 7);
-  addKey("7", Seven_Key, 0x30, 7);
-  addKey("8", Eight_Key, 0x70, 7);
-  addKey("9", Nine_Key, 0x08, 7);
-  addKey("0", Zero_Key, 0x48, 7);
-  addKey("ENTER", Enter_Key, 0x68, 7);
+  threadableProtocol = new SIRCProtocol(guiObject, index);
+
+  addSIRC12Key("1", One_Key, 0x0C, 0x00);
+  addSIRC12Key("2", Two_Key, 0x0C, 0x01);
+  addSIRC12Key("3", Three_Key, 0x0C, 0x02);
+  addSIRC12Key("4", Four_Key, 0x0C, 0x03);
+  addSIRC12Key("5", Five_Key, 0x0C, 0x04);
+  addSIRC12Key("6", Six_Key, 0x0C, 0x05);
+  addSIRC12Key("7", Seven_Key, 0x0C, 0x06);
+  addSIRC12Key("8", Eight_Key, 0x0C, 0x07);
+  addSIRC12Key("9", Nine_Key, 0x0C, 0x08);
+  addSIRC12Key("0", Zero_Key, 0x0C, 0x09);
+  addSIRC12Key("ENTER", Enter_Key, 0x0C, 0x0B);
+  addSIRC12Key("DIGITAL", Unmapped_Key, 0x0C, 0x0C);
+  addSIRC12Key("VIDEO3", Unmapped_Key, 0x0C, 0x0A);
+  addSIRC12Key("VIDEO4", Unmapped_Key, 0x0C, 0x0B);
+  addSIRC12Key("VOL+", VolumeUp_Key, 0x0C, 0x12);
+  addSIRC12Key("VOL-", VolumeDown_Key, 0x0C, 0x13);
+  addSIRC12Key("MUTE", Mute_Key, 0x0C, 0x14);
+  addSIRC12Key("POWER", Power_Key, 0x0C, 0x15);
+  addSIRC12Key("LD", Unmapped_Key, 0x0C, 0x19);
+  addSIRC12Key("TV", Unmapped_Key, 0x0C, 0x18);
+  addSIRC12Key("VIDEO2", Unmapped_Key, 0x0C, 0x1E);
+  addSIRC12Key("PHONO", Unmapped_Key, 0x0C, 0x20);
+  addSIRC12Key("TUNER", Unmapped_Key, 0x0C, 0x21);
+  addSIRC12Key("VIDEO1", Unmapped_Key, 0x0C, 0x22);
+  addSIRC12Key("TAPE", Unmapped_Key, 0x0C, 0x23);
+  addSIRC12Key("CD", Unmapped_Key, 0x0C, 0x25);
+  addSIRC12Key("DAT", Unmapped_Key, 0x0C, 0x46);
+  addSIRC12Key("SLEEP", Sleep_Key, 0x0C, 0x60);
+  addSIRC12Key("MD", Unmapped_Key, 0x0C, 0x69);
+  addSIRC12Key("TV2", Unmapped_Key, 0x0C, 0x6A);
+  addSIRC12Key("5.1CH", Unmapped_Key, 0x0C, 0x72);
+  addSIRC12Key("DVD", Unmapped_Key, 0x0C, 0x7D);
 }
 
 
+// These taken from LIRC config file "RM-AV2100T".
 SonyAmp2::SonyAmp2(
   QObject *guiObject,
   unsigned int index)
@@ -355,286 +240,151 @@ SonyAmp2::SonyAmp2(
       Sony_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 600,
-    1200, 600,
-    44737, true);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(2400, 600);
-
-//  np->setMinimumRepetitions(2);
-
-  addKey("power_on", Unmapped_Key, 0x741, 12);
-  addKey("power", Power_Key, 0xA81, 12);
-  addKey("up", Up_Key, 0x1E6, 12);
-  addKey("down", Down_Key, 0x9E6, 12);
-  addKey("left", Left_Key, 0x5E6, 12);
-  addKey("right", Right_Key, 0xDE6, 12);
-  addKey("shift", Unmapped_Key, 0xCD6, 12);
-  addKey("program_+", ChannelUp_Key, 0x096, 12);
-  addKey("program_-", ChannelDown_Key, 0x896, 12);
-  addKey("vol_+", VolumeUp_Key, 0x481, 12);
-  addKey("vol_-", VolumeDown_Key, 0xC81, 12);
-  addKey("mute", Mute_Key, 0x281, 12);
-  addKey("1", One_Key, 0x001, 12);
-  addKey("2", Two_Key, 0x801, 12);
-  addKey("3", Three_Key, 0x401, 12);
-  addKey("4", Four_Key, 0xC01, 12);
-  addKey("5", Five_Key, 0x201, 12);
-  addKey("6", Six_Key, 0xA01, 12);
-  addKey("7", Seven_Key, 0x601, 12);
-  addKey("8", Eight_Key, 0xE01, 12);
-  addKey("9", Nine_Key, 0x101, 12);
-  addKey("0", Zero_Key, 0x901, 12);
-  addKey("enter", Enter_Key, 0x301, 12);
-  addKey("video1", Unmapped_Key, 0x441, 12);
-  addKey("video2", Unmapped_Key, 0x781, 12);
-  addKey("video3", Unmapped_Key, 0x421, 12);
-  addKey("aux/vdp", Unmapped_Key, 0xB81, 12);
-  addKey("tuner", Unmapped_Key, 0x841, 12);
-  addKey("dvd", Unmapped_Key, 0xBE1, 12);
-  addKey("tv", Unmapped_Key, 0x561, 12);
-  addKey("cd", Unmapped_Key, 0xA41, 12);
-  addKey("tape", Unmapped_Key, 0xC41, 12);
-  addKey("phono", Unmapped_Key, 0x041, 12);
-  addKey("md/dat", Unmapped_Key, 0x4B08, 15); // note, longer command
+  threadableProtocol = new SIRCProtocol(guiObject, index);
+
+  addSIRC12Key("up", Up_Key, 0x0C, 0x78);
+  addSIRC12Key("down", Down_Key, 0x0C, 0x79);
+  addSIRC12Key("left", Left_Key, 0x0C, 0x7A);
+  addSIRC12Key("right", Right_Key, 0x0C, 0x7B);
+
+  addSIRC12Key("program_+", ChannelUp_Key, 0x0D, 0x10);
+  addSIRC12Key("program_-", ChannelDown_Key, 0x0D, 0x11);
+  addSIRC12Key("shift", Unmapped_Key, 0x0D, 0x55);
+
+  addSIRC12Key("1", One_Key, 0x10, 0x00);
+  addSIRC12Key("2", Two_Key, 0x10, 0x01);
+  addSIRC12Key("3", Three_Key, 0x10, 0x02);
+  addSIRC12Key("4", Four_Key, 0x10, 0x03);
+  addSIRC12Key("5", Five_Key, 0x10, 0x04);
+  addSIRC12Key("6", Six_Key, 0x10, 0x05);
+  addSIRC12Key("7", Seven_Key, 0x10, 0x06);
+  addSIRC12Key("8", Eight_Key, 0x10, 0x07);
+  addSIRC12Key("9", Nine_Key, 0x10, 0x08);
+  addSIRC12Key("0", Zero_Key, 0x10, 0x09);
+  addSIRC12Key("enter", Enter_Key, 0x10, 0x0C);
+  addSIRC12Key("vol_+", VolumeUp_Key, 0x10, 0x12);
+  addSIRC12Key("vol_-", VolumeDown_Key, 0x10, 0x13);
+  addSIRC12Key("mute", Mute_Key, 0x10, 0x14);
+  addSIRC12Key("power", Power_Key, 0x10, 0x15);
+  addSIRC12Key("aux/vdp", Unmapped_Key, 0x10, 0x1D);
+  addSIRC12Key("video2", Unmapped_Key, 0x10, 0x1E);
+  addSIRC12Key("phono", Unmapped_Key, 0x10, 0x20);
+  addSIRC12Key("tuner", Unmapped_Key, 0x10, 0x21);
+  addSIRC12Key("video1", Unmapped_Key, 0x10, 0x22);
+  addSIRC12Key("tape", Unmapped_Key, 0x10, 0x23);
+  addSIRC12Key("cd", Unmapped_Key, 0x10, 0x25);
+  addSIRC12Key("power_on", PowerOn_Key, 0x10, 0x2E);
+  addSIRC12Key("video3", Unmapped_Key, 0x10, 0x42);
+  addSIRC12Key("tv", Unmapped_Key, 0x10, 0x6A);
+  addSIRC12Key("dvd", Unmapped_Key, 0x10, 0x7D);
+
+  addSIRC15Key("md/dat", Unmapped_Key, 0x10, 0x69);
 }
 
 
-SonyCD1::SonyCD1(
+SonyAudio1::SonyAudio1(
   QObject *guiObject,
   unsigned int index)
   : PIRKeysetMetaData(
-      "CD Player Keyset 1",
+      "Audio Keyset 1",
       Sony_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 600,
-    1200, 600,
-    45000, true);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(2400, 600);
-
-  addKey("DSG", Unmapped_Key, 0x8C6, 12);
-  addKey("DISPLAY", Info_Key, 0xD21, 12);
-  addKey("ON-OFF", Power_Key, 0xA81, 12);
-  addKey("CD", Unmapped_Key, 0x4D1, 12);
-  addKey("TUNER-BAND", Unmapped_Key, 0xF16, 12);
-  addKey("TAPE", Unmapped_Key, 0x2CE, 12);
-  addKey("DIR_MODE", Unmapped_Key, 0x28E, 12);
-  addKey("PLAY_MODE", Unmapped_Key, 0x371, 12);
-  addKey("REC", Record_Key, 0x78E, 12);
-  addKey("CD_REPEAT", Unmapped_Key, 0x351, 12);
-  addKey("STEREO-MONO", Unmapped_Key, 0x856, 12);
-  addKey("TUNING_MODE", Unmapped_Key, 0xE96, 12);
-  addKey("MEMORY", Unmapped_Key, 0x716, 12);
-  addKey("TIMER_SET", Unmapped_Key, 0xA61, 12);
-  addKey("TIMER_SELECT", Unmapped_Key, 0x461, 12); // also "clock_select"
-  addKey("SLEEP", Sleep_Key, 0x061, 12);
-  addKey("VOL+", VolumeUp_Key, 0x481, 12);
-  addKey("VOL-", VolumeDown_Key, 0xC81, 12);
-  addKey("md", Unmapped_Key, 0x961, 12);
-  addKey("tuner", Unmapped_Key, 0xF01, 12);
-  addKey("game", Unmapped_Key, 0x3E1, 12);
-  addKey("cd", Unmapped_Key, 0xA41, 12);
-  addKey("dimmer", Unmapped_Key, 0xB21, 12);
-  addKey("karaoke_mpx", Unmapped_Key, 0xFA1, 12);
-  addKey("effect_on_off", Unmapped_Key, 0xF81, 12);
-  addKey("display", Unmapped_Key, 0xD21, 12);
-  addKey("tv_video", Input_Key, 0xA50, 12);
-
-  addKey("game_mixing", Unmapped_Key, 0x6609, 15);
-  addKey("spectrum", Unmapped_Key, 0x1609, 15);
-  addKey("cinema_effect", Unmapped_Key, 0x0109, 15);
-  addKey("surround_speaker_mode", Surround_Key, 0x7D09, 15);
-  addKey("music_eq", Unmapped_Key, 0x0309, 15);
-  addKey("movie_eq", Unmapped_Key, 0x4309, 15);
-  addKey("game_eq", Unmapped_Key, 0x2309, 15);
-  addKey("p_file", Unmapped_Key, 0x4E09, 15);
-
-  addKey("KEY_PAUSE", Pause_Key, 0x9CB9C, 20);
-  addKey("KEY_STOP", Stop_Key, 0x1CB9C, 20);
-  addKey("KEY_PREV_SONG", Previous_Key, 0x0CB9C, 20);
-  addKey("KEY_NEXT_SONG", Next_Key, 0x8CB9C, 20);
-  addKey("KEY_PREV", Rewind_Key, 0xCCB9C, 20);
-  addKey("KEY_NEXT", FastForward_Key, 0x2CB9C, 20);
-  addKey("KEY_ENTER", Enter_Key, 0x30B9C, 20);
-  addKey("1", One_Key, 0x00B9C, 20);
-  addKey("2", Two_Key, 0x80B9C, 20);
-  addKey("3", Three_Key, 0x40B9C, 20);
-  addKey("4", Four_Key, 0xC0B9C, 20);
-  addKey("5", Five_Key, 0x20B9C, 20);
-  addKey("6", Six_Key, 0xA0B9C, 20);
-  addKey("7", Seven_Key, 0x60B9C, 20);
-  addKey("8", Eight_Key, 0xE0B9C, 20);
-  addKey("9", Nine_Key, 0x10B9C, 20);
-  addKey("0", Zero_Key, 0x90B9C, 20);
-  addKey("gt_10", DoubleDigit_Key, 0xB0B9C, 20);
-  addKey("special_menu", Menu_Key, 0xCAB8C, 20);
-  addKey("clear", Clear_Key, 0xF0B9C, 20);
-  addKey("repeat", Unmapped_Key, 0x34B9C, 20);
-  addKey("d_skip", Unmapped_Key, 0x7CB9C, 20);
-  addKey("on_screen", Unmapped_Key, 0xAAB8C, 20);
-  addKey("prev_r", Unmapped_Key, 0x6CB8C, 20);
-  addKey("next_r", Unmapped_Key, 0xECB8C, 20);
-  addKey("return", Exit_Key, 0x70B8C, 20);
-  addKey("album+", Unmapped_Key, 0xF6B8C, 20);
-  addKey("album-", Unmapped_Key, 0x76B8C, 20);
-  addKey("sharp", Unmapped_Key, 0xD6B8C, 20);
-  addKey("flat", Unmapped_Key, 0x36B8C, 20);
-  addKey("up", Up_Key, 0x1EB9C, 20);
-  addKey("down", Down_Key, 0x9EB9C, 20);
-  addKey("left", Left_Key, 0x5EB9C, 20);
-  addKey("right", Right_Key, 0xDEB9C, 20);
-}
-
-
-SonyCD1a::SonyCD1a(
-  QObject *guiObject,
-  unsigned int index)
-  : SonyCD1(guiObject, index)
-{
-  setKeysetName("CD Keyset 1a");
-
-  addKey("tape", Unmapped_Key, 0xC41, 12);
-
-  addKey("select", Select_Key, 0x4CB9C, 20);
-  addKey("play", Play_Key, 0x4CB9C, 20);
-  addKey("play_mode", Unmapped_Key, 0x64B9C, 20);
-  addKey("enter", Enter_Key, 0x3EB9C, 20);
+  threadableProtocol = new SIRCProtocol(guiObject, index);
+
+  addSIRC12Key("tv_video", Input_Key, 0x01, 0x25);
+
+  addSIRC12Key("DSG", Unmapped_Key, 0x0C, 0x31);
+
+  addSIRC12Key("MEMORY", Program_Key, 0x0D, 0x0E);
+  addSIRC12Key("TUNER-BAND", TunerBand_Key, 0x0D, 0x0F);
+  addSIRC12Key("TUNING_MODE", Unmapped_Key, 0x0D, 0x17);
+  addSIRC12Key("STEREO-MONO", Audio_Key, 0x0D, 0x21);
+
+  addSIRC12Key("DIR_MODE", Unmapped_Key, 0x0E, 0x14);
+  addSIRC12Key("REC", Record_Key, 0x0E, 0x1E);
+  addSIRC12Key("TAPE", Unmapped_Key, 0x0E, 0x34);
+
+  addSIRC12Key("tuner", Unmapped_Key, 0x10, 0x0F); // "Tune Up"
+  addSIRC12Key("VOL+", VolumeUp_Key, 0x10, 0x12);
+  addSIRC12Key("VOL-", VolumeDown_Key, 0x10, 0x13);
+  addSIRC12Key("ON-OFF", Power_Key, 0x10, 0x15);
+  addSIRC12Key("effect_on_off", Unmapped_Key, 0x10, 0x1F);
+  addSIRC12Key("cd", Unmapped_Key, 0x10, 0x25);
+  addSIRC12Key("DISPLAY", Info_Key, 0x10, 0x4B);
+  addSIRC12Key("dimmer", Unmapped_Key, 0x10, 0x4D);
+  addSIRC12Key("karaoke_mpx", Unmapped_Key, 0x10, 0x5F);
+  addSIRC12Key("SLEEP", Sleep_Key, 0x10, 0x60);
+  addSIRC12Key("TIMER_SELECT", Unmapped_Key, 0x10, 0x62); // "clock_select"
+  addSIRC12Key("TIMER_SET", Timer_Key, 0x10, 0x65);
+  addSIRC12Key("md", Unmapped_Key, 0x10, 0x69);
+  addSIRC12Key("game", Unmapped_Key, 0x10, 0x7C);
+
+  addSIRC12Key("CD_REPEAT", Repeat_Key, 0x11, 0x2C);
+  addSIRC12Key("CD", Unmapped_Key, 0x11, 0x32);
+  addSIRC12Key("PLAY_MODE", Unmapped_Key, 0x11, 0x6C);
+
+  addSIRC15Key("cinema_effect", Unmapped_Key, 0x90, 0x08);
+  addSIRC15Key("game_mixing", Unmapped_Key, 0x90, 0x33);
+  addSIRC15Key("spectrum", Unmapped_Key, 0x90, 0x34);
+  addSIRC15Key("p_file", Unmapped_Key, 0x90, 0x39);
+  addSIRC15Key("surround_speaker_mode", Surround_Key, 0x90, 0x5F);
+  addSIRC15Key("music_eq", Unmapped_Key, 0x90, 0x60);
+  addSIRC15Key("movie_eq", Unmapped_Key, 0x90, 0x61);
+  addSIRC15Key("game_eq", Unmapped_Key, 0x90, 0x62);
+
+  addSIRC20Key("return", Exit_Key, 0x31, 0x1A, 0x0E);
+  addSIRC20Key("prev_r", Unmapped_Key, 0x31, 0x1A, 0x36);
+  addSIRC20Key("next_r", Unmapped_Key, 0x31, 0x1A, 0x37);
+  addSIRC20Key("special_menu", Menu_Key, 0x31, 0x1A, 0x53);
+  addSIRC20Key("on_screen", Unmapped_Key, 0x31, 0x1A, 0x55);
+  addSIRC20Key("sharp", Unmapped_Key, 0x31, 0x1A, 0x6B);
+  addSIRC20Key("flat", Unmapped_Key, 0x31, 0x1A, 0x6C);
+  addSIRC20Key("album-", Unmapped_Key, 0x31, 0x1A, 0x6E);
+  addSIRC20Key("album+", Unmapped_Key, 0x31, 0x1A, 0x6F);
+
+  addSIRC20Key("1", One_Key, 0x39, 0x1A, 0x00);
+  addSIRC20Key("2", Two_Key, 0x39, 0x1A, 0x01);
+  addSIRC20Key("3", Three_Key, 0x39, 0x1A, 0x02);
+  addSIRC20Key("4", Four_Key, 0x39, 0x1A, 0x03);
+  addSIRC20Key("5", Five_Key, 0x39, 0x1A, 0x04);
+  addSIRC20Key("6", Six_Key, 0x39, 0x1A, 0x05);
+  addSIRC20Key("7", Seven_Key, 0x39, 0x1A, 0x06);
+  addSIRC20Key("8", Eight_Key, 0x39, 0x1A, 0x07);
+  addSIRC20Key("9", Nine_Key, 0x39, 0x1A, 0x08);
+  addSIRC20Key("0", Zero_Key, 0x39, 0x1A, 0x09);
+  addSIRC20Key("KEY_ENTER", Enter_Key, 0x39, 0x1A, 0x0C);
+  addSIRC20Key("gt_10", DoubleDigit_Key, 0x39, 0x1A, 0x0D);
+  addSIRC20Key("clear", Clear_Key, 0x39, 0x1A, 0x0F);
+  addSIRC20Key("repeat", Repeat_Key, 0x39, 0x1A, 0x2C);
+  addSIRC20Key("KEY_PREV_SONG", Previous_Key, 0x39, 0x1A, 0x30);
+  addSIRC20Key("KEY_NEXT_SONG", Next_Key, 0x39, 0x1A, 0x31);
+  addSIRC20Key("KEY_PREV", Rewind_Key, 0x39, 0x1A, 0x33); // "Rewind"
+  addSIRC20Key("KEY_NEXT", FastForward_Key, 0x39, 0x1A, 0x34); // "Fast Forward"
+  addSIRC20Key("KEY_STOP", Stop_Key, 0x39, 0x1A, 0x38);
+  addSIRC20Key("KEY_PAUSE", Pause_Key, 0x39, 0x1A, 0x39);
+  addSIRC20Key("d_skip", DiscSelect_Key, 0x39, 0x1A, 0x3E);
+  addSIRC20Key("up", Up_Key, 0x39, 0x1A, 0x78);
+  addSIRC20Key("down", Down_Key, 0x39, 0x1A, 0x79);
+  addSIRC20Key("left", Left_Key, 0x39, 0x1A, 0x7A);
+  addSIRC20Key("right", Right_Key, 0x39, 0x1A, 0x7B);
+  addSIRC20Key("Select", Select_Key, 0x39, 0x1A, 0x7C);
 }
 
 
-SonyCD2::SonyCD2(
+SonyAudio1a::SonyAudio1a(
   QObject *guiObject,
   unsigned int index)
-  : PIRKeysetMetaData(
-      "CD Keyset 2",
-      Sony_Make,
-      index)
+  : SonyAudio1(guiObject, index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    612, 588,
-    1210, 588,
-    45604, true);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(2412, 588);
-
-  setPostData(0x7, 4);
-
-  addKey("PLAY", Play_Key, 0x59, 7);
-  addKey("STOP", Stop_Key, 0x71, 7);
-  addKey("PAUSE", Pause_Key, 0x31, 7);
-  addKey("NEXT", Next_Key, 0x39, 7);
-  addKey("PREV", Previous_Key, 0x79, 7);
-  addKey("FAST_FORWARD", FastForward_Key, 0x69, 7);
-  addKey("FAST_BACKWARD", Rewind_Key, 0x19, 7);
-  addKey("FORWARD", StepForward_Key, 0x11, 7);
-  addKey("BACKWARD", StepBack_Key, 0x51, 7);
-  addKey("VOLUME_UP", VolumeUp_Key, 0x5B, 7);
-  addKey("VOLUME_DOWN", VolumeDown_Key, 0x1B, 7);
-  addKey("RED", Red_Key, 0x03, 7);
-  addKey("GREEN", Green_Key, 0x29, 7);
-  addKey("YELLOW", Yellow_Key, 0x23, 7);
-  addKey("BLUE", Blue_Key, 0x43, 7);
-  addKey("QUIT", Exit_Key, 0x4B, 7);
-  addKey("UP", Up_Key, 0x07, 7);
-  addKey("DOWN", Down_Key, 0x02, 7);
-  addKey("RIGHT", Right_Key, 0x75, 7);
-  addKey("LEFT", Left_Key, 0x55, 7);
-  addKey("OK", Enter_Key, 0x0D, 7);
-  addKey("MENU1", Menu_Key, 0x0D, 7); // This might be wrong
-  addKey("MENU2", Unmapped_Key, 0x65, 7);
-  addKey("1", One_Key, 0x7F, 7);
-  addKey("TWO", Two_Key, 0x3F, 7);
-  addKey("3", Three_Key, 0x5F, 7);
-  addKey("4", Four_Key, 0x1F, 7);
-  addKey("5", Five_Key, 0x6F, 7);
-  addKey("6", Six_Key, 0x2F, 7);
-  addKey("7", Seven_Key, 0x4F, 7);
-  addKey("8", Eight_Key, 0x0F, 7);
-  addKey("9", Nine_Key, 0x77, 7);
-  addKey("10", Unmapped_Key, 0x7D, 7);
-  addKey("11", Unmapped_Key, 0x3D, 7);
-  addKey("12", Unmapped_Key, 0x5D, 7);
-  addKey("13", Unmapped_Key, 0x1D, 7);
-  addKey("14", Unmapped_Key, 0x6D, 7);
-  addKey("15", Unmapped_Key, 0x2D, 7);
-  addKey("16", Unmapped_Key, 0x4D, 7);
-  addKey("17", Unmapped_Key, 0x7B, 7);
-  addKey("18", Unmapped_Key, 0x3B, 7);
-  addKey("19", Unmapped_Key, 0x0B, 7);
-  addKey("20", Unmapped_Key, 0x35, 7);
-  addKey("ZERO", Zero_Key, 0x0D, 7);
-  addKey("CHECK", Unmapped_Key, 0x27, 7);
-  addKey("CLEAR", Clear_Key, 0x07, 7);
-}
+  setKeysetName("Audio Keyset 1a");
 
+  addSIRC12Key("tape", Unmapped_Key, 0x10, 0x23);
 
-SonyCD3::SonyCD3(
-  QObject *guiObject,
-  unsigned int index)
-  : PIRKeysetMetaData(
-      "CD Keyset 3",
-      Sony_Make,
-      index)
-{
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 600,
-    1200, 600,
-    44735, true);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(2400, 600);
-  np->setTrailerPulse(1200);
-
-//  np->setMinimumRepetitions(2);
-
-  setPostData(0x08, 5);
-
-  addKey("|<<", Previous_Key, 0x03, 6);
-  addKey(">>|", Next_Key, 0x23, 6);
-  addKey("<<", Rewind_Key, 0x33, 6);
-  addKey(">>", FastForward_Key, 0x0B, 6);
-  addKey("play", Play_Key, 0x13, 6);
-  addKey("stop", Stop_Key, 0x07, 6);
-  addKey("pause", Pause_Key, 0x27, 6);
-  addKey("power_on", Unmapped_Key, 0x1D, 6);
-  addKey("power", Power_Key, 0x2A, 6);
-  addKey("1", One_Key, 0x00, 6);
-  addKey("2", Two_Key, 0x20, 6);
-  addKey("3", Three_Key, 0x10, 6);
-  addKey("4", Four_Key, 0x30, 6);
-  addKey("5", Five_Key, 0x08, 6);
-  addKey("6", Six_Key, 0x28, 6);
-  addKey("7", Seven_Key, 0x18, 6);
-  addKey("8", Eight_Key, 0x38, 6);
-  addKey("9", Nine_Key, 0x04, 6);
-  addKey("0", Zero_Key, 0x01, 6);
-  addKey("+10", DoubleDigit_Key, 0x39, 6);
-  addKey("enter", Enter_Key, 0x34, 6);
-  addKey("clear", Clear_Key, 0x3C, 6);
-  addKey("d_skip", Unmapped_Key, 0x1F, 6);
-  addKey("repeat", Unmapped_Key, 0x2D, 6);
-  addKey("continue", Unmapped_Key, 0x2E, 6);
-  addKey("shuffle", Unmapped_Key, 0x2B, 6);
-  addKey("program", Program_Key, 0x3E, 6);
+//  addSIRC20Key("select", Select_Key, 0x39, 0x1A, 0x32); // Doesn't make sense
+  addSIRC20Key("play", Play_Key, 0x39, 0x1A, 0x32);
+  addSIRC20Key("play_mode", Unmapped_Key, 0x39, 0x1A, 0x26);
+  addSIRC20Key("enter", Select_Key, 0x39, 0x1A, 0x7C);
 }
 
 
@@ -646,48 +396,38 @@ SonyDAT1::SonyDAT1(
       Sony_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 600,
-    1200, 600,
-    25000, false);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(2400, 600);
-
-//  np->setMinimumRepetitions(2);
-
-  np->setCarrierFrequency(40000);
+  threadableProtocol = new SIRCProtocol(guiObject, index);
 
   setPostData(0x07, 5);
 
-  addKey("1", One_Key, 0x00, 7);
-  addKey("2", Two_Key, 0x40, 7);
-  addKey("3", Three_Key, 0x20, 7);
-  addKey("4", Four_Key, 0x60, 7);
-  addKey("5", Five_Key, 0x10, 7);
-  addKey("6", Six_Key, 0x50, 7);
-  addKey("7", Seven_Key, 0x30, 7);
-  addKey("8", Eight_Key, 0x70, 7);
-  addKey("9", Nine_Key, 0x08, 7);
-  addKey("0", Zero_Key, 0x14, 7);
-  addKey("PLAY", Play_Key, 0x2F, 7);
-  addKey("PAUSE", Pause_Key, 0x4E, 7);
-  addKey("STOP", Stop_Key, 0x0E, 7);
-  addKey("<<", Rewind_Key, 0x6E, 7);
-  addKey(">>", FastForward_Key, 0x1E, 7);
-  addKey("|<<", Previous_Key, 0x0B, 7);
-  addKey(">>|", Next_Key, 0x4B, 7);
-  addKey("RECORD", Record_Key, 0x3E, 7);
-  addKey("VOL+", VolumeUp_Key, 0x24, 7);
-  addKey("VOL-", VolumeDown_Key, 0x64, 7);
-  addKey("POWER_ON", Unmapped_Key, 0x3A, 7);
-  addKey("POWER_OFF", Unmapped_Key, 0x7A, 7);
-  addKey("MUTE", Mute_Key, 0x14, 7);
-  addKey("POWER", Power_Key, 0x54, 7);
-  addKey("ENTER", Enter_Key, 0x68, 7);
+  addSIRC12Key("1", One_Key, 0x1C, 0x00);
+  addSIRC12Key("2", Two_Key, 0x1C, 0x01);
+  addSIRC12Key("3", Three_Key, 0x1C, 0x02);
+  addSIRC12Key("4", Four_Key, 0x1C, 0x03); 
+  addSIRC12Key("5", Five_Key, 0x1C, 0x04);
+  addSIRC12Key("6", Six_Key, 0x1C, 0x05);
+  addSIRC12Key("7", Seven_Key, 0x1C, 0x06);
+  addSIRC12Key("8", Eight_Key, 0x1C, 0x07);
+  addSIRC12Key("9", Nine_Key, 0x1C, 0x08);
+  addSIRC12Key("0", Zero_Key, 0x1C, 0x14);
+  addSIRC12Key("PLAY", Play_Key, 0x1C, 0x3A);
+  addSIRC12Key("PAUSE", Pause_Key, 0x1C, 0x39);
+  addSIRC12Key("STOP", Stop_Key, 0x1C, 0x38);
+  addSIRC12Key("<<", Rewind_Key, 0x1C, 0x3B);
+  addSIRC12Key(">>", FastForward_Key, 0x1C, 0x3C);
+  addSIRC12Key("|<<", Previous_Key, 0x1C, 0x68);
+  addSIRC12Key(">>|", Next_Key, 0x1C, 0x69);
+  addSIRC12Key("RECORD", Record_Key, 0x1C, 0x3E);
+  addSIRC12Key("Open/Close", Eject_Key, 0x1C, 0x20);
+
+  // The following commands are dubious:
+  addSIRC12Key("VOL+", VolumeUp_Key, 0x1C, 0x12);
+  addSIRC12Key("VOL-", VolumeDown_Key, 0x1C, 0x13);
+  addSIRC12Key("POWER_ON", PowerOn_Key, 0x1C, 0x2E);
+  addSIRC12Key("POWER_OFF", PowerOff_Key, 0x1C, 0x2F);
+  addSIRC12Key("MUTE", Mute_Key, 0x1C, 0x14); // Makes no sense...
+  addSIRC12Key("POWER", Power_Key, 0x1C, 0x15);
+  addSIRC12Key("ENTER", Enter_Key, 0x1C, 0x0B);
 }
 
 
@@ -699,102 +439,96 @@ SonyDVD1::SonyDVD1(
       Sony_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 600,
-    1200, 600,
-    45000, true);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(2400, 600);
-
-//  np->setMinimumRepetitions(2);
-
-//  np->setCarrierFrequency(40000);
-
-  addKey("power", Power_Key, 0xA8B92, 20);
-  addKey("Display", Info_Key, 0x2AB92, 20);
-  addKey("prev", Previous_Key, 0x0CB92, 20);
-  addKey("next", Next_Key, 0x8CB92, 20);
-  addKey("Replay", Replay_Key, 0x3AB92, 20);
-  addKey("Advance", Advance_Key, 0x28B46, 20);
-  addKey("ffwd", FastForward_Key, 0x2CB92, 20);
-  addKey("rew", Rewind_Key, 0xCCB92, 20);
-  addKey("play", Play_Key, 0x4CB92, 20);
-  addKey("pause", Pause_Key, 0x9CB92, 20);
-  addKey("stop", Stop_Key, 0x1CB92, 20);
-  addKey("Favorites", Unmapped_Key, 0x7AB46, 20);
-  addKey("Input", Input_Key, 0x48B92, 20);
-  addKey("Guide", Guide_Key, 0x68B46, 20);
-  addKey("return", Exit_Key, 0x70B92, 20);
-  addKey("Options", Unmapped_Key, 0xE8B46, 20);
-  addKey("menu", Menu_Key, 0xCAB92, 20); // "setup"
-  addKey("up", Up_Key, 0x9EB92, 20);
-  addKey("down", Down_Key, 0x5EB92, 20);
-  addKey("left", Left_Key, 0xDEB92, 20);
-  addKey("right", Right_Key, 0x3EB92, 20);
-  addKey("select", Select_Key, 0xD0B92, 20);
-  addKey("1", One_Key, 0x00B92, 20);
-  addKey("2", Two_Key, 0x80B92, 20);
-  addKey("3", Three_Key, 0x40B92, 20);
-  addKey("4", Four_Key, 0xC0B92, 20);
-  addKey("5", Five_Key, 0x20B92, 20);
-  addKey("6", Six_Key, 0xA0B92, 20);
-  addKey("7", Seven_Key, 0x60B92, 20);
-  addKey("8", Eight_Key, 0xE0B92, 20);
-  addKey("9", Nine_Key, 0x10B92, 20);
-  addKey("0", Zero_Key, 0x90B92, 20);
-  addKey("Ent", Enter_Key, 0xB0B92, 20);
-  addKey("Dot", Unmapped_Key, 0xB8B46, 20);
-  addKey("prog+", ChannelUp_Key, 0xC8B92, 20);
-  addKey("prog-", ChannelDown_Key, 0x28B92, 20);
-  addKey("rec", Record_Key, 0x98B92, 20);
-  addKey("RecPause", Unmapped_Key, 0x7CB92, 20);
-  addKey("RecStop", Unmapped_Key, 0xBCB92, 20);
-  addKey("top_menu", DiscTitle_Key, 0x58B92, 20); // "Title"
-  addKey("dvd_menu", DiscMenu_Key, 0xD8B92, 20);
-  addKey("F1", Unmapped_Key, 0x74B46, 20);
-  addKey("F2", Unmapped_Key, 0xF4B46, 20);
-  addKey("Red", Red_Key, 0xE6B46, 20);
-  addKey("Green", Green_Key, 0x16B46, 20);
-  addKey("Purple", Blue_Key, 0x66B46, 20);
-  addKey("Yellow", Yellow_Key, 0x96B46, 20);
-  addKey("Language", Language_Key, 0x26B92, 20);
-  addKey("subtitles", Captions_Key, 0xC6B92, 20); // "Subtitle_Change"
-  addKey("X2_BACK", Unmapped_Key, 0x6CB92, 20);
-  addKey("X2_FORWARD", Unmapped_Key, 0xECB92, 20);
-  addKey("SUBTITLE_ON_OFF", Unmapped_Key, 0x46B92, 20);
-  addKey("CLEAR", Clear_Key, 0xF0B92, 20);
-  addKey("SLOW_BACK", Unmapped_Key, 0x06B92, 20);
-  addKey("SLOW_FORWARD", Unmapped_Key, 0x86B92, 20);
-  addKey("STEP_BACK", StepBack_Key, 0x5CB92, 20);       // JOG-
-  addKey("STEP_FORWARD", StepForward_Key, 0xDCB92, 20); // JOG+
-  addKey("SEARCH_MODE", Unmapped_Key, 0xD2B92, 20);
-  addKey("TIME", Unmapped_Key, 0x14B92, 20);
-  addKey("DNR", Unmapped_Key, 0x12B92, 20);
-  addKey("TV_DVD", Unmapped_Key, 0x8AB92, 20);
-  addKey("surround", Surround_Key, 0x5AB92, 20);
-  addKey("open/close", Eject_Key, 0x68B92, 20);
-  addKey("a-b", Unmapped_Key, 0x54B92, 20);
-  addKey("shuffle", Unmapped_Key, 0xACB92, 20);
-  addKey("repeat", Unmapped_Key, 0x34B92, 20);
-  addKey("program", Program_Key, 0xF8B92, 20);
-  addKey("PICTUREMODE", Unmapped_Key, 0xDAB92, 20);
-  addKey("Picture_Navi", Unmapped_Key, 0x0AB92, 20);
-  addKey("DiscSkip", Unmapped_Key, 0x7CB46, 20);
-  addKey("SA-CD_MULTI/2CH", Unmapped_Key, 0x7AB92, 20);
-  addKey("SA-CD/CD", Unmapped_Key, 0xFAB92, 20);
-  addKey("ALBUM-MINUS", Unmapped_Key, 0x94B46, 20);
-  addKey("ALBUM-PLUS", Unmapped_Key, 0x54B46, 20);
-  addKey("ZOOM", Unmapped_Key, 0x9EB46, 20);
-  addKey("POWER_ON", Unmapped_Key, 0x74B92, 20);
-  addKey("POWER_OFF", Unmapped_Key, 0xF4B92, 20);
-  addKey("INDEX+", Unmapped_Key, 0xE4B92, 20);
-  addKey("INDEX-", Unmapped_Key, 0x64B92, 20);
-  addKey("ANGLE_CHANGE", Unmapped_Key, 0xA6B92, 20);
-  addKey("JOG_STOP", Unmapped_Key, 0x94B92, 20);
+  threadableProtocol = new SIRCProtocol(guiObject, index);
+
+  addSIRC20Key("1", One_Key, 0x49, 0x1A, 0x00);
+  addSIRC20Key("2", Two_Key, 0x49, 0x1A, 0x01);
+  addSIRC20Key("3", Three_Key, 0x49, 0x1A, 0x02);
+  addSIRC20Key("4", Four_Key, 0x49, 0x1A, 0x03);
+  addSIRC20Key("5", Five_Key, 0x49, 0x1A, 0x04);
+  addSIRC20Key("6", Six_Key, 0x49, 0x1A, 0x05);
+  addSIRC20Key("7", Seven_Key, 0x49, 0x1A, 0x06);
+  addSIRC20Key("8", Eight_Key, 0x49, 0x1A, 0x07);
+  addSIRC20Key("9", Nine_Key, 0x49, 0x1A, 0x08);
+  addSIRC20Key("0", Zero_Key, 0x49, 0x1A, 0x09);
+  addSIRC20Key("select", Select_Key, 0x49, 0x1A, 0x0B); //"Enter"
+  addSIRC20Key("Disc Explorer", Unmapped_Key, 0x49, 0x1A, 0x0C);
+  addSIRC20Key("Ent", Enter_Key, 0x49, 0x1A, 0x0D); // "Set"
+  addSIRC20Key("return", Exit_Key, 0x49, 0x1A, 0x0E);
+  addSIRC20Key("CLEAR", Clear_Key, 0x49, 0x1A, 0x0F);
+  addSIRC20Key("-/--", DoubleDigit_Key, 0x49, 0x1A, 0x0F);
+
+  addSIRC20Key("Input", Input_Key, 0x49, 0x1A, 0x12);
+  addSIRC20Key("prog+", ChannelUp_Key, 0x49, 0x1A, 0x13);
+  addSIRC20Key("prog-", ChannelDown_Key, 0x49, 0x1A, 0x14);
+  addSIRC20Key("power", Power_Key, 0x49, 0x1A, 0x15);
+  addSIRC20Key("open/close", Eject_Key, 0x49, 0x1A, 0x16);
+  addSIRC20Key("rec", Record_Key, 0x49, 0x1A, 0x19);
+  addSIRC20Key("top_menu", DiscTitle_Key, 0x49, 0x1A, 0x1A); // "Title"
+  addSIRC20Key("dvd_menu", DiscMenu_Key, 0x49, 0x1A, 0x1B);
+  addSIRC20Key("program", Program_Key, 0x49, 0x1A, 0x1F);
+  addSIRC20Key("INDEX-", Unmapped_Key, 0x49, 0x1A, 0x26);
+  addSIRC20Key("INDEX+", Unmapped_Key, 0x49, 0x1A, 0x27);
+  addSIRC20Key("TIME", Unmapped_Key, 0x49, 0x1A, 0x28);
+  addSIRC20Key("JOG_STOP", Unmapped_Key, 0x49, 0x1A, 0x29); // "Pause"
+  addSIRC20Key("a-b", RepeatAB_Key, 0x49, 0x1A, 0x2A);
+  addSIRC20Key("repeat", Repeat_Key, 0x49, 0x1A, 0x2C);
+  addSIRC20Key("POWER_ON", PowerOn_Key, 0x49, 0x1A, 0x2E);
+  addSIRC20Key("POWER_OFF", PowerOff_Key, 0x49, 0x1A, 0x2F);
+
+  addSIRC20Key("prev", Previous_Key, 0x49, 0x1A, 0x30);
+  addSIRC20Key("next", Next_Key, 0x49, 0x1A, 0x31);
+  addSIRC20Key("play", Play_Key, 0x49, 0x1A, 0x32);
+  addSIRC20Key("rew", Rewind_Key, 0x49, 0x1A, 0x33);
+  addSIRC20Key("ffwd", FastForward_Key, 0x49, 0x1A, 0x34);
+  addSIRC20Key("shuffle", Random_Key, 0x49, 0x1A, 0x35);
+  addSIRC20Key("X2_BACK", Unmapped_Key, 0x49, 0x1A, 0x36);
+  addSIRC20Key("X2_FORWARD", Unmapped_Key, 0x49, 0x1A, 0x37);
+  addSIRC20Key("stop", Stop_Key, 0x49, 0x1A, 0x38);
+  addSIRC20Key("pause", Pause_Key, 0x49, 0x1A, 0x39);
+  addSIRC20Key("STEP_BACK", StepBack_Key, 0x49, 0x1A, 0x3A); // "Jog Rev"
+  addSIRC20Key("STEP_FORWARD", StepForward_Key, 0x49, 0x1A, 0x3B); // "Jog Fwd"
+  addSIRC20Key("RecStop", RecordStop_Key, 0x49, 0x1A, 0x3D);
+  addSIRC20Key("RecPause", RecordPause_Key, 0x49, 0x1A, 0x3E);
+
+  addSIRC20Key("DNR", Unmapped_Key, 0x49, 0x1A, 0x48);
+  addSIRC20Key("SEARCH_MODE", Unmapped_Key, 0x49, 0x1A, 0x4B);
+  addSIRC20Key("Picture_Navi", Unmapped_Key, 0x49, 0x1A, 0x50);
+  addSIRC20Key("TV_DVD", Unmapped_Key, 0x49, 0x1A, 0x51);
+  addSIRC20Key("menu", Menu_Key, 0x49, 0x1A, 0x53); // "setup"
+  addSIRC20Key("Display", Info_Key, 0x49, 0x1A, 0x54);
+  addSIRC20Key("surround", Surround_Key, 0x49, 0x1A, 0x5A);
+  addSIRC20Key("PICTUREMODE", PictureMode_Key, 0x49, 0x1A, 0x5B);
+  addSIRC20Key("Replay", Replay_Key, 0x49, 0x1A, 0x5C);
+  addSIRC20Key("SA-CD_MULTI/2CH", Unmapped_Key, 0x49, 0x1A, 0x5E);
+  addSIRC20Key("SA-CD/CD", Unmapped_Key, 0x49, 0x1A, 0x5F);
+
+  addSIRC20Key("SLOW_BACK", SlowMinus_Key, 0x49, 0x1A, 0x60);
+  addSIRC20Key("SLOW_FORWARD", SlowPlus_Key, 0x49, 0x1A, 0x61);
+  addSIRC20Key("SUBTITLE_ON_OFF", Captions_Key, 0x49, 0x1A, 0x62);
+  addSIRC20Key("Subtitle Change", Unmapped_Key, 0x49, 0x1A, 0x63);
+  addSIRC20Key("Language", Audio_Key, 0x49, 0x1A, 0x64); // "Audio"
+  addSIRC20Key("ANGLE_CHANGE", Angle_Key, 0x49, 0x1A, 0x65); // "Angle"
+  addSIRC20Key("up", Up_Key, 0x49, 0x1A, 0x79);
+  addSIRC20Key("down", Down_Key, 0x49, 0x1A, 0x7A);
+  addSIRC20Key("left", Left_Key, 0x49, 0x1A, 0x7B);
+  addSIRC20Key("right", Right_Key, 0x49, 0x1A, 0x7C);
+
+  addSIRC20Key("Advance", Advance_Key, 0x62, 0x1A, 0x14);
+  addSIRC20Key("Guide", Guide_Key, 0x62, 0x1A, 0x16);
+  addSIRC20Key("Options", Unmapped_Key, 0x62, 0x1A, 0x17); // "Tools"
+  addSIRC20Key("Dot", Unmapped_Key, 0x62, 0x1A, 0x1D);
+  addSIRC20Key("ALBUM-MINUS", Unmapped_Key, 0x62, 0x1A, 0x29);
+  addSIRC20Key("ALBUM-PLUS", Unmapped_Key, 0x62, 0x1A, 0x2A);
+  addSIRC20Key("F1", Unmapped_Key, 0x62, 0x1A, 0x2E); // "HDD"
+  addSIRC20Key("F2", Unmapped_Key, 0x62, 0x1A, 0x2F); // "DVD"
+  addSIRC20Key("DiscSkip", DiscSelect_Key, 0x62, 0x1A, 0x3E);
+  addSIRC20Key("Favorites", Favorites_Key, 0x62, 0x1A, 0x5E);
+  addSIRC20Key("Purple", Blue_Key, 0x62, 0x1A, 0x66);
+  addSIRC20Key("Red", Red_Key, 0x62, 0x1A, 0x67);
+  addSIRC20Key("Green", Green_Key, 0x62, 0x1A, 0x68);
+  addSIRC20Key("Yellow", Yellow_Key, 0x62, 0x1A, 0x69);
+  addSIRC20Key("ZOOM", Zoom_Key, 0x62, 0x1A, 0x79);
 }
 
 
@@ -805,10 +539,10 @@ SonyDVD1a::SonyDVD1a(
 {
   setKeysetName("DVD Keyset 1a");
 
-  addKey("STEP_BACK", StepBack_Key, 0x04B92, 20);
-  addKey("STEP_FORWARD", StepForward_Key, 0x84B92, 20);
-  addKey("SLOW_BACK", Unmapped_Key, 0x44B92, 20);
-  addKey("SLOW_FORWARD", Unmapped_Key, 0xC4B92, 20);
+  addSIRC20Key("STEP_BACK", StepBack_Key, 0x49, 0x1A, 0x20);
+  addSIRC20Key("STEP_FORWARD", StepForward_Key, 0x49, 0x1A, 0x21);
+  addSIRC20Key("SLOW_BACK", SlowMinus_Key, 0x49, 0x1A, 0x22);
+  addSIRC20Key("SLOW_FORWARD", SlowPlus_Key, 0x49, 0x1A, 0x23);
 }
 
 
@@ -819,8 +553,8 @@ SonyDVD1b::SonyDVD1b(
 {
   setKeysetName("DVD Keyset 1b");
 
-  addKey("SLOW-", Unmapped_Key, 0x4EB92, 20);
-  addKey("SLOW+", Unmapped_Key, 0xCEB92, 20);
+  addSIRC20Key("SLOW-", SlowMinus_Key, 0x49, 0x1A, 0x72);
+  addSIRC20Key("SLOW+", SlowPlus_Key, 0x49, 0x1A, 0x73);
 }
 
 
@@ -831,12 +565,12 @@ SonyDVD1c::SonyDVD1c(
 {
   setKeysetName("DVD Keyset 1c");
 
-  addKey("up", Up_Key, 0x9CB92, 20);
-  addKey("down", Down_Key, 0x1CB92, 20);
-  addKey("left", Left_Key, 0xCCB92, 20);
-  addKey("right", Right_Key, 0x2CB92, 20);
-  addKey("ok", Select_Key, 0x4CB92, 7);
-  addKey("enter", Enter_Key, 0xD0B92, 7);
+  addSIRC20Key("up", Up_Key, 0x49, 0x1A, 0x39);
+  addSIRC20Key("down", Down_Key, 0x49, 0x1A, 0x38);
+  addSIRC20Key("left", Left_Key, 0x49, 0x1A, 0x33);
+  addSIRC20Key("right", Right_Key, 0x49, 0x1A, 0x34);
+  addSIRC20Key("ok", Select_Key, 0x49, 0x1A, 0x32);
+  addSIRC20Key("enter", Enter_Key, 0x49, 0x1A, 0x0B);
 }
 
 
@@ -848,56 +582,52 @@ SonyVCR1::SonyVCR1(
       Sony_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    703, 517,
-    1301, 517,
-    45239, true);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(2499, 517);
-  np->setTrailerPulse(703);
-
-//  np->setMinimumRepetitions(2);
-
-  addKey("pwon", Power_Key, 0x54D, 11);
-  addKey("1", One_Key, 0x00D, 11);
-  addKey("2", Two_Key, 0x40D, 11);
-  addKey("3", Three_Key, 0x20D, 11);
-  addKey("4", Four_Key, 0x60D, 11);
-  addKey("5", Five_Key, 0x10D, 11);
-  addKey("6", Six_Key, 0x50D, 11);
-  addKey("7", Seven_Key, 0x30D, 11);
-  addKey("8", Eight_Key, 0x70D, 11);
-  addKey("9", Nine_Key, 0x08D, 11);
-  addKey("0", Zero_Key, 0x48D, 11);
-  addKey("jump", PrevChannel_Key, 0x28D, 11); // might be wrong
-  addKey("red", Red_Key, 0x19C, 11);
-  addKey("green", Green_Key, 0x59C, 11);
-  addKey("blue", Blue_Key, 0x79C, 11);
-  addKey("rec", Record_Key, 0x5CD, 11);
-  addKey("up", Up_Key, 0x4CD, 11);
-  addKey("down", Down_Key, 0x0CD, 11);
-  addKey("left", Left_Key, 0x6CD, 11);
-  addKey("right", Right_Key, 0x1CD, 11);
-  addKey("ok", Select_Key, 0x2CD, 11);
-  addKey("prog-next", ChannelUp_Key, 0x04D, 11);
-  addKey("prog-prev", ChannelDown_Key, 0x44D, 11);
-  addKey("power_on", Unmapped_Key, 0x3AD, 11);
-  addKey("<<", Rewind_Key, 0x6CD, 11); // 0xD9A
-  addKey(">>", FastForward_Key, 0x1CD, 11); // 0x39A
-  addKey("play", Play_Key, 0x2CD, 11); // 0x59A
-  addKey("stop", Stop_Key, 0x0CD, 11); // 0x19A
-  addKey("pause", Pause_Key, 0x4CD, 11); // 0x99A
-  addKey("menu", Menu_Key, 0x59D, 11);
-  addKey("ant/sw", Unmapped_Key, 0x2AD, 11);
-  addKey("input", Input_Key, 0x79D, 11);
-  addKey("display", Info_Key, 0x2DD, 11);
-  addKey("ENT", Unmapped_Key, 0x68D, 11);
-  addKey("VOL_UP", VolumeUp_Key, 0x248, 11);
-  addKey("VOL_DOWN", VolumeDown_Key, 0x648, 11);
+  threadableProtocol = new SIRCProtocol(guiObject, index);
+
+  addSIRC12Key("VOL_UP", VolumeUp_Key, 0x01, 0x12);
+  addSIRC12Key("VOL_DOWN", VolumeDown_Key, 0x01, 0x13);
+
+  addSIRC12Key("red", Red_Key, 0x03, 0x4C);
+  addSIRC12Key("green", Green_Key, 0x03, 0x4D);
+  addSIRC12Key("Yellow", Yellow_Key, 0x03, 0x4E);
+  addSIRC12Key("blue", Blue_Key, 0x03, 0x4F);
+
+  addSIRC12Key("1", One_Key, 0x0B, 0x00);
+  addSIRC12Key("2", Two_Key, 0x0B, 0x01);
+  addSIRC12Key("3", Three_Key, 0x0B, 0x02);
+  addSIRC12Key("4", Four_Key, 0x0B, 0x03);
+  addSIRC12Key("5", Five_Key, 0x0B, 0x04);
+  addSIRC12Key("6", Six_Key, 0x0B, 0x05);
+  addSIRC12Key("7", Seven_Key, 0x0B, 0x06);
+  addSIRC12Key("8", Eight_Key, 0x0B, 0x07);
+  addSIRC12Key("9", Nine_Key, 0x0B, 0x08);
+  addSIRC12Key("0", Zero_Key, 0x0B, 0x09);
+//  addSIRC12Key("jump", PrevChannel_Key, 0x0B, 0x0A); // might be wrong
+  addSIRC12Key("-/--", DoubleDigit_Key, 0x0B, 0x0A);
+  addSIRC12Key("ENT", Enter_Key, 0x0B, 0x0B); // "Enter"
+
+  addSIRC12Key("prog-next", ChannelUp_Key, 0x0B, 0x10);
+  addSIRC12Key("prog-prev", ChannelDown_Key, 0x0B, 0x11);
+  addSIRC12Key("pwon", Power_Key, 0x0B, 0x15);
+  addSIRC12Key("stop", Stop_Key, 0x0B, 0x18);
+  addSIRC12Key("pause", Pause_Key, 0x0B, 0x19);
+  addSIRC12Key("play", Play_Key, 0x0B, 0x1A);
+  addSIRC12Key("<<", Rewind_Key, 0x0B, 0x1B);
+  addSIRC12Key(">>", FastForward_Key, 0x0B, 0x1C);
+  addSIRC12Key("rec", Record_Key, 0x0B, 0x1D);
+  addSIRC12Key("ant/sw", Unmapped_Key, 0x0B, 0x2A);  // "tv/vcr"
+  addSIRC12Key("power_on", PowerOn_Key, 0x0B, 0x2E);
+  addSIRC12Key("Power Off", PowerOff_Key, 0x0B, 0x2F);
+  addSIRC12Key("menu", Menu_Key, 0x0B, 0x4D);
+  addSIRC12Key("input", Input_Key, 0x0B, 0x4F);
+  addSIRC12Key("display", Info_Key, 0x0B, 0x5A);
+
+  // Odd cursor keys, overlap with media controls:
+  addSIRC12Key("down", Down_Key, 0x0B, 0x18);
+  addSIRC12Key("up", Up_Key, 0x0B, 0x19);
+  addSIRC12Key("ok", Select_Key, 0x0B, 0x1A);
+  addSIRC12Key("left", Left_Key, 0x0B, 0x1B);
+  addSIRC12Key("right", Right_Key, 0x0B, 0x1C);
 }
 
 
@@ -908,13 +638,40 @@ SonyVCR1a::SonyVCR1a(
 {
   setKeysetName("VCR Keyset 1a");
 
-  addKey("up", Up_Key, 0x21D, 11);  // 0x43A
-  addKey("down", Down_Key, 0x61D, 11);  // 0xC3A
-  addKey("left", Left_Key, 0x23D, 11);  // 0x47A
-  addKey("right", Right_Key, 0x43D, 11); // 0x87A
-  addKey("execute", Select_Key, 0x45D, 11); // 0x8BA
-  addKey("-/--", DoubleDigit_Key, 0x28D, 11);
-  addKey("SLEEP", Sleep_Key, 0x79D, 11); // 0xF3A
+  // These are the expected cursor keys:
+  addSIRC12Key("up", Up_Key, 0x0B, 0x42);
+  addSIRC12Key("down", Down_Key, 0x0B, 0x43);
+  addSIRC12Key("left", Left_Key, 0x0B, 0x62);
+  addSIRC12Key("right", Right_Key, 0x0B, 0x61);
+  addSIRC12Key("execute", Select_Key, 0x0B, 0x51); //"OK"
+
+//  addKey("SLEEP", Sleep_Key, 0x0B, 0x4F); // odd
+}
+
+
+// Extra codes off of hifi-remote website:
+SonyVCR1b::SonyVCR1b(
+  QObject *guiObject,
+  unsigned int index)
+  : SonyVCR1a(guiObject, index)
+{
+  setKeysetName("VCR Keyset 1b");
+
+  addSIRC12Key("Volume Up", VolumeUp_Key, 0x0B, 0x12);
+  addSIRC12Key("Volume Down", VolumeDown_Key, 0x0B, 0x13);
+  addSIRC12Key("Eject", Eject_Key, 0x0B, 0x16);
+  addSIRC12Key("Record Pause", RecordPause_Key, 0x0B, 0x1E);
+  addSIRC12Key("Record Mute", RecordMute_Key, 0x0B, 0x1F);
+  addSIRC12Key("Auto Tracking", AutoTracking_Key, 0x0B, 0x27);
+  addSIRC12Key("Frame Reverse", StepBack_Key, 0x0B, 0x30);
+  addSIRC12Key("Frame Advance", StepForward_Key, 0x0B, 0x31);
+  addSIRC12Key("Mute", Mute_Key, 0x0B, 0x35);
+  addSIRC12Key("Sleep", Sleep_Key, 0x0B, 0x36);
+  addSIRC12Key("Slow +", SlowPlus_Key, 0x0B, 0x3D);
+  addSIRC12Key("Slow -", SlowMinus_Key, 0x0B, 0x3E);
+  addSIRC12Key("Tracking Up", TrackingPlus_Key, 0x0B, 0x44);
+  addSIRC12Key("Tracking Down", TrackingMinus_Key, 0x0B, 0x45);
+  addSIRC12Key("SP/EP", VHSSpeed_Key, 0x0B, 0x58);
 }
 
 
@@ -926,52 +683,42 @@ SonyReceiver1::SonyReceiver1(
       Sony_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    693, 502,
-    1291, 502,
-    40006, true);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(2486, 498);
-
-//  np->setMinimumRepetitions(1);
-
-  addKey("SLEEP", Sleep_Key, 0x030C, 15);
-  addKey("POWER", Power_Key, 0x540C, 15);
-  addKey("VIDEO1", Unmapped_Key, 0x220C, 15);
-  addKey("VIDEO2", Unmapped_Key, 0x3C0C, 15);
-  addKey("VIDEO3", Unmapped_Key, 0x210C, 15);
-  addKey("DVD", Unmapped_Key, 0x5F0C, 15);
-  addKey("SAT", Unmapped_Key, 0x600D, 15);
-  addKey("TV", Unmapped_Key, 0x2B0C, 15);
-  addKey("SA_CD", Unmapped_Key, 0x520C, 15);
-  addKey("TUNER", Unmapped_Key, 0x420C, 15);
-  addKey("2CH", Unmapped_Key, 0x410D, 15);
-  addKey("AFD", Unmapped_Key, 0x210D, 15);
-  addKey("MOVIE", Unmapped_Key, 0x610D, 15);
-  addKey("MUSIC", Unmapped_Key, 0x490D, 15);
-  addKey("1", One_Key, 0x000C, 15);
-  addKey("2", Two_Key, 0x400C, 15);
-  addKey("3", Three_Key, 0x200C, 15);
-  addKey("4", Four_Key, 0x600C, 15);
-  addKey("5", Five_Key, 0x100C, 15);
-  addKey("6", Six_Key, 0x500C, 15);
-  addKey("7", Seven_Key, 0x300C, 15);
-  addKey("8", Eight_Key, 0x700C, 15);
-  addKey("9", Nine_Key, 0x080C, 15);
-  addKey("0", Zero_Key, 0x480C, 15);
-  addKey("AMP_MENU", Menu_Key, 0x770D, 15);
-  addKey("DVD_MENU", Unmapped_Key, 0x5A0D, 15);
-  addKey("DISPLAY", Info_Key, 0x690C, 15);
-  addKey("MUTING", Mute_Key, 0x140C, 15);
-  addKey("LEFT", Left_Key, 0x2F0D, 15);
-  addKey("UP", Up_Key, 0x0F0D, 15);
-  addKey("RIGHT", Right_Key, 0x6F0D, 15);
-  addKey("DOWN", Down_Key, 0x4F0D, 15);
-  addKey("SELECT", Select_Key, 0x180C, 15);
-  addKey("VOLUME_UP", VolumeUp_Key, 0x240C, 15);
-  addKey("VOLUME_DOWN", VolumeDown_Key, 0x640C, 15);
+  threadableProtocol = new SIRCProtocol(guiObject, index);
+
+  addSIRC15Key("1", One_Key, 0x30, 0x00);
+  addSIRC15Key("2", Two_Key, 0x30, 0x01);
+  addSIRC15Key("3", Three_Key, 0x30, 0x02);
+  addSIRC15Key("4", Four_Key, 0x30, 0x03);
+  addSIRC15Key("5", Five_Key, 0x30, 0x04);
+  addSIRC15Key("6", Six_Key, 0x30, 0x05);
+  addSIRC15Key("7", Seven_Key, 0x30, 0x06);
+  addSIRC15Key("8", Eight_Key, 0x30, 0x07);
+  addSIRC15Key("9", Nine_Key, 0x30, 0x08);
+  addSIRC15Key("0", Zero_Key, 0x30, 0x09);
+  addSIRC15Key("SELECT", Select_Key, 0x30, 0x0C);
+  addSIRC15Key("VOLUME_UP", VolumeUp_Key, 0x30, 0x12);
+  addSIRC15Key("VOLUME_DOWN", VolumeDown_Key, 0x30, 0x13);
+  addSIRC15Key("MUTING", Mute_Key, 0x30, 0x14);
+  addSIRC15Key("POWER", Power_Key, 0x30, 0x15);
+  addSIRC15Key("VIDEO2", Unmapped_Key, 0x30, 0x1E);
+  addSIRC15Key("TUNER", Unmapped_Key, 0x30, 0x21);
+  addSIRC15Key("VIDEO1", Unmapped_Key, 0x30, 0x22);
+  addSIRC15Key("SA_CD", Unmapped_Key, 0x30, 0x25);
+  addSIRC15Key("VIDEO3", Unmapped_Key, 0x30, 0x42);
+  addSIRC15Key("DISPLAY", Info_Key, 0x30, 0x4B);
+  addSIRC15Key("SLEEP", Sleep_Key, 0x30, 0x60);
+  addSIRC15Key("TV", Unmapped_Key, 0x30, 0x6A);
+  addSIRC15Key("DVD", Unmapped_Key, 0x30, 0x7D);
+
+  addSIRC15Key("SAT", Unmapped_Key, 0xB0, 0x03);
+  addSIRC15Key("2CH", Unmapped_Key, 0xB0, 0x09);
+  addSIRC15Key("AFD", Unmapped_Key, 0xB0, 0x0A);
+  addSIRC15Key("MOVIE", Unmapped_Key, 0xB0, 0x0B);
+  addSIRC15Key("DVD_MENU", DiscMenu_Key, 0xB0, 0x2D); // Not sure about this
+  addSIRC15Key("MUSIC", Unmapped_Key, 0xB0, 0x49);
+  addSIRC15Key("AMP_MENU", Menu_Key, 0xB0, 0x77);
+  addSIRC15Key("UP", Up_Key, 0xB0, 0x78);
+  addSIRC15Key("DOWN", Down_Key, 0xB0, 0x79);
+  addSIRC15Key("LEFT", Left_Key, 0xB0, 0x7A);
+  addSIRC15Key("RIGHT", Right_Key, 0xB0, 0x7B);
 }
index 60843e3..61f4f62 100644 (file)
@@ -23,7 +23,7 @@ public:
 };
 
 
-class SonyTV1b: public SonyTV1
+class SonyTV1b: public SonyTV1a
 {
 public:
   SonyTV1b(
@@ -32,10 +32,10 @@ public:
 };
 
 
-class SonyTV1d: public SonyTV1a
+class SonyTV1c: public SonyTV1
 {
 public:
-  SonyTV1d(
+  SonyTV1c(
     QObject *guiObject,
     unsigned int index);
 };
@@ -59,37 +59,19 @@ public:
 };
 
 
-class SonyCD1: public PIRKeysetMetaData
+class SonyAudio1: public PIRKeysetMetaData
 {
 public:
-  SonyCD1(
+  SonyAudio1(
     QObject *guiObject,
     unsigned int index);
 };
 
 
-class SonyCD1a: public SonyCD1
+class SonyAudio1a: public SonyAudio1
 {
 public:
-  SonyCD1a(
-    QObject *guiObject,
-    unsigned int index);
-};
-
-
-class SonyCD2: public PIRKeysetMetaData
-{
-public:
-  SonyCD2(
-    QObject *guiObject,
-    unsigned int index);
-};
-
-
-class SonyCD3: public PIRKeysetMetaData
-{
-public:
-  SonyCD3(
+  SonyAudio1a(
     QObject *guiObject,
     unsigned int index);
 };
@@ -158,6 +140,15 @@ public:
 };
 
 
+class SonyVCR1b: public SonyVCR1a
+{
+public:
+  SonyVCR1b(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
 class SonyReceiver1: public PIRKeysetMetaData
 {
 public:
index 2747f54..e21edd6 100644 (file)
@@ -9,14 +9,14 @@ Tivo1::Tivo1(
       Tivo_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
+  threadableProtocol = new NECProtocol(guiObject, index, LIRC_NEC);
 
   setPreData(0xA10C, 16);
 
 //  setCarrierFrequency(40000);
 
   addKey("TIVO", Power_Key, 0x000F, 16);
-  addKey("LIVETV", Unmapped_Key, 0x8807, 16);
+  addKey("LIVETV", LiveTV_Key, 0x8807, 16);
   addKey("UP", Up_Key, 0x2807, 16);
   addKey("DOWN", Down_Key, 0x6807, 16);
   addKey("RIGHT", Right_Key, 0xA807, 16);
@@ -31,7 +31,7 @@ Tivo1::Tivo1(
   addKey("REV", Rewind_Key, 0x440B, 16);
   addKey("FWD", FastForward_Key, 0x240B, 16);
   addKey("PAUSE", Pause_Key, 0xC40B, 16);
-  addKey("SLOW", Unmapped_Key, 0xA40B, 16);
+  addKey("SLOW", Slow_Key, 0xA40B, 16);
   addKey("REPLAY", Replay_Key, 0x640B, 16);
   addKey("JUMPTOEND", Advance_Key, 0xE40B, 16);
   addKey("1", One_Key, 0x140B, 16);
index 61c3924..24030fa 100644 (file)
@@ -12,81 +12,79 @@ ToshibaTV1::ToshibaTV1(
 {
   addControlledDevice(Toshiba_Make, "21S03D", TV_Device);
 
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x02FD, 16);
-
-  addKey("POWER", Power_Key, 0x48B7, 16);
-  addKey("1", One_Key, 0x807F, 16);
-  addKey("2", Two_Key, 0x40BF, 16);
-  addKey("3", Three_Key, 0xC03F, 16);
-  addKey("4", Four_Key, 0x20DF, 16);
-  addKey("5", Five_Key, 0xA05F, 16);
-  addKey("6", Six_Key, 0x609F, 16);
-  addKey("7", Seven_Key, 0xE01F, 16);
-  addKey("8", Eight_Key, 0x10EF, 16);
-  addKey("9", Nine_Key, 0x906F, 16);
-  addKey("0", Zero_Key, 0x00FF, 16);
-  addKey("TV", Unmapped_Key, 0x4EB1, 16);
-  addKey("SCART", Input_Key, 0x28D7, 16); // "AV", "inputs", "source"
-  addKey("CALL", Unmapped_Key, 0x6897, 16);
-  addKey("-/--", DoubleDigit_Key, 0xD02F, 16);
-  addKey("DOULBY", Unmapped_Key, 0x5AA5, 16);
-  addKey("CLOCK", Unmapped_Key, 0x8E71, 16);  // "TIMER"
-  addKey("RED", Red_Key, 0x12ED, 16);
-  addKey("GREEN", Green_Key, 0x926D, 16);
-  addKey("YELLOW", Yellow_Key, 0x52AD, 16);
-  addKey("BLUE", Blue_Key, 0xD22D, 16);
-  addKey("MUTE", Mute_Key, 0x08F7, 16);
-  addKey("SIZE", AspectRatio_Key, 0x9A65, 16); // "WIDE"
-  addKey("P+", ChannelUp_Key, 0xD827, 16);
-  addKey("P-", ChannelDown_Key, 0xF807, 16);
-  addKey("V+", VolumeUp_Key, 0x58A7, 16);
-  addKey("V-", VolumeDown_Key, 0x7887, 16);
-  addKey("MENU", Menu_Key, 0xDA25, 16);
-  addKey("OK", Select_Key, 0x847B, 16);
-  addKey("P+", Up_Key, 0xD827, 16);
-  addKey("P-", Down_Key, 0xF807, 16);
-  addKey("V-", Left_Key, 0x7887, 16);
-  addKey("V+", Right_Key, 0x58A7, 16);
-  addKey("exit", Exit_Key, 0x1AE5, 16);
-  addKey("100", PlusOneHundred_Key, 0x50AF, 16);
-  addKey("recall", PrevChannel_Key, 0x38C7, 16);
-  addKey("tv/video", Unmapped_Key, 0xF00F, 16); // "input"
-  addKey("fav+", Unmapped_Key, 0x9867, 16);
-  addKey("reset", Reset_Key, 0x30CF, 16);
-  addKey("cap/text", Captions_Key, 0xEA15, 16); // Image
-  addKey("1/2", Unmapped_Key, 0xC639, 16); // "cap1/cap2"
-  addKey("fav-", Unmapped_Key, 0xB847, 16);
-  addKey("still", Unmapped_Key, 0x32CD, 16);
-  addKey("locate", Unmapped_Key, 0x728D, 16);
-  addKey("swap", PIPSwap_Key, 0xCA35, 16); // Reduce
-  addKey("pip", PIP_Key, 0x8A75, 16);
-  addKey("pip_ch_up", Unmapped_Key, 0x52AD, 16); // Yellow
-  addKey("pip_ch_down", Unmapped_Key, 0xD22D, 16); // Blue
-  addKey("mts", Language_Key, 0xC837, 16); // "audio_stereo_2channel"
-  addKey("sleep", Sleep_Key, 0xA857, 16);  // Clock
-  addKey("BLANK", PictureMode_Key, 0x8877, 16); // "Contrast", "picture_preset"
-  addKey("Double_Arrow", Unmapped_Key, 0x4AB5, 16); // "swap", but not pip!; "back"
-//  addKey("?", Unmapped_Key, 0x2AD5, 16);
-  addKey("PIC_SIZE", AspectRatio_Key, 0x2AD5, 16); // "16:9"
-  addKey("Enlarge", Unmapped_Key, 0xB04F, 16);
-  addKey("multi", Unmapped_Key, 0x8976, 16);
-  addKey("source", Unmapped_Key, 0xF20D, 16);
-  addKey("info", Info_Key, 0xC936, 16);
-  addKey("favorite", Favorites_Key, 0x09F6, 16);
-  addKey("Tone", Unmapped_Key, 0xAA55, 16);
-  addKey("POP_DIR", Unmapped_Key, 0x649B, 16);
-  addKey("a/d", Unmapped_Key, 0x22DD, 16);
-  addKey("SEARCH", Unmapped_Key, 0xF10E, 16);
-
-  // teletext stuff:
-  addKey("TXT/MIX", Unmapped_Key, 0xE817, 16);  // "ent", "ch_rtn"
-  addKey("textindex", Unmapped_Key, 0xD42B, 16);
-  addKey("textpages", Unmapped_Key, 0x34CB, 16);
-  addKey("textanswer", Unmapped_Key, 0x2AD5, 16);
-  addKey("texthold", Unmapped_Key, 0xCA35, 16);
-  addKey("textzoom", Unmapped_Key, 0xB04F, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0x02FD, 16);
+  setPreData(0x40, 8);
+
+  addKey("0", Zero_Key, 0x00, 8);
+  addKey("1", One_Key, 0x01, 8);
+  addKey("2", Two_Key, 0x02, 8);
+  addKey("3", Three_Key, 0x03, 8);
+  addKey("4", Four_Key, 0x04, 8);
+  addKey("5", Five_Key, 0x05, 8);
+  addKey("6", Six_Key, 0x06, 8);
+  addKey("7", Seven_Key, 0x07, 8);
+  addKey("8", Eight_Key, 0x08, 8);
+  addKey("9", Nine_Key, 0x09, 8);
+  addKey("100", PlusOneHundred_Key, 0x0A, 8);
+  addKey("-/--", DoubleDigit_Key, 0x0B, 8);
+  addKey("reset", Reset_Key, 0x0C, 8);
+  addKey("textzoom", TeletextSize_Key, 0x0D, 8); // "Enlarge"
+  addKey("tv/video", Unmapped_Key, 0x0F, 8); // "input"
+  addKey("MUTE", Mute_Key, 0x10, 8);
+  addKey("BLANK", PictureMode_Key, 0x11, 8); // "Contrast", "picture_preset"
+  addKey("POWER", Power_Key, 0x12, 8);
+  addKey("mts", Unmapped_Key, 0x13, 8); // "audio_stereo_2channel"
+  addKey("SCART", Input_Key, 0x14, 8); // "AV", "inputs", "source"
+  addKey("sleep", Sleep_Key, 0x15, 8);  // Clock
+  addKey("CALL", Unmapped_Key, 0x16, 8);
+  addKey("ent", Enter_Key, 0x17, 8);  // "ch_rtn"
+  addKey("TXT/MIX", Teletext_Key, 0x17, 8);
+  addKey("fav+", Unmapped_Key, 0x19, 8);
+  addKey("V+", VolumeUp_Key, 0x1A, 8);
+  addKey("V+", Right_Key, 0x1A, 8);
+  addKey("P+", ChannelUp_Key, 0x1B, 8);
+  addKey("P+", Up_Key, 0x1B, 8);
+  addKey("recall", PrevChannel_Key, 0x1C, 8);
+  addKey("fav-", Unmapped_Key, 0x1D, 8);
+  addKey("V-", VolumeDown_Key, 0x1E, 8);
+  addKey("V-", Left_Key, 0x1E, 8);
+  addKey("P-", ChannelDown_Key, 0x1F, 8);
+  addKey("P-", Down_Key, 0x1F, 8);
+  addKey("OK", Select_Key, 0x21, 8);
+  addKey("POP_DIR", Unmapped_Key, 0x26, 8);
+  addKey("textindex", Unmapped_Key, 0x2B, 8);
+  addKey("textpages", Unmapped_Key, 0x2C, 8);
+  addKey("a/d", Unmapped_Key, 0x44, 8);
+  addKey("RED", Red_Key, 0x48, 8);
+  addKey("GREEN", Green_Key, 0x49, 8);
+  addKey("YELLOW", Yellow_Key, 0x4A, 8);
+  addKey("pip_ch_up", PIPChannelUp_Key, 0x4A, 8); // Yellow
+  addKey("BLUE", Blue_Key, 0x4B, 8);
+  addKey("pip_ch_down", PIPChannelDown_Key, 0x4B, 8); // Blue
+  addKey("still", Unmapped_Key, 0x4C, 8);
+  addKey("locate", Unmapped_Key, 0x4E, 8);
+  addKey("source", Unmapped_Key, 0x4F, 8);
+  addKey("pip", PIP_Key, 0x51, 8);
+  addKey("Double_Arrow", Unmapped_Key, 0x52, 8); // "swap", but not pip!; "back"
+  addKey("swap", PIPSwap_Key, 0x53, 8); // Reduce
+  addKey("texthold", TeletextHold_Key, 0x53, 8);
+  addKey("PIC_SIZE", AspectRatio_Key, 0x54, 8); // "16:9"
+  addKey("textanswer", TeletextReveal_Key, 0x54, 8); // "?"
+  addKey("Tone", Unmapped_Key, 0x55, 8);
+  addKey("cap/text", Captions_Key, 0x57, 8); // Image
+  addKey("exit", Exit_Key, 0x58, 8);
+  addKey("SIZE", AspectRatio_Key, 0x59, 8); // "WIDE"
+  addKey("DOULBY", Unmapped_Key, 0x5A, 8);
+  addKey("1/2", Audio_Key, 0x63, 8); // "cap1/cap2"
+  addKey("MENU", Menu_Key, 0x5B, 8);
+  addKey("CLOCK", Timer_Key, 0x71, 8);  // "TIMER"
+  addKey("TV", Unmapped_Key, 0x72, 8);
+  addKey("SEARCH", Unmapped_Key, 0x8F, 8);
+  addKey("favorite", Favorites_Key, 0x90, 8);
+  addKey("multi", Unmapped_Key, 0x91, 8);
+  addKey("info", Info_Key, 0x93, 8);
 }
 
 
@@ -99,8 +97,8 @@ ToshibaTV1a::ToshibaTV1a(
 
   addControlledDevice(Toshiba_Make, "27A51", TV_Device);
 
-  addKey("menu/enter", Menu_Key, 0x01FE, 16);
-  addKey("menu/enter", Select_Key, 0x01FE, 16);
+  addKey("menu/enter", Menu_Key, 0x80, 8);
+  addKey("menu/enter", Select_Key, 0x80, 8);
 }
 
 
@@ -111,13 +109,12 @@ ToshibaTV1b::ToshibaTV1b(
 {
   setKeysetName("TV Keyset 1b");
 
-  addKey("menu", Menu_Key, 0x01FE, 16);
-  addKey("up", Up_Key, 0x41BE, 16); // "set+"
-  addKey("down", Down_Key, 0xC13E, 16); // "set-"
-  addKey("left", Left_Key, 0xB847, 16);
-  addKey("right", Right_Key, 0x9867, 16);
-//  addKey("enter", Select_Key, 0x916E, 16);
-  addKey("menu/enter", Select_Key, 0x01FE, 16);
+  addKey("right", Right_Key, 0x19, 8); // "fav+"
+  addKey("left", Left_Key, 0x1D, 8); // "fav-"
+  addKey("menu/enter", Menu_Key, 0x80, 8);
+  addKey("menu/enter", Select_Key, 0x80, 8);
+  addKey("up", Up_Key, 0x82, 8); // "set+"
+  addKey("down", Down_Key, 0x83, 8); // "set-"
 }
 
 
@@ -152,8 +149,8 @@ ToshibaTV1d::ToshibaTV1d(
   addKey("subtitle", Captions_Key, 0x30CF, 16);
   addKey("stillpicture", Pause_Key, 0x44BB, 16);
   addKey("24-", Unmapped_Key, 0x2AD5, 16);
-  addKey("page-", Unmapped_Key, 0xCA35, 16);
-  addKey("page+", Unmapped_Key, 0xB04F, 16);
+  addKey("page-", PageUp_Key, 0xCA35, 16);
+  addKey("page+", PageDown_Key, 0xB04F, 16);
   addKey("24+", Unmapped_Key, 0xA857, 16);
 }
 
@@ -190,6 +187,20 @@ ToshibaTV1f::ToshibaTV1f(
 }
 
 
+ToshibaTV1g::ToshibaTV1g(
+  QObject *guiObject,
+  unsigned int index)
+  : ToshibaTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1g");
+
+  addKey("menu", Menu_Key, 0x80, 8);
+  addKey("set+", Right_Key, 0x82, 8);
+  addKey("set-", Left_Key, 0x83, 8);
+  addKey("enter", Select_Key, 0x89, 8);
+}
+
+
 ToshibaVCR1::ToshibaVCR1(
   QObject *guiObject,
   unsigned int index)
@@ -198,37 +209,37 @@ ToshibaVCR1::ToshibaVCR1(
       Toshiba_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x22DD, 16);
-
-  addKey("power", Power_Key, 0x48B7, 16);
-  addKey("1", One_Key, 0x807F, 16);
-  addKey("2", Two_Key, 0x40BF, 16);
-  addKey("3", Three_Key, 0xC03F, 16);
-  addKey("4", Four_Key, 0x20DF, 16);
-  addKey("5", Five_Key, 0xA05F, 16);
-  addKey("6", Six_Key, 0x609F, 16);
-  addKey("7", Seven_Key, 0xE01F, 16);
-  addKey("8", Eight_Key, 0x10EF, 16);
-  addKey("9", Nine_Key, 0x906F, 16);
-  addKey("0", Zero_Key, 0x50AF, 16);
-  addKey("input", Input_Key, 0xFA05, 16);
-  addKey("ch+", ChannelUp_Key, 0xD827, 16);
-  addKey("ch-", ChannelDown_Key, 0xF807, 16);
-  addKey("pause", Pause_Key, 0x08F7, 16);
-  addKey("play", Play_Key, 0xA857, 16);
-  addKey("rew", Rewind_Key, 0x9867, 16);
-  addKey("ff", FastForward_Key, 0xC837, 16);
-  addKey("eject", Eject_Key, 0xAF50, 16);
-  addKey("stop", Stop_Key, 0x28D7, 16);
-  addKey("previous", Previous_Key, 0xF906, 16);
-  addKey("skip", Next_Key, 0x7986, 16);
-  addKey("tv/vcr", Input_Key, 0x8877, 16);
-  addKey("record", Record_Key, 0x18E7, 16);
-  addKey("100", PlusOneHundred_Key, 0xD02F, 16);
-  addKey("recall", PrevChannel_Key, 0xC13E, 16);
-  addKey("slow/dir_fwd", StepForward_Key, 0xB04F, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+  setPreData(0x44, 16);
+
+  addKey("1", One_Key, 0x01, 8);
+  addKey("2", Two_Key, 0x02, 8);
+  addKey("3", Three_Key, 0x03, 8);
+  addKey("4", Four_Key, 0x04, 8);
+  addKey("5", Five_Key, 0x05, 8);
+  addKey("6", Six_Key, 0x06, 8);
+  addKey("7", Seven_Key, 0x07, 8);
+  addKey("8", Eight_Key, 0x08, 8);
+  addKey("9", Nine_Key, 0x09, 0);
+  addKey("0", Zero_Key, 0x0A, 8);
+  addKey("100", PlusOneHundred_Key, 0x0B, 8);
+  addKey("slow/dir_fwd", StepForward_Key, 0x0D, 8);
+  addKey("pause", Pause_Key, 0x10, 8);
+  addKey("tv/vcr", Input_Key, 0x11, 8);
+  addKey("power", Power_Key, 0x12, 8);
+  addKey("ff", FastForward_Key, 0x13, 8);
+  addKey("stop", Stop_Key, 0x14, 8);
+  addKey("play", Play_Key, 0x15, 8);
+  addKey("record", Record_Key, 0x18, 8);
+  addKey("rew", Rewind_Key, 0x19, 8);
+  addKey("ch+", ChannelUp_Key, 0x1B, 8);
+  addKey("ch-", ChannelDown_Key, 0x1F, 8);
+  addKey("input", Input_Key, 0x5F, 8);
+  addKey("recall", PrevChannel_Key, 0x83, 8);
+  addKey("skip", Next_Key, 0x9E, 8);
+  addKey("previous", Previous_Key, 0x9F, 8);
+  addKey("eject", Eject_Key, 0xF5, 8);
 }
 
 
@@ -239,8 +250,8 @@ ToshibaVCR1a::ToshibaVCR1a(
 {
   setKeysetName("VCR Keyset 1a");
 
-  addKey("ch+", ChannelUp_Key, 0x7887, 16);
-  addKey("ch-", ChannelDown_Key, 0xF807, 16);
+  addKey("ch+", ChannelUp_Key, 0x1E, 8);
+//  addKey("ch-", ChannelDown_Key, 0x1F, 8); // Already in parent
 }
 
 
@@ -252,58 +263,60 @@ ToshibaDisc1::ToshibaDisc1(
       Toshiba_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0xA25D, 16);
-
-  addKey("power", Power_Key, 0x48B7, 16);
-  addKey("1", One_Key, 0x807F, 16);
-  addKey("2", Two_Key, 0x40BF, 16);
-  addKey("3", Three_Key, 0xC03F, 16);
-  addKey("4", Four_Key, 0x20DF, 16);
-  addKey("5", Five_Key, 0xA05F, 16);
-  addKey("6", Six_Key, 0x609F, 16);
-  addKey("7", Seven_Key, 0xE01F, 16);
-  addKey("8", Eight_Key, 0x10EF, 16);
-  addKey("9", Nine_Key, 0x906F, 16);
-  addKey("0", Zero_Key, 0x50AF, 16);
-  addKey("+10", DoubleDigit_Key, 0xA45B, 16);
-  addKey("vol-", VolumeDown_Key, 0x8A75, 16);
-  addKey("vol+", VolumeUp_Key, 0xB24D, 16);
-  addKey("ch+", ChannelUp_Key, 0x01FE, 16);
-  addKey("ch-", ChannelDown_Key, 0x817E, 16);
-  addKey("display", Info_Key, 0x6897, 16);
-  addKey("clear", Clear_Key, 0xF708, 16);
-  addKey("top_menu", DiscTitle_Key, 0x7B84, 16);
-  addKey("menu", DiscMenu_Key, 0x21DE, 16);
-  addKey("enter", Select_Key, 0x847B, 16); // "ok"
-  addKey("exit", Exit_Key, 0x44BB, 16);
-  addKey("up", Up_Key, 0x01FE, 16); // "ch+"
-  addKey("down", Down_Key, 0x817E, 16); // "ch-"
-  addKey("left", Left_Key, 0x8A75, 16); // "vol-"
-  addKey("right", Right_Key, 0xB24D, 16); // "vol+"
-  addKey("rew", Rewind_Key, 0x9867, 16);
-  addKey("play", Play_Key, 0xA857, 16);
-  addKey("ff", FastForward_Key, 0xC837, 16);
-  addKey("stop", Stop_Key, 0x28D7, 16);
-  addKey("pause", Pause_Key, 0x00FF, 16);
-  addKey("skip-", Previous_Key, 0xC43B, 16);
-  addKey("skip+", Next_Key, 0x24DB, 16);
-  addKey("eject", Eject_Key, 0xAF50, 16);
-  addKey("slow/dir-rev", StepBack_Key, 0x708F, 16);
-  addKey("slow/dir-fwd", StepForward_Key, 0xB04F, 16);
-  addKey("disc", DiscSelect_Key, 0x52AD, 16); // "DISC SELECT"
-  addKey("FL_DIMMER", Unmapped_Key, 0x827D, 16);
-  addKey("3D", Unmapped_Key, 0xC23D, 16);
-  addKey("KEY_ANGLE", Unmapped_Key, 0x946B, 16);
-  addKey("SUBTITLE", Captions_Key, 0x14EB, 16);
-  addKey("T", Unmapped_Key, 0x649B, 16);
-  addKey("RANDOM", Unmapped_Key, 0x748B, 16);
-  addKey("MEMORY", Unmapped_Key, 0x54AB, 16);
-  addKey("REPEAT", Unmapped_Key, 0xD42B, 16);
-  addKey("A-B_RPT", Unmapped_Key, 0x34CB, 16);
-  addKey("FlSelect", Unmapped_Key, 0xEB14, 16);
-  addKey("FlDim", Unmapped_Key, 0x827D, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0xA25D, 16);
+  setPreData(0x45, 8);
+
+  addKey("pause", Pause_Key, 0x00, 8);
+  addKey("1", One_Key, 0x01, 8);
+  addKey("2", Two_Key, 0x02, 8);
+  addKey("3", Three_Key, 0x03, 8);
+  addKey("4", Four_Key, 0x04, 8);
+  addKey("5", Five_Key, 0x05, 8);
+  addKey("6", Six_Key, 0x06, 8);
+  addKey("7", Seven_Key, 0x07, 8);
+  addKey("8", Eight_Key, 0x08, 8);
+  addKey("9", Nine_Key, 0x09, 8);
+  addKey("0", Zero_Key, 0x0A, 8);
+  addKey("slow/dir-fwd", StepForward_Key, 0x0D, 8);
+  addKey("slow/dir-rev", StepBack_Key, 0x0E, 8);
+  addKey("power", Power_Key, 0x12, 8);
+  addKey("ff", FastForward_Key, 0x13, 8);
+  addKey("stop", Stop_Key, 0x14, 8);
+  addKey("play", Play_Key, 0x15, 8);
+  addKey("display", Info_Key, 0x16, 8);
+  addKey("rew", Rewind_Key, 0x19, 8);
+  addKey("menu/enter", Menu_Key, 0x21, 8); // "ok", "enter"
+  addKey("menu/enter", Select_Key, 0x21, 8); // "ok", "enter"
+  addKey("exit", Exit_Key, 0x22, 8);
+  addKey("skip-", Previous_Key, 0x23, 8);
+  addKey("skip+", Next_Key, 0x24, 8);
+  addKey("+10", DoubleDigit_Key, 0x25, 8);
+  addKey("100", PlusOneHundred_Key, 0x25, 8);
+  addKey("T", Unmapped_Key, 0x26, 8); // direct access to title by number
+  addKey("SUBTITLE", Captions_Key, 0x28, 8);
+  addKey("KEY_ANGLE", Angle_Key, 0x29, 8);
+  addKey("MEMORY", Program_Key, 0x2A, 8);
+  addKey("REPEAT", Repeat_Key, 0x2B, 8);
+  addKey("A-B_RPT", RepeatAB_Key, 0x2C, 8);
+  addKey("RANDOM", Random_Key, 0x2E, 8);
+  addKey("FL_DIMMER", Unmapped_Key, 0x41, 8); // "FlDim"
+  addKey("3D", Unmapped_Key, 0x43, 8);
+  addKey("disc", DiscSelect_Key, 0x4A, 8); // "DISC SELECT"
+  addKey("vol+", VolumeUp_Key, 0x4D, 8);
+  addKey("right", Right_Key, 0x4D, 8); // "vol+"
+  addKey("vol-", VolumeDown_Key, 0x51, 8);
+  addKey("left", Left_Key, 0x51, 8); // "vol-"
+  addKey("ch+", ChannelUp_Key, 0x80, 8);
+  addKey("up", Up_Key, 0x80, 8); // "ch+"
+  addKey("ch-", ChannelDown_Key, 0x81, 8);
+  addKey("down", Down_Key, 0x81, 8); // "ch-"
+  addKey("menu", DiscMenu_Key, 0x84, 8);
+  addKey("FlSelect", Unmapped_Key, 0xD7, 8);
+  addKey("top_menu", DiscTitle_Key, 0xDE, 8); // "title"
+  addKey("clear", Clear_Key, 0xEF, 8);
+  addKey("eject", Eject_Key, 0xF5, 8);
 }
 
 
@@ -314,12 +327,9 @@ ToshibaDisc1a::ToshibaDisc1a(
 {
   setKeysetName("Disc Keyset 1a");
 
-  addKey("100", PlusOneHundred_Key, 0xA45B, 16);
-  addKey("action", Unmapped_Key, 0x21DE, 16);
-  addKey("setup", Menu_Key, 0x04FB, 16);
-  addKey("title", DiscTitle_Key, 0x7B84, 16);
-  addKey("audio", Language_Key, 0xE41B, 16);
-  addKey("menu/enter", Select_Key, 0x847B, 16); // also menu?
+  addKey("setup", Menu_Key, 0x20, 8);
+  addKey("audio", Audio_Key, 0x27, 8);
+  addKey("action", Unmapped_Key, 0x84, 8);
 }
 
 
@@ -331,9 +341,8 @@ ToshibaDisc1b::ToshibaDisc1b(
 {
   setKeysetName("Disc Keyset 1b");
 
-  addKey("100", PlusOneHundred_Key, 0xA45B, 16);
-  addKey("enter", Select_Key, 0x21DE, 16);
-  addKey("mark", Unmapped_Key, 0x847B, 16);
+  addKey("enter", Select_Key, 0x84, 8);
+  addKey("mark", Unmapped_Key, 0x21, 8);
 }
 
 
@@ -344,10 +353,10 @@ ToshibaDisc1c::ToshibaDisc1c(
 {
   setKeysetName("Disc Keyset 1c");
 
-  addKey("KEY_SLOW", Unmapped_Key, 0x649B, 16);
-  addKey("KEY_DVD", Unmapped_Key, 0x44BB, 16);
-  addKey("KEY_FAVORITES", Favorites_Key, 0x7B84, 16);
-  addKey("KEY_EJECTCD", Eject_Key, 0xFB04, 16);
+  addKey("KEY_DVD", Unmapped_Key, 0x22, 8);
+  addKey("KEY_SLOW", Slow_Key, 0x26, 8);
+  addKey("KEY_FAVORITES", Favorites_Key, 0xDE, 8);
+  addKey("KEY_EJECTCD", Eject_Key, 0xDF, 8);
 }
 
 
@@ -358,5 +367,5 @@ ToshibaDisc1d::ToshibaDisc1d(
 {
   setKeysetName("Disc Keyset 1d");
 
-  addKey("recall", PrevChannel_Key, 0x6897, 16);
+  addKey("recall", PrevChannel_Key, 0x16, 8);
 }
index a33a775..53c07ab 100644 (file)
@@ -60,6 +60,14 @@ public:
     unsigned int index);
 };
 
+class ToshibaTV1g: public ToshibaTV1
+{
+public:
+  ToshibaTV1g(
+    QObject *guiObject,
+    unsigned int index);
+};
+
 class ToshibaVCR1: public PIRKeysetMetaData
 {
 public:
index a992949..eecfbd2 100644 (file)
@@ -9,50 +9,41 @@ WestinghouseTV1::WestinghouseTV1(
       Westinghouse_Make,
       index)
 {
-  NECProtocol *np = new NECProtocol(
-    guiObject,
-    index,
-    600, 500,
-    600, 1600,
-    108000, true);
-
-  threadableProtocol = np;
-
-  np->setHeaderPair(9000, 4500);
-  np->setTrailerPulse(600);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
 
-  setPreData(0x807F, 16);
+//  setPreData(0x807F, 16);
+  setPreData(0x01, 8);
 
-  addKey("KEY_1", One_Key, 0x8877, 16);
-  addKey("KEY_2", Two_Key, 0x48B7, 16);
-  addKey("KEY_3", Three_Key, 0xC837, 16);
-  addKey("KEY_4", Four_Key, 0x28D7, 16);
-  addKey("KEY_5", Five_Key, 0xA857, 16);
-  addKey("KEY_6", Six_Key, 0x6897, 16);
-  addKey("KEY_7", Seven_Key, 0xE817, 16);
-  addKey("KEY_8", Eight_Key, 0x18E7, 16);
-  addKey("KEY_9", Nine_Key, 0x9867, 16);
-  addKey("KEY_0", Zero_Key, 0x58A7, 16);
-  addKey("KEY_BACK", PrevChannel_Key, 0x10EF, 16);
-  addKey("KEY_MENU", Menu_Key, 0x629D, 16);
-  addKey("KEY_POWER", Power_Key, 0x807F, 16);
-  addKey("KEY_UP", Up_Key, 0x02FD, 16);
-  addKey("KEY_DOWN", Down_Key, 0x22DD, 16);
-  addKey("KEY_LEFT", Left_Key, 0x827D, 16);
-  addKey("KEY_RIGHT", Right_Key, 0xC23D, 16);
-  addKey("KEY_MUTE", Mute_Key, 0x08F7, 16);
-  addKey("KEY_INFO", Info_Key, 0xD827, 16);
-  addKey("KEY_VOLUMEUP", VolumeUp_Key, 0x20DF, 16);
-  addKey("KEY_VOLUMEDOWN", VolumeDown_Key, 0xA05F, 16);
-  addKey("INPUT", Input_Key, 0x00FF, 16);
-  addKey("YPbPr", Unmapped_Key, 0x50AF, 16);
-  addKey("FREEZE", Unmapped_Key, 0x38C7, 16);
-  addKey("VGA", Unmapped_Key, 0x906F, 16);
-  addKey("DVI", Unmapped_Key, 0x609F, 16);
-  addKey("S-Video", Unmapped_Key, 0x30CF, 16);
-  addKey("AV", Unmapped_Key, 0xD02F, 16);
-  addKey("KEY_ENTER", Enter_Key, 0x42BD, 16);
-  addKey("ASPECT_RATIO", AspectRatio_Key, 0xE01F, 16);
+  addKey("INPUT", Input_Key, 0x00, 8);
+  addKey("KEY_POWER", Power_Key, 0x01, 8);
+  addKey("KEY_VOLUMEUP", VolumeUp_Key, 0x04, 8);
+  addKey("KEY_VOLUMEDOWN", VolumeDown_Key, 0x05, 8);
+  addKey("DVI", Unmapped_Key, 0x06, 8);
+  addKey("ASPECT_RATIO", AspectRatio_Key, 0x07, 8);
+  addKey("KEY_BACK", PrevChannel_Key, 0x08, 8);
+  addKey("VGA", Unmapped_Key, 0x09, 8);
+  addKey("YPbPr", Unmapped_Key, 0x0A, 8);
+  addKey("AV", Unmapped_Key, 0x0B, 8);
+  addKey("S-Video", Unmapped_Key, 0x0C, 8);
+  addKey("KEY_MUTE", Mute_Key, 0x10, 8);
+  addKey("KEY_1", One_Key, 0x11, 8);
+  addKey("KEY_2", Two_Key, 0x12, 8);
+  addKey("KEY_3", Three_Key, 0x13, 8);
+  addKey("KEY_4", Four_Key, 0x14, 8);
+  addKey("KEY_5", Five_Key, 0x15, 8);
+  addKey("KEY_6", Six_Key, 0x16, 8);
+  addKey("KEY_7", Seven_Key, 0x17, 8);
+  addKey("KEY_8", Eight_Key, 0x18, 8);
+  addKey("KEY_9", Nine_Key, 0x19, 8);
+  addKey("KEY_0", Zero_Key, 0x1A, 8);
+  addKey("KEY_INFO", Info_Key, 0x1B, 8);
+  addKey("FREEZE", Pause_Key, 0x1C, 8);
+  addKey("KEY_UP", Up_Key, 0x40, 8);
+  addKey("KEY_LEFT", Left_Key, 0x41, 8);
+  addKey("KEY_ENTER", Enter_Key, 0x42, 8);
+  addKey("KEY_RIGHT", Right_Key, 0x43, 8);
+  addKey("KEY_DOWN", Down_Key, 0x44, 8);
+  addKey("KEY_MENU", Menu_Key, 0x46, 8);
 }
 
 
@@ -69,7 +60,8 @@ WestinghouseTV2::WestinghouseTV2(
     index,
     600, 500,
     1200, 500,
-    45000, true);
+    45000, true,
+    LIRC_NEC);
 
   threadableProtocol = np;
 
@@ -100,7 +92,7 @@ WestinghouseTV2::WestinghouseTV2(
   addKey(".", Unmapped_Key, 0x510, 12);
   addKey("EnterNumPad", Enter_Key, 0xD10, 12);
   addKey("Input", Input_Key, 0xA50, 12);
-  addKey("Zoom", Unmapped_Key, 0x390, 12);
+  addKey("Zoom", Zoom_Key, 0x390, 12);
   addKey("Vol+", VolumeUp_Key, 0x490, 12);
   addKey("Vol-", VolumeDown_Key, 0xC90, 12);
   addKey("Ch+", ChannelUp_Key, 0x090, 12);
index f5193c4..705505a 100644 (file)
@@ -10,40 +10,43 @@ YamahaDVD1::YamahaDVD1(
       Yamaha_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x3EC1, 16);
-
-  addKey("title", DiscTitle_Key, 0x8D72, 16);
-  addKey("menu", DiscMenu_Key, 0x4DB2, 16);
-  addKey("up", Up_Key, 0x2DD2, 16);
-  addKey("down", Down_Key, 0xCD32, 16);
-  addKey("left", Left_Key, 0xAD52, 16);
-  addKey("right", Right_Key, 0x6D92, 16);
-  addKey("enter", Select_Key, 0x1DE2, 16);
-  addKey("return", Exit_Key, 0xED12, 16);
-  addKey("display", Info_Key, 0x659A, 16);
-  addKey("record", Record_Key, 0xD12E, 16);
-  addKey("stop", Stop_Key, 0xA15E, 16);
-  addKey("pause", Pause_Key, 0xC13E, 16);
-  addKey("play", Play_Key, 0x41BE, 16);
-  addKey("rewind", Rewind_Key, 0x619E, 16);
-  addKey("fast_forward", FastForward_Key, 0xE11E, 16);
-  addKey("previous", Previous_Key, 0x9D62, 16);
-  addKey("next", Next_Key, 0x5DA2, 16);
-  addKey("1", One_Key, 0x29D6, 16);
-  addKey("2", Two_Key, 0xA956, 16);
-  addKey("3", Three_Key, 0x6996, 16);
-  addKey("4", Four_Key, 0xE916, 16);
-  addKey("5", Five_Key, 0x19E6, 16);
-  addKey("6", Six_Key, 0x9966, 16);
-  addKey("7", Seven_Key, 0x59A6, 16);
-  addKey("8", Eight_Key, 0xD926, 16);
-  addKey("9", Nine_Key, 0x39C6, 16);
-  addKey("0", Zero_Key, 0xC936, 16);
-  addKey("+10", DoubleDigit_Key, 0xB946, 16);
-  addKey("ent", Enter_Key, 0x7986, 16);
-  addKey("power_av", Power_Key, 0x01FE, 16); // might be wrong
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0x3EC1, 16);
+  setPreData(0x7C, 8);
+
+  addKey("power_av", Power_Key, 0x80, 16); // might be wrong
+  addKey("play", Play_Key, 0x82, 8);
+  addKey("pause", Pause_Key, 0x83, 8);
+  addKey("stop", Stop_Key, 0x85, 8);
+  addKey("rewind", Rewind_Key, 0x86, 8);
+  addKey("fast_forward", FastForward_Key, 0x87, 8);
+  addKey("record", Record_Key, 0x8B, 8);
+
+  addKey("0", Zero_Key, 0x93, 8);
+  addKey("1", One_Key, 0x94, 8);
+  addKey("2", Two_Key, 0x95, 8);
+  addKey("3", Three_Key, 0x96, 8);
+  addKey("4", Four_Key, 0x97, 8);
+  addKey("5", Five_Key, 0x98, 8);
+  addKey("6", Six_Key, 0x99, 8);
+  addKey("7", Seven_Key, 0x9A, 8);
+  addKey("8", Eight_Key, 0x9B, 8);
+  addKey("9", Nine_Key, 0x9C, 8);
+  addKey("+10", DoubleDigit_Key, 0x9D, 8);
+  addKey("ent", Enter_Key, 0x9E, 8);
+
+  addKey("display", Info_Key, 0xA6, 8);
+  addKey("title", DiscTitle_Key, 0xB1, 8);
+  addKey("menu", DiscMenu_Key, 0xB2, 8);
+  addKey("down", Down_Key, 0xB3, 8);
+  addKey("up", Up_Key, 0xB4, 8);
+  addKey("left", Left_Key, 0xB5, 8);
+  addKey("right", Right_Key, 0xB6, 8);
+  addKey("return", Exit_Key, 0xB7, 8);
+  addKey("enter", Select_Key, 0xB8, 8);
+  addKey("previous", Previous_Key, 0xB9, 8);
+  addKey("next", Next_Key, 0xBA, 8);
 }
 
 
@@ -54,17 +57,17 @@ YamahaDVD1a::YamahaDVD1a(
 {
   setKeysetName("DVD/LD Keyset 1a");
 
-  addKey("LD_PLAY", Play_Key, 0xA05F, 16);
-  addKey("LD_PAUSE/STOP", Pause_Key, 0x20DF, 16);
-  addKey("LD_STOP", Stop_Key, 0xDA25, 16);
-  addKey("LD_SCH_FWD", FastForward_Key, 0xE01F, 16);
-  addKey("LD_SCH_REV", Rewind_Key, 0x609F, 16);
-  addKey("LD_CH_+", ChannelUp_Key, 0xC03F, 16);
-  addKey("LD_CH_-", ChannelDown_Key, 0x40BF, 16);
-  addKey("LD_STILL_FWD", StepForward_Key, 0xD02F, 16);
-  addKey("LD_STILL_REV", StepBack_Key, 0x50AF, 16);
-  addKey("DISPLAY", Info_Key, 0xC837, 16);
-  addKey("SOUND", Unmapped_Key, 0x48B7, 16);
+  addKey("LD_CH_-", ChannelDown_Key, 0x02, 8);
+  addKey("LD_CH_+", ChannelUp_Key, 0x03, 8);
+  addKey("LD_PAUSE/STOP", Pause_Key, 0x04, 8);
+  addKey("LD_PLAY", Play_Key, 0x05, 8);
+  addKey("LD_SCH_FWD", FastForward_Key, 0x07, 8);
+  addKey("LD_SCH_REV", Rewind_Key, 0x06, 8);
+  addKey("LD_STILL_REV", StepBack_Key, 0x0A, 8);
+  addKey("LD_STILL_FWD", StepForward_Key, 0x0B, 8);
+  addKey("SOUND", Unmapped_Key, 0x12, 8);
+  addKey("DISPLAY", Info_Key, 0x13, 8);
+  addKey("LD_STOP", Stop_Key, 0x5B, 8);
 }
 
 
@@ -76,63 +79,64 @@ YamahaAudio1::YamahaAudio1(
       Yamaha_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x9E61, 16);
-
-  addKey("SYNCHRO", Unmapped_Key, 0x1AE5, 16); // "DIRECT_OUT"
-  addKey("DIMMER", Unmapped_Key, 0x7887, 16); // "MODE"
-  addKey("TIME", Info_Key, 0x50AF, 16); // "TIME_DISPLAY"
-  addKey("OPEN", Eject_Key, 0x807F, 16);
-  addKey("SPACE", Unmapped_Key, 0xF00F, 16);
-  addKey("PEAK", Unmapped_Key, 0xBA45, 16);
-  addKey("TAPE", Unmapped_Key, 0xEA15, 16);
-  addKey("CLEAR", Clear_Key, 0xB04F, 16); // "CANCEL"
-  addKey("PROG", Program_Key, 0x30CF, 16);
-  addKey("1", One_Key, 0x8877, 16);
-  addKey("2", Two_Key, 0x48B7, 16);
-  addKey("3", Three_Key, 0xC837, 16);
-  addKey("4", Four_Key, 0x28D7, 16);
-  addKey("5", Five_Key, 0xA857, 16);
-  addKey("6", Six_Key, 0x6897, 16);
-  addKey("7", Seven_Key, 0xE817, 16);
-  addKey("8", Eight_Key, 0x18E7, 16);
-  addKey("9", Nine_Key, 0x9867, 16);
-  addKey("0", Zero_Key, 0x08F7, 16);
-  addKey("10", Unmapped_Key, 0x02FD, 16);
-  addKey("11", Unmapped_Key, 0x827D, 16);
-  addKey("12", Unmapped_Key, 0x42BD, 16);
-  addKey("13", Unmapped_Key, 0xC23D, 16);
-  addKey("14", Unmapped_Key, 0x22DD, 16);
-  addKey("15", Unmapped_Key, 0xA25D, 16);
-  addKey("16", Unmapped_Key, 0x629D, 16);
-  addKey("17", Unmapped_Key, 0xE21D, 16);
-  addKey("18", Unmapped_Key, 0x12ED, 16);
-  addKey("19", Unmapped_Key, 0x926D, 16);
-  addKey("20", Unmapped_Key, 0x52AD, 16);
-  addKey("21", Unmapped_Key, 0xD22D, 16);
-  addKey("22", Unmapped_Key, 0x32CD, 16);
-  addKey("23", Unmapped_Key, 0xB24D, 16);
-  addKey("24", Unmapped_Key, 0x728D, 16);
-  addKey("PLUS10", DoubleDigit_Key, 0x58A7, 16);
-  addKey("INDEX", Unmapped_Key, 0xD02F, 16);
-  addKey("REPEAT", Unmapped_Key, 0x10EF, 16); // "REPEAT_S/F/OFF", "S/F"
-  addKey("RANDOM", Unmapped_Key, 0xD827, 16); // "AUTO"
-  addKey("SEARCH_BACK", Rewind_Key, 0xA05F, 16);
-  addKey("SEARCH_FWD", FastForward_Key, 0x609F, 16);
-  addKey("OUTPUT_MINUS", VolumeDown_Key, 0x38C7, 16);
-  addKey("OUTPUT_PLUS", VolumeUp_Key, 0xB847, 16);
-  addKey("SKIP_BACK", Previous_Key, 0x20DF, 16); // "-", "PREV"
-  addKey("SKIP_FWD", Next_Key, 0xE01F, 16); // "+", "NEXT"
-  addKey("STOP", Stop_Key, 0x6A95, 16);
-  addKey("PAUSE", Pause_Key, 0xAA55, 16);
-  addKey("PLAY", Play_Key, 0x40BF, 16);
-  addKey("DEL", Unmapped_Key, 0x708F, 16);
-  addKey("REPEAT_A-B", Unmapped_Key, 0x906F, 16);
-  addKey("DISC_SKIP_FORWARD", Unmapped_Key, 0xF20D, 16);
-  addKey("DISC_SKIP_REVERSE", Unmapped_Key, 0x0AF5, 16);
-  addKey("MODE", Unmapped_Key, 0x00FF, 16);
-  addKey("DISC_SCAN", Unmapped_Key, 0xCA35, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0x9E61, 16);
+  setPreData(0x79, 8);
+
+  addKey("MODE", Unmapped_Key, 0x00, 8);
+  addKey("OPEN", Eject_Key, 0x01, 8);
+  addKey("PLAY", Play_Key, 0x02, 8);
+  addKey("SKIP_BACK", Previous_Key, 0x04, 8); // "-", "PREV"
+  addKey("SEARCH_BACK", Rewind_Key, 0x05, 8);
+  addKey("SEARCH_FWD", FastForward_Key, 0x06, 8);
+  addKey("SKIP_FWD", Next_Key, 0x07, 8); // "+", "NEXT"
+  addKey("REPEAT", Repeat_Key, 0x08, 8); // "REPEAT_S/F/OFF", "S/F"
+  addKey("REPEAT_A-B", RepeatAB_Key, 0x09, 8);
+  addKey("TIME", Info_Key, 0x0A, 8); // "TIME_DISPLAY"
+  addKey("INDEX", Unmapped_Key, 0x0B, 8);
+  addKey("PROG", Program_Key, 0x0C, 8);
+  addKey("CLEAR", Clear_Key, 0x0D, 8); // "CANCEL"
+  addKey("DEL", Unmapped_Key, 0x0E, 8);
+  addKey("SPACE", Unmapped_Key, 0x0F, 8);
+  addKey("0", Zero_Key, 0x10, 8);
+  addKey("1", One_Key, 0x11, 8);
+  addKey("2", Two_Key, 0x12, 8);
+  addKey("3", Three_Key, 0x13, 8);
+  addKey("4", Four_Key, 0x14, 8);
+  addKey("5", Five_Key, 0x15, 8);
+  addKey("6", Six_Key, 0x16, 8);
+  addKey("7", Seven_Key, 0x17, 8);
+  addKey("8", Eight_Key, 0x18, 8);
+  addKey("9", Nine_Key, 0x19, 8);
+  addKey("PLUS10", DoubleDigit_Key, 0x1A, 8);
+  addKey("RANDOM", Random_Key, 0x1B, 8); // "AUTO"
+  addKey("OUTPUT_MINUS", VolumeDown_Key, 0x1C, 8);
+  addKey("OUTPUT_PLUS", VolumeUp_Key, 0x1D, 8);
+  addKey("DIMMER", Unmapped_Key, 0x1E, 8); // "MODE"
+  addKey("10", Unmapped_Key, 0x40, 8);
+  addKey("11", Unmapped_Key, 0x41, 8);
+  addKey("12", Unmapped_Key, 0x42, 8);
+  addKey("13", Unmapped_Key, 0x43, 8);
+  addKey("14", Unmapped_Key, 0x44, 8);
+  addKey("15", Unmapped_Key, 0x45, 8);
+  addKey("16", Unmapped_Key, 0x46, 8);
+  addKey("17", Unmapped_Key, 0x47, 8);
+  addKey("18", Unmapped_Key, 0x48, 8);
+  addKey("19", Unmapped_Key, 0x49, 8);
+  addKey("20", Unmapped_Key, 0x4A, 8);
+  addKey("21", Unmapped_Key, 0x4B, 8);
+  addKey("22", Unmapped_Key, 0x4C, 8);
+  addKey("23", Unmapped_Key, 0x4D, 8);
+  addKey("24", Unmapped_Key, 0x4E, 8);
+  addKey("DISC_SKIP_FORWARD", DiscSelect_Key, 0x4F, 8);
+  addKey("DISC_SKIP_REVERSE", Unmapped_Key, 0x50, 8);
+  addKey("DISC_SCAN", Unmapped_Key, 0x53, 8);
+  addKey("PAUSE", Pause_Key, 0x55, 8);
+  addKey("STOP", Stop_Key, 0x56, 8);
+  addKey("TAPE", Unmapped_Key, 0x57, 8);
+  addKey("SYNCHRO", Unmapped_Key, 0x58, 8); // "DIRECT_OUT"
+  addKey("PEAK", Unmapped_Key, 0x5D, 8);
 }
 
 
@@ -143,8 +147,8 @@ YamahaAudio1a::YamahaAudio1a(
 {
   setKeysetName("Audio Keyset 1a");
 
-  addKey("PAUSE/STOP", Stop_Key, 0xC03F, 16);
-  addKey("PAUSE/STOP", Pause_Key, 0xC03F, 16);
+  addKey("PAUSE/STOP", Stop_Key, 0x03, 8);
+  addKey("PAUSE/STOP", Pause_Key, 0x03, 8);
 }
 
 
@@ -156,80 +160,84 @@ YamahaAudio2::YamahaAudio2(
       Yamaha_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x5EA1, 16);
-
-  addKey("Power", Power_Key, 0xF807, 16); // "STANDBY"
-  addKey("mute", Mute_Key, 0x38C7, 16); // "-20DB"
-  addKey("vol+", VolumeUp_Key, 0x58A7, 16);
-  addKey("vol-", VolumeDown_Key, 0xD827, 16);
-  addKey("cd", Unmapped_Key, 0xA857, 16);
-  addKey("tuner", Unmapped_Key, 0x6897, 16);
-  addKey("tapemonitor", Unmapped_Key, 0x18E7, 16); // "Tape/MD_Monitor", "DAT"
-  addKey("dvdld", Unmapped_Key, 0xE817, 16); // "d-tv/cbl", "AUX"
-  addKey("tvdbs", Unmapped_Key, 0x2AD5, 16); // "SAT/D-TV" "d-tv/cbl alt"
-  addKey("vcr", Unmapped_Key, 0xF00F, 16);
-  addKey("phono", Unmapped_Key, 0x28D7, 16);
-  addKey("vaux", Unmapped_Key, 0xAA55, 16); // "GO_CDV1"
-  addKey("extdecoder", Unmapped_Key, 0xE11E, 16); // "ExternalDecoder", "6chIN"
-  addKey("ch-", ChannelDown_Key, 0x8877, 16);
-  addKey("ch+", ChannelUp_Key, 0x08F7, 16);
-  addKey("abcde", Unmapped_Key, 0x48B7, 16); // "A/B/C/D/E" "tuner-toggle"
-  addKey("sleep", Sleep_Key, 0xEA15, 16);
-  addKey("display", Info_Key, 0x43BC, 16); // "onscreen"
-  addKey("on", Unmapped_Key, 0xB847, 16); // Map this to "Power_Key"?
-  addKey("off", Unmapped_Key, 0x7887, 16); // and this?
-  addKey("test", Unmapped_Key, 0xA15E, 16); // "DSP_TEST"
-  addKey("effect", Unmapped_Key, 0x6A95, 16);
-  addKey("up", Up_Key, 0x19E6, 16);
-  addKey("down", Down_Key, 0x9966, 16);
-  addKey("left", Left_Key, 0xCA35, 16); // "DSP-", "DELAY_TIME-"
-  addKey("right", Right_Key, 0x4AB5, 16);  // "DSP+", "DELAY_TIME+"
-  addKey("level", Unmapped_Key, 0x619E, 16); // "Time/Level"
-  addKey("setmenu", Unmapped_Key, 0x39C6, 16);
-  addKey("setmenu-", Unmapped_Key, 0xB946, 16);
-  addKey("effect-", Unmapped_Key, 0x9A65, 16); // "DSP_Prg-"
-  addKey("effect+", Unmapped_Key, 0x1AE5, 16); // "DSP_Prg+"
-  addKey("dolbydts", Surround_Key, 0x11EE, 16); // "PRO_LOGIC_SURROUND"
-  addKey("movietheater1", Unmapped_Key, 0x916E, 16); // "PRO_LOGIC_ENHANCED"
-  addKey("movietheater2", Unmapped_Key, 0x51AE, 16); // "CNCT_VIDEO"
-  addKey("monomovie", Unmapped_Key, 0xD12E, 16);
-  addKey("tvsports", Unmapped_Key, 0x31CE, 16); // "ROCK"
-  addKey("disco", Unmapped_Key, 0xB14E, 16); // "HALL"
-  addKey("rock", Unmapped_Key, 0x718E, 16);
-  addKey("jazzclub", Unmapped_Key, 0xF10E, 16);
-  addKey("church", Unmapped_Key, 0x09F6, 16);
-  addKey("hall", Unmapped_Key, 0x8976, 16);
-  addKey("DiscSkip", Unmapped_Key, 0xF20D, 16); // "CD_DISC"
-  addKey("TapeRec", Record_Key, 0x20DF, 16); // "TAPE_RECPAUSE"
-  addKey("TapeDeckA/B", Unmapped_Key, 0x609F, 16);
-  addKey("TapeRewind", Unmapped_Key, 0x807F, 16);
-  addKey("TapeForward", Unmapped_Key, 0x40BF, 16);
-  addKey("TapePlay", Unmapped_Key, 0x00FF, 16);
-  addKey("TapeStop", Unmapped_Key, 0xC03F, 16);
-  addKey("TapeDirA", Unmapped_Key, 0xE01F, 16);
-  addKey("TapeDirB", Unmapped_Key, 0x02FD, 16);
-  addKey("CDSkipBack", Replay_Key, 0xD02F, 16);
-  addKey("CDSkipForward", Advance_Key, 0x50AF, 16);
-  addKey("CDPlay", Play_Key, 0x10EF, 16);
-  addKey("CDPause/Stop", Pause_Key, 0x906F, 16);
-  addKey("CDPause/Stop", Stop_Key, 0x906F, 16);
-  addKey("CDRewind", Rewind_Key, 0xB04F, 16);
-  addKey("CDForward", FastForward_Key, 0x30CF, 16);
-  addKey("TAPE2", Unmapped_Key, 0x9867, 16);
-  addKey("CENTRE_MODE", Unmapped_Key, 0x21DE, 16);
-  addKey("FRONT_EFFECT_LEVEL_+", Unmapped_Key, 0x01FE, 16);
-  addKey("FRONT_EFFECT_LEVEL_-", Unmapped_Key, 0x817E, 16);
-  addKey("CENTRE_LEVEL_+", Unmapped_Key, 0x41BE, 16);
-  addKey("CENTRE_LEVEL_-", Unmapped_Key, 0xC13E, 16);
-  addKey("REAR_LEVEL_+", Unmapped_Key, 0x7A85, 16);
-  addKey("REAR_LEVEL_-", Unmapped_Key, 0xFA05, 16);
-  addKey("PHONO_PLAY/CUT", Unmapped_Key, 0x708F, 16);
-  addKey("TAPE_REC_MUTE", Unmapped_Key, 0xA05F, 16);
-  addKey("EQ_PRESET_SKIP", Unmapped_Key, 0xDA25, 16);
-  addKey("EQ_ON/FLAT", Unmapped_Key, 0x5AA5, 16);
-  addKey("GO_VCR2", Unmapped_Key, 0xC837, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0x5EA1, 16);
+  setPreData(0x7A, 8);
+
+  addKey("TapePlay", Unmapped_Key, 0x00, 8);
+  addKey("TapeRewind", Unmapped_Key, 0x01, 8);
+  addKey("TapeForward", Unmapped_Key, 0x02, 8);
+  addKey("TapeStop", Unmapped_Key, 0x03, 8);
+  addKey("TapeRec", Record_Key, 0x04, 8); // "TAPE_RECPAUSE"
+  addKey("TAPE_REC_MUTE", Unmapped_Key, 0x05, 8);
+  addKey("TapeDeckA/B", Unmapped_Key, 0x06, 8);
+  addKey("TapeDirA", Unmapped_Key, 0x07, 8);
+  addKey("CDPlay", Play_Key, 0x08, 8);
+  addKey("CDPause/Stop", Pause_Key, 0x09, 8);
+  addKey("CDPause/Stop", Stop_Key, 0x09, 8);
+  addKey("CDSkipForward", Advance_Key, 0x0A, 8);
+  addKey("CDSkipBack", Replay_Key, 0x0B, 8);
+  addKey("CDForward", FastForward_Key, 0x0C, 8);
+  addKey("CDRewind", Rewind_Key, 0x0D, 8);
+  addKey("PHONO_PLAY/CUT", Unmapped_Key, 0x0E, 8);
+  addKey("vcr", Unmapped_Key, 0x0F, 8);
+  addKey("ch+", ChannelUp_Key, 0x10, 8);
+  addKey("ch-", ChannelDown_Key, 0x11, 8);
+  addKey("abcde", TunerBand_Key, 0x12, 8); // "A/B/C/D/E" "tuner-toggle"
+  addKey("GO_VCR2", Unmapped_Key, 0x13, 8);
+  addKey("phono", Unmapped_Key, 0x14, 8);
+  addKey("cd", Unmapped_Key, 0x15, 8);
+  addKey("tuner", Unmapped_Key, 0x16, 8);
+  addKey("dvdld", Unmapped_Key, 0x17, 8); // "d-tv/cbl", "AUX"
+  addKey("tapemonitor", Unmapped_Key, 0x18, 8); // "Tape/MD_Monitor", "DAT"
+  addKey("TAPE2", Unmapped_Key, 0x19, 8);
+  addKey("vol+", VolumeUp_Key, 0x1A, 8);
+  addKey("vol-", VolumeDown_Key, 0x1B, 8);
+  addKey("mute", Mute_Key, 0x1C, 8); // "-20DB"
+  addKey("on", PowerOn_Key, 0x1D, 8);
+  addKey("off", PowerOff_Key, 0x1E, 8);
+  addKey("Power", Power_Key, 0x1F, 8); // "STANDBY"
+
+  addKey("TapeDirB", Unmapped_Key, 0x40, 8);
+  addKey("DiscSkip", Unmapped_Key, 0x4F, 8); // "CD_DISC"
+  addKey("right", Right_Key, 0x52, 8);  // "DSP+", "DELAY_TIME+"
+  addKey("left", Left_Key, 0x53, 8); // "DSP-", "DELAY_TIME-"
+  addKey("tvdbs", Unmapped_Key, 0x54, 8); // "SAT/D-TV" "d-tv/cbl alt"
+  addKey("vaux", Unmapped_Key, 0x55, 8); // "GO_CDV1"
+  addKey("effect", Unmapped_Key, 0x56, 8);
+  addKey("sleep", Sleep_Key, 0x57, 8);
+  addKey("effect+", Unmapped_Key, 0x58, 8); // "DSP_Prg+"
+  addKey("effect-", Unmapped_Key, 0x59, 8); // "DSP_Prg-"
+  addKey("EQ_ON/FLAT", Unmapped_Key, 0x5A, 8);
+  addKey("EQ_PRESET_SKIP", Unmapped_Key, 0x5B, 8);
+  addKey("REAR_LEVEL_+", Unmapped_Key, 0x5E, 8);
+  addKey("REAR_LEVEL_-", Unmapped_Key, 0x5F, 8);
+
+  addKey("FRONT_EFFECT_LEVEL_+", Unmapped_Key, 0x80, 8);
+  addKey("FRONT_EFFECT_LEVEL_-", Unmapped_Key, 0x81, 8);
+  addKey("CENTRE_LEVEL_+", Unmapped_Key, 0x82, 8);
+  addKey("CENTRE_LEVEL_-", Unmapped_Key, 0x83, 8);
+  addKey("CENTRE_MODE", Unmapped_Key, 0x84, 8);
+  addKey("test", Unmapped_Key, 0x85, 8); // "DSP_TEST"
+  addKey("level", Unmapped_Key, 0x86, 8); // "Time/Level"
+  addKey("extdecoder", Unmapped_Key, 0x87, 8); // "ExternalDecoder", "6chIN"
+  addKey("dolbydts", Surround_Key, 0x88, 8); // "PRO_LOGIC_SURROUND"
+  addKey("movietheater1", Unmapped_Key, 0x89, 8); // "PRO_LOGIC_ENHANCED"
+  addKey("movietheater2", Unmapped_Key, 0x8A, 8); // "CNCT_VIDEO"
+  addKey("monomovie", Unmapped_Key, 0x8B, 8);
+  addKey("tvsports", Unmapped_Key, 0x8C, 8); // "ROCK"
+  addKey("disco", Unmapped_Key, 0x8D, 8); // "HALL"
+  addKey("rock", Unmapped_Key, 0x8E, 8);
+  addKey("jazzclub", Unmapped_Key, 0x8F, 8);
+  addKey("church", Unmapped_Key, 0x90, 8);
+  addKey("hall", Unmapped_Key, 0x91, 8);
+
+  addKey("up", Up_Key, 0x98, 8);
+  addKey("down", Down_Key, 0x99, 8);
+  addKey("setmenu", Unmapped_Key, 0x9C, 8);
+  addKey("setmenu-", Unmapped_Key, 0x9D, 8);
+  addKey("display", Info_Key, 0xC2, 8); // "onscreen"
 }
 
 
@@ -240,10 +248,10 @@ YamahaAudio2a::YamahaAudio2a(
 {
   setKeysetName("Audio Keyset 2a");
 
-  addKey("Dolby/DTS", Unmapped_Key, 0x09F6, 16);
-  addKey("6.1/5.1", Unmapped_Key, 0xE916, 16);
-  addKey("Night", Unmapped_Key, 0xA956, 16);
-  addKey("Stereo", Unmapped_Key, 0x6A95, 16);
+  addKey("Dolby/DTS", Unmapped_Key, 0x90, 8);
+  addKey("6.1/5.1", Unmapped_Key, 0x97, 8);
+  addKey("Night", Unmapped_Key, 0x95, 8);
+  addKey("Stereo", Unmapped_Key, 0x56, 8);
 }
 
 
@@ -254,7 +262,7 @@ YamahaAudio2b::YamahaAudio2b(
 {
   setKeysetName("Audio Keyset 2b");
 
-  addKey("SOURCE_DIRECT", Unmapped_Key, 0x6A95, 16);
+  addKey("SOURCE_DIRECT", Unmapped_Key, 0x56, 8);
 }
 
 
@@ -265,24 +273,24 @@ YamahaAudio2c::YamahaAudio2c(
 {
   setKeysetName("Audio Keyset 2c");
 
-  addKey("1", One_Key, 0x11EE, 16);
-  addKey("2", Two_Key, 0x916E, 16);
-  addKey("3", Three_Key, 0x51AE, 16);
-  addKey("4", Four_Key, 0xD12E, 16);
-  addKey("5", Five_Key, 0x31CE, 16);
-  addKey("6", Six_Key, 0xB14E, 16);
-  addKey("7", Seven_Key, 0x718E, 16);
-  addKey("8", Eight_Key, 0xF10E, 16);
-  addKey("9", Nine_Key, 0x09F6, 16);
-  addKey("0", Zero_Key, 0x8976, 16);
-  addKey("set+", Unmapped_Key, 0x7986, 16);
-  addKey("set-", Unmapped_Key, 0xF906, 16);
-  addKey("set^", Unmapped_Key, 0xB946, 16);
-  addKey("setv", Unmapped_Key, 0x39C6, 16);
-  addKey("parameter^", Unmapped_Key, 0xA35C, 16);
-  addKey("parameterv", Unmapped_Key, 0x23DC, 16);
-  addKey("parameter-", Unmapped_Key, 0xE31C, 16);
-  addKey("parameter+", Unmapped_Key, 0x639C, 16);
+  addKey("parameterv", Unmapped_Key, 0xC4, 8);
+  addKey("parameter^", Unmapped_Key, 0xC5, 8);
+  addKey("parameter+", Unmapped_Key, 0xC6, 8);
+  addKey("parameter-", Unmapped_Key, 0xC7, 8);
+  addKey("1", One_Key, 0x88, 8);
+  addKey("2", Two_Key, 0x89, 8);
+  addKey("3", Three_Key, 0x8A, 8);
+  addKey("4", Four_Key, 0x8B, 8);
+  addKey("5", Five_Key, 0x8C, 8);
+  addKey("6", Six_Key, 0x8D, 8);
+  addKey("7", Seven_Key, 0x8E, 8);
+  addKey("8", Eight_Key, 0x8F, 8);
+  addKey("9", Nine_Key, 0x90, 8);
+  addKey("0", Zero_Key, 0x91, 8);
+  addKey("setv", Unmapped_Key, 0x9C, 8);
+  addKey("set^", Unmapped_Key, 0x9D, 8);
+  addKey("set+", Unmapped_Key, 0x9E, 8);
+  addKey("set-", Unmapped_Key, 0x9F, 8);
 }
 
 
@@ -293,8 +301,8 @@ YamahaAudio2d::YamahaAudio2d(
 {
   setKeysetName("Audio Keyset 2d");
 
-  addKey("LOUDNESS_-", Unmapped_Key, 0x7887, 16);
-  addKey("LOUDNESS_+", Unmapped_Key, 0xB847, 16);
+  addKey("LOUDNESS_+", Unmapped_Key, 0x1D, 8);
+  addKey("LOUDNESS_-", Unmapped_Key, 0x1E, 8);
 }
 
 
@@ -306,45 +314,47 @@ YamahaAudio3::YamahaAudio3(
       Yamaha_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0xFE01, 16);
-
-  addKey("PLAY", Play_Key, 0x00FF, 16);
-  addKey("STOP", Stop_Key, 0xC03F, 16);
-  addKey("RECORD/PAUSE", Record_Key, 0x20DF, 16);
-  addKey("FAST_FORWARD", FastForward_Key, 0x40BF, 16);
-  addKey("REWIND", Rewind_Key, 0x807F, 16);
-  addKey("RECORD_MUTE", Unmapped_Key, 0xA05F, 16);
-  addKey("INTRO_SCAN_FORWARD", Unmapped_Key, 0x7887, 16);
-  addKey("INTRO_SCAN_REVERSE", Unmapped_Key, 0xF807, 16);
-  addKey("SEARCH_FORWARD", Advance_Key, 0x50AF, 16);
-  addKey("SEARCH_REVERSE", Replay_Key, 0xD02F, 16);
-  addKey("DIRECTION_<>", Unmapped_Key, 0xE01F, 16); // "DIR_A"
-  addKey("DIR_B", Unmapped_Key, 0x10EF, 16);
-  addKey("DECK_A/B", Unmapped_Key, 0x609F, 16);
-  addKey("MONITOR", Unmapped_Key, 0xF00F, 16);
-  addKey("DUBBING", Unmapped_Key, 0x906F, 16);
-  addKey("COUNTER_RESET", Reset_Key, 0xB04F, 16);
-  addKey("COUNTER_REMAIN", Unmapped_Key, 0xB847, 16);
-  addKey("COUNTER_MEMORY", Unmapped_Key, 0x708F, 16);
-  addKey("COUNTER_TAPE", Unmapped_Key, 0x30CF, 16);
-  addKey("1", One_Key, 0x8877, 16);
-  addKey("2", Two_Key, 0x48B7, 16);
-  addKey("3", Three_Key, 0xC837, 16);
-  addKey("4", Four_Key, 0x28D7, 16);
-  addKey("5", Five_Key, 0xA857, 16);
-  addKey("6", Six_Key, 0x6897, 16);
-  addKey("7", Seven_Key, 0xE817, 16);
-  addKey("8", Eight_Key, 0x18E7, 16);
-  addKey("9", Nine_Key, 0x9867, 16);
-  addKey("0", Zero_Key, 0x08F7, 16);
-  addKey("CLEAR", Clear_Key, 0xD827, 16);
-  addKey("PROG", Program_Key, 0x58A7, 16);
-  addKey("RUN", Unmapped_Key, 0x38C7, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0xFE01, 16);
+  setPreData(0x7F, 8);
+
+  addKey("PLAY", Play_Key, 0x00, 8);
+  addKey("REWIND", Rewind_Key, 0x01, 8);
+  addKey("FAST_FORWARD", FastForward_Key, 0x02, 8);
+  addKey("STOP", Stop_Key, 0x03, 8);
+  addKey("RECORD/PAUSE", Record_Key, 0x04, 8);
+  addKey("RECORD_MUTE", RecordMute_Key, 0x05, 8);
+  addKey("DECK_A/B", Unmapped_Key, 0x06, 8);
+  addKey("DIRECTION_<>", Unmapped_Key, 0x07, 8); // "DIR_A"
+  addKey("DIR_B", Unmapped_Key, 0x08, 8);
+  addKey("DUBBING", Unmapped_Key, 0x09, 8);
+  addKey("SEARCH_FORWARD", Advance_Key, 0x0A, 8);
+  addKey("SEARCH_REVERSE", Replay_Key, 0x0B, 8);
+  addKey("COUNTER_TAPE", Unmapped_Key, 0x0C, 8);
+  addKey("COUNTER_RESET", Reset_Key, 0x0D, 8);
+  addKey("COUNTER_MEMORY", Unmapped_Key, 0x0E, 8);
+  addKey("MONITOR", Unmapped_Key, 0x0F, 8);
+  addKey("0", Zero_Key, 0x10, 8);
+  addKey("1", One_Key, 0x11, 8);
+  addKey("2", Two_Key, 0x12, 8);
+  addKey("3", Three_Key, 0x13, 8);
+  addKey("4", Four_Key, 0x14, 8);
+  addKey("5", Five_Key, 0x15, 8);
+  addKey("6", Six_Key, 0x16, 8);
+  addKey("7", Seven_Key, 0x17, 8);
+  addKey("8", Eight_Key, 0x18, 8);
+  addKey("9", Nine_Key, 0x19, 8);
+  addKey("PROG", Program_Key, 0x1A, 8);
+  addKey("CLEAR", Clear_Key, 0x1B, 8);
+  addKey("RUN", Unmapped_Key, 0x1C, 8);
+  addKey("COUNTER_REMAIN", Unmapped_Key, 0x1D, 8);
+  addKey("INTRO_SCAN_FORWARD", Unmapped_Key, 0x1E, 8);
+  addKey("INTRO_SCAN_REVERSE", Unmapped_Key, 0x1F, 8);
 }
 
 
+// This one is strange, need to look at it harder:
 YamahaAudio4::YamahaAudio4(
   QObject *guiObject,
   unsigned int index)
@@ -353,7 +363,7 @@ YamahaAudio4::YamahaAudio4(
       Yamaha_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
+  threadableProtocol = new NECProtocol(guiObject, index, LIRC_NEC);
 
   setPreData(0x857A, 16);
 
@@ -386,7 +396,7 @@ YamahaAudio4::YamahaAudio4(
   addKey("VOL_DOWN", VolumeDown_Key, 0xE41B, 16);
   addKey("TUNER_PRESET_+", ChannelUp_Key, 0xEF10, 16);
   addKey("TUNER_PRESET_-", ChannelDown_Key, 0xEE11, 16);
-  addKey("TUNER_ABCDE", Unmapped_Key, 0xED12, 16);
+  addKey("TUNER_ABCDE", TunerBand_Key, 0xED12, 16);
   addKey("EQ_PRESET_SKIP", Unmapped_Key, 0xA45B, 16);
   addKey("EQ_ON/FLAT", Unmapped_Key, 0xA55A, 16);
   addKey("PHONO_PLAY/CUT", Unmapped_Key, 0xF10E, 16);
@@ -401,40 +411,41 @@ YamahaAudio5::YamahaAudio5(
       Yamaha_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0xA25D, 16);
-
-  addKey("Power", Power_Key, 0x48B7, 16);
-  addKey("Rewind", Rewind_Key, 0x9867, 16);
-  addKey("Forward", FastForward_Key, 0xC837, 16);
-  addKey("SkipBack", Replay_Key, 0xC43B, 16);
-  addKey("SkipForward", Advance_Key, 0x24DB, 16);
-  addKey("Pause", Pause_Key, 0x00FF, 16);
-  addKey("Stop", Stop_Key, 0x28D7, 16);
-  addKey("Play", Play_Key, 0xA857, 16);
-  addKey("Title", DiscTitle_Key, 0x7B84, 16);
-  addKey("Menu", DiscMenu_Key, 0x21DE, 16);
-  addKey("Up", Up_Key, 0x01FE, 16);
-  addKey("Down", Down_Key, 0x817E, 16);
-  addKey("Left", Left_Key, 0x8A75, 16);
-  addKey("Right", Right_Key, 0xB24D, 16);
-  addKey("Select", Select_Key, 0x847B, 16);
-  addKey("Clear", Clear_Key, 0xF708, 16);
-  addKey("Return", Exit_Key, 0x44BB, 16);
-  addKey("Display", Info_Key, 0x6897, 16);
-  addKey("Index", Unmapped_Key, 0x649B, 16);
-  addKey("+10", DoubleDigit_Key, 0xA45B, 16);
-  addKey("0", Zero_Key, 0x50AF, 16);
-  addKey("1", One_Key, 0x807F, 16);
-  addKey("2", Two_Key, 0x40BF, 16);
-  addKey("3", Three_Key, 0xC03F, 16);
-  addKey("4", Four_Key, 0x20DF, 16);
-  addKey("5", Five_Key, 0xA05F, 16);
-  addKey("6", Six_Key, 0x609F, 16);
-  addKey("7", Seven_Key, 0xE01F, 16);
-  addKey("8", Eight_Key, 0x10EF, 16);
-  addKey("9", Nine_Key, 0x906F, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0xA25D, 16);
+  setPreData(0x45, 8);
+
+  addKey("Pause", Pause_Key, 0x00, 8);
+  addKey("1", One_Key, 0x01, 8);
+  addKey("2", Two_Key, 0x02, 8);
+  addKey("3", Three_Key, 0x03, 8);
+  addKey("4", Four_Key, 0x04, 8);
+  addKey("5", Five_Key, 0x05, 8);
+  addKey("6", Six_Key, 0x06, 8);
+  addKey("7", Seven_Key, 0x07, 8);
+  addKey("8", Eight_Key, 0x08, 8);
+  addKey("9", Nine_Key, 0x09, 8);
+  addKey("0", Zero_Key, 0x0A, 8);
+  addKey("Power", Power_Key, 0x12, 8);
+  addKey("Forward", FastForward_Key, 0x13, 8);
+  addKey("Stop", Stop_Key, 0x14, 8);
+  addKey("Play", Play_Key, 0x15, 8);
+  addKey("Display", Info_Key, 0x16, 8);
+  addKey("Rewind", Rewind_Key, 0x19, 8);
+  addKey("Select", Select_Key, 0x21, 8);
+  addKey("Return", Exit_Key, 0x22, 8);
+  addKey("SkipBack", Replay_Key, 0x23, 8);
+  addKey("SkipForward", Advance_Key, 0x24, 8);
+  addKey("+10", DoubleDigit_Key, 0x25, 8);
+  addKey("Index", Unmapped_Key, 0x26, 8);
+  addKey("Right", Right_Key, 0x4D, 8);
+  addKey("Left", Left_Key, 0x51, 8);
+  addKey("Up", Up_Key, 0x80, 8);
+  addKey("Down", Down_Key, 0x81, 8);
+  addKey("Menu", DiscMenu_Key, 0x84, 8);
+  addKey("Title", DiscTitle_Key, 0xDE, 8);
+  addKey("Clear", Clear_Key, 0xEF, 8);
 }
 
 
@@ -446,19 +457,20 @@ YamahaAudio6::YamahaAudio6(
       Yamaha_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x8B74, 16);
-
-  addKey("A/B/C/D/E", Unmapped_Key, 0xB04F, 16);
-  addKey("1", One_Key, 0x708F, 16);
-  addKey("2", Two_Key, 0xF00F, 16);
-  addKey("3", Three_Key, 0x08F7, 16);
-  addKey("4", Four_Key, 0x8877, 16);
-  addKey("5", Five_Key, 0x48B7, 16);
-  addKey("6", Six_Key, 0xC837, 16);
-  addKey("7", Seven_Key, 0x28D7, 16);
-  addKey("8", Eight_Key, 0xA857, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0x8B74, 16);
+  setPreData(0xD1, 8);
+
+  addKey("A/B/C/D/E", TunerBand_Key, 0x0D, 8);
+  addKey("1", One_Key, 0x0E, 8);
+  addKey("2", Two_Key, 0x0F, 8);
+  addKey("3", Three_Key, 0x10, 8);
+  addKey("4", Four_Key, 0x11, 8);
+  addKey("5", Five_Key, 0x12, 8);
+  addKey("6", Six_Key, 0x13, 8);
+  addKey("7", Seven_Key, 0x14, 8);
+  addKey("8", Eight_Key, 0x15, 8);
 }
 
 
@@ -470,55 +482,56 @@ YamahaAudio7::YamahaAudio7(
       Yamaha_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x1EE1, 16);
-
-  addKey("1", One_Key, 0x8877, 16);
-  addKey("2", Two_Key, 0x48B7, 16);
-  addKey("3", Three_Key, 0xC837, 16);
-  addKey("4", Four_Key, 0x28D7, 16);
-  addKey("5", Five_Key, 0xA857, 16);
-  addKey("6", Six_Key, 0x6897, 16);
-  addKey("7", Seven_Key, 0xE817, 16);
-  addKey("8", Eight_Key, 0x18E7, 16);
-  addKey("9", Nine_Key, 0x9867, 16);
-  addKey("0", Zero_Key, 0x08F7, 16);
-  addKey("time", Unmapped_Key, 0x50AF, 16);
-  addKey("prog", Program_Key, 0xD02F, 16);
-  addKey("tape", Unmapped_Key, 0x10EF, 16);
-  addKey("edit", Unmapped_Key, 0x906F, 16);
-  addKey("+10", DoubleDigit_Key, 0x58A7, 16);
-  addKey("mode", Unmapped_Key, 0xBA45, 16);
-  addKey("repeat", Unmapped_Key, 0x30CF, 16);
-  addKey("random", Unmapped_Key, 0xE01F, 16);
-  addKey("open", Eject_Key, 0x00FF, 16);
-  addKey("tuner", Unmapped_Key, 0xD22D, 16);
-  addKey("disc_skip", Unmapped_Key, 0xB04F, 16);
-  addKey("cd_last", Previous_Key, 0x20DF, 16);
-  addKey("cd_next", Next_Key, 0xC03F, 16);
-  addKey("cd_stop", Stop_Key, 0x807F, 16);
-  addKey("cd_play", Play_Key, 0x40BF, 16);
-  addKey("location", Unmapped_Key, 0xDA25, 16);
-  addKey("up_arrow", Up_Key, 0xAA55, 16);
-  addKey("tape_play_back", Unmapped_Key, 0xC23D, 16);
-  addKey("tape_stop", Unmapped_Key, 0x827D, 16);
-  addKey("tape_play_forward", Unmapped_Key, 0x42BD, 16);
-  addKey("left_arrow", Left_Key, 0xEA15, 16);
-  addKey("music", Unmapped_Key, 0x5AA5, 16);
-  addKey("right_arrow", Right_Key, 0x1AE5, 16);
-  addKey("tape_back", Unmapped_Key, 0xA25D, 16);
-  addKey("tape_forward", Unmapped_Key, 0x22DD, 16);
-  addKey("user", Unmapped_Key, 0x3AC5, 16);
-  addKey("down_arrow", Down_Key, 0x6A95, 16);
-  addKey("flat", Unmapped_Key, 0x9A65, 16);
-  addKey("rec", Record_Key, 0x629D, 16);
-  addKey("tape1/2", Unmapped_Key, 0xE21D, 16);
-  addKey("sleep", Sleep_Key, 0xF20D, 16);
-  addKey("-", Unmapped_Key, 0xF807, 16);
-  addKey("power", Power_Key, 0xF00F, 16);
-  addKey("+", Unmapped_Key, 0x7887, 16);
-  addKey("input", Input_Key, 0x7A85, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0x1EE1, 16);
+  setPreData(0x78, 8);
+
+  addKey("open", Eject_Key, 0x00, 8);
+  addKey("cd_stop", Stop_Key, 0x01, 8);
+  addKey("cd_play", Play_Key, 0x02, 8);
+  addKey("cd_next", Next_Key, 0x03, 8);
+  addKey("cd_last", Previous_Key, 0x04, 8);
+  addKey("random", Random_Key, 0x07, 8);
+  addKey("tape", Unmapped_Key, 0x08, 8);
+  addKey("edit", Unmapped_Key, 0x09, 8);
+  addKey("time", Unmapped_Key, 0x0A, 8);
+  addKey("prog", Program_Key, 0x0B, 8);
+  addKey("repeat", Repeat_Key, 0x0C, 8);
+  addKey("disc_skip", DiscSelect_Key, 0x0D, 8);
+  addKey("power", Power_Key, 0x0F, 8);
+  addKey("0", Zero_Key, 0x10, 8);
+  addKey("1", One_Key, 0x11, 8);
+  addKey("2", Two_Key, 0x12, 8);
+  addKey("3", Three_Key, 0x13, 8);
+  addKey("4", Four_Key, 0x14, 8);
+  addKey("5", Five_Key, 0x15, 8);
+  addKey("6", Six_Key, 0x16, 8);
+  addKey("7", Seven_Key, 0x17, 8);
+  addKey("8", Eight_Key, 0x18, 8);
+  addKey("9", Nine_Key, 0x19, 8);
+  addKey("+10", DoubleDigit_Key, 0x1A, 8);
+  addKey("+", ChannelUp_Key, 0x1E, 8);
+  addKey("-", ChannelDown_Key, 0x1F, 8);
+  addKey("tape_stop", Unmapped_Key, 0x41, 8);
+  addKey("tape_play_forward", Unmapped_Key, 0x42, 8);
+  addKey("tape_play_back", Unmapped_Key, 0x43, 8);
+  addKey("tape_forward", Unmapped_Key, 0x44, 8);
+  addKey("tape_back", Unmapped_Key, 0x45, 8);
+  addKey("rec", Record_Key, 0x46, 8);
+  addKey("tape1/2", Unmapped_Key, 0x47, 8);
+  addKey("tuner", TunerBand_Key, 0x4B, 8);
+  addKey("sleep", Sleep_Key, 0x4F, 8);
+  addKey("up_arrow", Up_Key, 0x55, 8);
+  addKey("down_arrow", Down_Key, 0x56, 8);
+  addKey("left_arrow", Left_Key, 0x57, 8);
+  addKey("right_arrow", Right_Key, 0x58, 8);
+  addKey("flat", Unmapped_Key, 0x59, 8);
+  addKey("music", Unmapped_Key, 0x5A, 8);
+  addKey("location", Unmapped_Key, 0x5B, 8);
+  addKey("user", Unmapped_Key, 0x5C, 8);
+  addKey("mode", Unmapped_Key, 0x5D, 8);
+  addKey("input", Input_Key, 0x5E, 8);
 }
 
 
@@ -530,26 +543,27 @@ YamahaTV1::YamahaTV1(
       Yamaha_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0x20DF, 16);
-
-  addKey("1", One_Key, 0x8877, 16);
-  addKey("2", Two_Key, 0x48B7, 16);
-  addKey("3", Three_Key, 0xC837, 16);
-  addKey("4", Four_Key, 0x28D7, 16);
-  addKey("5", Five_Key, 0xA857, 16);
-  addKey("6", Six_Key, 0x6897, 16);
-  addKey("7", Seven_Key, 0xE817, 16);
-  addKey("8", Eight_Key, 0x18E7, 16);
-  addKey("9", Nine_Key, 0x9867, 16);
-  addKey("0", Zero_Key, 0x08F7, 16);
-  addKey("ch+", ChannelUp_Key, 0x00FF, 16);
-  addKey("ch-", ChannelDown_Key, 0x807F, 16);
-  addKey("vol+", VolumeUp_Key, 0x40BF, 16);
-  addKey("vol-", VolumeDown_Key, 0xC03F, 16);
-  addKey("mute", Mute_Key, 0x906F, 16);
-  addKey("goback", PrevChannel_Key, 0x58A7, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0x20DF, 16);
+  setPreData(0x04, 8);
+
+  addKey("ch+", ChannelUp_Key, 0x00, 8);
+  addKey("ch-", ChannelDown_Key, 0x01, 8);
+  addKey("vol+", VolumeUp_Key, 0x02, 8);
+  addKey("vol-", VolumeDown_Key, 0x03, 8);
+  addKey("mute", Mute_Key, 0x09, 8);
+  addKey("0", Zero_Key, 0x10, 8);
+  addKey("1", One_Key, 0x11, 8);
+  addKey("2", Two_Key, 0x12, 8);
+  addKey("3", Three_Key, 0x13, 8);
+  addKey("4", Four_Key, 0x14, 8);
+  addKey("5", Five_Key, 0x15, 8);
+  addKey("6", Six_Key, 0x16, 8);
+  addKey("7", Seven_Key, 0x17, 8);
+  addKey("8", Eight_Key, 0x18, 8);
+  addKey("9", Nine_Key, 0x19, 8);
+  addKey("goback", PrevChannel_Key, 0x1A, 8);
 }
 
 
@@ -561,27 +575,28 @@ YamahaKaraoke1::YamahaKaraoke1(
       Yamaha_Make,
       index)
 {
-  threadableProtocol = new NECProtocol(guiObject, index);
-
-  setPreData(0xDE21, 16);
-
-  addKey("POWER", Power_Key, 0x01FE, 16);
-  addKey("VOL+", VolumeUp_Key, 0x41BE, 16);
-  addKey("VOL-", VolumeDown_Key, 0xC13E, 16);
-  addKey("VCR", Unmapped_Key, 0x718E, 16);
-  addKey("TAPE", Unmapped_Key, 0xF10E, 16);
-  addKey("CD/CDG", Unmapped_Key, 0xB14E, 16);
-  addKey("LD", Unmapped_Key, 0x31CE, 16);
-  addKey("AUX1", Unmapped_Key, 0x8976, 16);
-  addKey("AUX2", Unmapped_Key, 0x09F6, 16);
-  addKey("VOCAL_AID", Unmapped_Key, 0x9B64, 16);
-  addKey("ONE_TOUCH_KAR.", Unmapped_Key, 0x5BA4, 16);
-  addKey("MPX/STEREO", Unmapped_Key, 0x1BE4, 16);
-  addKey("BALLAD", Unmapped_Key, 0x9966, 16);
-  addKey("POPS", Unmapped_Key, 0x59A6, 16);
-  addKey("JAZZ", Unmapped_Key, 0xD926, 16);
-  addKey("ROCK", Unmapped_Key, 0x39C6, 16);
-  addKey("B_SYMBOL", Unmapped_Key, 0x6996, 16);
-  addKey("SQUARE_SYMBOL", Unmapped_Key, 0xE916, 16);
-  addKey("HASH", Unmapped_Key, 0x19E6, 16);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
+
+//  setPreData(0xDE21, 16);
+  setPreData(0x7B, 8);
+
+  addKey("POWER", Power_Key, 0x80, 8);
+  addKey("VOL+", VolumeUp_Key, 0x82, 8);
+  addKey("VOL-", VolumeDown_Key, 0x83, 8);
+  addKey("LD", Unmapped_Key, 0x8C, 8);
+  addKey("CD/CDG", Unmapped_Key, 0x8D, 8);
+  addKey("VCR", Unmapped_Key, 0x8E, 8);
+  addKey("TAPE", Unmapped_Key, 0x8F, 8);
+  addKey("AUX2", Unmapped_Key, 0x90, 8);
+  addKey("AUX1", Unmapped_Key, 0x91, 8);
+  addKey("B_SYMBOL", Unmapped_Key, 0x96, 8);
+  addKey("SQUARE_SYMBOL", Unmapped_Key, 0x97, 8);
+  addKey("HASH", Unmapped_Key, 0x98, 8);
+  addKey("BALLAD", One_Key, 0x99, 8);
+  addKey("POPS", Two_Key, 0x9A, 8);
+  addKey("JAZZ", Three_Key, 0x9B, 8);
+  addKey("ROCK", Four_Key, 0x9C, 8);
+  addKey("MPX/STEREO", Unmapped_Key, 0xD8, 8);
+  addKey("VOCAL_AID", Unmapped_Key, 0xD9, 8);
+  addKey("ONE_TOUCH_KAR.", Unmapped_Key, 0xDA, 8);
 }
index db3b7d0..2532e13 100644 (file)
@@ -12,49 +12,50 @@ ZenithC32V37::ZenithC32V37(
 {
   addControlledDevice(Zenith_Make, "C32V37", TV_Device);
 
-  threadableProtocol = new NECProtocol(guiObject, index);
+  threadableProtocol = new NECProtocol(guiObject, index, Standard_NEC);
 
-  setPreData(0x20DF, 16);
+//  setPreData(0x20DF, 16);
+  setPreData(0x04, 8);
 
-  addKey("power", Power_Key, 0x10EF, 16);
-  addKey("tv/video", Input_Key, 0xD02F, 16);
-  addKey("front", Unmapped_Key, 0x8A75, 16);
-  addKey("comp/dvi", Unmapped_Key, 0x19E6, 16);
-  addKey("ratio", Unmapped_Key, 0x9E61, 16);
-  addKey("signal", Unmapped_Key, 0x6996, 16);
-  addKey("freeze", Unmapped_Key, 0xA659, 16);
-  addKey("1", One_Key, 0x8877, 16);
-  addKey("2", Two_Key, 0x48B7, 16);
-  addKey("3", Three_Key, 0xC837, 16);
-  addKey("4", Four_Key, 0x28D7, 16);
-  addKey("5", Five_Key, 0xA857, 16);
-  addKey("6", Six_Key, 0x6897, 16);
-  addKey("7", Seven_Key, 0xE817, 16);
-  addKey("8", Eight_Key, 0x18E7, 16);
-  addKey("9", Nine_Key, 0x9867, 16);
-  addKey("0", Zero_Key, 0x08F7, 16);
-  addKey("dash", Dash_Key, 0x32CD, 16);
-  addKey("flashbk", Unmapped_Key, 0x58A7, 16);
-  addKey("mute", Mute_Key, 0x906F, 16);
-  addKey("audio", Unmapped_Key, 0x50AF, 16);
-  addKey("VOL_UP", VolumeUp_Key, 0x40BF, 16);
-  addKey("VOL_DOWN", VolumeDown_Key, 0xC03F, 16);
-  addKey("CH_UP", ChannelUp_Key, 0x00FF, 16);
-  addKey("CH_DOWN", ChannelDown_Key, 0x807F, 16);
-  addKey("surf", Unmapped_Key, 0x7887, 16);
-  addKey("video", Unmapped_Key, 0xB24D, 16);
-  addKey("pip", PIP_Key, 0x06F9, 16);
-  addKey("pipch-", Unmapped_Key, 0x4EB1, 16);
-  addKey("pipch+", Unmapped_Key, 0x8E71, 16);
-  addKey("pcin", Unmapped_Key, 0x8679, 16);
-  addKey("info", Info_Key, 0x55AA, 16);
-  addKey("timer", Unmapped_Key, 0x708F, 16);
-  addKey("cc", Captions_Key, 0x9C63, 16);
-  addKey("swap", PIPSwap_Key, 0xC639, 16);
-  addKey("up", Up_Key, 0x02FD, 16);
-  addKey("left", Left_Key, 0xE01F, 16);
-  addKey("right", Right_Key, 0x609F, 16);
-  addKey("down", Down_Key, 0x827D, 16);
-  addKey("menu", Menu_Key, 0xC23D, 16);
-  addKey("exit", Exit_Key, 0xDA25, 16);
+  addKey("CH_UP", ChannelUp_Key, 0x00, 8);
+  addKey("CH_DOWN", ChannelDown_Key, 0x01, 8);
+  addKey("VOL_UP", VolumeUp_Key, 0x02, 8);
+  addKey("VOL_DOWN", VolumeDown_Key, 0x03, 8);
+  addKey("right", Right_Key, 0x06, 8);
+  addKey("left", Left_Key, 0x07, 8);
+  addKey("power", Power_Key, 0x08, 8);
+  addKey("mute", Mute_Key, 0x09, 8);
+  addKey("audio", Audio_Key, 0x0A, 8);
+  addKey("tv/video", Input_Key, 0x0B, 8);
+  addKey("timer", Sleep_Key, 0x0E, 8);
+  addKey("0", Zero_Key, 0x10, 8);
+  addKey("1", One_Key, 0x11, 8);
+  addKey("2", Two_Key, 0x12, 8);
+  addKey("3", Three_Key, 0x13, 8);
+  addKey("4", Four_Key, 0x14, 8);
+  addKey("5", Five_Key, 0x15, 8);
+  addKey("6", Six_Key, 0x16, 8);
+  addKey("7", Seven_Key, 0x17, 8);
+  addKey("8", Eight_Key, 0x18, 8);
+  addKey("9", Nine_Key, 0x19, 8);
+  addKey("flashbk", PrevChannel_Key, 0x1A, 8);
+  addKey("surf", Unmapped_Key, 0x1E, 8);
+  addKey("cc", Captions_Key, 0x39, 8);
+  addKey("up", Up_Key, 0x40, 8);
+  addKey("down", Down_Key, 0x41, 8);
+  addKey("menu", Menu_Key, 0x43, 8);
+  addKey("dash", Dash_Key, 0x4C, 8);
+  addKey("video", PictureMode_Key, 0x4D, 8);
+  addKey("front", Unmapped_Key, 0x51, 8);
+  addKey("exit", Exit_Key, 0x5B, 8);
+  addKey("pip", PIP_Key, 0x60, 8);
+  addKey("pcin", Unmapped_Key, 0x61, 8);
+  addKey("swap", PIPSwap_Key, 0x63, 8);
+  addKey("freeze", PIPPause_Key, 0x65, 8);
+  addKey("pipch+", PIPChannelUp_Key, 0x71, 8);
+  addKey("pipch-", PIPChannelDown_Key, 0x72, 8);
+  addKey("ratio", AspectRatio_Key, 0x79, 8);
+  addKey("signal", Unmapped_Key, 0x96, 8);
+  addKey("comp/dvi", Unmapped_Key, 0x98, 8);
+  addKey("info", Info_Key, 0xAA, 8);
 }
index beeec77..405fcff 100644 (file)
@@ -54,16 +54,21 @@ MainWindow::MainWindow(QWidget *parent)
   populateFavorites();
 
   QSettings settings("pietrzak.org", "Pierogi");
-  if (settings.contains("currentKeyset"))
+  if (settings.contains("currentKeysetName"))
   {
-    currentKeyset = settings.value("currentKeyset").toInt();
+    myKeysets->findKeysetID(
+      settings.value("currentKeysetMake").toString(),
+      settings.value("currentKeysetName").toString(),
+      currentKeyset);
+//    currentKeyset = settings.value("currentKeyset").toInt();
   }
 
   enableButtons();
 
   connect(
     ui->favoriteKeysetsWidget,
-    SIGNAL(itemActivated(QListWidgetItem *)),
+//    SIGNAL(itemActivated(QListWidgetItem *)),
+    SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)),
     this,
     SLOT(keysetSelectionChanged(QListWidgetItem *)),
     Qt::QueuedConnection);
@@ -176,6 +181,11 @@ void MainWindow::enableButtons()
   emit channelUpEnabled(myKeysets->hasKey(currentKeyset, ChannelUp_Key));
   emit channelDownEnabled(myKeysets->hasKey(currentKeyset, ChannelDown_Key));
 
+  // Main tab labels:
+  emit keysetMakeChanged(
+    makeManager.getMakeString(myKeysets->getMake(currentKeyset)));
+  emit keysetNameChanged(myKeysets->getDisplayName(currentKeyset));
+
   // Utility keys:
   emit redEnabled(myKeysets->hasKey(currentKeyset, Red_Key));
   emit greenEnabled(myKeysets->hasKey(currentKeyset, Green_Key));
@@ -183,8 +193,8 @@ void MainWindow::enableButtons()
   emit blueEnabled(myKeysets->hasKey(currentKeyset, Blue_Key));
   emit aspectRatioEnabled(myKeysets->hasKey(currentKeyset, AspectRatio_Key));
   emit surroundEnabled(myKeysets->hasKey(currentKeyset, Surround_Key));
-  emit languageEnabled(myKeysets->hasKey(currentKeyset, Language_Key));
-  emit favoritesEnabled(myKeysets->hasKey(currentKeyset, Favorites_Key));
+  emit audioEnabled(myKeysets->hasKey(currentKeyset, Audio_Key));
+  emit infoEnabled(myKeysets->hasKey(currentKeyset, Info_Key));
   emit captionsEnabled(myKeysets->hasKey(currentKeyset, Captions_Key));
   emit sleepEnabled(myKeysets->hasKey(currentKeyset, Sleep_Key));
   emit inputEnabled(myKeysets->hasKey(currentKeyset, Input_Key));
@@ -209,52 +219,65 @@ void MainWindow::enableButtons()
   emit prevChannelEnabled(myKeysets->hasKey(currentKeyset, PrevChannel_Key));
 
   // Menu keys:
-  emit menuEnabled(myKeysets->hasKey(currentKeyset, Menu_Key));
   emit upEnabled(myKeysets->hasKey(currentKeyset, Up_Key));
   emit downEnabled(myKeysets->hasKey(currentKeyset, Down_Key));
   emit leftEnabled(myKeysets->hasKey(currentKeyset, Left_Key));
   emit rightEnabled(myKeysets->hasKey(currentKeyset, Right_Key));
   emit selectEnabled(myKeysets->hasKey(currentKeyset, Select_Key));
+  emit menuEnabled(myKeysets->hasKey(currentKeyset, Menu_Key));
   emit exitEnabled(myKeysets->hasKey(currentKeyset, Exit_Key));
-  emit infoEnabled(myKeysets->hasKey(currentKeyset, Info_Key));
   emit guideEnabled(myKeysets->hasKey(currentKeyset, Guide_Key));
+  emit discMenuEnabled(myKeysets->hasKey(currentKeyset, DiscMenu_Key));
 
   // Media keys:
-  emit playEnabled(myKeysets->hasKey(currentKeyset, Play_Key));
-  emit pauseEnabled(myKeysets->hasKey(currentKeyset, Pause_Key));
-  emit stopEnabled(myKeysets->hasKey(currentKeyset, Stop_Key));
-  emit fastForwardEnabled(myKeysets->hasKey(currentKeyset, FastForward_Key));
-  emit reverseEnabled(myKeysets->hasKey(currentKeyset, Rewind_Key));
   emit nextEnabled(myKeysets->hasKey(currentKeyset, Next_Key));
   emit previousEnabled(myKeysets->hasKey(currentKeyset, Previous_Key));
-  emit stepForwardEnabled(myKeysets->hasKey(currentKeyset, StepForward_Key));
-  emit stepBackEnabled(myKeysets->hasKey(currentKeyset, StepBack_Key));
   emit advanceEnabled(myKeysets->hasKey(currentKeyset, Advance_Key));
   emit replayEnabled(myKeysets->hasKey(currentKeyset, Replay_Key));
+  emit stepForwardEnabled(myKeysets->hasKey(currentKeyset, StepForward_Key));
+  emit stepBackEnabled(myKeysets->hasKey(currentKeyset, StepBack_Key));
+  emit fastForwardEnabled(myKeysets->hasKey(currentKeyset, FastForward_Key));
+  emit reverseEnabled(myKeysets->hasKey(currentKeyset, Rewind_Key));
+  emit playEnabled(myKeysets->hasKey(currentKeyset, Play_Key));
+  emit pauseEnabled(myKeysets->hasKey(currentKeyset, Pause_Key));
+  emit stopEnabled(myKeysets->hasKey(currentKeyset, Stop_Key));
   emit ejectEnabled(myKeysets->hasKey(currentKeyset, Eject_Key));
 
-  // Other keys:
-  emit pipEnabled(myKeysets->hasKey(currentKeyset, PIP_Key));
-  emit pipSwapEnabled(myKeysets->hasKey(currentKeyset, PIPSwap_Key));
-  emit pipMoveEnabled(myKeysets->hasKey(currentKeyset, PIPMove_Key));
-  emit pipSourceEnabled(myKeysets->hasKey(currentKeyset, PIPSource_Key));
-  emit scanEnabled(myKeysets->hasKey(currentKeyset, Scan_Key));
-  emit programEnabled(myKeysets->hasKey(currentKeyset, Program_Key));
-  emit pictureModeEnabled(myKeysets->hasKey(currentKeyset, PictureMode_Key));
-  emit soundModeEnabled(myKeysets->hasKey(currentKeyset, SoundMode_Key));
+  // Media2 keys:
   emit discTitleEnabled(myKeysets->hasKey(currentKeyset, DiscTitle_Key));
-  emit discMenuEnabled(myKeysets->hasKey(currentKeyset, DiscMenu_Key));
   emit discSelectEnabled(myKeysets->hasKey(currentKeyset, DiscSelect_Key));
-  emit recordEnabled(myKeysets->hasKey(currentKeyset, Record_Key));
+  emit vhsSpeedEnabled(myKeysets->hasKey(currentKeyset, VHSSpeed_Key));
   emit trackingMinusEnabled(myKeysets->hasKey(currentKeyset, TrackingMinus_Key));
   emit trackingPlusEnabled(myKeysets->hasKey(currentKeyset, TrackingPlus_Key));
   emit autoTrackingEnabled(myKeysets->hasKey(currentKeyset, AutoTracking_Key));
-  emit vhsSpeedEnabled(myKeysets->hasKey(currentKeyset, VHSSpeed_Key));
-
-  emit keysetMakeChanged(
-    makeManager.getMakeString(myKeysets->getMake(currentKeyset)));
+  emit pageUpEnabled(myKeysets->hasKey(currentKeyset, PageUp_Key));
+  emit pageDownEnabled(myKeysets->hasKey(currentKeyset, PageDown_Key));
+  emit slowEnabled(myKeysets->hasKey(currentKeyset, Slow_Key));
+  emit slowMinusEnabled(myKeysets->hasKey(currentKeyset, SlowMinus_Key));
+  emit slowPlusEnabled(myKeysets->hasKey(currentKeyset, SlowPlus_Key));
+  emit programEnabled(myKeysets->hasKey(currentKeyset, Program_Key));
+  emit tunerBandEnabled(myKeysets->hasKey(currentKeyset, TunerBand_Key));
+  emit repeatEnabled(myKeysets->hasKey(currentKeyset, Repeat_Key));
+  emit repeatABEnabled(myKeysets->hasKey(currentKeyset, RepeatAB_Key));
+  emit randomEnabled(myKeysets->hasKey(currentKeyset, Random_Key));
 
-  emit keysetNameChanged(myKeysets->getDisplayName(currentKeyset));
+  // TV Keys:
+  emit pictureModeEnabled(myKeysets->hasKey(currentKeyset, PictureMode_Key));
+  emit soundModeEnabled(myKeysets->hasKey(currentKeyset, SoundMode_Key));
+  emit liveTVEnabled(myKeysets->hasKey(currentKeyset, LiveTV_Key));
+  emit favoritesEnabled(myKeysets->hasKey(currentKeyset, Favorites_Key));
+  emit teletextEnabled(myKeysets->hasKey(currentKeyset, Teletext_Key));
+  emit teletextHoldEnabled(myKeysets->hasKey(currentKeyset, TeletextHold_Key));
+  emit teletextRevealEnabled(myKeysets->hasKey(currentKeyset, TeletextReveal_Key));
+  emit teletextSizeEnabled(myKeysets->hasKey(currentKeyset, TeletextSize_Key));
+  emit pipEnabled(myKeysets->hasKey(currentKeyset, PIP_Key));
+  emit pipSwapEnabled(myKeysets->hasKey(currentKeyset, PIPSwap_Key));
+  emit pipMoveEnabled(myKeysets->hasKey(currentKeyset, PIPMove_Key));
+  emit pipSourceEnabled(myKeysets->hasKey(currentKeyset, PIPSource_Key));
+  emit pipChannelUpEnabled(myKeysets->hasKey(currentKeyset, PIPChannelUp_Key));
+  emit pipChannelDownEnabled(myKeysets->hasKey(currentKeyset, PIPChannelDown_Key));
+  emit pipPauseEnabled(myKeysets->hasKey(currentKeyset, PIPPause_Key));
+  emit pipSizeEnabled(myKeysets->hasKey(currentKeyset, PIPSize_Key));
 }
 
 
@@ -383,22 +406,22 @@ void MainWindow::on_surroundButton_released()
   stopRepeating();
 }
 
-void MainWindow::on_languageButton_pressed()
+void MainWindow::on_audioButton_pressed()
 {
-  startRepeating(currentKeyset, Language_Key);
+  startRepeating(currentKeyset, Audio_Key);
 }
 
-void MainWindow::on_languageButton_released()
+void MainWindow::on_audioButton_released()
 {
   stopRepeating();
 }
 
-void MainWindow::on_favoritesButton_pressed()
+void MainWindow::on_infoButton_pressed()
 {
-  startRepeating(currentKeyset, Favorites_Key);
+  startRepeating(currentKeyset, Info_Key);
 }
 
-void MainWindow::on_favoritesButton_released()
+void MainWindow::on_infoButton_released()
 {
   stopRepeating();
 }
@@ -679,6 +702,25 @@ void MainWindow::on_exitButton_released()
   stopRepeating();
 }
 
+void MainWindow::on_guideButton_pressed()
+{
+  startRepeating(currentKeyset, Guide_Key);
+}
+
+void MainWindow::on_guideButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_discMenuButton_pressed()
+{
+  startRepeating(currentKeyset, DiscMenu_Key);
+}
+
+void MainWindow::on_discMenuButton_released()
+{
+  stopRepeating();
+}
 
 
 // Media tab buttons:
@@ -804,54 +846,114 @@ void MainWindow::on_ejectButton_released()
 }
 
 
-// Misc tab slots:
+// Media2 tab slots:
 
-void MainWindow::on_pipOnOffButton_pressed()
+void MainWindow::on_discTitleButton_pressed()
 {
-  startRepeating(currentKeyset, PIP_Key);
+  startRepeating(currentKeyset, DiscTitle_Key);
 }
 
-void MainWindow::on_pipOnOffButton_released()
+void MainWindow::on_discTitleButton_released()
 {
   stopRepeating();
 }
 
-void MainWindow::on_pipSwapButton_pressed()
+void MainWindow::on_discSelectButton_pressed()
 {
-  startRepeating(currentKeyset, PIPSwap_Key);
+  startRepeating(currentKeyset, DiscSelect_Key);
 }
 
-void MainWindow::on_pipSwapButton_released()
+void MainWindow::on_discSelectButton_released()
 {
   stopRepeating();
 }
 
-void MainWindow::on_pipPositionButton_pressed()
+void MainWindow::on_vhsSpeedButton_pressed()
 {
-  startRepeating(currentKeyset, PIPMove_Key);
+  startRepeating(currentKeyset, VHSSpeed_Key);
 }
 
-void MainWindow::on_pipPositionButton_released()
+void MainWindow::on_vhsSpeedButton_released()
 {
   stopRepeating();
 }
 
-void MainWindow::on_pipSourceButton_pressed()
+void MainWindow::on_trackingPlusButton_pressed()
 {
-  startRepeating(currentKeyset, PIPSource_Key);
+  startRepeating(currentKeyset, TrackingPlus_Key);
 }
 
-void MainWindow::on_pipSourceButton_released()
+void MainWindow::on_trackingPlusButton_released()
 {
   stopRepeating();
 }
 
-void MainWindow::on_scanButton_pressed()
+void MainWindow::on_trackingMinusButton_pressed()
 {
-  startRepeating(currentKeyset, Scan_Key);
+  startRepeating(currentKeyset, TrackingMinus_Key);
 }
 
-void MainWindow::on_scanButton_released()
+void MainWindow::on_trackingMinusButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_autoTrackingButton_pressed()
+{
+  startRepeating(currentKeyset, AutoTracking_Key);
+}
+
+void MainWindow::on_autoTrackingButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_pageUpButton_pressed()
+{
+  startRepeating(currentKeyset, PageUp_Key);
+}
+
+void MainWindow::on_pageUpButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_pageDownButton_pressed()
+{
+  startRepeating(currentKeyset, PageDown_Key);
+}
+
+void MainWindow::on_pageDownButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_slowButton_pressed()
+{
+  startRepeating(currentKeyset, Slow_Key);
+}
+
+void MainWindow::on_slowButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_slowMinusButton_pressed()
+{
+  startRepeating(currentKeyset, SlowMinus_Key);
+}
+
+void MainWindow::on_slowMinusButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_slowPlusButton_pressed()
+{
+  startRepeating(currentKeyset, SlowPlus_Key);
+}
+
+void MainWindow::on_slowPlusButton_released()
 {
   stopRepeating();
 }
@@ -866,6 +968,49 @@ void MainWindow::on_programButton_released()
   stopRepeating();
 }
 
+void MainWindow::on_tunerBandButton_pressed()
+{
+  startRepeating(currentKeyset, TunerBand_Key);
+}
+
+void MainWindow::on_tunerBandButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_repeatButton_pressed()
+{
+  startRepeating(currentKeyset, Repeat_Key);
+}
+
+void MainWindow::on_repeatButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_repeatABButton_pressed()
+{
+  startRepeating(currentKeyset, RepeatAB_Key);
+}
+
+void MainWindow::on_repeatABButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_randomButton_pressed()
+{
+  startRepeating(currentKeyset, Random_Key);
+}
+
+void MainWindow::on_randomButton_released()
+{
+  stopRepeating();
+}
+
+
+// TV Slots:
+
 void MainWindow::on_pictureModeButton_pressed()
 {
   startRepeating(currentKeyset, PictureMode_Key);
@@ -886,87 +1031,148 @@ void MainWindow::on_soundModeButton_released()
   stopRepeating();
 }
 
-void MainWindow::on_discTitleButton_pressed()
+void MainWindow::on_liveTVButton_pressed()
 {
-  startRepeating(currentKeyset, DiscTitle_Key);
+  startRepeating(currentKeyset, LiveTV_Key);
 }
 
-void MainWindow::on_discTitleButton_released()
+void MainWindow::on_liveTVButton_released()
 {
   stopRepeating();
 }
 
-void MainWindow::on_discMenuButton_pressed()
+void MainWindow::on_favoritesButton_pressed()
 {
-  startRepeating(currentKeyset, DiscMenu_Key);
+  startRepeating(currentKeyset, Favorites_Key);
 }
 
-void MainWindow::on_discMenuButton_released()
+void MainWindow::on_favoritesButton_released()
 {
   stopRepeating();
 }
 
-void MainWindow::on_discSelectButton_pressed()
+void MainWindow::on_teletextButton_pressed()
 {
-  startRepeating(currentKeyset, DiscSelect_Key);
+  startRepeating(currentKeyset, Teletext_Key);
 }
 
-void MainWindow::on_discSelectButton_released()
+void MainWindow::on_teletextButton_released()
 {
   stopRepeating();
 }
 
-void MainWindow::on_trackingPlusButton_pressed()
+void MainWindow::on_teletextHoldButton_pressed()
 {
-  startRepeating(currentKeyset, TrackingPlus_Key);
+  startRepeating(currentKeyset, TeletextHold_Key);
 }
 
-void MainWindow::on_trackingPlusButton_released()
+void MainWindow::on_teletextHoldButton_released()
 {
   stopRepeating();
 }
 
-void MainWindow::on_trackingMinusButton_pressed()
+void MainWindow::on_teletextRevealButton_pressed()
 {
-  startRepeating(currentKeyset, TrackingMinus_Key);
+  startRepeating(currentKeyset, TeletextReveal_Key);
 }
 
-void MainWindow::on_trackingMinusButton_released()
+void MainWindow::on_teletextRevealButton_released()
 {
   stopRepeating();
 }
 
-void MainWindow::on_autoTrackingButton_pressed()
+void MainWindow::on_teletextSizeButton_pressed()
 {
-  startRepeating(currentKeyset, AutoTracking_Key);
+  startRepeating(currentKeyset, TeletextSize_Key);
 }
 
-void MainWindow::on_autoTrackingButton_released()
+void MainWindow::on_teletextSizeButton_released()
 {
   stopRepeating();
 }
 
-void MainWindow::on_vhsSpeedButton_pressed()
+void MainWindow::on_pipOnOffButton_pressed()
 {
-  startRepeating(currentKeyset, VHSSpeed_Key);
+  startRepeating(currentKeyset, PIP_Key);
 }
 
-void MainWindow::on_vhsSpeedButton_released()
+void MainWindow::on_pipOnOffButton_released()
 {
   stopRepeating();
 }
 
-void MainWindow::on_recordButton_pressed()
+void MainWindow::on_pipSwapButton_pressed()
+{
+  startRepeating(currentKeyset, PIPSwap_Key);
+}
+
+void MainWindow::on_pipSwapButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_pipPositionButton_pressed()
+{
+  startRepeating(currentKeyset, PIPMove_Key);
+}
+
+void MainWindow::on_pipPositionButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_pipSourceButton_pressed()
+{
+  startRepeating(currentKeyset, PIPSource_Key);
+}
+
+void MainWindow::on_pipSourceButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_pipChannelUpButton_pressed()
+{
+  startRepeating(currentKeyset, PIPChannelUp_Key);
+}
+
+void MainWindow::on_pipChannelUpButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_pipChannelDownButton_pressed()
+{
+  startRepeating(currentKeyset, PIPChannelDown_Key);
+}
+
+void MainWindow::on_pipChannelDownButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_pipPauseButton_pressed()
+{
+  startRepeating(currentKeyset, PIPPause_Key);
+}
+
+void MainWindow::on_pipPauseButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_pipSizeButton_pressed()
 {
-  startRepeating(currentKeyset, Record_Key);
+  startRepeating(currentKeyset, PIPSize_Key);
 }
 
-void MainWindow::on_recordButton_released()
+void MainWindow::on_pipSizeButton_released()
 {
   stopRepeating();
 }
 
 
+
 // Menu actions:
 
 void MainWindow::on_actionSelectKeyset_triggered()
@@ -1009,7 +1215,15 @@ void MainWindow::keysetSelectionChanged(
   currentKeyset = kwi->getID();
 
   QSettings settings("pietrzak.org", "Pierogi");
-  settings.setValue("currentKeyset", currentKeyset);
+//  settings.setValue("currentKeyset", currentKeyset);
+
+  settings.setValue(
+    "currentKeysetMake",
+    makeManager.getMakeString(kwi->getMake()));
+
+  settings.setValue(
+    "currentKeysetName",
+    myKeysets->getDisplayName(currentKeyset));
 
   enableButtons();
 }
@@ -1061,7 +1275,14 @@ void MainWindow::on_addKeysetButton_clicked()
 
   settings.beginWriteArray("favorites");
   settings.setArrayIndex(favSettingsSize);
-  settings.setValue("keysetID", currentKeyset);
+//  settings.setValue("keysetID", currentKeyset);
+
+  settings.setValue(
+    "keysetMake",
+    makeManager.getMakeString(myKeysets->getMake(currentKeyset)));
+
+  settings.setValue("keysetName", myKeysets->getDisplayName(currentKeyset));
+
   settings.endArray();
 }
 
@@ -1088,6 +1309,7 @@ void MainWindow::on_removeKeysetButton_clicked()
   if (count == 0) return;
 
   int index = 0;
+  unsigned int id;
   PIRKeysetWidgetItem *kwi = NULL;
   settings.beginWriteArray("favorites");
   while (index < count)
@@ -1096,7 +1318,15 @@ void MainWindow::on_removeKeysetButton_clicked()
       ui->favoriteKeysetsWidget->item(index));
 
     settings.setArrayIndex(index);
-    settings.setValue("keysetID", kwi->getID());
+//    settings.setValue("keysetID", kwi->getID());
+    id = kwi->getID();
+
+    settings.setValue(
+      "keysetMake",
+      makeManager.getMakeString(myKeysets->getMake(id)));
+
+    settings.setValue("keysetName", myKeysets->getDisplayName(id));
+
     ++index;
   }
   settings.endArray();
@@ -1108,27 +1338,33 @@ void MainWindow::populateFavorites()
 
   int size = settings.beginReadArray("favorites");
   int index = 0;
-  PIRMakeName make;
+  QString make;
   QString name;
-  unsigned int id;
-//  PIRKeysetWidgetItem *kwi;
+//  unsigned int id;
+  PIRKeysetWidgetItem *kwi;
 
   while (index < size)
   {
     settings.setArrayIndex(index);
-    id = settings.value("keysetID").toInt();
+//    id = settings.value("keysetID").toInt();
+    make = settings.value("keysetMake").toString();
+    name = settings.value("keysetName").toString();
+
+    kwi = myKeysets->makeKeysetItem(make, name);
 
-    // Sanity check: Does this keyset even exist?
-    if (myKeysets->keysetExists(id))
+    // Did the item creation work?
+//    if (myKeysets->keysetExists(id))
+    if (kwi)
     {
       // Keyset does exist, so continue:
-      make = myKeysets->getMake(id);
-      name = makeManager.getMakeString(make);
-      name.append(" ");
-      name.append(myKeysets->getDisplayName(id));
+//      make = myKeysets->getMake(id);
+//      name = makeManager.getMakeString(make);
+//      name.append(" ");
+//      name.append(myKeysets->getDisplayName(id));
 //    kwi = new PIRKeysetWidgetItem(name, id, make);
 //    myKeysets->populateDeviceTypes(kwi, id);
-      ui->favoriteKeysetsWidget->addItem(new PIRKeysetWidgetItem(name, id, make));
+//      ui->favoriteKeysetsWidget->addItem(new PIRKeysetWidgetItem(name, id, make));
+      ui->favoriteKeysetsWidget->addItem(kwi);
     }
 
     ++index;
index 1b1a60a..b80c2ca 100644 (file)
@@ -50,8 +50,8 @@ signals:
   void blueEnabled(bool);
   void aspectRatioEnabled(bool);
   void surroundEnabled(bool);
-  void languageEnabled(bool);
-  void favoritesEnabled(bool);
+  void audioEnabled(bool);
+  void infoEnabled(bool);
   void captionsEnabled(bool);
   void inputEnabled(bool);
   void muteEnabled(bool);
@@ -83,8 +83,8 @@ signals:
   void rightEnabled(bool);
   void selectEnabled(bool);
   void exitEnabled(bool);
-  void infoEnabled(bool);
   void guideEnabled(bool);
+  void discMenuEnabled(bool);
 
   // Media keys
   void playEnabled(bool);
@@ -100,23 +100,41 @@ signals:
   void replayEnabled(bool);
   void ejectEnabled(bool);
 
-  // Other Keys
-  void pipEnabled(bool);
-  void pipSwapEnabled(bool);
-  void pipMoveEnabled(bool);
-  void pipSourceEnabled(bool);
-  void scanEnabled(bool);
-  void programEnabled(bool);
-  void pictureModeEnabled(bool);
-  void soundModeEnabled(bool);
+  // Media2 Keys
   void discTitleEnabled(bool);
-  void discMenuEnabled(bool);
   void discSelectEnabled(bool);
-  void recordEnabled(bool);
+  void vhsSpeedEnabled(bool);
   void trackingMinusEnabled(bool);
   void trackingPlusEnabled(bool);
   void autoTrackingEnabled(bool);
-  void vhsSpeedEnabled(bool);
+  void pageUpEnabled(bool);
+  void pageDownEnabled(bool);
+  void slowEnabled(bool);
+  void slowPlusEnabled(bool);
+  void slowMinusEnabled(bool);
+  void programEnabled(bool);
+  void tunerBandEnabled(bool);
+  void repeatEnabled(bool);
+  void repeatABEnabled(bool);
+  void randomEnabled(bool);
+
+  // TV Keys
+  void pictureModeEnabled(bool);
+  void soundModeEnabled(bool);
+  void liveTVEnabled(bool);
+  void favoritesEnabled(bool);
+  void teletextEnabled(bool);
+  void teletextHoldEnabled(bool);
+  void teletextRevealEnabled(bool);
+  void teletextSizeEnabled(bool);
+  void pipEnabled(bool);
+  void pipSwapEnabled(bool);
+  void pipMoveEnabled(bool);
+  void pipSourceEnabled(bool);
+  void pipChannelUpEnabled(bool);
+  void pipChannelDownEnabled(bool);
+  void pipPauseEnabled(bool);
+  void pipSizeEnabled(bool);
 
   void keysetMakeChanged(QString);
   void keysetNameChanged(QString);
@@ -157,10 +175,10 @@ private slots:
   void on_aspectRatioButton_released();
   void on_surroundButton_pressed();
   void on_surroundButton_released();
-  void on_languageButton_pressed();
-  void on_languageButton_released();
-  void on_favoritesButton_pressed();
-  void on_favoritesButton_released();
+  void on_audioButton_pressed();
+  void on_audioButton_released();
+  void on_infoButton_pressed();
+  void on_infoButton_released();
   void on_captionButton_pressed();
   void on_captionButton_released();
   void on_inputButton_pressed();
@@ -219,6 +237,10 @@ private slots:
   void on_menuButton_released();
   void on_exitButton_pressed();
   void on_exitButton_released();
+  void on_guideButton_pressed();
+  void on_guideButton_released();
+  void on_discMenuButton_pressed();
+  void on_discMenuButton_released();
 
   // Media tab slots:
   void on_mediaPreviousButton_pressed();
@@ -246,39 +268,73 @@ private slots:
   void on_ejectButton_pressed();
   void on_ejectButton_released();
 
-  // Misc tab slots:
-  void on_pipOnOffButton_pressed();
-  void on_pipOnOffButton_released();
-  void on_pipSwapButton_pressed();
-  void on_pipSwapButton_released();
-  void on_recordButton_pressed();
-  void on_recordButton_released();
-  void on_pipPositionButton_pressed();
-  void on_pipPositionButton_released();
-  void on_pipSourceButton_pressed();
-  void on_pipSourceButton_released();
-  void on_scanButton_pressed();
-  void on_scanButton_released();
-  void on_programButton_pressed();
-  void on_programButton_released();
-  void on_pictureModeButton_pressed();
-  void on_pictureModeButton_released();
-  void on_soundModeButton_pressed();
-  void on_soundModeButton_released();
+  // Media2 tab slots:
   void on_discTitleButton_pressed();
   void on_discTitleButton_released();
-  void on_discMenuButton_pressed();
-  void on_discMenuButton_released();
   void on_discSelectButton_pressed();
   void on_discSelectButton_released();
+  void on_vhsSpeedButton_pressed();
+  void on_vhsSpeedButton_released();
   void on_trackingPlusButton_pressed();
   void on_trackingPlusButton_released();
   void on_trackingMinusButton_pressed();
   void on_trackingMinusButton_released();
   void on_autoTrackingButton_pressed();
   void on_autoTrackingButton_released();
-  void on_vhsSpeedButton_pressed();
-  void on_vhsSpeedButton_released();
+  void on_pageUpButton_pressed();
+  void on_pageUpButton_released();
+  void on_pageDownButton_pressed();
+  void on_pageDownButton_released();
+  void on_slowButton_pressed();
+  void on_slowButton_released();
+  void on_slowMinusButton_pressed();
+  void on_slowMinusButton_released();
+  void on_slowPlusButton_pressed();
+  void on_slowPlusButton_released();
+  void on_programButton_pressed();
+  void on_programButton_released();
+  void on_tunerBandButton_pressed();
+  void on_tunerBandButton_released();
+  void on_repeatButton_pressed();
+  void on_repeatButton_released();
+  void on_repeatABButton_pressed();
+  void on_repeatABButton_released();
+  void on_randomButton_pressed();
+  void on_randomButton_released();
+
+  // TV Tab slots:
+  void on_pictureModeButton_pressed();
+  void on_pictureModeButton_released();
+  void on_soundModeButton_pressed();
+  void on_soundModeButton_released();
+  void on_liveTVButton_pressed();
+  void on_liveTVButton_released();
+  void on_favoritesButton_pressed();
+  void on_favoritesButton_released();
+  void on_teletextButton_pressed();
+  void on_teletextButton_released();
+  void on_teletextHoldButton_pressed();
+  void on_teletextHoldButton_released();
+  void on_teletextRevealButton_pressed();
+  void on_teletextRevealButton_released();
+  void on_teletextSizeButton_pressed();
+  void on_teletextSizeButton_released();
+  void on_pipOnOffButton_pressed();
+  void on_pipOnOffButton_released();
+  void on_pipSwapButton_pressed();
+  void on_pipSwapButton_released();
+  void on_pipPositionButton_pressed();
+  void on_pipPositionButton_released();
+  void on_pipSourceButton_pressed();
+  void on_pipSourceButton_released();
+  void on_pipChannelUpButton_pressed();
+  void on_pipChannelUpButton_released();
+  void on_pipChannelDownButton_pressed();
+  void on_pipChannelDownButton_released();
+  void on_pipPauseButton_pressed();
+  void on_pipPauseButton_released();
+  void on_pipSizeButton_pressed();
+  void on_pipSizeButton_released();
 
   // Favorites tab actions:
   void on_addKeysetButton_clicked();
index 6b1ce1c..81dc0ac 100644 (file)
        <attribute name="title">
         <string>Utility</string>
        </attribute>
-       <layout class="QGridLayout" name="gridLayout_6">
+       <layout class="QGridLayout" name="gridLayout_9">
         <property name="margin">
          <number>8</number>
         </property>
           </property>
          </widget>
         </item>
-        <item row="0" column="2">
+        <item row="0" column="1">
          <widget class="QPushButton" name="greenButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
           </property>
          </widget>
         </item>
-        <item row="0" column="3">
+        <item row="0" column="2">
          <widget class="QPushButton" name="yellowButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
           </property>
          </widget>
         </item>
-        <item row="0" column="4">
+        <item row="0" column="3">
          <widget class="QPushButton" name="blueButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
           </property>
          </widget>
         </item>
-        <item row="2" column="2">
-         <widget class="QPushButton" name="inputButton">
+        <item row="1" column="0">
+         <widget class="QPushButton" name="aspectRatioButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Input</string>
+           <string>Aspect Ratio</string>
           </property>
          </widget>
         </item>
-        <item row="2" column="3">
-         <widget class="QPushButton" name="sleepButton">
+        <item row="1" column="1">
+         <widget class="QPushButton" name="surroundButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Sleep</string>
+           <string>Surround</string>
           </property>
          </widget>
         </item>
-        <item row="2" column="4">
-         <widget class="QPushButton" name="muteButton">
+        <item row="1" column="2">
+         <widget class="QPushButton" name="audioButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Mute</string>
-          </property>
-          <property name="icon">
-           <iconset resource="PierogiResources.qrc">
-            <normaloff>:/icons/sound_mute_icon&amp;48.png</normaloff>:/icons/sound_mute_icon&amp;48.png</iconset>
-          </property>
-          <property name="iconSize">
-           <size>
-            <width>48</width>
-            <height>48</height>
-           </size>
+           <string>I/II Audio</string>
           </property>
          </widget>
         </item>
-        <item row="2" column="0">
-         <widget class="QPushButton" name="captionButton">
+        <item row="1" column="3">
+         <widget class="QPushButton" name="infoButton">
           <property name="sizePolicy">
-           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>CC / Subtitle</string>
+           <string>Info</string>
           </property>
          </widget>
         </item>
-        <item row="1" column="0">
-         <widget class="QPushButton" name="aspectRatioButton">
+        <item row="2" column="0">
+         <widget class="QPushButton" name="captionButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Aspect Ratio</string>
+           <string>CC / Subtitle</string>
           </property>
          </widget>
         </item>
-        <item row="1" column="2">
-         <widget class="QPushButton" name="surroundButton">
+        <item row="2" column="1">
+         <widget class="QPushButton" name="inputButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Surround</string>
+           <string>Input</string>
           </property>
          </widget>
         </item>
-        <item row="1" column="3">
-         <widget class="QPushButton" name="languageButton">
+        <item row="2" column="2">
+         <widget class="QPushButton" name="sleepButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Language</string>
+           <string>Sleep</string>
           </property>
          </widget>
         </item>
-        <item row="1" column="4">
-         <widget class="QPushButton" name="favoritesButton">
+        <item row="2" column="3">
+         <widget class="QPushButton" name="muteButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Favorites</string>
+           <string>Mute</string>
+          </property>
+          <property name="icon">
+           <iconset resource="PierogiResources.qrc">
+            <normaloff>:/icons/sound_mute_icon&amp;48.png</normaloff>:/icons/sound_mute_icon&amp;48.png</iconset>
+          </property>
+          <property name="iconSize">
+           <size>
+            <width>48</width>
+            <height>48</height>
+           </size>
           </property>
          </widget>
         </item>
         <property name="margin">
          <number>8</number>
         </property>
+        <item row="0" column="0">
+         <widget class="QPushButton" name="guideButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Guide</string>
+          </property>
+         </widget>
+        </item>
         <item row="0" column="1">
          <widget class="QPushButton" name="upButton">
           <property name="sizePolicy">
-           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
          </widget>
         </item>
-        <item row="0" column="2">
+        <item row="0" column="3">
          <widget class="QPushButton" name="menuButton">
           <property name="sizePolicy">
-           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
          </widget>
         </item>
-        <item row="1" column="1">
-         <widget class="QPushButton" name="selectButton">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-          <property name="text">
-           <string>Select</string>
-          </property>
-         </widget>
-        </item>
-        <item row="1" column="2">
-         <widget class="QPushButton" name="rightButton">
+        <item row="2" column="0">
+         <widget class="QPushButton" name="leftButton">
           <property name="sizePolicy">
-           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Right</string>
+           <string>Left</string>
           </property>
           <property name="icon">
            <iconset resource="PierogiResources.qrc">
-            <normaloff>:/icons/arrow_right_icon&amp;48.png</normaloff>:/icons/arrow_right_icon&amp;48.png</iconset>
+            <normaloff>:/icons/arrow_left_icon&amp;48.png</normaloff>:/icons/arrow_left_icon&amp;48.png</iconset>
           </property>
           <property name="iconSize">
            <size>
           </property>
          </widget>
         </item>
-        <item row="2" column="1">
-         <widget class="QPushButton" name="downButton">
+        <item row="2" column="3">
+         <widget class="QPushButton" name="rightButton">
           <property name="sizePolicy">
-           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Down</string>
+           <string>Right</string>
           </property>
           <property name="icon">
            <iconset resource="PierogiResources.qrc">
-            <normaloff>:/icons/arrow_bottom_icon&amp;48.png</normaloff>:/icons/arrow_bottom_icon&amp;48.png</iconset>
+            <normaloff>:/icons/arrow_right_icon&amp;48.png</normaloff>:/icons/arrow_right_icon&amp;48.png</iconset>
           </property>
           <property name="iconSize">
            <size>
           </property>
          </widget>
         </item>
-        <item row="2" column="2">
-         <widget class="QPushButton" name="exitButton">
+        <item row="3" column="0">
+         <widget class="QPushButton" name="discMenuButton">
           <property name="sizePolicy">
-           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Exit</string>
+           <string>Disc Menu</string>
           </property>
          </widget>
         </item>
-        <item row="0" column="0">
-         <widget class="QPushButton" name="infoButton">
+        <item row="3" column="3">
+         <widget class="QPushButton" name="exitButton">
           <property name="sizePolicy">
-           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Info</string>
+           <string>Exit</string>
           </property>
          </widget>
         </item>
-        <item row="2" column="0">
-         <widget class="QPushButton" name="guideButton">
+        <item row="2" column="1">
+         <widget class="QPushButton" name="selectButton">
           <property name="sizePolicy">
-           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Guide</string>
+           <string>Select</string>
           </property>
          </widget>
         </item>
-        <item row="1" column="0">
-         <widget class="QPushButton" name="leftButton">
+        <item row="3" column="1">
+         <widget class="QPushButton" name="downButton">
           <property name="sizePolicy">
-           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Left</string>
+           <string>Down</string>
           </property>
           <property name="icon">
            <iconset resource="PierogiResources.qrc">
-            <normaloff>:/icons/arrow_left_icon&amp;48.png</normaloff>:/icons/arrow_left_icon&amp;48.png</iconset>
+            <normaloff>:/icons/arrow_bottom_icon&amp;48.png</normaloff>:/icons/arrow_bottom_icon&amp;48.png</iconset>
           </property>
           <property name="iconSize">
            <size>
         </item>
        </layout>
       </widget>
-      <widget class="QWidget" name="miscTab">
+      <widget class="QWidget" name="media2Tab">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
         </sizepolicy>
        </property>
        <attribute name="title">
-        <string>Misc</string>
+        <string>Media2</string>
        </attribute>
        <layout class="QGridLayout" name="gridLayout_5">
         <property name="margin">
          <number>8</number>
         </property>
         <item row="0" column="0">
-         <widget class="QPushButton" name="pipOnOffButton">
+         <widget class="QPushButton" name="discTitleButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>PIP On-Off</string>
+           <string>Disc Title</string>
           </property>
          </widget>
         </item>
         <item row="0" column="1">
-         <widget class="QPushButton" name="pipSwapButton">
+         <widget class="QPushButton" name="discSelectButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>PIP Swap</string>
+           <string>Disc Select</string>
           </property>
          </widget>
         </item>
-        <item row="0" column="2">
-         <widget class="QPushButton" name="pipPositionButton">
+        <item row="2" column="0">
+         <widget class="QPushButton" name="autoTrackingButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>PIP Move</string>
+           <string>Auto Tracking</string>
           </property>
          </widget>
         </item>
-        <item row="0" column="3">
-         <widget class="QPushButton" name="pipSourceButton">
+        <item row="2" column="1">
+         <widget class="QPushButton" name="trackingMinusButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>PIP Source</string>
+           <string>Tracking -</string>
           </property>
          </widget>
         </item>
-        <item row="1" column="0">
-         <widget class="QPushButton" name="scanButton">
+        <item row="2" column="2">
+         <widget class="QPushButton" name="trackingPlusButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Scan</string>
+           <string>Tracking +</string>
           </property>
          </widget>
         </item>
-        <item row="1" column="1">
-         <widget class="QPushButton" name="programButton">
+        <item row="3" column="0">
+         <widget class="QPushButton" name="slowButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Program</string>
+           <string>Slow</string>
           </property>
          </widget>
         </item>
-        <item row="1" column="2">
-         <widget class="QPushButton" name="pictureModeButton">
+        <item row="3" column="1">
+         <widget class="QPushButton" name="slowMinusButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Picture Mode</string>
+           <string>Slow -</string>
           </property>
          </widget>
         </item>
-        <item row="1" column="3">
-         <widget class="QPushButton" name="soundModeButton">
+        <item row="3" column="2">
+         <widget class="QPushButton" name="slowPlusButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Sound Mode</string>
+           <string>slow +</string>
           </property>
          </widget>
         </item>
-        <item row="2" column="0">
-         <widget class="QPushButton" name="discTitleButton">
+        <item row="3" column="3">
+         <widget class="QPushButton" name="programButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Disc Title</string>
+           <string>Program</string>
           </property>
          </widget>
         </item>
-        <item row="2" column="1">
-         <widget class="QPushButton" name="discMenuButton">
+        <item row="4" column="0">
+         <widget class="QPushButton" name="tunerBandButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Disc Menu</string>
+           <string>Tuner Band</string>
           </property>
          </widget>
         </item>
-        <item row="2" column="2">
-         <widget class="QPushButton" name="discSelectButton">
+        <item row="4" column="1">
+         <widget class="QPushButton" name="repeatButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Disc Select</string>
+           <string>Repeat</string>
           </property>
          </widget>
         </item>
-        <item row="2" column="3">
-         <widget class="QPushButton" name="recordButton">
+        <item row="4" column="2">
+         <widget class="QPushButton" name="repeatABButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Record</string>
-          </property>
-          <property name="icon">
-           <iconset resource="PierogiResources.qrc">
-            <normaloff>:/icons/red_record_icon.png</normaloff>:/icons/red_record_icon.png</iconset>
-          </property>
-          <property name="iconSize">
-           <size>
-            <width>48</width>
-            <height>48</height>
-           </size>
+           <string>RepeatAB</string>
           </property>
          </widget>
         </item>
-        <item row="4" column="2">
-         <widget class="QPushButton" name="autoTrackingButton">
+        <item row="4" column="3">
+         <widget class="QPushButton" name="randomButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Auto Tracking</string>
+           <string>Random</string>
           </property>
          </widget>
         </item>
-        <item row="4" column="3">
-         <widget class="QPushButton" name="vhsSpeedButton">
+        <item row="0" column="3">
+         <widget class="QPushButton" name="pageUpButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>SP/LP/EP</string>
+           <string>Page Up</string>
+          </property>
+          <property name="icon">
+           <iconset resource="PierogiResources.qrc">
+            <normaloff>:/icons/arrow_top_icon&amp;48.png</normaloff>:/icons/arrow_top_icon&amp;48.png</iconset>
+          </property>
+          <property name="iconSize">
+           <size>
+            <width>48</width>
+            <height>48</height>
+           </size>
           </property>
          </widget>
         </item>
-        <item row="4" column="0">
-         <widget class="QPushButton" name="trackingMinusButton">
+        <item row="0" column="2">
+         <widget class="QPushButton" name="vhsSpeedButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Tracking -</string>
+           <string>SP/LP/EP</string>
           </property>
          </widget>
         </item>
-        <item row="4" column="1">
-         <widget class="QPushButton" name="trackingPlusButton">
+        <item row="2" column="3">
+         <widget class="QPushButton" name="pageDownButton">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
             <horstretch>0</horstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Tracking +</string>
+           <string>Page Down</string>
+          </property>
+          <property name="icon">
+           <iconset resource="PierogiResources.qrc">
+            <normaloff>:/icons/arrow_bottom_icon&amp;48.png</normaloff>:/icons/arrow_bottom_icon&amp;48.png</iconset>
+          </property>
+          <property name="iconSize">
+           <size>
+            <width>48</width>
+            <height>48</height>
+           </size>
           </property>
          </widget>
         </item>
        </layout>
       </widget>
-      <widget class="QWidget" name="favoritesTab">
+      <widget class="QWidget" name="tvTab">
        <attribute name="title">
-        <string>Favorites</string>
+        <string>TV</string>
+       </attribute>
+       <layout class="QGridLayout" name="gridLayout_6">
+        <property name="margin">
+         <number>8</number>
+        </property>
+        <item row="3" column="0">
+         <widget class="QPushButton" name="teletextButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Teletext</string>
+          </property>
+         </widget>
+        </item>
+        <item row="3" column="1">
+         <widget class="QPushButton" name="teletextHoldButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Txt Hold</string>
+          </property>
+         </widget>
+        </item>
+        <item row="3" column="3">
+         <widget class="QPushButton" name="teletextRevealButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Txt Reveal</string>
+          </property>
+         </widget>
+        </item>
+        <item row="3" column="4">
+         <widget class="QPushButton" name="teletextSizeButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Txt Size</string>
+          </property>
+         </widget>
+        </item>
+        <item row="6" column="0">
+         <widget class="QPushButton" name="pipChannelUpButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>PIP Ch Up</string>
+          </property>
+          <property name="icon">
+           <iconset resource="PierogiResources.qrc">
+            <normaloff>:/icons/br_up_icon&amp;48.png</normaloff>:/icons/br_up_icon&amp;48.png</iconset>
+          </property>
+          <property name="iconSize">
+           <size>
+            <width>48</width>
+            <height>48</height>
+           </size>
+          </property>
+         </widget>
+        </item>
+        <item row="6" column="1">
+         <widget class="QPushButton" name="pipChannelDownButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>PIP Ch Down</string>
+          </property>
+          <property name="icon">
+           <iconset resource="PierogiResources.qrc">
+            <normaloff>:/icons/br_down_icon&amp;48.png</normaloff>:/icons/br_down_icon&amp;48.png</iconset>
+          </property>
+          <property name="iconSize">
+           <size>
+            <width>48</width>
+            <height>48</height>
+           </size>
+          </property>
+         </widget>
+        </item>
+        <item row="6" column="3">
+         <widget class="QPushButton" name="pipPauseButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>PIP Pause</string>
+          </property>
+          <property name="icon">
+           <iconset resource="PierogiResources.qrc">
+            <normaloff>:/icons/playback_pause_icon&amp;48.png</normaloff>:/icons/playback_pause_icon&amp;48.png</iconset>
+          </property>
+          <property name="iconSize">
+           <size>
+            <width>48</width>
+            <height>48</height>
+           </size>
+          </property>
+         </widget>
+        </item>
+        <item row="6" column="4">
+         <widget class="QPushButton" name="pipSizeButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>PIP Size</string>
+          </property>
+          <property name="iconSize">
+           <size>
+            <width>48</width>
+            <height>48</height>
+           </size>
+          </property>
+         </widget>
+        </item>
+        <item row="5" column="0">
+         <widget class="QPushButton" name="pipOnOffButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Picture in Picture</string>
+          </property>
+         </widget>
+        </item>
+        <item row="5" column="1">
+         <widget class="QPushButton" name="pipSwapButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>PIP Swap</string>
+          </property>
+         </widget>
+        </item>
+        <item row="5" column="3">
+         <widget class="QPushButton" name="pipPositionButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>PIP Move</string>
+          </property>
+         </widget>
+        </item>
+        <item row="5" column="4">
+         <widget class="QPushButton" name="pipSourceButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>PIP Source</string>
+          </property>
+         </widget>
+        </item>
+        <item row="2" column="0">
+         <widget class="QPushButton" name="pictureModeButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Picture Mode</string>
+          </property>
+         </widget>
+        </item>
+        <item row="2" column="1">
+         <widget class="QPushButton" name="soundModeButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Sound Mode</string>
+          </property>
+         </widget>
+        </item>
+        <item row="2" column="4">
+         <widget class="QPushButton" name="favoritesButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Favorites</string>
+          </property>
+         </widget>
+        </item>
+        <item row="2" column="3">
+         <widget class="QPushButton" name="liveTVButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Live TV</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="favoritesTab">
+       <attribute name="title">
+        <string>Favorite</string>
        </attribute>
        <layout class="QGridLayout" name="gridLayout_8">
         <property name="margin">
  <connections>
   <connection>
    <sender>MainWindow</sender>
-   <signal>soundModeEnabled(bool)</signal>
-   <receiver>soundModeButton</receiver>
+   <signal>reverseEnabled(bool)</signal>
+   <receiver>reverseButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>492</x>
+     <y>239</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>fastForwardEnabled(bool)</signal>
+   <receiver>fastForwardButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>678</x>
+     <y>239</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>pauseEnabled(bool)</signal>
+   <receiver>pauseButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>306</x>
+     <y>337</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>playEnabled(bool)</signal>
+   <receiver>playButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>120</x>
+     <y>337</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>stopEnabled(bool)</signal>
+   <receiver>stopButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>492</x>
+     <y>337</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>replayEnabled(bool)</signal>
+   <receiver>replayButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>492</x>
+     <y>141</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>advanceEnabled(bool)</signal>
+   <receiver>advanceButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>678</x>
+     <y>141</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>plusOneHundredEnabled(bool)</signal>
+   <receiver>plusOneHundredButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>677</x>
+     <y>106</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>keysetMakeChanged(QString)</signal>
+   <receiver>makeLabel</receiver>
+   <slot>setText(QString)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>283</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>dashEnabled(bool)</signal>
+   <receiver>dashButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>683</x>
+     <y>107</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>doubleDigitEnabled(bool)</signal>
+   <receiver>doubleDigitButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>692</x>
-     <y>199</y>
+     <x>683</x>
+     <y>289</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>reverseEnabled(bool)</signal>
-   <receiver>reverseButton</receiver>
+   <signal>greenEnabled(bool)</signal>
+   <receiver>greenButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>492</x>
-     <y>239</y>
+     <x>305</x>
+     <y>153</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>fastForwardEnabled(bool)</signal>
-   <receiver>fastForwardButton</receiver>
+   <signal>redEnabled(bool)</signal>
+   <receiver>redButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>678</x>
-     <y>239</y>
+     <x>116</x>
+     <y>153</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>pauseEnabled(bool)</signal>
-   <receiver>pauseButton</receiver>
+   <signal>yellowEnabled(bool)</signal>
+   <receiver>yellowButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>306</x>
-     <y>337</y>
+     <x>494</x>
+     <y>153</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>playEnabled(bool)</signal>
-   <receiver>playButton</receiver>
+   <signal>blueEnabled(bool)</signal>
+   <receiver>blueButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>120</x>
-     <y>337</y>
+     <x>683</x>
+     <y>153</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>stopEnabled(bool)</signal>
-   <receiver>stopButton</receiver>
+   <signal>inputEnabled(bool)</signal>
+   <receiver>inputButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>492</x>
-     <y>337</y>
+     <x>305</x>
+     <y>334</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>replayEnabled(bool)</signal>
-   <receiver>replayButton</receiver>
+   <signal>captionsEnabled(bool)</signal>
+   <receiver>captionButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>492</x>
-     <y>141</y>
+     <x>116</x>
+     <y>334</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>advanceEnabled(bool)</signal>
-   <receiver>advanceButton</receiver>
+   <signal>sleepEnabled(bool)</signal>
+   <receiver>sleepButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>678</x>
-     <y>141</y>
+     <x>494</x>
+     <y>334</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>pipSwapEnabled(bool)</signal>
-   <receiver>pipSwapButton</receiver>
+   <signal>muteEnabled(bool)</signal>
+   <receiver>muteButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>306</x>
-     <y>150</y>
+     <x>683</x>
+     <y>334</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>pipEnabled(bool)</signal>
-   <receiver>pipOnOffButton</receiver>
+   <signal>audioEnabled(bool)</signal>
+   <receiver>audioButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>120</x>
-     <y>150</y>
+     <x>497</x>
+     <y>246</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>plusOneHundredEnabled(bool)</signal>
-   <receiver>plusOneHundredButton</receiver>
+   <signal>aspectRatioEnabled(bool)</signal>
+   <receiver>aspectRatioButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>677</x>
-     <y>106</y>
+     <x>107</x>
+     <y>246</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>keysetMakeChanged(QString)</signal>
-   <receiver>makeLabel</receiver>
-   <slot>setText(QString)</slot>
+   <signal>ejectEnabled(bool)</signal>
+   <receiver>ejectButton</receiver>
+   <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <x>399</x>
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>399</x>
-     <y>283</y>
+     <x>692</x>
+     <y>373</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>dashEnabled(bool)</signal>
-   <receiver>dashButton</receiver>
+   <signal>programEnabled(bool)</signal>
+   <receiver>programButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>683</x>
-     <y>107</y>
+     <x>302</x>
+     <y>199</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>doubleDigitEnabled(bool)</signal>
-   <receiver>doubleDigitButton</receiver>
+   <signal>discTitleEnabled(bool)</signal>
+   <receiver>discTitleButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>683</x>
-     <y>289</y>
+     <x>107</x>
+     <y>294</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>greenEnabled(bool)</signal>
-   <receiver>greenButton</receiver>
+   <signal>trackingMinusEnabled(bool)</signal>
+   <receiver>trackingMinusButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>305</x>
-     <y>153</y>
+     <x>107</x>
+     <y>389</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>redEnabled(bool)</signal>
-   <receiver>redButton</receiver>
+   <signal>trackingPlusEnabled(bool)</signal>
+   <receiver>trackingPlusButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>116</x>
-     <y>153</y>
+     <x>107</x>
+     <y>389</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>yellowEnabled(bool)</signal>
-   <receiver>yellowButton</receiver>
+   <signal>autoTrackingEnabled(bool)</signal>
+   <receiver>autoTrackingButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>494</x>
-     <y>153</y>
+     <x>497</x>
+     <y>389</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>blueEnabled(bool)</signal>
-   <receiver>blueButton</receiver>
+   <signal>vhsSpeedEnabled(bool)</signal>
+   <receiver>vhsSpeedButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>683</x>
-     <y>153</y>
+     <x>692</x>
+     <y>389</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>inputEnabled(bool)</signal>
-   <receiver>inputButton</receiver>
+   <signal>surroundEnabled(bool)</signal>
+   <receiver>surroundButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>305</x>
-     <y>334</y>
+     <x>302</x>
+     <y>246</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>captionsEnabled(bool)</signal>
-   <receiver>captionButton</receiver>
+   <signal>discSelectEnabled(bool)</signal>
+   <receiver>discSelectButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>116</x>
-     <y>334</y>
+     <x>497</x>
+     <y>294</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>sleepEnabled(bool)</signal>
-   <receiver>sleepButton</receiver>
+   <signal>oneEnabled(bool)</signal>
+   <receiver>oneButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>792</x>
+     <y>33</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>45</x>
+     <y>110</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>twoEnabled(bool)</signal>
+   <receiver>twoButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>177</x>
+     <y>443</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>230</x>
+     <y>110</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>threeEnabled(bool)</signal>
+   <receiver>threeButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>479</x>
+     <y>439</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>417</x>
+     <y>110</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>fourEnabled(bool)</signal>
+   <receiver>fourButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>86</x>
+     <y>442</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>45</x>
+     <y>187</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>fiveEnabled(bool)</signal>
+   <receiver>fiveButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>269</x>
+     <y>442</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>230</x>
+     <y>187</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>sixEnabled(bool)</signal>
+   <receiver>sixButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>438</x>
+     <y>441</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>417</x>
+     <y>187</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>sevenEnabled(bool)</signal>
+   <receiver>sevenButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>90</x>
+     <y>442</y>
     </hint>
     <hint type="destinationlabel">
-     <x>494</x>
-     <y>334</y>
+     <x>45</x>
+     <y>266</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>muteEnabled(bool)</signal>
-   <receiver>muteButton</receiver>
+   <signal>eightEnabled(bool)</signal>
+   <receiver>eightButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>254</x>
+     <y>443</y>
     </hint>
     <hint type="destinationlabel">
-     <x>683</x>
-     <y>334</y>
+     <x>230</x>
+     <y>266</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>languageEnabled(bool)</signal>
-   <receiver>languageButton</receiver>
+   <signal>nineEnabled(bool)</signal>
+   <receiver>nineButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>550</x>
+     <y>442</y>
     </hint>
     <hint type="destinationlabel">
-     <x>497</x>
-     <y>246</y>
+     <x>417</x>
+     <y>266</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>aspectRatioEnabled(bool)</signal>
-   <receiver>aspectRatioButton</receiver>
+   <signal>powerEnabled(bool)</signal>
+   <receiver>powerButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>375</x>
+     <y>443</y>
     </hint>
     <hint type="destinationlabel">
-     <x>107</x>
-     <y>246</y>
+     <x>299</x>
+     <y>164</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>favoritesEnabled(bool)</signal>
-   <receiver>favoritesButton</receiver>
+   <signal>leftEnabled(bool)</signal>
+   <receiver>leftButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>104</x>
+     <y>442</y>
     </hint>
     <hint type="destinationlabel">
-     <x>692</x>
+     <x>119</x>
      <y>246</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>ejectEnabled(bool)</signal>
-   <receiver>ejectButton</receiver>
+   <signal>zeroEnabled(bool)</signal>
+   <receiver>zeroButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>325</x>
+     <y>440</y>
     </hint>
     <hint type="destinationlabel">
-     <x>692</x>
-     <y>373</y>
+     <x>230</x>
+     <y>344</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>pipSourceEnabled(bool)</signal>
-   <receiver>pipSourceButton</receiver>
+   <signal>enterEnabled(bool)</signal>
+   <receiver>enterButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>547</x>
+     <y>441</y>
     </hint>
     <hint type="destinationlabel">
-     <x>692</x>
-     <y>104</y>
+     <x>417</x>
+     <y>344</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>pipMoveEnabled(bool)</signal>
-   <receiver>pipPositionButton</receiver>
+   <signal>upEnabled(bool)</signal>
+   <receiver>upButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>350</x>
+     <y>25</y>
     </hint>
     <hint type="destinationlabel">
-     <x>497</x>
-     <y>104</y>
+     <x>355</x>
+     <y>139</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>programEnabled(bool)</signal>
-   <receiver>programButton</receiver>
+   <signal>selectEnabled(bool)</signal>
+   <receiver>selectButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>310</x>
+     <y>440</y>
     </hint>
     <hint type="destinationlabel">
-     <x>302</x>
-     <y>199</y>
+     <x>309</x>
+     <y>245</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>scanEnabled(bool)</signal>
-   <receiver>scanButton</receiver>
+   <signal>stepBackEnabled(bool)</signal>
+   <receiver>stepBackButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>107</x>
-     <y>199</y>
+     <x>120</x>
+     <y>239</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>pictureModeEnabled(bool)</signal>
-   <receiver>pictureModeButton</receiver>
+   <signal>menuEnabled(bool)</signal>
+   <receiver>menuButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>577</x>
+     <y>85</y>
     </hint>
     <hint type="destinationlabel">
-     <x>497</x>
-     <y>199</y>
+     <x>570</x>
+     <y>138</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>discMenuEnabled(bool)</signal>
-   <receiver>discMenuButton</receiver>
+   <signal>downEnabled(bool)</signal>
+   <receiver>downButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>363</x>
+     <y>443</y>
     </hint>
     <hint type="destinationlabel">
-     <x>302</x>
-     <y>294</y>
+     <x>372</x>
+     <y>346</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>discTitleEnabled(bool)</signal>
-   <receiver>discTitleButton</receiver>
+   <signal>rightEnabled(bool)</signal>
+   <receiver>rightButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>702</x>
+     <y>48</y>
     </hint>
     <hint type="destinationlabel">
-     <x>107</x>
-     <y>294</y>
+     <x>699</x>
+     <y>232</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>recordEnabled(bool)</signal>
-   <receiver>recordButton</receiver>
+   <signal>exitEnabled(bool)</signal>
+   <receiver>exitButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>578</x>
+     <y>441</y>
     </hint>
     <hint type="destinationlabel">
-     <x>692</x>
-     <y>294</y>
+     <x>583</x>
+     <y>343</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>trackingMinusEnabled(bool)</signal>
-   <receiver>trackingMinusButton</receiver>
+   <signal>channelDownEnabled(bool)</signal>
+   <receiver>mainChannelDownButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>222</x>
+     <y>27</y>
     </hint>
     <hint type="destinationlabel">
-     <x>107</x>
-     <y>389</y>
+     <x>51</x>
+     <y>294</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>trackingPlusEnabled(bool)</signal>
-   <receiver>trackingPlusButton</receiver>
+   <signal>channelUpEnabled(bool)</signal>
+   <receiver>mainChannelUpButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>102</x>
+     <y>26</y>
     </hint>
     <hint type="destinationlabel">
-     <x>107</x>
-     <y>389</y>
+     <x>51</x>
+     <y>164</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>autoTrackingEnabled(bool)</signal>
-   <receiver>autoTrackingButton</receiver>
+   <signal>volumeUpEnabled(bool)</signal>
+   <receiver>mainVolumeUp</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>621</x>
+     <y>24</y>
     </hint>
     <hint type="destinationlabel">
-     <x>497</x>
-     <y>389</y>
+     <x>546</x>
+     <y>164</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>vhsSpeedEnabled(bool)</signal>
-   <receiver>vhsSpeedButton</receiver>
+   <signal>volumeDownEnabled(bool)</signal>
+   <receiver>mainVolumeDownButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>796</x>
+     <y>232</y>
     </hint>
     <hint type="destinationlabel">
-     <x>692</x>
-     <y>389</y>
+     <x>546</x>
+     <y>294</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>surroundEnabled(bool)</signal>
-   <receiver>surroundButton</receiver>
+   <signal>prevChannelEnabled(bool)</signal>
+   <receiver>prevChannelButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>595</x>
+     <y>443</y>
     </hint>
     <hint type="destinationlabel">
-     <x>302</x>
-     <y>246</y>
+     <x>602</x>
+     <y>110</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>discSelectEnabled(bool)</signal>
-   <receiver>discSelectButton</receiver>
+   <signal>clearEnabled(bool)</signal>
+   <receiver>clearButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>399</x>
-     <y>222</y>
+     <x>43</x>
+     <y>443</y>
     </hint>
     <hint type="destinationlabel">
-     <x>497</x>
-     <y>294</y>
+     <x>45</x>
+     <y>344</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>oneEnabled(bool)</signal>
-   <receiver>oneButton</receiver>
+   <signal>guideEnabled(bool)</signal>
+   <receiver>guideButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>792</x>
-     <y>33</y>
+     <x>399</x>
+     <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>45</x>
-     <y>110</y>
+     <x>151</x>
+     <y>337</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>twoEnabled(bool)</signal>
-   <receiver>twoButton</receiver>
-   <slot>setEnabled(bool)</slot>
+   <signal>keysetNameChanged(QString)</signal>
+   <receiver>nameLabel</receiver>
+   <slot>setText(QString)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>177</x>
-     <y>443</y>
+     <x>399</x>
+     <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>230</x>
-     <y>110</y>
+     <x>399</x>
+     <y>301</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>threeEnabled(bool)</signal>
-   <receiver>threeButton</receiver>
+   <signal>nextEnabled(bool)</signal>
+   <receiver>mediaNextButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>479</x>
-     <y>439</y>
+     <x>399</x>
+     <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>417</x>
-     <y>110</y>
+     <x>306</x>
+     <y>141</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>fourEnabled(bool)</signal>
-   <receiver>fourButton</receiver>
+   <signal>previousEnabled(bool)</signal>
+   <receiver>mediaPreviousButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>86</x>
-     <y>442</y>
+     <x>399</x>
+     <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>45</x>
-     <y>187</y>
+     <x>120</x>
+     <y>141</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>fiveEnabled(bool)</signal>
-   <receiver>fiveButton</receiver>
+   <signal>stepForwardEnabled(bool)</signal>
+   <receiver>stepForwardButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>269</x>
-     <y>442</y>
+     <x>399</x>
+     <y>222</y>
     </hint>
     <hint type="destinationlabel">
-     <x>230</x>
-     <y>187</y>
+     <x>306</x>
+     <y>239</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>sixEnabled(bool)</signal>
-   <receiver>sixButton</receiver>
+   <signal>infoEnabled(bool)</signal>
+   <receiver>infoButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>438</x>
-     <y>441</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>417</x>
-     <y>187</y>
+     <x>695</x>
+     <y>264</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>sevenEnabled(bool)</signal>
-   <receiver>sevenButton</receiver>
+   <signal>discMenuEnabled(bool)</signal>
+   <receiver>discMenuButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>90</x>
-     <y>442</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>45</x>
-     <y>266</y>
+     <x>137</x>
+     <y>405</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>eightEnabled(bool)</signal>
-   <receiver>eightButton</receiver>
+   <signal>pageUpEnabled(bool)</signal>
+   <receiver>pageUpButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>254</x>
-     <y>443</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>230</x>
-     <y>266</y>
+     <x>695</x>
+     <y>105</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>nineEnabled(bool)</signal>
-   <receiver>nineButton</receiver>
+   <signal>pageDownEnabled(bool)</signal>
+   <receiver>pageDownButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>550</x>
-     <y>442</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>417</x>
-     <y>266</y>
+     <x>695</x>
+     <y>211</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>powerEnabled(bool)</signal>
-   <receiver>powerButton</receiver>
+   <signal>slowEnabled(bool)</signal>
+   <receiver>slowButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>375</x>
-     <y>443</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>299</x>
-     <y>164</y>
+     <x>104</x>
+     <y>317</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>leftEnabled(bool)</signal>
-   <receiver>leftButton</receiver>
+   <signal>slowMinusEnabled(bool)</signal>
+   <receiver>slowMinusButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>104</x>
-     <y>442</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>119</x>
-     <y>246</y>
+     <x>301</x>
+     <y>317</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>zeroEnabled(bool)</signal>
-   <receiver>zeroButton</receiver>
+   <signal>slowPlusEnabled(bool)</signal>
+   <receiver>slowPlusButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>325</x>
-     <y>440</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>230</x>
-     <y>344</y>
+     <x>498</x>
+     <y>317</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>enterEnabled(bool)</signal>
-   <receiver>enterButton</receiver>
+   <signal>tunerBandEnabled(bool)</signal>
+   <receiver>tunerBandButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>547</x>
-     <y>441</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>417</x>
-     <y>344</y>
+     <x>104</x>
+     <y>422</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>upEnabled(bool)</signal>
-   <receiver>upButton</receiver>
+   <signal>repeatEnabled(bool)</signal>
+   <receiver>repeatButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>350</x>
-     <y>25</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>355</x>
-     <y>139</y>
+     <x>301</x>
+     <y>422</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>selectEnabled(bool)</signal>
-   <receiver>selectButton</receiver>
+   <signal>repeatABEnabled(bool)</signal>
+   <receiver>repeatABButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>310</x>
-     <y>440</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>309</x>
-     <y>245</y>
+     <x>498</x>
+     <y>422</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>stepBackEnabled(bool)</signal>
-   <receiver>stepBackButton</receiver>
+   <signal>randomEnabled(bool)</signal>
+   <receiver>randomButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <x>399</x>
-     <y>222</y>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>120</x>
-     <y>239</y>
+     <x>695</x>
+     <y>422</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>menuEnabled(bool)</signal>
-   <receiver>menuButton</receiver>
+   <signal>pictureModeEnabled(bool)</signal>
+   <receiver>pictureModeButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>577</x>
-     <y>85</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>570</x>
-     <y>138</y>
+     <x>104</x>
+     <y>105</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>downEnabled(bool)</signal>
-   <receiver>downButton</receiver>
+   <signal>soundModeEnabled(bool)</signal>
+   <receiver>soundModeButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>363</x>
-     <y>443</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>372</x>
-     <y>346</y>
+     <x>301</x>
+     <y>105</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>rightEnabled(bool)</signal>
-   <receiver>rightButton</receiver>
+   <signal>liveTVEnabled(bool)</signal>
+   <receiver>liveTVButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>702</x>
-     <y>48</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>699</x>
-     <y>232</y>
+     <x>498</x>
+     <y>105</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>exitEnabled(bool)</signal>
-   <receiver>exitButton</receiver>
+   <signal>favoritesEnabled(bool)</signal>
+   <receiver>favoritesButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>578</x>
-     <y>441</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>583</x>
-     <y>343</y>
+     <x>695</x>
+     <y>105</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>channelDownEnabled(bool)</signal>
-   <receiver>mainChannelDownButton</receiver>
+   <signal>teletextEnabled(bool)</signal>
+   <receiver>teletextButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>222</x>
-     <y>27</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>51</x>
-     <y>294</y>
+     <x>104</x>
+     <y>211</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>channelUpEnabled(bool)</signal>
-   <receiver>mainChannelUpButton</receiver>
+   <signal>teletextHoldEnabled(bool)</signal>
+   <receiver>teletextHoldButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>102</x>
-     <y>26</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>51</x>
-     <y>164</y>
+     <x>301</x>
+     <y>211</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>volumeUpEnabled(bool)</signal>
-   <receiver>mainVolumeUp</receiver>
+   <signal>teletextRevealEnabled(bool)</signal>
+   <receiver>teletextRevealButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>621</x>
-     <y>24</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>546</x>
-     <y>164</y>
+     <x>498</x>
+     <y>211</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>volumeDownEnabled(bool)</signal>
-   <receiver>mainVolumeDownButton</receiver>
+   <signal>pipEnabled(bool)</signal>
+   <receiver>pipOnOffButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>796</x>
-     <y>232</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>546</x>
-     <y>294</y>
+     <x>104</x>
+     <y>317</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>prevChannelEnabled(bool)</signal>
-   <receiver>prevChannelButton</receiver>
+   <signal>pipSwapEnabled(bool)</signal>
+   <receiver>pipSwapButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>595</x>
-     <y>443</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>602</x>
-     <y>110</y>
+     <x>301</x>
+     <y>317</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>clearEnabled(bool)</signal>
-   <receiver>clearButton</receiver>
+   <signal>pipMoveEnabled(bool)</signal>
+   <receiver>pipPositionButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>43</x>
-     <y>443</y>
+     <x>399</x>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>45</x>
-     <y>344</y>
+     <x>498</x>
+     <y>317</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>guideEnabled(bool)</signal>
-   <receiver>guideButton</receiver>
+   <signal>pipSourceEnabled(bool)</signal>
+   <receiver>pipSourceButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <x>399</x>
-     <y>222</y>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>151</x>
-     <y>337</y>
+     <x>695</x>
+     <y>317</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>infoEnabled(bool)</signal>
-   <receiver>infoButton</receiver>
+   <signal>pipChannelUpEnabled(bool)</signal>
+   <receiver>pipChannelUpButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <x>399</x>
-     <y>222</y>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>151</x>
-     <y>141</y>
+     <x>104</x>
+     <y>422</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>keysetNameChanged(QString)</signal>
-   <receiver>nameLabel</receiver>
-   <slot>setText(QString)</slot>
+   <signal>pipChannelDownEnabled(bool)</signal>
+   <receiver>pipChannelDownButton</receiver>
+   <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <x>399</x>
-     <y>222</y>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>399</x>
-     <y>301</y>
+     <x>301</x>
+     <y>422</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>nextEnabled(bool)</signal>
-   <receiver>mediaNextButton</receiver>
+   <signal>pipPauseEnabled(bool)</signal>
+   <receiver>pipPauseButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <x>399</x>
-     <y>222</y>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>306</x>
-     <y>141</y>
+     <x>498</x>
+     <y>422</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>previousEnabled(bool)</signal>
-   <receiver>mediaPreviousButton</receiver>
+   <signal>pipSizeEnabled(bool)</signal>
+   <receiver>pipSizeButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <x>399</x>
-     <y>222</y>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>120</x>
-     <y>141</y>
+     <x>695</x>
+     <y>422</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>MainWindow</sender>
-   <signal>stepForwardEnabled(bool)</signal>
-   <receiver>stepForwardButton</receiver>
+   <signal>teletextSizeEnabled(bool)</signal>
+   <receiver>teletextSizeButton</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
      <x>399</x>
-     <y>222</y>
+     <y>239</y>
     </hint>
     <hint type="destinationlabel">
-     <x>306</x>
-     <y>239</y>
+     <x>695</x>
+     <y>211</y>
     </hint>
    </hints>
   </connection>
   <signal>advanceEnabled(bool)</signal>
   <signal>stepBackEnabled(bool)</signal>
   <signal>stepForwardEnabled(bool)</signal>
-  <signal>recordEnabled(bool)</signal>
   <signal>pipEnabled(bool)</signal>
   <signal>pipSwapEnabled(bool)</signal>
   <signal>sleepEnabled(bool)</signal>
   <signal>surroundEnabled(bool)</signal>
   <signal>selectEnabled(bool)</signal>
   <signal>aspectRatioEnabled(bool)</signal>
-  <signal>languageEnabled(bool)</signal>
+  <signal>audioEnabled(bool)</signal>
   <signal>favoritesEnabled(bool)</signal>
   <signal>pipMoveEnabled(bool)</signal>
   <signal>pipSourceEnabled(bool)</signal>
-  <signal>scanEnabled(bool)</signal>
   <signal>programEnabled(bool)</signal>
   <signal>pictureModeEnabled(bool)</signal>
   <signal>discTitleEnabled(bool)</signal>
   <signal>autoTrackingEnabled(bool)</signal>
   <signal>vhsSpeedEnabled(bool)</signal>
   <signal>soundModeEnabled(bool)</signal>
+  <signal>pageUpEnabled(bool)</signal>
+  <signal>pageDownEnabled(bool)</signal>
+  <signal>slowEnabled(bool)</signal>
+  <signal>slowMinusEnabled(bool)</signal>
+  <signal>slowPlusEnabled(bool)</signal>
+  <signal>tunerBandEnabled(bool)</signal>
+  <signal>repeatEnabled(bool)</signal>
+  <signal>repeatABEnabled(bool)</signal>
+  <signal>randomEnabled(bool)</signal>
+  <signal>liveTVEnabled(bool)</signal>
+  <signal>teletextEnabled(bool)</signal>
+  <signal>teletextHoldEnabled(bool)</signal>
+  <signal>teletextRevealEnabled(bool)</signal>
+  <signal>teletextSizeEnabled(bool)</signal>
+  <signal>pipChannelUpEnabled(bool)</signal>
+  <signal>pipChannelDownEnabled(bool)</signal>
+  <signal>pipPauseEnabled(bool)</signal>
+  <signal>pipSizeEnabled(bool)</signal>
  </slots>
 </ui>
index 6468e12..d3de072 100644 (file)
@@ -20,7 +20,8 @@ extern QMutex commandIFMutex;
 // For standard NEC, use this constructor:
 NECProtocol::NECProtocol(
   QObject *guiObject,
-  unsigned int index)
+  unsigned int index,
+  NECKeyFormat fmt)
   : PIRProtocol(guiObject, index, 110000, true),
     zeroPulse(560),
     zeroSpace(560),
@@ -36,7 +37,8 @@ NECProtocol::NECProtocol(
     hasRepeatPair(true),
     repeatNeedsHeader(false),
     fullHeadlessRepeat(false),
-    elevenBitToggle(false)
+    elevenBitToggle(false),
+    encodingFormat(fmt)
 {
 }
 
@@ -49,7 +51,8 @@ NECProtocol::NECProtocol(
   unsigned int oPulse,
   unsigned int oSpace,
   unsigned int gSpace,
-  bool iclflag)
+  bool iclflag,
+  NECKeyFormat fmt)
   : PIRProtocol(guiObject, index, gSpace, iclflag),
     zeroPulse(zPulse),
     zeroSpace(zSpace),
@@ -60,7 +63,8 @@ NECProtocol::NECProtocol(
     hasRepeatPair(false),
     repeatNeedsHeader(false),
     fullHeadlessRepeat(false),
-    elevenBitToggle(false)
+    elevenBitToggle(false),
+    encodingFormat(fmt)
 {
 }
 
@@ -140,10 +144,9 @@ void NECProtocol::startSendingCommand(
     PIRRX51Hardware rx51device(carrierFrequency, dutyCycle);
 
     int repeatCount = 0;
+    int commandDuration = 0;
     while (repeatCount < MAX_REPEAT_COUNT)
     {
-      int commandDuration;
-
       // If we are currently repeating, and have a special "repeat signal",
       // use that signal.  Otherwise, generate a normal command string.
       if (hasRepeatPair && repeatCount)
@@ -208,14 +211,38 @@ int NECProtocol::generateStandardCommand(
     duration += (headerPulse + headerSpace);
   }
 
-  // Next, the "pre" data:
-  duration += pushBits(preData, rx51device);
-
-  // Next, add the actual command:
-  duration += pushBits(bits, rx51device);
-
-  // Next, add the "post" data:
-  duration += pushBits(postData, rx51device);
+  // Now, check the encoding format:
+  switch(encodingFormat)
+  {
+  case Standard_NEC:
+    // Standard NEC is made up of an eight-bit "address" and an eight-bit
+    // "command".  First the address bits are sent (in reverse order), then
+    // the address bits are inverted and sent again (in reverse order).
+    // Next, we do the same to the command bits.
+    // - "preData" should contain 8-bit value
+    // - "bits" should contain 8-bit value
+    duration += pushReverseBits(preData, rx51device);
+    duration += pushInvertedReverseBits(preData, rx51device);
+    duration += pushReverseBits(bits, rx51device);
+    duration += pushInvertedReverseBits(bits, rx51device);
+    break;
+  case Extended_NEC:
+    // In extended NEC, the address has been extended to 16 bits, but only
+    // the reversed bits are sent, not inverted.  The command portion stays
+    // the same.
+    // - "preData" should contain 16-bit value
+    // - "bits" should contain 8-bit value
+    duration += pushReverseBits(preData, rx51device);
+    duration += pushReverseBits(bits, rx51device);
+    duration += pushInvertedReverseBits(bits, rx51device);
+    break;
+  case LIRC_NEC: default:
+    // In this case, we just dump the raw bits into the device:
+    duration += pushBits(preData, rx51device);
+    duration += pushBits(bits, rx51device);
+    duration += pushBits(postData, rx51device);
+    break;
+  }
 
   // Finally add the "trail":
   if (hasTrailerPulse)
@@ -372,3 +399,57 @@ int NECProtocol::pushBits(
 
   return duration;
 }
+
+
+int NECProtocol::pushReverseBits(
+  const CommandSequence &bits,
+  PIRRX51Hardware &rx51device)
+{
+  int duration = 0;
+  CommandSequence::const_reverse_iterator i = bits.rbegin();
+  while (i != bits.rend())
+  {
+    if (*i)
+    {
+      // Send the pulse for "One":
+      rx51device.addPair(onePulse, oneSpace);
+      duration += (onePulse + oneSpace);
+    }
+    else
+    {
+      // Send the pulse for "Zero":
+      rx51device.addPair(zeroPulse, zeroSpace);
+      duration += (zeroPulse + zeroSpace);
+    }
+    ++i;
+  }
+
+  return duration;
+}
+
+
+int NECProtocol::pushInvertedReverseBits(
+  const CommandSequence &bits,
+  PIRRX51Hardware &rx51device)
+{
+  int duration = 0;
+  CommandSequence::const_reverse_iterator i = bits.rbegin();
+  while (i != bits.rend())
+  {
+    if (*i)
+    {
+      // Send the pulse for "Zero":
+      rx51device.addPair(zeroPulse, zeroSpace);
+      duration += (zeroPulse + zeroSpace);
+    }
+    else
+    {
+      // Send the pulse for "One":
+      rx51device.addPair(onePulse, oneSpace);
+      duration += (onePulse + oneSpace);
+    }
+    ++i;
+  }
+
+  return duration;
+}
index 9de409d..ef6e1cc 100644 (file)
 // and mostly define 0s and 1s by the length of time between pulses...
 //
 
+//
+// There exist two well-defined NEC protocols: "standard" and "extended".
+// Some remotes might not fit into either format; LIRC has given up and
+// simply recorded the exact set of IR pulses as bits, rather than attempt
+// to follow the standard encodings.  I'll use the following enum to
+// describe which mechanism the key data follows:
+//
+
+enum NECKeyFormat
+{
+  Standard_NEC,
+  Extended_NEC,
+  LIRC_NEC
+};
+
 class NECProtocol: public PIRProtocol
 {
 public:
@@ -27,7 +42,8 @@ public:
   // Constructor for standard NEC:
   NECProtocol(
     QObject *guiObject,
-    unsigned int index);
+    unsigned int index,
+    NECKeyFormat type);
 
   // Constructor for non-standard NEC:
   NECProtocol(
@@ -38,7 +54,8 @@ public:
     unsigned int oPulse,
     unsigned int oSpace,
     unsigned int gapSpace,
-    bool iclflag);
+    bool iclflag,
+    NECKeyFormat type);
 
   void setHeaderPair(
     unsigned int pulse,
@@ -81,9 +98,6 @@ private:
   unsigned int trailerPulse;
   bool hasTrailerPulse;
 
-  // Each remote key has a unique command sequence:
-//  KeyCommandMap commands;
-
   // A pulse that means "repeat the last command":
   unsigned int repeatPulse;
   unsigned int repeatSpace;
@@ -92,6 +106,9 @@ private:
   bool fullHeadlessRepeat; // Repeat full command but without header
   bool elevenBitToggle; // A few remotes toggle the last eleven bits on repeat
 
+  // A flag used to determine how to encode the bits:
+  NECKeyFormat encodingFormat;
+
   int generateStandardCommand(
     const CommandSequence &bits,
     PIRRX51Hardware &device);
@@ -110,6 +127,14 @@ private:
   int pushBits(
     const CommandSequence &bits,
     PIRRX51Hardware &device);
+
+  int pushReverseBits(
+    const CommandSequence &bits,
+    PIRRX51Hardware &device);
+
+  int pushInvertedReverseBits(
+    const CommandSequence &bits,
+    PIRRX51Hardware &device);
 };
 
 #endif // NECPROTOCOL_H
index bced6d8..12e9876 100644 (file)
@@ -68,7 +68,11 @@ SOURCES += main.cpp mainwindow.cpp \
     keysets/magnavox.cpp \
     rc6protocol.cpp \
     keysets/philips.cpp \
-    keysets/tivo.cpp
+    keysets/tivo.cpp \
+    keysets/elgato.cpp \
+    sircprotocol.cpp \
+    jvcprotocol.cpp \
+    sharpprotocol.cpp
 HEADERS += mainwindow.h \
     pirkeynames.h \
     necprotocol.h \
@@ -111,7 +115,11 @@ HEADERS += mainwindow.h \
     keysets/magnavox.h \
     rc6protocol.h \
     keysets/philips.h \
-    keysets/tivo.h
+    keysets/tivo.h \
+    keysets/elgato.h \
+    sircprotocol.h \
+    jvcprotocol.h \
+    sharpprotocol.h
 FORMS += mainwindow.ui \
     pirdocumentationform.ui \
     piraboutform.ui \
@@ -169,16 +177,18 @@ OTHER_FILES += \
     pierogi.sudoers \
     qtc_packaging/debian_fremantle/postinst \
     www/index.html \
-    www/FavoritesTab.png \
     www/KeypadTab.png \
     www/MainTab.png \
     www/MediaTab.png \
     www/MenuTab.png \
-    www/MiscTab.png \
     www/PierogiIcon.png \
     www/SelectKeysetWindow.png \
     www/UtilityTab.png \
-    qtc_packaging/debian_fremantle/postrm.needsfixing
+    qtc_packaging/debian_fremantle/postrm.needsfixing \
+    www/FavoriteTab.png \
+    www/Media2Tab.png \
+    www/TVTab.png \
+    www/PierogiIcon.png
 
 RESOURCES += \
     PierogiResources.qrc
index f226505..c513a18 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by Qt Creator 2.4.0, 2012-01-25T13:47:37. -->
+<!-- Written by Qt Creator 2.4.0, 2012-01-30T20:37:02. -->
 <qtcreator>
  <data>
   <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -79,7 +79,7 @@
       <value type="QString" key="ProjectExplorer.ProcessStep.Arguments">dpkg-buildpackage -sa -S -uc -us</value>
       <value type="QString" key="ProjectExplorer.ProcessStep.Command">/Users/john/QtSDK/Maemo/4.6.2/bin/mad</value>
       <value type="bool" key="ProjectExplorer.ProcessStep.Enabled">false</value>
-      <value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">/Users/john/Develop/n900/pierogi-0.1.6</value>
+      <value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">/Users/john/Develop/n900/pierogi-0.1.7</value>
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Process Step</value>
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.ProcessStep</value>
        <value type="QString">/Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_1_1_armel.deb</value>
        <value type="QString">/Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_0_1_armel.deb</value>
        <value type="QString">/Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_1_0_armel.deb</value>
+       <value type="QString">/Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_1_7_armel.deb</value>
        <value type="QString">/Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_0_1_armel.deb</value>
        <value type="QString">/Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_1_6_armel.deb</value>
       </valuelist>
        <value type="QString">192.168.0.15</value>
        <value type="QString">192.168.0.15</value>
        <value type="QString">192.168.0.15</value>
+       <value type="QString">192.168.0.15</value>
        <value type="QString">localhost</value>
        <value type="QString">192.168.0.15</value>
       </valuelist>
        <value type="QString"></value>
        <value type="QString"></value>
        <value type="QString"></value>
+       <value type="QString"></value>
       </valuelist>
       <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedTimes">
        <value type="QDateTime">2012-01-23T09:47:37</value>
        <value type="QDateTime">2012-01-17T00:15:23</value>
        <value type="QDateTime">2012-01-14T13:11:32</value>
        <value type="QDateTime">2012-01-17T00:03:13</value>
+       <value type="QDateTime">2012-01-30T20:23:06</value>
        <value type="QDateTime">2012-01-01T15:35:35</value>
        <value type="QDateTime">2012-01-25T13:42:55</value>
       </valuelist>
index 49e20ee..29e60ff 100644 (file)
@@ -26,6 +26,8 @@ enum PIRKeyName{
   DoubleDigit_Key,
   // Power control:
   Power_Key,
+  PowerOn_Key,
+  PowerOff_Key,
   // Volume control:
   VolumeUp_Key,
   VolumeDown_Key,
@@ -40,6 +42,9 @@ enum PIRKeyName{
   Pause_Key,
   Stop_Key,
   Record_Key,
+  RecordPause_Key,
+  RecordStop_Key,
+  RecordMute_Key,
   FastForward_Key,
   Rewind_Key,
   Next_Key,
@@ -51,6 +56,12 @@ enum PIRKeyName{
   Eject_Key,
   Random_Key,
   Repeat_Key,
+  RepeatAB_Key,
+  Slow_Key,
+  SlowPlus_Key,
+  SlowMinus_Key,
+  Timer_Key,
+  Clock_Key,
   // Menu control:
   Menu_Key,
   Up_Key,
@@ -59,11 +70,27 @@ enum PIRKeyName{
   Right_Key,
   Select_Key,
   Exit_Key,
+  PageUp_Key,
+  PageDown_Key,
   // Color buttons:
   Red_Key,
   Green_Key,
   Yellow_Key,
   Blue_Key,
+  // Teletext buttons:
+  Teletext_Key,
+  TeletextReveal_Key,
+  TeletextHold_Key,
+  TeletextSize_Key,
+  TeletextSelect_Key,
+  TeletextTime_Key,
+  TeletextAndTV_Key,
+  TeletextDown_Key,
+  TeletextUp_Key,
+  TeletextBackgroundTV_Key,
+  TeletextStore_Key,
+  TeletextIndex_Key,
+  TeletextOff_Key,
   // Picture-in-picture stuff:
   PIP_Key,
   PIPSwap_Key,
@@ -72,10 +99,13 @@ enum PIRKeyName{
   PIPChannelUp_Key,
   PIPChannelDown_Key,
   PIPPause_Key,
+  PIPSize_Key,
+  PIPScan_Key,
   // DVD / Blue-ray / etc. keys:
   DiscTitle_Key,
   DiscMenu_Key,
   DiscSelect_Key,
+  Angle_Key,
   // VHS / Beta / etc. keys:
   VHSSpeed_Key,
   TrackingPlus_Key,
@@ -88,15 +118,16 @@ enum PIRKeyName{
   Sleep_Key,
   PictureMode_Key, // "PMODE"
   SoundMode_Key,
-  Clock_Key,
-  Timer_Key,
   Reset_Key,
   Program_Key,
   Surround_Key,
   AspectRatio_Key,
-  Language_Key,
+  Audio_Key,
   Favorites_Key,
-  Scan_Key
+  Scan_Key,
+  Zoom_Key,
+  LiveTV_Key,
+  TunerBand_Key
 };
 
 #endif // PIRKEYNAMES_H
index b00bd50..4b94ada 100644 (file)
@@ -3,6 +3,7 @@
 #include "keysets/apple.h"
 #include "keysets/denon.h"
 #include "keysets/ei.h"
+#include "keysets/elgato.h"
 #include "keysets/goldstar.h"
 #include "keysets/hauppauge.h"
 #include "keysets/hitachi.h"
@@ -75,7 +76,9 @@ PIRKeysetManager::PIRKeysetManager(
   populateKeyset(new DenonAudio4(guiObject, counter++));
   populateKeyset(new DenonAudio5(guiObject, counter++));
 
-  populateKeyset(new EiKeyset(guiObject, counter++));
+  populateKeyset(new EiTV1(guiObject, counter++));
+
+  populateKeyset(new ElgatoEyeTV1(guiObject, counter++));
 
   populateKeyset(new GoldStarTV1(guiObject, counter++));
   populateKeyset(new GoldStarTV2(guiObject, counter++));
@@ -83,7 +86,6 @@ PIRKeysetManager::PIRKeysetManager(
   populateKeyset(new GoldStarVCR1a(guiObject, counter++));
   populateKeyset(new GoldStarVCR1b(guiObject, counter++));
   populateKeyset(new GoldStarVCR1c(guiObject, counter++));
-  populateKeyset(new GoldStarVCR1d(guiObject, counter++));
   populateKeyset(new GoldStarCD1(guiObject, counter++));
 
   populateKeyset(new HauppaugePCTV1(guiObject, counter++));
@@ -96,28 +98,19 @@ PIRKeysetManager::PIRKeysetManager(
   populateKeyset(new JVCSat2(guiObject, counter++));
   populateKeyset(new JVCVCR1(guiObject, counter++));
   populateKeyset(new JVCVCR1a(guiObject, counter++));
-  populateKeyset(new JVCVCR1b(guiObject, counter++));
-  populateKeyset(new JVCVCR1c(guiObject, counter++));
-  populateKeyset(new JVCVCR2(guiObject, counter++));
-  populateKeyset(new JVCVCR2a(guiObject, counter++));
-  populateKeyset(new JVCVCR2b(guiObject, counter++));
-  populateKeyset(new JVCVCR2c(guiObject, counter++));
+  populateKeyset(new JVCVCRBmode1(guiObject, counter++));
+  populateKeyset(new JVCVCRBmode1a(guiObject, counter++));
   populateKeyset(new JVCTV1(guiObject, counter++));
   populateKeyset(new JVCTV1a(guiObject, counter++));
   populateKeyset(new JVCTV1b(guiObject, counter++));
   populateKeyset(new JVCTV1c(guiObject, counter++));
   populateKeyset(new JVCTV1d(guiObject, counter++));
-  populateKeyset(new JVCTV2(guiObject, counter++));
-  populateKeyset(new JVCTV2a(guiObject, counter++));
-  populateKeyset(new JVCTV2b(guiObject, counter++));
-  populateKeyset(new JVCTV2c(guiObject, counter++));
-  populateKeyset(new JVCTV2d(guiObject, counter++));
   populateKeyset(new JVCDAT1(guiObject, counter++));
   populateKeyset(new JVCCarDeck1(guiObject, counter++));
-  populateKeyset(new JVCPortableAudio1(guiObject, counter++));
-  populateKeyset(new JVCPortableAudio1a(guiObject, counter++));
-  populateKeyset(new JVCPortableAudio1b(guiObject, counter++));
-  populateKeyset(new JVCPortableAudio2(guiObject, counter++));
+  populateKeyset(new JVCAudio1(guiObject, counter++));
+  populateKeyset(new JVCAudio1a(guiObject, counter++));
+  populateKeyset(new JVCAudio1b(guiObject, counter++));
+  populateKeyset(new JVCAudio2(guiObject, counter++));
   populateKeyset(new JVCDVD1(guiObject, counter++));
 
   populateKeyset(new LGTV1(guiObject, counter++));
@@ -246,6 +239,7 @@ PIRKeysetManager::PIRKeysetManager(
   populateKeyset(new SanyoTV1b(guiObject, counter++));
   populateKeyset(new SanyoTV1c(guiObject, counter++));
   populateKeyset(new SanyoTV1d(guiObject, counter++));
+  populateKeyset(new SanyoTV1e(guiObject, counter++));
   populateKeyset(new SanyoProjector(guiObject, counter++));
 
   populateKeyset(new SharpTV1(guiObject, counter++));
@@ -260,13 +254,11 @@ PIRKeysetManager::PIRKeysetManager(
   populateKeyset(new SonyTV1(guiObject, counter++));
   populateKeyset(new SonyTV1a(guiObject, counter++));
   populateKeyset(new SonyTV1b(guiObject, counter++));
-  populateKeyset(new SonyTV1d(guiObject, counter++));
+  populateKeyset(new SonyTV1c(guiObject, counter++));
   populateKeyset(new SonyAmp1(guiObject, counter++));
   populateKeyset(new SonyAmp2(guiObject, counter++));
-  populateKeyset(new SonyCD1(guiObject, counter++));
-  populateKeyset(new SonyCD1a(guiObject, counter++));
-  populateKeyset(new SonyCD2(guiObject, counter++));
-  populateKeyset(new SonyCD3(guiObject, counter++));
+  populateKeyset(new SonyAudio1(guiObject, counter++));
+  populateKeyset(new SonyAudio1a(guiObject, counter++));
   populateKeyset(new SonyDAT1(guiObject, counter++));
   populateKeyset(new SonyDVD1(guiObject, counter++));
   populateKeyset(new SonyDVD1a(guiObject, counter++));
@@ -274,6 +266,7 @@ PIRKeysetManager::PIRKeysetManager(
   populateKeyset(new SonyDVD1c(guiObject, counter++));
   populateKeyset(new SonyVCR1(guiObject, counter++));
   populateKeyset(new SonyVCR1a(guiObject, counter++));
+  populateKeyset(new SonyVCR1b(guiObject, counter++));
   populateKeyset(new SonyReceiver1(guiObject, counter++));
 
   populateKeyset(new Tivo1(guiObject, counter++));
@@ -289,6 +282,7 @@ PIRKeysetManager::PIRKeysetManager(
   populateKeyset(new ToshibaTV1d(guiObject, counter++));
   populateKeyset(new ToshibaTV1e(guiObject, counter++));
   populateKeyset(new ToshibaTV1f(guiObject, counter++));
+  populateKeyset(new ToshibaTV1g(guiObject, counter++));
   populateKeyset(new ToshibaVCR1(guiObject, counter++));
   populateKeyset(new ToshibaVCR1a(guiObject, counter++));
   populateKeyset(new ToshibaDisc1(guiObject, counter++));
@@ -357,6 +351,50 @@ bool PIRKeysetManager::keysetExists(
 }
 
 
+bool PIRKeysetManager::findKeysetID(
+  QString make,
+  QString name,
+  unsigned int &id)
+{
+  // Only modify the id if we actually find a match!
+
+  PIRKeysetMakeIndex::const_iterator i = makeIndex.find(make);
+  if (i == makeIndex.end())
+  {
+    return false;
+  }
+
+  PIRKeysetNameIndex::const_iterator ii = (*i).second.find(name);
+  if (ii == (*i).second.end())
+  {
+    return false;
+  }
+
+  //  Ok, we've found it, pull out the id:
+  id = (*ii).second;
+  return true;
+}
+
+
+PIRKeysetWidgetItem *PIRKeysetManager::makeKeysetItem(
+  QString make,
+  QString name)
+{
+  unsigned int id;
+
+  if (!findKeysetID(make, name, id))
+  {
+    return NULL;
+  }
+
+  QString fullname = make;
+  fullname.append(" ");
+  fullname.append(name);
+
+  return new PIRKeysetWidgetItem(fullname, id, getMake(id));
+}
+
+
 bool PIRKeysetManager::hasKey(
   unsigned int keysetID,
   PIRKeyName name)
@@ -394,9 +432,16 @@ QString PIRKeysetManager::getDisplayName(
 void PIRKeysetManager::populateKeyset(
   PIRKeysetMetaData *keyset)
 {
+  // Set up the keyset collection:
   keysetsInfo[keyset->getID()] = keyset;
 
   keyset->moveProtocolToThread(commandThread);
+
+  // Also, set up a name-based index into the collection:
+  makeIndex
+    [QString(makeManager.getMakeString(keyset->getMake()))]
+    [QString(keyset->getKeysetName())]
+    = keyset->getID();
 }
 
 
index 66f0f56..156b1f6 100644 (file)
@@ -8,13 +8,19 @@
 #include "pirselectkeysetform.h"
 #include "pirkeysetwidgetitem.h"
 
+#include <QString> // needed to work with QSettings data...
+
 //#include <QtCore/QCoreApplication>
 #include <QThread>
 //#include <QStringList>
 
 #include <map>
 
-typedef std::map<int, PIRKeysetMetaData *> PIRKeysetCollection;
+typedef std::map<unsigned int, PIRKeysetMetaData *> PIRKeysetCollection;
+
+// Maps used to locate metadata using QSettings values:
+typedef std::map<QString, unsigned int> PIRKeysetNameIndex;
+typedef std::map<QString, PIRKeysetNameIndex> PIRKeysetMakeIndex;
 
 class PIRKeysetManager
 {
@@ -30,6 +36,15 @@ public:
   bool keysetExists(
     unsigned int keysetID);
 
+  bool findKeysetID(
+    QString make,
+    QString name,
+    unsigned int &id);
+
+  PIRKeysetWidgetItem *makeKeysetItem(
+    QString make,
+    QString name);
+
   bool hasKey(
     unsigned int keysetID,
     PIRKeyName name);
@@ -50,6 +65,7 @@ private:
     PIRKeysetMetaData *keyset);
 
   PIRKeysetCollection keysetsInfo;
+  PIRKeysetMakeIndex makeIndex;
 
   // The counter will be used to generate unique ids for each keyset:
   unsigned int counter;
index 32c46bb..8e5ac10 100644 (file)
@@ -59,15 +59,74 @@ void PIRKeysetMetaData::addKey(
   const char *name,
   PIRKeyName key,
   unsigned long data,
-  unsigned int bits)
+  unsigned int size)
 {
   // Don't have a system for the unmapped keys yet!
   if (key != Unmapped_Key)
   {
     keys[key] = name;
+
+    threadableProtocol->addKey(key, data, size);
+  }
+}
+
+
+void PIRKeysetMetaData::addSIRC12Key(
+  const char *name,
+  PIRKeyName key,
+  unsigned int addressData,
+  unsigned int commandData)
+{
+  if (key != Unmapped_Key)
+  {
+    keys[key] = name;
+
+    threadableProtocol->addSIRCKey(key, addressData, 5, commandData);
+  }
+}
+
+
+void PIRKeysetMetaData::addSIRC15Key(
+  const char *name,
+  PIRKeyName key,
+  unsigned int addressData,
+  unsigned int commandData)
+{
+  if (key != Unmapped_Key)
+  {
+    keys[key] = name;
+    threadableProtocol->addSIRCKey(key, addressData, 8, commandData);
   }
+}
 
-  threadableProtocol->addKey(key, data, bits);
+
+void PIRKeysetMetaData::addSIRC20Key(
+  const char *name,
+  PIRKeyName key,
+  unsigned int secondaryAddressData,
+  unsigned int primaryAddressData,
+  unsigned int commandData)
+{
+  if (key != Unmapped_Key)
+  {
+    keys[key] = name;
+    threadableProtocol->addSIRC20Key(
+      key, secondaryAddressData, primaryAddressData, commandData);
+  }
+}
+
+
+void PIRKeysetMetaData::addSharpKey(
+  const char *name,
+  PIRKeyName key,
+  unsigned int addressData,
+  unsigned int commandData)
+{
+  if (key != Unmapped_Key)
+  {
+    keys[key] = name;
+    threadableProtocol->addSharpKey(key, addressData, commandData);
+  }
 }
 
 
index 7bdf2e9..7436079 100644 (file)
@@ -67,7 +67,34 @@ protected:
     const char *name,
     PIRKeyName key,
     unsigned long data,
-    unsigned int bits);
+    unsigned int size);
+
+  // Special helper methods for SIRC keys:
+  void addSIRC12Key(
+    const char *name,
+    PIRKeyName key,
+    unsigned int addressData,
+    unsigned int commandData);
+
+  void addSIRC15Key(
+    const char *name,
+    PIRKeyName key,
+    unsigned int addressData,
+    unsigned int commandData);
+
+  void addSIRC20Key(
+    const char *name,
+    PIRKeyName key,
+    unsigned int secondaryAddressData,
+    unsigned int primaryAddressData,
+    unsigned int commandData);
+
+  // Helper method for Sharp keys:
+  void addSharpKey(
+    const char *name,
+    PIRKeyName key,
+    unsigned int addressData,
+    unsigned int commandData);
 
   void setPreData(
     unsigned long data,
index 95c6476..3848068 100644 (file)
@@ -6,6 +6,7 @@ PIRMakeMgr::PIRMakeMgr()
   makes[Apple_Make] = "Apple";
   makes[Denon_Make] = "Denon";
   makes[Ei_Make] = "Ei";
+  makes[Elgato_Make] = "Elgato";
   makes[GoldStar_Make] = "GoldStar";
   makes[Hauppauge_Make] = "Hauppauge";
   makes[Hitachi_Make] = "Hitachi";
index eb3145e..4d432a9 100644 (file)
@@ -10,6 +10,7 @@ enum PIRMakeName{
   Apple_Make,
   Denon_Make,
   Ei_Make,
+  Elgato_Make,
   GoldStar_Make,
   Hauppauge_Make,
   Hitachi_Make,
index 60a7286..ddacbfd 100644 (file)
@@ -54,7 +54,45 @@ PIRProtocol::PIRProtocol(
 void PIRProtocol::addKey(
   PIRKeyName key,
   unsigned long command,
-  unsigned int bits)
+  unsigned int size)
+{
+  // First, if key already exists, clear it out:
+  KeycodeCollection::iterator i = keycodes.find(key);
+  if (i != keycodes.end())
+  {
+    i->second.clear();
+  }
+
+  appendToBitSeq(keycodes[key], command, size);
+}
+
+
+void PIRProtocol::addSIRCKey(
+  PIRKeyName key,
+  unsigned int addressData,
+  unsigned int size,
+  unsigned int commandData)
+{
+  // First, if key already exists, clear it out:
+  KeycodeCollection::iterator i = keycodes.find(key);
+  if (i != keycodes.end())
+  {
+    i->second.clear();
+  }
+
+  // First, append the address data:
+  appendToBitSeq(keycodes[key], addressData, size);
+
+  // Next, the command data.  The size is always 7 bits:
+  appendToBitSeq(keycodes[key], commandData, 7);
+}
+
+
+void PIRProtocol::addSIRC20Key(
+  PIRKeyName key,
+  unsigned int secondaryAddressData,
+  unsigned int primaryAddressData,
+  unsigned int commandData)
 {
   // First, if key already exists, clear it out:
   KeycodeCollection::iterator i = keycodes.find(key);
@@ -63,7 +101,32 @@ void PIRProtocol::addKey(
     i->second.clear();
   }
 
-  appendToBitSeq(keycodes[key], command, bits);
+  // First, append the secondary address data:
+  appendToBitSeq(keycodes[key], secondaryAddressData, 8);
+
+  // Next, the primary address data:
+  appendToBitSeq(keycodes[key], primaryAddressData, 5);
+
+  // Next, the command data.  The size is always 7 bits:
+  appendToBitSeq(keycodes[key], commandData, 7);
+}
+
+
+void PIRProtocol::addSharpKey(
+  PIRKeyName key,
+  unsigned int addressData,
+  unsigned int commandData)
+{
+  // First, if key already exists, clear it out:
+  KeycodeCollection::iterator i = keycodes.find(key);
+  if (i != keycodes.end())
+  {
+    i->second.clear();
+  }
+
+  // Sharp commands are all 5 bit address, 8 bit command:
+  appendToBitSeq(keycodes[key], addressData, 5);
+  appendToBitSeq(keycodes[key], commandData, 8);
 }
 
 
@@ -126,9 +189,9 @@ bool PIRProtocol::isCommandSupported(
 void PIRProtocol::appendToBitSeq(
   CommandSequence &sequence,
   unsigned int bits,
-  int significantBits)
+  int size)
 {
-  if (significantBits == 0)
+  if (size == 0)
   {
     // This is bad, but just return silently for now...
     return;
@@ -136,7 +199,7 @@ void PIRProtocol::appendToBitSeq(
 
   // For each bit in the char, append a 1 or a 0 into the sequence.
   // Starting with the largest bit, move forward one bit at a time:
-  unsigned int currentBit = 1 << (significantBits - 1);
+  unsigned int currentBit = 1 << (size - 1);
 
   do
   {
@@ -196,11 +259,19 @@ void PIRProtocol::sleepUntilRepeat(
     microseconds = gap - PIEROGI_OVERHEAD_HACK;
   }
 
+/*
   // Don't even bother sleeping if there's only a few microseconds:
   if (microseconds < 1000)
   {
     return;
   }
+*/
+  // For now, I'm going to enforce a minimum sleep of 10 ms, so that we
+  // don't get runaway commands:
+  if (microseconds < 10000)
+  {
+    microseconds = 10000;
+  }
 
   timespec sleeptime;
   sleeptime.tv_sec = 0;
index b78c523..273eae2 100644 (file)
@@ -40,7 +40,25 @@ public:
   void addKey(
     PIRKeyName key,
     unsigned long data,
-    unsigned int bits);
+    unsigned int size);
+
+  // A special addKey used for Sony's SIRC protocol:
+  void addSIRCKey(
+    PIRKeyName key,
+    unsigned int addressData,
+    unsigned int size,
+    unsigned int commandData);
+
+  void addSIRC20Key(
+    PIRKeyName key,
+    unsigned int secondaryAddressData,
+    unsigned int primaryAddressData,
+    unsigned int commandData);
+
+  void addSharpKey(
+    PIRKeyName key,
+    unsigned int addressData,
+    unsigned int commandData);
 
   void setCarrierFrequency(
     unsigned int freq);
index a60d7d4..9c9e878 100644 (file)
@@ -1,3 +1,8 @@
+pierogi (0.5.0) unstable; urgency=low
+  * Somewhat extended and improved UI, some backend improvements, I'm labeling this as now "half-way usable", thus version 0.5
+
+ -- John Pietrzak <jpietrzak8@gmail.com>  Mon, 30 Jan 2012 20:24:28 -0500
+
 pierogi (0.1.7) unstable; urgency=low
   * Finally put together RC6 codepath, and created a Philips keyset.  Still not tested, though!  Also, some general cleanup work on protocol classes.
 
index 0a599a4..d9d5f8f 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/sh
 
-chmod u+s /opt/pierogi/bin/loadRX51Module
-chmod u+s /opt/pierogi/bin/unloadRX51Module
 update-sudoers
 
 exit 0
index 5fa1d08..cece165 100644 (file)
@@ -58,10 +58,9 @@ void RC5Protocol::startSendingCommand(
     PIRRX51Hardware rx51device(carrierFrequency, dutyCycle);
 
     int repeatCount = 0;
+    int commandDuration = 0;
     while (repeatCount < MAX_REPEAT_COUNT)
     {
-      int commandDuration = 0;
-
       // Now, throw together an RC5 protocol command string.
 
       if (!preData.empty())
index dcdaee6..fcbb412 100644 (file)
@@ -51,10 +51,9 @@ void RC6Protocol::startSendingCommand(
     PIRRX51Hardware rx51device(carrierFrequency, dutyCycle);
 
     int repeatCount = 0;
+    int duration = 0;
     while (repeatCount < MAX_REPEAT_COUNT)
     {
-      int duration = 0;
-
       // First, construct the "Header" segment of the pulse train.  For now,
       // I'm only supporting the "consumer electronics mode" of RC6; this code
       // must be changed if we want to support more than that!
diff --git a/sharpprotocol.cpp b/sharpprotocol.cpp
new file mode 100644 (file)
index 0000000..37e2eb5
--- /dev/null
@@ -0,0 +1,253 @@
+#include "sharpprotocol.h"
+
+#include "pirexception.h"
+#include <string>
+//#include <iostream>
+
+// Some global communications stuff:
+#include <QMutex>
+extern bool commandInFlight;
+extern QMutex commandIFMutex;
+
+// Sharp's protocol should have the following attributes:
+// A "zero" is encoded with a 320 usec pulse, 680 usec space.
+// A "one" is encoded with a 320 usec pulse, and 1680 usec space.
+// There is no header pulse.
+// The pulse train ends with a trailing 320 usec pulse.
+// For repeating, the entire train is re-sent, except that the command
+// section (and the last two bits) are inverted in each odd repeat.
+// There is a 40000 usec delay between the end of one command and the start
+// of the next.
+// The command should be repeated at least once.
+// The carrier frequency is 38 kHz, duty cycle is 1/3.
+
+SharpProtocol::SharpProtocol(
+  QObject *guiObject,
+  unsigned int index,
+  bool expBit)
+  : PIRProtocol(guiObject, index, 40000, false),
+    zeroPulse(320),
+    zeroSpace(680),
+    onePulse(320),
+    oneSpace(1680),
+    trailerPulse(320),
+    expansionBit(expBit)
+{
+  setCarrierFrequency(38000);
+  setDutyCycle(33);
+}
+
+
+void SharpProtocol::startSendingCommand(
+  unsigned int threadableID,
+  PIRKeyName command)
+{
+  // Exceptions here are problematic; I'll try to weed them out by putting the
+  // whole thing in a try/catch block:
+  try
+  {
+    // First, check if we are meant to be the recipient of this command:
+    if (threadableID != id) return;
+
+    clearRepeatFlag();
+
+    KeycodeCollection::const_iterator i = keycodes.find(command);
+
+    // Do we even have this key defined?
+    if (i == keycodes.end())
+    {
+      std::string s = "Tried to send a non-existent command.\n";
+      throw PIRException(s);
+    }
+
+    // construct the device:
+    PIRRX51Hardware rx51device(carrierFrequency, dutyCycle);
+
+    int repeatCount = 0;
+    int commandDuration = 0;
+    while (repeatCount < MAX_REPEAT_COUNT)
+    {
+      // Every other repeat count, we invert everything but the address:
+      if (repeatCount % 2)
+      {
+        commandDuration = generateToggledCommand((*i).second, rx51device);
+      }
+      else
+      {
+        commandDuration = generateStandardCommand((*i).second, rx51device);
+      }
+
+      // Now, tell the device to send the whole command:
+      rx51device.sendCommandToDevice();
+
+      // sleep until the next repetition of command:
+      sleepUntilRepeat(commandDuration);
+
+      // Check whether we've reached the minimum required number of repetitons:
+//      if (repeatCount >= minimumRepetitions)
+      if (repeatCount >= 1)
+      {
+        // Check whether we've been asked to stop:
+        if (checkRepeatFlag())
+        {
+          QMutexLocker cifLocker(&commandIFMutex);
+          commandInFlight = false;
+          return;
+        }
+      }
+
+      ++repeatCount;
+    }
+  }
+  catch (PIRException e)
+  {
+    // inform the gui:
+    emit commandFailed(e.getError().c_str());
+  }
+
+  QMutexLocker cifLocker(&commandIFMutex);
+  commandInFlight = false;
+}
+
+
+int SharpProtocol::generateStandardCommand(
+  const CommandSequence &bits,
+  PIRRX51Hardware &rx51device)
+{
+  int duration = 0;
+
+  // Right now, I've got both the 5-bit address and the 8-bit command
+  // smushed together into the command sequence.  Need to pick each of
+  // these out and reverse their bits:
+
+  // First, push the address:
+
+  CommandSequence::const_reverse_iterator addressStart = bits.rbegin();
+  // Move past the command's 8 bits:
+  addressStart += 8;
+  duration += pushBits(addressStart, bits.rend(), rx51device);
+
+  // Next, push the command:
+  CommandSequence::const_reverse_iterator commandEnd = bits.rbegin();
+  // Again, move past the commands's 8 bits:
+  commandEnd += 8;
+  duration += pushBits(bits.rbegin(), commandEnd, rx51device);
+
+  // Next, there is an "expansion" bit and a "check" bit.  Not entirely sure
+  // what these two do.  The check bit is fixed at "1".
+  if (expansionBit)
+  {
+    rx51device.addPair(onePulse, oneSpace);
+    duration += (onePulse + oneSpace);
+  }
+  else
+  {
+    rx51device.addPair(zeroPulse, zeroSpace);
+    duration += (zeroPulse + zeroSpace);
+  }
+
+  rx51device.addPair(zeroPulse, zeroSpace);
+  duration += (zeroPulse + zeroSpace);
+
+  // Finally add the "trail":
+  rx51device.addSingle(trailerPulse);
+  duration += trailerPulse;
+
+  return duration;
+}
+
+
+// This is the same as the standard command, except all bits but the address
+// are inverted:
+int SharpProtocol::generateToggledCommand(
+  const CommandSequence &bits,
+  PIRRX51Hardware &rx51device)
+{
+  int duration = 0;
+
+  CommandSequence::const_reverse_iterator addressStart = bits.rbegin();
+  addressStart += 8;
+  duration += pushBits(addressStart, bits.rend(), rx51device);
+
+  CommandSequence::const_reverse_iterator commandEnd = bits.rbegin();
+  commandEnd += 8;
+  // This time we invert the bits:
+  duration += pushInvertedBits(bits.rbegin(), commandEnd, rx51device);
+
+  // We'll also invert the two administrative bits here:
+  if (expansionBit)
+  {
+    rx51device.addPair(zeroPulse, zeroSpace);
+    duration += (zeroPulse + zeroSpace);
+  }
+  else
+  {
+    rx51device.addPair(onePulse, oneSpace);
+    duration += (onePulse + oneSpace);
+  }
+
+  rx51device.addPair(onePulse, oneSpace);
+  duration += (onePulse + oneSpace);
+
+  // Add trail on end:
+  rx51device.addSingle(trailerPulse);
+  duration += trailerPulse;
+
+  return duration;
+}
+
+
+int SharpProtocol::pushBits(
+  CommandSequence::const_reverse_iterator i,
+  CommandSequence::const_reverse_iterator end,
+  PIRRX51Hardware &rx51device)
+{
+  int duration = 0;
+
+  while (i != end);
+  {
+    if (*i)
+    {
+      // Send the pulse for "One":
+      rx51device.addPair(onePulse, oneSpace);
+      duration += (onePulse + oneSpace);
+    }
+    else
+    {
+      // Send the pulse for "Zero":
+      rx51device.addPair(zeroPulse, zeroSpace);
+      duration += (zeroPulse + zeroSpace);
+    }
+    ++i;
+  }
+
+  return duration;
+}
+
+
+int SharpProtocol::pushInvertedBits(
+  CommandSequence::const_reverse_iterator i,
+  CommandSequence::const_reverse_iterator end,
+  PIRRX51Hardware &rx51device)
+{
+  int duration = 0;
+
+  while (i != end)
+  {
+    if (*i)
+    {
+      // Send the pulse for "Zero":
+      rx51device.addPair(zeroPulse, zeroSpace);
+      duration += (zeroPulse + zeroSpace);
+    }
+    else
+    {
+      // Send the pulse for "One":
+      rx51device.addPair(onePulse, oneSpace);
+      duration += (onePulse + oneSpace);
+    }
+    ++i;
+  }
+
+  return duration;
+}
diff --git a/sharpprotocol.h b/sharpprotocol.h
new file mode 100644 (file)
index 0000000..321e7eb
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef SHARPPROTOCOL_H
+#define SHARPPROTOCOL_H
+
+#include "pirprotocol.h"
+#include "pirrx51hardware.h"
+
+//
+// Sharp has its own protocol.  It is "space-encoded", like the popular NEC
+// protocol (i.e., a 1 takes longer to transmit than a 0), but differs in
+// several ways.  Most notably, the entire command section of the pulse
+// train is inverted for each odd-numbered repetition.  Also, there is no
+// header pulse.
+//
+
+class SharpProtocol: public PIRProtocol
+{
+public:
+  SharpProtocol(
+    QObject *guiObject,
+    unsigned int index,
+    bool expBit);
+
+public slots:
+  void startSendingCommand(
+    unsigned int threadableID,
+    PIRKeyName command);
+
+private:
+  // First, define what is used to represent 0 and 1:
+  unsigned int zeroPulse;
+  unsigned int zeroSpace;
+  unsigned int onePulse;
+  unsigned int oneSpace;
+
+  // A tailing on-request, not followed by a specific off time:
+  unsigned int trailerPulse;
+
+  // An "expansion bit".  Not sure what this is, but Sharp seems to leave it
+  // at 1, and Denon usually sets it to 0.
+  bool expansionBit;
+
+  int generateStandardCommand(
+    const CommandSequence &bits,
+    PIRRX51Hardware &device);
+
+  int generateToggledCommand(
+    const CommandSequence &bits,
+    PIRRX51Hardware &device);
+
+  int pushBits(
+    CommandSequence::const_reverse_iterator i,
+    CommandSequence::const_reverse_iterator end,
+    PIRRX51Hardware &device);
+
+  int pushInvertedBits(
+    CommandSequence::const_reverse_iterator i,
+    CommandSequence::const_reverse_iterator end,
+    PIRRX51Hardware &device);
+};
+
+#endif // SHARPPROTOCOL_H
diff --git a/sircprotocol.cpp b/sircprotocol.cpp
new file mode 100644 (file)
index 0000000..3e0796b
--- /dev/null
@@ -0,0 +1,143 @@
+#include "sircprotocol.h"
+
+#include "pirexception.h"
+#include <string>
+//#include <iostream>
+
+// Some global communications stuff:
+#include <QMutex>
+extern bool commandInFlight;
+extern QMutex commandIFMutex;
+
+// The SIRC protocol should have the following attributes:
+// A "zero" is encoded with a 600 usec pulse, 600 usec space.
+// A "one" is encoded with a 1200 usec pulse, and 600 usec space.
+// The header is a 2400 usec pulse, 600 usec space.
+// There is no trailing pulse.
+// When repeating a command, the entire train is re-broadcast every 45000 usec.
+// The carrier frequency is 40 kHz, duty cycle is 1/3.
+
+SIRCProtocol::SIRCProtocol(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRProtocol(guiObject, index, 45000, true),
+    zeroPulse(600),
+    zeroSpace(600),
+    onePulse(1200),
+    oneSpace(600),
+    headerPulse(2400),
+    headerSpace(600)
+{
+  setCarrierFrequency(40000);
+  setDutyCycle(33);
+}
+
+
+void SIRCProtocol::startSendingCommand(
+  unsigned int threadableID,
+  PIRKeyName command)
+{
+  // Exceptions here are problematic; I'll try to weed them out by putting the
+  // whole thing in a try/catch block:
+  try
+  {
+    // First, check if we are meant to be the recipient of this command:
+    if (threadableID != id) return;
+
+    clearRepeatFlag();
+
+    KeycodeCollection::const_iterator i = keycodes.find(command);
+
+    // Do we even have this key defined?
+    if (i == keycodes.end())
+    {
+      std::string s = "Tried to send a non-existent command.\n";
+      throw PIRException(s);
+    }
+
+    // construct the device:
+    PIRRX51Hardware rx51device(carrierFrequency, dutyCycle);
+
+    int repeatCount = 0;
+    int commandDuration = 0;
+    while (repeatCount < MAX_REPEAT_COUNT)
+    {
+      commandDuration = generateStandardCommand((*i).second, rx51device);
+
+      // Now, tell the device to send the whole command:
+      rx51device.sendCommandToDevice();
+
+      // sleep until the next repetition of command:
+      sleepUntilRepeat(commandDuration);
+
+      // Check whether we've reached the minimum required number of repetitons:
+//      if (repeatCount >= minimumRepetitions)
+      if (repeatCount >= 3)
+      {
+        // Check whether we've been asked to stop:
+        if (checkRepeatFlag())
+        {
+          QMutexLocker cifLocker(&commandIFMutex);
+          commandInFlight = false;
+          return;
+        }
+      }
+
+      ++repeatCount;
+    }
+  }
+  catch (PIRException e)
+  {
+    // inform the gui:
+    emit commandFailed(e.getError().c_str());
+  }
+
+  QMutexLocker cifLocker(&commandIFMutex);
+  commandInFlight = false;
+}
+
+
+int SIRCProtocol::generateStandardCommand(
+  const CommandSequence &bits,
+  PIRRX51Hardware &rx51device)
+{
+  int duration = 0;
+
+  // First, the "header" pulse:
+  rx51device.addPair(headerPulse, headerSpace);
+  duration += (headerPulse + headerSpace);
+
+  // Next, push the data.  Each key _must_ contain all 12, 15, or 20 bits.
+  // These bits are sent in reverse order.
+  duration += pushReverseBits(bits, rx51device);
+
+  return duration;
+}
+
+
+int SIRCProtocol::pushReverseBits(
+  const CommandSequence &bits,
+  PIRRX51Hardware &rx51device)
+{
+  int duration = 0;
+  CommandSequence::const_reverse_iterator i = bits.rbegin();
+  while (i != bits.rend())
+  {
+    if (*i)
+    {
+      // Send the pulse for "One":
+      rx51device.addPair(onePulse, oneSpace);
+      duration += (onePulse + oneSpace);
+    }
+    else
+    {
+      // Send the pulse for "Zero":
+      rx51device.addPair(zeroPulse, zeroSpace);
+      duration += (zeroPulse + zeroSpace);
+    }
+    ++i;
+  }
+
+  return duration;
+}
+
diff --git a/sircprotocol.h b/sircprotocol.h
new file mode 100644 (file)
index 0000000..5046f8d
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef SIRCPROTOCOL_H
+#define SIRCPROTOCOL_H
+
+#include "pirprotocol.h"
+#include "pirrx51hardware.h"
+
+//
+// The SIRC protocol is Sony's system for transmitting information via
+// infrared light.  As with the very popular "NEC" protocol, binary data is
+// encoded by varying the amount of time each bit is held: a zero is held for
+// a short span of time, a one lasts a little bit longer.
+//
+// Currently, there seem to be three types of SIRC commands; 12 bit, 15 bit,
+// and 20 bit.  In each type, it appears the last seven bits specify the
+// command, and the rest specify the device being addressed.  (The bits are
+// passed in reverse order in the actual IR stream.)
+//
+// The marvelous thing about the Sony Infrared Remote Control protocol is just
+// how simple and easy it is; just a header pulse, the command, the address,
+// and a trailer pulse.  The terrible thing about the protocol is that Sony
+// has given up on following their own rules.  Sony devices today regularly
+// support commands from a variety of addresses, making the whole concept of
+// the "address" kind of meaningless. :(  I can see why the LIRC guys would
+// give up and just encode the raw IR bits, rather than wade into this mess...
+//
+
+class SIRCProtocol: public PIRProtocol
+{
+public:
+  SIRCProtocol(
+    QObject *guiObject,
+    unsigned int index);
+
+public slots:
+  void startSendingCommand(
+    unsigned int threadableID,
+    PIRKeyName command);
+
+private:
+  unsigned int zeroPulse;
+  unsigned int zeroSpace;
+  unsigned int onePulse;
+  unsigned int oneSpace;
+
+  unsigned int headerPulse;
+  unsigned int headerSpace;
+
+  int generateStandardCommand(
+    const CommandSequence &bits,
+    PIRRX51Hardware &device);
+
+  int pushReverseBits(
+    const CommandSequence &bits,
+    PIRRX51Hardware &device);
+};
+
+#endif // SIRCPROTOCOL_H
diff --git a/www/FavoriteTab.png b/www/FavoriteTab.png
new file mode 100755 (executable)
index 0000000..54016be
Binary files /dev/null and b/www/FavoriteTab.png differ
diff --git a/www/FavoritesTab.png b/www/FavoritesTab.png
deleted file mode 100755 (executable)
index bd3ffe9..0000000
Binary files a/www/FavoritesTab.png and /dev/null differ
index cec7cc9..bf4e124 100755 (executable)
Binary files a/www/KeypadTab.png and b/www/KeypadTab.png differ
index aacfc80..8c49d94 100755 (executable)
Binary files a/www/MainTab.png and b/www/MainTab.png differ
diff --git a/www/Media2Tab.png b/www/Media2Tab.png
new file mode 100755 (executable)
index 0000000..26f4344
Binary files /dev/null and b/www/Media2Tab.png differ
index 4a61f9e..c4cb9af 100755 (executable)
Binary files a/www/MediaTab.png and b/www/MediaTab.png differ
index e687cb4..e020b4e 100755 (executable)
Binary files a/www/MenuTab.png and b/www/MenuTab.png differ
diff --git a/www/MiscTab.png b/www/MiscTab.png
deleted file mode 100755 (executable)
index ad1a991..0000000
Binary files a/www/MiscTab.png and /dev/null differ
index e7434b0..bb321da 100755 (executable)
Binary files a/www/SelectKeysetWindow.png and b/www/SelectKeysetWindow.png differ
diff --git a/www/TVTab.png b/www/TVTab.png
new file mode 100755 (executable)
index 0000000..761aae9
Binary files /dev/null and b/www/TVTab.png differ
index dd5014d..6cb1e81 100755 (executable)
Binary files a/www/UtilityTab.png and b/www/UtilityTab.png differ
index 084efcf..82fa34e 100644 (file)
@@ -89,8 +89,9 @@ controls.  The name of the current keyset is also provided in this tab.</p>
 
 <p>The Utility tab contains a selection of commonly useful controls, such as
 "Mute", "Sleep", "Input", "Closed Captions / Subtitles", and the color buttons.
-The exact selection of buttons on this tab will probably change to reflect
-which commands turn out to be the most popular.</p>
+This tab is intended to be a quick way to reach the most frequently used
+buttons; as such, the selection may be updated in future versions of Pierogi.
+</p>
 
 <h3>Keypad Tab</h3>
 
@@ -112,8 +113,9 @@ allow you to enter a second digit.</p>
 
 <p>This tab contains buttons used to enter and exit a menu, navigate within
 a menu, and select menu entries.  The "Menu" button is meant to enter the
-main system menu of a given device; the "Info" and "Guide" buttons are
-targeted towards entering other useful menus when available.</p>
+main system menu of a given device; "Guide" is a content-related menu available
+on many modern devices; and "Disc Menu" is used to access the menu interface
+provided with DVD and Blu-Ray media.</p>
 
 <h3>Media Tab</h3>
 
@@ -124,20 +126,29 @@ targeted towards entering other useful menus when available.</p>
 (often called rewind) and "Fast Forward".  A variety of other less common
 navigation controls are included, along with the "Eject" command.</p>
 
-<h3>Misc Tab</h3>
+<h3>Media2 Tab</h3>
+
+<img src="Media2Tab.png">
+
+<p>This is another page of media buttons, containing a mix of commands useful
+for DVD players, VCRs, audio devices, and possibly other devices.  The content
+of this page may change in the future.</p>
+
+<h3>TV Tab</h3>
 
-<img src="MiscTab.png">
+<img src="TVTab.png">
 
-<p>This tab contains a selection of buttons that did not fit into any of the
-previous tabs.  The content of this tab is subject to change.</p>
+<p>This page contains several more TV-oriented buttons, including controls for
+picture-in-picture, teletext, and some graphics and audio controls.  The
+content of this page is subject to change.</p>
 
-<h3>Favorites Tab</h3>
+<h3>Favorite Tab</h3>
 
-<img src="FavoritesTab.png">
+<img src="FavoriteTab.png">
 
-<p>As there are numerous keysets available in Pierogi, a "favorites" tab has
+<p>As there are numerous keysets available in Pierogi, a "Favorite" tab has
 been implemented.  To add a favorite keyset to the tab, first select that
-keyset from the "Select Keyset" window.  Then, navigate to the Favorites tab
+keyset from the "Select Keyset" window.  Then, navigate to the Favorite tab
 and press "Add Current Keyset".</p>
 
 <p>Once you have added some keysets to the favorites list, you can tell
@@ -302,14 +313,15 @@ of code once I've seen it, so I've rewritten it in C++, reorganizing it in
 an object-oriented manner along the way.</p>
 
 <p>
-Here's one way in which I disagree with the authors of LIRC: they've managed
-to cram support for practically every protocol used by every remote control
-ever made into a single codepath.  So, there's a single "transmit" function,
-sorting through a massive pile of flags, conditional statements, and some
-really funky delayed-action buffering to make everything work.  The simple act
-of splitting the code into one routine for the RC5 (biphase) protocol and
-another for the NEC (space-encoded) protocol makes it much easier to read, at
-least to my eyes.  (I haven't yet implemented the RC6 or other protocols.)
+As I have progressed in adding support for additional IR protocols, I'm
+beginning to see why the authors of the LIRC made the attempt to compress
+every possible IR protocol into a straightforward count of individual IR
+pulses.  The total number of IR protocols in use is amazing, and many of them
+(through oversight or due to the longevity of their use) are mind-numbingly
+complicated to deal with.  Still, I believe that separating the major protocols
+into their own code paths results in code that is easier to understand and
+maintain; I'm slowly moving away from the LIRC's system to my own as time
+goes on.
 </p>
 
 <p>
@@ -345,12 +357,13 @@ to the theory and practice behind consumer IR devices
 
 <li>Some <a href="http://www2.renesas.com/faq/en/mi_com/f_com_remo.html">More info on the NEC protocol</a>
 
+<li>An introduction to the <a href="http://www.sbprojects.com/knowledge/ir/sirc.php">Sony SIRC protocol</a>
+
+<li>An excellent collection of <a href="http://www.hifi-remote.com/sony/">Sony command codes</a>
+
 <li>Link to (what appears to be) source code for the N900's
 <a href="http://svn.jacekowski.org/host_mode/trunk/drivers/input/lirc/lirc_rx51.c">/dev/lirc0 device driver</a>.
 
-<li>A surprisingly decent description of how to use the
-<a href="http://www.yamahapab.com/assets/downloads/codes/Custom_Install_HB.pdf">Yamaha Remote Control</a>.
-
 <ul>
 
 </body>