Keyset update
authorJohn Pietrzak <john@pietrzak.org>
Mon, 5 Mar 2012 00:57:33 +0000 (19:57 -0500)
committerJohn Pietrzak <john@pietrzak.org>
Mon, 5 Mar 2012 00:57:33 +0000 (19:57 -0500)
In celebration of finally supporting the XMP protocol, a number of keysets
have finally been entered (Dreambox, Thomson, and Telenet).  Also added
keysets for Magnum and Genius.

24 files changed:
keysets/dreambox.cpp [new file with mode: 0644]
keysets/dreambox.h [new file with mode: 0644]
keysets/genius.cpp [new file with mode: 0644]
keysets/genius.h [new file with mode: 0644]
keysets/magnum.cpp [new file with mode: 0644]
keysets/magnum.h [new file with mode: 0644]
keysets/mce.cpp
keysets/telenet.cpp [new file with mode: 0644]
keysets/telenet.h [new file with mode: 0644]
keysets/thomson.cpp [new file with mode: 0644]
keysets/thomson.h [new file with mode: 0644]
pierogi.pro
pierogi.pro.user
pirkeysetmanager.cpp
pirkeysetmetadata.cpp
pirkeysetmetadata.h
pirmakenames.cpp
pirmakenames.h
protocols/pirprotocol.cpp
protocols/pirprotocol.h
protocols/xmpprotocol.cpp [new file with mode: 0644]
protocols/xmpprotocol.h [new file with mode: 0644]
qtc_packaging/debian_fremantle/changelog
qtc_packaging/debian_fremantle/control

diff --git a/keysets/dreambox.cpp b/keysets/dreambox.cpp
new file mode 100644 (file)
index 0000000..5581aaf
--- /dev/null
@@ -0,0 +1,408 @@
+#include "dreambox.h"
+#include "protocols/xmpprotocol.h"
+#include "protocols/necprotocol.h"
+
+
+DreamboxSat1::DreamboxSat1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Dreambox Keyset 1",
+      Dreambox_Make,
+      index)
+{
+}
+
+
+void DreamboxSat1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new XMPProtocol(
+    guiObject, index, 0x0, 0x0, 0x44, 0x1A, false);
+
+  addXMPKey("0", Zero_Key, 0x00, 0x00);
+  addXMPKey("1", One_Key, 0x01, 0x00);
+  addXMPKey("2", Two_Key, 0x02, 0x00);
+  addXMPKey("3", Three_Key, 0x03, 0x00);
+  addXMPKey("4", Four_Key, 0x04, 0x00);
+  addXMPKey("5", Five_Key, 0x05, 0x00);
+  addXMPKey("6", Six_Key, 0x06, 0x00);
+  addXMPKey("7", Seven_Key, 0x07, 0x00);
+  addXMPKey("8", Eight_Key, 0x08, 0x00);
+  addXMPKey("9", Nine_Key, 0x09, 0x00);
+  addXMPKey("vol+", VolumeUp_Key, 0x0A, 0x00);
+  addXMPKey("vol-", VolumeDown_Key, 0x0B, 0x00);
+  addXMPKey("tv_stop", Input_Key, 0x0C, 0x00);
+  addXMPKey("tv_stop", Stop_Key, 0x0C, 0x00);
+  addXMPKey("bouquet+", ChannelUp_Key, 0x0D, 0x00);
+  addXMPKey("bouquet-", ChannelDown_Key, 0x0E, 0x00);
+  addXMPKey("power", Power_Key, 0x0F, 0x00);
+  addXMPKey("dream (menu)", Menu_Key, 0x20, 0x00);
+  addXMPKey("arrow up", Up_Key, 0x21, 0x00);
+  addXMPKey("arrow down", Down_Key, 0x22, 0x00);
+  addXMPKey("arrow left", Left_Key, 0x23, 0x00);
+  addXMPKey("arrow right", Right_Key, 0x24, 0x00);
+  addXMPKey("ok", Select_Key, 0x25, 0x00);
+  addXMPKey("audio", SoundMode_Key, 0x26, 0x00);
+  addXMPKey("video", PictureMode_Key, 0x27, 0x00);
+  addXMPKey("info", Info_Key, 0x28, 0x00);
+  addXMPKey("SHIFT-RED", Rewind_Key, 0x30, 0x00);
+  addXMPKey("SHIFT-GREEN", Play_Key, 0x31, 0x00);
+  addXMPKey("SHIFT-YELLOW", Pause_Key, 0x32, 0x00);
+  addXMPKey("SHIFT-BLUE", FastForward_Key, 0x33, 0x00);
+  addXMPKey("SHIFT-MUTE", Unmapped_Key, 0x34, 0x00);
+  addXMPKey("SHIFT-RADIO", Record_Key, 0x35, 0x00);
+  addXMPKey("red", Red_Key, 0x40, 0x00);
+  addXMPKey("green", Green_Key, 0x41, 0x00);
+  addXMPKey("yellow", Yellow_Key, 0x42, 0x00);
+  addXMPKey("blue", Blue_Key, 0x43, 0x00);
+  addXMPKey("mute", Mute_Key, 0x44, 0x00);
+  addXMPKey("text", Teletext_Key, 0x45, 0x00);
+  addXMPKey("forward >", Next_Key, 0x50, 0x00);
+  addXMPKey("back <", Previous_Key, 0x51, 0x00);
+  addXMPKey("lame! (esc)", Exit_Key, 0x52, 0x00);
+  addXMPKey("radio", TunerInput_Key, 0x53, 0x00);
+  addXMPKey("help", Guide_Key, 0x54, 0x00);
+  addXMPKey("discrete_off", PowerOff_Key, 0xB4, 0x00);
+  addXMPKey("discrete_on", PowerOn_Key, 0xE8, 0x00);
+}
+
+
+DreamboxSat1a::DreamboxSat1a(
+  unsigned int index)
+  : DreamboxSat1(index)
+{
+  setKeysetName("Dreambox Keyset 1a");
+}
+
+
+void DreamboxSat1a::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  DreamboxSat1::populateProtocol(guiObject);
+
+  addXMPKey("mute", Mute_Key, 0x0C, 0x00);
+  addXMPKey("tv", Input_Key, 0x44, 0x00);
+  addXMPKey("help", Guide_Key, 0x52, 0x00);
+  addXMPKey("LAME", Exit_Key, 0x54, 0x00);
+  addXMPKey("rewind", Rewind_Key, 0x55, 0x00);
+  addXMPKey("play", Play_Key, 0x56, 0x00);
+  addXMPKey("forward", FastForward_Key, 0x57, 0x00);
+  addXMPKey("pause", Pause_Key, 0x58, 0x00);
+  addXMPKey("stop", Stop_Key, 0x59, 0x00);
+}
+
+
+DreamboxSat1b::DreamboxSat1b(
+  unsigned int index)
+  : DreamboxSat1(index)
+{
+  setKeysetName("Dreambox Keyset 1b");
+}
+
+
+void DreamboxSat1b::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  DreamboxSat1::populateProtocol(guiObject);
+
+  addXMPKey("mute", Mute_Key, 0x0C, 0x00);
+  addXMPKey("rewind", Rewind_Key, 0x40, 0x00);
+  addXMPKey("play", Play_Key, 0x41, 0x00);
+  addXMPKey("pause", Pause_Key, 0x42, 0x00);
+  addXMPKey("forward", FastForward_Key, 0x43, 0x00);
+  addXMPKey("tv", Input_Key, 0x44, 0x00);
+  addXMPKey("PgUp", PageUp_Key, 0x50, 0x00);
+  addXMPKey("PgDn", PageDown_Key, 0x51, 0x00);
+  addXMPKey("record", Record_Key, 0x53, 0x00);
+  addXMPKey("exit", Exit_Key, 0x54, 0x00);
+}
+
+
+DreamboxSat1c::DreamboxSat1c(
+  unsigned int index)
+  : DreamboxSat1(index)
+{
+  setKeysetName("Dreambox Keyset 1c");
+}
+
+
+void DreamboxSat1c::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  DreamboxSat1::populateProtocol(guiObject);
+
+  addKey("rewind", Rewind_Key, 0x40, 0x00);
+  addKey("play", Play_Key, 0x41, 0x00);
+  addKey("pause", Pause_Key, 0x42, 0x00);
+  addKey("forward", FastForward_Key, 0x43, 0x00);
+  addKey("record", Record_Key, 0x53, 0x00);
+  addKey("PowerOff", PowerOff_Key, 0x60, 0x00);
+  addKey("PowerOn", PowerOn_Key, 0x61, 0x00);
+}
+
+
+DreamboxSat2::DreamboxSat2(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Dreambox Keyset 2",
+      Dreambox_Make,
+      index)
+{
+}
+
+
+void DreamboxSat2::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new XMPProtocol(
+    guiObject, index, 0x3, 0x1, 0x44, 0x1A, false);
+
+  addXMPKey("0", Zero_Key, 0x00, 0x00);
+  addXMPKey("1", One_Key, 0x01, 0x00);
+  addXMPKey("2", Two_Key, 0x02, 0x00);
+  addXMPKey("3", Three_Key, 0x03, 0x00);
+  addXMPKey("4", Four_Key, 0x04, 0x00);
+  addXMPKey("5", Five_Key, 0x05, 0x00);
+  addXMPKey("6", Six_Key, 0x06, 0x00);
+  addXMPKey("7", Seven_Key, 0x07, 0x00);
+  addXMPKey("8", Eight_Key, 0x08, 0x00);
+  addXMPKey("9", Nine_Key, 0x09, 0x00);
+  addXMPKey("vol+", VolumeUp_Key, 0x0A, 0x00);
+  addXMPKey("vol-", VolumeDown_Key, 0x0B, 0x00);
+  addXMPKey("tv_stop", Input_Key, 0x0C, 0x00);
+  addXMPKey("bouquet+", ChannelUp_Key, 0x0D, 0x00);
+  addXMPKey("bouquet-", ChannelDown_Key, 0x0E, 0x00);
+  addXMPKey("power", Power_Key, 0x0F, 0x00);
+  addXMPKey("dream (menu)", Menu_Key, 0x20, 0x00);
+  addXMPKey("arrow up", Up_Key, 0x21, 0x00);
+  addXMPKey("arrow down", Down_Key, 0x22, 0x00);
+  addXMPKey("arrow left", Left_Key, 0x23, 0x00);
+  addXMPKey("arrow right", Right_Key, 0x24, 0x00);
+  addXMPKey("ok", Select_Key, 0x25, 0x00);
+  addXMPKey("audio", SoundMode_Key, 0x26, 0x00);
+  addXMPKey("video", PictureMode_Key, 0x27, 0x00);
+  addXMPKey("info", Info_Key, 0x28, 0x00);
+  addXMPKey("rewind", Rewind_Key, 0x30, 0x00);
+  addXMPKey("play", Play_Key, 0x31, 0x00);
+  addXMPKey("pause", Pause_Key, 0x31, 0x00);
+  addXMPKey("forward", FastForward_Key, 0x33, 0x00);
+  addXMPKey("stop", Stop_Key, 0x34, 0x00);
+  addXMPKey("record", Record_Key, 0x35, 0x00);
+  addXMPKey("red", Red_Key, 0x40, 0x00);
+  addXMPKey("green", Green_Key, 0x41, 0x00);
+  addXMPKey("yellow", Yellow_Key, 0x42, 0x00);
+  addXMPKey("blue", Blue_Key, 0x43, 0x00);
+  addXMPKey("mute", Mute_Key, 0x44, 0x00);
+  addXMPKey("text", Teletext_Key, 0x45, 0x00);
+  addXMPKey("PgUp", PageUp_Key, 0x50, 0x00);
+  addXMPKey("PgDn", PageDown_Key, 0x51, 0x00);
+  addXMPKey("exit", Exit_Key, 0x52, 0x00);
+  addXMPKey("radio", TunerInput_Key, 0x53, 0x00);
+  addXMPKey("help", Guide_Key, 0x54, 0x00);
+//  addXMPKey("discrete_off", PowerOff_Key, 0xB4, 0x00);
+//  addXMPKey("discrete_on", PowerOn_Key, 0xE8, 0x00);
+}
+
+
+DreamboxSat3::DreamboxSat3(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Dreambox Keyset 3",
+      Dreambox_Make,
+      index)
+{
+}
+
+
+void DreamboxSat3::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, false, true);
+
+  setPreData(0x32, 8);
+
+  addKey("Power", Power_Key, 0x00, 8);
+  addKey("num_1", One_Key, 0x01, 8);
+  addKey("num_2", Two_Key, 0x02, 8);
+  addKey("num_3", Three_Key, 0x03, 8);
+  addKey("num_4", Four_Key, 0x04, 8);
+  addKey("num_5", Five_Key, 0x05, 8);
+  addKey("num_6", Six_Key, 0x06, 8);
+  addKey("num_7", Seven_Key, 0x07, 8);
+  addKey("num_8", Eight_Key, 0x08, 8);
+  addKey("num_9", Nine_Key, 0x09, 8);
+  addKey("Skip-", Previous_Key, 0x0A, 8);
+  addKey("num_0", Zero_Key, 0x0B, 8);
+  addKey("Skip+", Next_Key, 0x0C, 8);
+  addKey("Audio", SoundMode_Key, 0x0E, 8);
+  addKey("Info", Info_Key, 0x10, 8);
+  addKey("up_arrow", Up_Key, 0x11, 8);
+  addKey("Menu", Menu_Key, 0x12, 8);
+  addKey("left_arrow", Left_Key, 0x13, 8);
+  addKey("Select", Select_Key, 0x14, 8);
+  addKey("right_arrow", Right_Key, 0x15, 8);
+  addKey("down_arrow", Down_Key, 0x17, 8);
+  addKey("PVR", HDDInput_Key, 0x18, 8);
+  addKey("Vol+", VolumeUp_Key, 0x19, 8);
+  addKey("Mute", Mute_Key, 0x1A, 8);
+  addKey("Page-", PageDown_Key, 0x1B, 8);
+  addKey("Vol-", VolumeDown_Key, 0x1C, 8);
+  addKey("exit", Exit_Key, 0x1D, 8);
+  addKey("Page+", PageUp_Key, 0x1E, 8);
+  addKey("Red", Red_Key, 0x1F, 8);
+  addKey("Green", Green_Key, 0x20, 8);
+  addKey("Yellow", Yellow_Key, 0x21, 8);
+  addKey("Blue", Blue_Key, 0x22, 8);
+  addKey("rewind", Rewind_Key, 0x23, 8);
+  addKey("Play", Play_Key, 0x24, 8);
+  addKey("Pause", Pause_Key, 0x24, 8);
+  addKey("Stop", Stop_Key, 0x25, 8);
+  addKey("ffwd", FastForward_Key, 0x26, 8);
+  addKey("TV", Input_Key, 0x27, 8);
+  addKey("Radio", TunerInput_Key, 0x28, 8);
+  addKey("Teletext", Teletext_Key, 0x29, 8);
+  addKey("Record", Record_Key, 0x2A, 8);
+}
+
+
+DreamboxSat4::DreamboxSat4(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Dreambox Keyset 4",
+      Dreambox_Make,
+      index)
+{
+}
+
+
+void DreamboxSat4::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, true, true);
+
+  setPreData(0x0000, 16);
+
+  addKey("channel up", ChannelUp_Key, 0x00, 8);
+  addKey("up arrow", Up_Key, 0x00, 8);
+  addKey("channel down", ChannelDown_Key, 0x01, 8);
+  addKey("down arrow", Down_Key, 0x01, 8);
+  addKey("right arrow", Right_Key, 0x02, 8);
+  addKey("left arrow", Left_Key, 0x03, 8);
+  addKey("menu", Menu_Key, 0x05, 8);
+  addKey("exit", Exit_Key, 0x07, 8);
+  addKey("power", Power_Key, 0x0A, 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("last (prev ch)", PrevChannel_Key, 0x1B, 8);
+  addKey("program guide", Guide_Key, 0x1E, 8);
+  addKey("select", Select_Key, 0x1F, 8);
+  addKey("display", Info_Key, 0x40, 8);
+}
+
+
+DreamboxSat5::DreamboxSat5(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Dreambox Keyset 5",
+      Dreambox_Make,
+      index)
+{
+}
+
+
+void DreamboxSat5::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, false, true);
+
+  setPreData(0x10, 8);
+
+  addKey("9", Nine_Key, 0x02, 8);
+  addKey("8", Eight_Key, 0x03, 8);
+  addKey("last (prev ch)", PrevChannel_Key, 0x06, 8);
+  addKey("0", Zero_Key, 0x07, 8);
+  addKey("menu", Menu_Key, 0x0A, 8);
+  addKey("channel up", ChannelUp_Key, 0x0B, 8);
+  addKey("up arrow", Up_Key, 0x0B, 8);
+  addKey("right arrow", Right_Key, 0x0E, 8);
+  addKey("select", Select_Key, 0x0F, 8);
+  addKey("exit", Exit_Key, 0x12, 8);
+  addKey("channel down", ChannelDown_Key, 0x13, 8);
+  addKey("down arrow", Down_Key, 0x13, 8);
+  addKey("favourite", Favorites_Key, 0x16, 8);
+  addKey("subtitle", Captions_Key, 0x17, 8);
+  addKey("blue", Blue_Key, 0x1A, 8);
+  addKey("yellow", Yellow_Key, 0x1B, 8);
+  addKey("power", Power_Key, 0x40, 8);
+  addKey("6", Six_Key, 0x41, 8);
+  addKey("7", Seven_Key, 0x42, 8);
+  addKey("2", Two_Key, 0x44, 8);
+  addKey("5", Five_Key, 0x45, 8);
+  addKey("tv/radio", Input_Key, 0x46, 8);
+  addKey("1", One_Key, 0x48, 8);
+  addKey("display", Info_Key, 0x4A, 8);
+  addKey("3", Three_Key, 0x4C, 8);
+  addKey("4", Four_Key, 0x4D, 8);
+  addKey("left arrow", Left_Key, 0x4E, 8);
+  addKey("program guide", Guide_Key, 0x52, 8);
+  addKey("teletext", Teletext_Key, 0x54, 8);
+  addKey("audio", SoundMode_Key, 0x56, 8);
+  addKey("green", Green_Key, 0x58, 8);
+  addKey("red", Red_Key, 0x5A, 8);
+}
diff --git a/keysets/dreambox.h b/keysets/dreambox.h
new file mode 100644 (file)
index 0000000..64cce64
--- /dev/null
@@ -0,0 +1,88 @@
+#ifndef DREAMBOX_H
+#define DREAMBOX_H
+
+#include "pirkeysetmetadata.h"
+
+class QObject;
+
+class DreamboxSat1: public PIRKeysetMetaData
+{
+public:
+  DreamboxSat1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class DreamboxSat1a: public DreamboxSat1
+{
+public:
+  DreamboxSat1a(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class DreamboxSat1b: public DreamboxSat1
+{
+public:
+  DreamboxSat1b(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class DreamboxSat1c: public DreamboxSat1
+{
+public:
+  DreamboxSat1c(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class DreamboxSat2: public PIRKeysetMetaData
+{
+public:
+  DreamboxSat2(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class DreamboxSat3: public PIRKeysetMetaData
+{
+public:
+  DreamboxSat3(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class DreamboxSat4: public PIRKeysetMetaData
+{
+public:
+  DreamboxSat4(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class DreamboxSat5: public PIRKeysetMetaData
+{
+public:
+  DreamboxSat5(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+#endif // DREAMBOX_H
diff --git a/keysets/genius.cpp b/keysets/genius.cpp
new file mode 100644 (file)
index 0000000..8b9e1b0
--- /dev/null
@@ -0,0 +1,40 @@
+#include "genius.h"
+#include "protocols/lircprotocol.h"
+
+
+GeniusSpeakers1::GeniusSpeakers1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Speaker Keyset 1",
+      Genius_Make,
+      index)
+{
+}
+
+
+void GeniusSpeakers1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  LIRCProtocol *lp = new LIRCProtocol(
+    guiObject, index,
+    359, 1327,
+    1202, 484,
+    53977, true);
+
+  threadableProtocol = lp;
+
+  lp->setTrailerPulse(359);
+
+  setPreData(0x6, 3);
+
+  addKey("POWER", Power_Key, 0x50, 8);
+  addKey("MUTE", Mute_Key, 0x48, 8);
+  addKey("VOL_DOWN", VolumeDown_Key, 0x88, 8);
+  addKey("VOL_UP", VolumeUp_Key, 0x90, 8);
+}
diff --git a/keysets/genius.h b/keysets/genius.h
new file mode 100644 (file)
index 0000000..4fc017a
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef GENIUS_H
+#define GENIUS_H
+
+#include "pirkeysetmetadata.h"
+
+class QObject;
+
+class GeniusSpeakers1: public PIRKeysetMetaData
+{
+public:
+  GeniusSpeakers1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+#endif // GENIUS_H
diff --git a/keysets/magnum.cpp b/keysets/magnum.cpp
new file mode 100644 (file)
index 0000000..7005fd7
--- /dev/null
@@ -0,0 +1,64 @@
+#include "magnum.h"
+#include "protocols/rc5protocol.h"
+
+
+MagnumTV1::MagnumTV1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "TV Keyset 1",
+      Magnum_Make,
+      index)
+{
+}
+
+
+void MagnumTV1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new RC5Protocol(guiObject, index);
+
+  addKey("OK", Select_Key, 0x0057, 13);
+  addKey("TOP10", Favorites_Key, 0x0058, 13);
+  addKey("CONTRAST+", ContrastUp_Key, 0x0070, 13);
+  addKey("CONTRAST-", ContrastDown_Key, 0x0071, 13);
+
+  addKey("AV", CableInput_Key, 0x1040, 13);
+  addKey("1", One_Key, 0x1041, 13);
+  addKey("2", Two_Key, 0x1042, 13);
+  addKey("3", Three_Key, 0x1043, 13);
+  addKey("4", Four_Key, 0x1044, 13);
+  addKey("5", Five_Key, 0x1045, 13);
+  addKey("6", Six_Key, 0x1046, 13);
+  addKey("7", Seven_Key, 0x1047, 13);
+  addKey("8", Eight_Key, 0x1048, 13);
+  addKey("9", Nine_Key, 0x1049, 13);
+  addKey("POWER", Power_Key, 0x104D, 13);
+
+  addKey("TV", Input_Key, 0x1051, 13);
+  addKey("EYE", Unmapped_Key, 0x1052, 13);
+  addKey("MUTE", Mute_Key, 0x1053, 13);
+  addKey("RED", Red_Key, 0x1054, 13);
+  addKey("GREEN", Green_Key, 0x1055, 13);
+  addKey("YELLOW", Yellow_Key, 0x1056, 13);
+  addKey("BLUE", Blue_Key, 0x1057, 13);
+
+  addKey("P+", ChannelUp_Key, 0x1060, 13);
+  addKey("P+", Up_Key, 0x1060, 13);
+  addKey("P-", ChannelDown_Key, 0x1061, 13);
+  addKey("P-", Down_Key, 0x1061, 13);
+  addKey("BRIGHTNESS-", BrightnessDown_Key, 0x1065, 13);
+  addKey("BRIGHTNESS+", BrightnessUp_Key, 0x1066, 13);
+  addKey("HELP", Guide_Key, 0x1069, 13);
+
+  addKey("LEFT", Left_Key, 0x1075, 13);
+  addKey("LEFT", VolumeDown_Key, 0x1075, 13); // just guessing here
+  addKey("RIGHT", Right_Key, 0x1076, 13);
+  addKey("RIGHT", VolumeUp_Key, 0x1076, 13);  // more guesswork
+  addKey("MENU", Menu_Key, 0x1077, 13);
+}
diff --git a/keysets/magnum.h b/keysets/magnum.h
new file mode 100644 (file)
index 0000000..77bfbd7
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef MAGNUM_H
+#define MAGNUM_H
+
+#include "pirkeysetmetadata.h"
+
+class QObject;
+
+class MagnumTV1: public PIRKeysetMetaData
+{
+public:
+  MagnumTV1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+#endif // MAGNUM_H
index 460d650..27ccf08 100644 (file)
@@ -8,7 +8,7 @@ MCERemote1::MCERemote1(
       Microsoft_Make,
       index)
 {
-  addControlledDevice(Any_Make, "ASRock HT330", Computer_Device);
+  addControlledDevice(Microsoft_Make, "Windows PC ASRock HT330", Computer_Device);
 }
 
 
diff --git a/keysets/telenet.cpp b/keysets/telenet.cpp
new file mode 100644 (file)
index 0000000..9b2f6f4
--- /dev/null
@@ -0,0 +1,71 @@
+#include "telenet.h"
+#include "protocols/xmpprotocol.h"
+
+
+TelenetSTB1::TelenetSTB1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "STB Keyset 1",
+      Telenet_Make,
+      index)
+{
+}
+
+
+void TelenetSTB1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new XMPProtocol(
+    guiObject, index, 0x1, 0x1, 0x44, 0x2A, false);
+
+  addXMPKey("del", Unmapped_Key, 0x00, 0x00);
+  addXMPKey("2", Two_Key, 0x01, 0x00);
+  addXMPKey("3", Three_Key, 0x02, 0x00);
+  addXMPKey("4", Four_Key, 0x03, 0x00);
+  addXMPKey("5", Five_Key, 0x04, 0x00);
+  addXMPKey("6", Six_Key, 0x05, 0x00);
+  addXMPKey("7", Seven_Key, 0x06, 0x00);
+  addXMPKey("8", Eight_Key, 0x07, 0x00);
+  addXMPKey("9", Nine_Key, 0x08, 0x00);
+  addXMPKey("mute", Mute_Key, 0x09, 0x00);
+  addXMPKey("right", Right_Key, 0x0B, 0x00);
+  addXMPKey("1", One_Key, 0x0F, 0x00);
+
+  addXMPKey("kiosk", Unmapped_Key, 0x20, 0x00);
+  addXMPKey("comm", Unmapped_Key, 0x21, 0x00);
+  addXMPKey("smiley", Unmapped_Key, 0x22, 0x00);
+  addXMPKey("chup", ChannelUp_Key, 0x23, 0x00);
+  addXMPKey("tvgids", Unmapped_Key, 0x24, 0x00);
+  addXMPKey("chdown", ChannelDown_Key, 0x25, 0x00);
+  addXMPKey("tvtheek", Unmapped_Key, 0x26, 0x00);
+  addXMPKey("voldown", VolumeDown_Key, 0x28, 0x00);
+
+  addXMPKey("yellow", Yellow_Key, 0x30, 0x00);
+  addXMPKey("blue", Blue_Key, 0x31, 0x00);
+  addXMPKey("screen", Unmapped_Key, 0x32, 0x00);
+  addXMPKey("previous", Previous_Key, 0x33, 0x00);
+  addXMPKey("next", Next_Key, 0x34, 0x00);
+  addXMPKey("help", Unmapped_Key, 0x35, 0x00);
+  addXMPKey("pause", Pause_Key, 0x36, 0x00);
+  addXMPKey("play", Play_Key, 0x37, 0x00);
+  addXMPKey("stop", Stop_Key, 0x38, 0x00);
+
+  addXMPKey("back", PrevChannel_Key, 0x40, 0x00);
+  addXMPKey("exit", Exit_Key, 0x41, 0x00);
+  addXMPKey("red", Red_Key, 0x42, 0x00);
+  addXMPKey("green", Green_Key, 0x43, 0x00);
+  addXMPKey("power", Power_Key, 0x44, 0x00);
+  addXMPKey("left", Left_Key, 0x45, 0x00);
+
+  addXMPKey("volup", VolumeUp_Key, 0x50, 0x00);
+  addXMPKey("0", Zero_Key, 0x51, 0x00);
+  addXMPKey("up", Up_Key, 0x52, 0x00);
+  addXMPKey("down", Down_Key, 0x53, 0x00);
+  addXMPKey("ok", Select_Key, 0x54, 0x00);
+}
diff --git a/keysets/telenet.h b/keysets/telenet.h
new file mode 100644 (file)
index 0000000..1db44ec
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef TELENET_H
+#define TELENET_H
+
+#include "pirkeysetmetadata.h"
+
+class QObject;
+
+class TelenetSTB1: public PIRKeysetMetaData
+{
+public:
+  TelenetSTB1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+#endif // TELENET_H
diff --git a/keysets/thomson.cpp b/keysets/thomson.cpp
new file mode 100644 (file)
index 0000000..aa56a3c
--- /dev/null
@@ -0,0 +1,404 @@
+#include "thomson.h"
+#include "protocols/xmpprotocol.h"
+#include "protocols/thomsonprotocol.h"
+#include "protocols/necprotocol.h"
+
+
+ThomsonConverter1::ThomsonConverter1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Converter Keyset 1",
+      Thomson_Make,
+      index)
+{
+}
+
+
+void ThomsonConverter1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new XMPProtocol(
+    guiObject, index, 0x1, 0x0, 0x44, 0x3E, false);
+
+  addXMPKey("KEY_1", One_Key, 0x01, 0x00);
+  addXMPKey("KEY_2", Two_Key, 0x02, 0x00);
+  addXMPKey("KEY_3", Three_Key, 0x03, 0x00);
+  addXMPKey("KEY_4", Four_Key, 0x04, 0x00);
+  addXMPKey("KEY_5", Five_Key, 0x05, 0x00);
+  addXMPKey("KEY_6", Six_Key, 0x06, 0x00);
+  addXMPKey("KEY_7", Seven_Key, 0x07, 0x00);
+  addXMPKey("KEY_8", Eight_Key, 0x08, 0x00);
+  addXMPKey("KEY_9", Nine_Key, 0x09, 0x00);
+  addXMPKey("KEY_0", Zero_Key, 0x00, 0x00);
+  addXMPKey("KEY_CHANNELDOWN", ChannelDown_Key, 0x0E, 0x00);
+  addXMPKey("KEY_CHANNELUP", ChannelUp_Key, 0x0D, 0x00);
+  addXMPKey("KEY_MUTE", Mute_Key, 0x0C, 0x00);
+  addXMPKey("KEY_VOLUMEDOWN", VolumeDown_Key, 0x0B, 0x00);
+  addXMPKey("KEY_VOLUMEUP", VolumeUp_Key, 0x0A, 0x00);
+  addXMPKey("KEY_LANGUAGE", Audio_Key, 0x82, 0x00);
+  addXMPKey("KEY_INFO", Info_Key, 0x26, 0x00);
+  addXMPKey("KEY_ENTER", Enter_Key, 0x25, 0x00);
+  addXMPKey("KEY_LAST", PrevChannel_Key, 0x51, 0x00);
+}
+
+
+ThomsonTV1::ThomsonTV1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "TV/DVR Keyset 1",
+      Thomson_Make,
+      index)
+{
+}
+
+
+void ThomsonTV1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new ThomsonProtocol(guiObject, index);
+
+  setPreData(0x3, 4);
+
+  addKey("1", One_Key, 0x00, 7);
+  addKey("4", Four_Key, 0x01, 7);
+  addKey("7", Seven_Key, 0x02, 7);
+  addKey("REPLAY", Replay_Key, 0x03, 7);
+  addKey("WIDE", AspectRatio_Key, 0x04, 7);
+  addKey("MUTE", Mute_Key, 0x05, 7);
+  addKey("SUBTITLES", Captions_Key, 0x06, 7);
+  addKey("2", Two_Key, 0x08, 7);
+  addKey("5", Five_Key, 0x09, 7);
+  addKey("8", Eight_Key, 0x0A, 7);
+  addKey("UP", Up_Key, 0x0B, 7);
+  addKey("OK", Select_Key, 0x0C, 7);
+  addKey("DOWN", Down_Key, 0x0D, 7);
+  addKey("0", Zero_Key, 0x0E, 7);
+//  addKey("0/--", DoubleDigit_Key, 0x0E, 7);
+
+  addKey("3", Three_Key, 0x10, 7);
+  addKey("6", Six_Key, 0x11, 7);
+  addKey("9", Nine_Key, 0x12, 7);
+  addKey("GUIDE", Guide_Key, 0x15, 7);
+  addKey("Blue", Blue_Key, 0x15, 7);
+  addKey("LIVE", LiveTV_Key, 0x16, 7);
+  addKey("AV", Input_Key, 0x18, 7);
+  addKey("tvtouche", Unmapped_Key, 0x1C, 7);
+  addKey("POWER", Power_Key, 0x1D, 7);
+  addKey("TEXT", Teletext_Key, 0x1E, 7); // "Magenta"
+
+  addKey("REV", Rewind_Key, 0x20, 7);
+  addKey("PLAY", Play_Key, 0x21, 7);
+  addKey("FWD", FastForward_Key, 0x23, 7);
+  addKey("-/--", DoubleDigit_Key, 0x24, 7); // "nn", "tventer"
+  addKey("CHNEXT", ChannelUp_Key, 0x25, 7); // "PR+"
+  addKey("CHPREV", ChannelDown_Key, 0x27, 7); // "PR-"
+  addKey("RETURN", PrevChannel_Key, 0x28, 7);
+  addKey("VOLUP", VolumeUp_Key, 0x29, 7);
+  addKey("VOLDOWN", VolumeDown_Key, 0x2A, 7);
+  addKey("Videotext_Halt", TeletextHold_Key, 0x2B, 7); // "OPT"
+  addKey("REC", Record_Key, 0x2C, 7);
+  addKey("STOP", Stop_Key, 0x2D, 7);
+  addKey("PAUSE", Pause_Key, 0x2E, 7);
+
+  addKey("MENU", Menu_Key, 0x31, 7);
+  addKey("LEFT", Left_Key, 0x36, 7);
+  addKey("RIGHT", Right_Key, 0x37, 7);
+  addKey("INFO", Info_Key, 0x38, 7);
+  addKey("Yellow", Yellow_Key, 0x38, 7);
+  addKey("Red", Red_Key, 0x39, 7); // "PRESETS", "tv_lock"
+  addKey("Green", Green_Key, 0x3B, 7); // "LIST", "tv_timer"
+  addKey("EXIT", Exit_Key, 0x3E, 7);
+
+  addKey("Videotext_Info", Unmapped_Key, 0x7F, 7);
+}
+
+
+ThomsonVCR1::ThomsonVCR1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "VCR Keyset 1",
+      Thomson_Make,
+      index)
+{
+}
+
+
+void ThomsonVCR1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new ThomsonProtocol(guiObject, index);
+
+  setPreData(0x0, 4);
+
+  addKey("1", One_Key, 0x00, 7);
+  addKey("4", Four_Key, 0x01, 7);
+  addKey("7", Seven_Key, 0x02, 7);
+  addKey("vcr_mode", Mode_Key, 0x04, 7);
+  addKey("SP/LP", VHSSpeed_Key, 0x05, 7); // "vcr_again" -- odd
+  addKey("2", Two_Key, 0x08, 7);
+  addKey("5", Five_Key, 0x09, 7);
+  addKey("8", Eight_Key, 0x0A, 7);
+  addKey("0", Zero_Key, 0x0E, 7);
+
+  addKey("3", Three_Key, 0x10, 7);
+  addKey("6", Six_Key, 0x11, 7);
+  addKey("9", Nine_Key, 0x12, 7);
+  addKey("GUIDE", Guide_Key, 0x15, 7);
+  addKey("Blue", Blue_Key, 0x15, 7);
+  addKey("AV", Input_Key, 0x18, 7);
+  addKey("POWER", Power_Key, 0x1D, 7);
+  addKey("Magenta", Teletext_Key, 0x1E, 7); // "TEXT"
+  addKey("Rew", Rewind_Key, 0x1F, 7);
+
+  addKey("Play", Play_Key, 0x20, 7);
+  addKey("F_FWD", FastForward_Key, 0x21, 7);
+  addKey("Pause", Pause_Key, 0x22, 7);
+  addKey("Rec", Record_Key, 0x23, 7);
+  addKey("Stop", Stop_Key, 0x24, 7);
+  addKey("vcr_open", Eject_Key, 0x26, 7);
+  addKey("vcr_return", PrevChannel_Key, 0x28, 7);
+  addKey("CHANNRL+", ChannelUp_Key, 0x29, 7);
+  addKey("CHANNEL-", ChannelDown_Key, 0x2A, 7);
+
+  addKey("MENU", Menu_Key, 0x31, 7);
+  addKey("OK", Select_Key, 0x33, 7);
+  addKey("UP", Up_Key, 0x34, 7);
+  addKey("DOWN", Down_Key, 0x35, 7);
+  addKey("LEFT", Left_Key, 0x36, 7);
+  addKey("RIGHT", Right_Key, 0x37, 7);
+  addKey("INFO", Info_Key, 0x38, 7);
+  addKey("YELLOW", Yellow_Key, 0x38, 7);
+  addKey("RED", Red_Key, 0x39, 7); // "vcr_Lock"
+  addKey("GREEN", Green_Key, 0x3B, 7);
+  addKey("vcr_timer", Timer_Key, 0x3B, 7);
+  addKey("INDEX_MARK", Unmapped_Key, 0x3C, 7); // "vcr_zoom"?
+  addKey("Reset_counter", Reset_Key, 0x3D, 7);
+  addKey("EXIT", Exit_Key, 0x3E, 7); // "vcr_clear" -- need child keyset?
+}
+
+
+ThomsonVCR1a::ThomsonVCR1a(
+  unsigned int index)
+  : ThomsonVCR1(index)
+{
+  setKeysetName("VCR Keyset 1a");
+}
+
+
+void ThomsonVCR1a::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  ThomsonVCR1::populateProtocol(guiObject);
+
+  setPreData(0xA, 4);
+}
+
+
+ThomsonDVD1::ThomsonDVD1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "DVD Keyset 1",
+      Thomson_Make,
+      index)
+{
+}
+
+
+void ThomsonDVD1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new ThomsonProtocol(guiObject, index);
+
+  setPreData(0x4, 4);
+
+  addKey("1", One_Key, 0x00, 7);
+  addKey("4", Four_Key, 0x01, 7);
+  addKey("7", Seven_Key, 0x02, 7);
+  addKey("dvd_mode", Mode_Key, 0x05, 7);
+  addKey("2", Two_Key, 0x08, 7);
+  addKey("5", Five_Key, 0x09, 7);
+  addKey("8", Eight_Key, 0x0A, 7);
+  addKey("0", Zero_Key, 0x0E, 7);
+
+  addKey("3", Three_Key, 0x10, 7);
+  addKey("6", Six_Key, 0x11, 7);
+  addKey("9", Nine_Key, 0x12, 7);
+  addKey("YELLOW", Yellow_Key, 0x14, 7);
+  addKey("dvd_info", Info_Key, 0x14, 7);
+  addKey("BLUE", Blue_Key, 0x15, 7);
+  addKey("dvd_title", DiscTitle_Key, 0x15, 7);
+  addKey("MARKER", Unmapped_Key, 0x16, 7);
+  addKey("VIOLET", Unmapped_Key, 0x17, 7);
+  addKey("dvd_cam", Angle_Key, 0x17, 7);
+  addKey("PAUSE", Pause_Key, 0x18, 7);
+  addKey("MENU", Menu_Key, 0x19, 7);
+  addKey("dvd_av", Input_Key, 0x1A, 7);
+  addKey("GREEN", Green_Key, 0x1B, 7);
+  addKey("dvd_timer", Timer_Key, 0x1B, 7);
+  addKey("OFF", Power_Key, 0x1D, 7);
+  addKey("REW", Rewind_Key, 0x1F, 7);
+
+  addKey("PLAY", Play_Key, 0x20, 7);
+  addKey("FFW", FastForward_Key, 0x21, 7);
+  addKey("ZOOM", Zoom_Key, 0x23, 7);
+  addKey("STOP", Stop_Key, 0x24, 7);
+  addKey("EJECT", Eject_Key, 0x26, 7);
+  addKey("CH+", ChannelUp_Key, 0x27, 7);
+  addKey("CH-", ChannelDown_Key, 0x28, 7);
+  addKey("RETURN", PrevChannel_Key, 0x29, 7);
+  addKey("EXIT", Exit_Key, 0x29, 7);
+  addKey("PROG/RANDOM", Program_Key, 0x2A, 7);
+  addKey("PROG/RANDOM", Random_Key, 0x2A, 7);
+  addKey("REPLAY", Replay_Key, 0x2C, 7); // "dvd_again"
+
+  addKey("SURROUND", Surround_Key, 0x32, 7);
+  addKey("OK", Select_Key, 0x33, 7);
+  addKey("UP", Up_Key, 0x34, 7);
+  addKey("DOWN", Down_Key, 0x35, 7);
+  addKey("LEFT", Left_Key, 0x36, 7);
+  addKey("RIGHT", Right_Key, 0x37, 7);
+  addKey("RED", Red_Key, 0x39, 7); // "lock"
+  addKey("THREE_CIRCLE", Unmapped_Key, 0x3C, 7);
+  addKey("CLEAR", Clear_Key, 0x3D, 7); // "SOURCE"
+  addKey("dvd_record", Record_Key, 0x3E, 7);
+}
+
+
+ThomsonSat1::ThomsonSat1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Sat Keyset 1",
+      Thomson_Make,
+      index)
+{
+}
+
+
+void ThomsonSat1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new ThomsonProtocol(guiObject, index);
+
+  setPreData(0xC, 4);
+
+  addKey("1", One_Key, 0x00, 7);
+  addKey("4", Four_Key, 0x01, 7);
+  addKey("7", Seven_Key, 0x02, 7);
+  addKey("mute", Mute_Key, 0x05, 7);
+  addKey("2", Two_Key, 0x08, 7);
+  addKey("5", Five_Key, 0x09, 7);
+  addKey("8", Eight_Key, 0x0A, 7);
+  addKey("red", Red_Key, 0x0D, 7);
+  addKey("0", Zero_Key, 0x0E, 7);
+
+  addKey("3", Three_Key, 0x10, 7);
+  addKey("6", Six_Key, 0x11, 7);
+  addKey("9", Nine_Key, 0x12, 7);
+  addKey("radio", TunerInput_Key, 0x18, 7);
+  addKey("menu", Menu_Key, 0x19, 7);
+  addKey("green", Green_Key, 0x1A, 7);
+  addKey("blue", Blue_Key, 0x1C, 7);
+  addKey("pwr", Power_Key, 0x1D, 7);
+  addKey("text", Teletext_Key, 0x1E, 7); // "purple"
+  addKey("rev", Rewind_Key, 0x1F, 7);
+
+  addKey("play", Play_Key, 0x20, 7);
+  addKey("fwd", FastForward_Key, 0x21, 7);
+  addKey("pause", Pause_Key, 0x22, 7);
+  addKey("rec", Record_Key, 0x23, 7);
+  addKey("stop", Stop_Key, 0x24, 7);
+  addKey("ch_up", ChannelUp_Key, 0x25, 7);
+  addKey("ch_down", ChannelDown_Key, 0x27, 7);
+  addKey("back", PrevChannel_Key, 0x28, 7);
+  addKey("vol_down", VolumeDown_Key, 0x2A, 7);
+  addKey("vol_up", VolumeUp_Key, 0x2B, 7);
+  addKey("again", Repeat_Key, 0x2C, 7);
+  addKey("advance", Advance_Key, 0x2D, 7);
+  addKey("av", Input_Key, 0x2E, 7);
+  addKey("live", LiveTV_Key, 0x2F, 7);
+
+  addKey("yellow", Yellow_Key, 0x32, 7);
+  addKey("ok", Select_Key, 0x33, 7);
+  addKey("up", Up_Key, 0x34, 7);
+  addKey("down", Down_Key, 0x35, 7);
+  addKey("left", Left_Key, 0x36, 7);
+  addKey("right", Right_Key, 0x37, 7);
+  addKey("exit", Exit_Key, 0x3D, 7);
+}
+
+
+ThomsonAudio1::ThomsonAudio1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Audio Keyset 1",
+      Thomson_Make,
+      index)
+{
+}
+
+
+void ThomsonAudio1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, true, false);
+
+  setPreData(0xFF80, 16);
+
+  addKey("source", Input_Key, 0x80, 8);
+  addKey("play", Play_Key, 0x84, 8);
+  addKey("stop", Stop_Key, 0x88, 8);
+  addKey("trackNext", Next_Key, 0x8C, 8);
+  addKey("volDown", VolumeDown_Key, 0x8D, 8);
+  addKey("trackBack", Previous_Key, 0x90, 8);
+  addKey("volUp", VolumeUp_Key, 0x91, 8);
+  addKey("soundEffect", Unmapped_Key, 0x93, 8);
+  addKey("band", TunerBand_Key, 0x94, 8);
+  addKey("mode", Mode_Key, 0x95, 8);
+  addKey("select", Select_Key, 0x99, 8); // ?
+  addKey("presUp", ChannelUp_Key, 0x9C, 8);
+  addKey("presUp", NextPreset_Key, 0x9C, 8);
+  addKey("presDown", ChannelDown_Key, 0x9D, 8);
+  addKey("presDown", PrevPreset_Key, 0x9D, 8);
+}
diff --git a/keysets/thomson.h b/keysets/thomson.h
new file mode 100644 (file)
index 0000000..f443263
--- /dev/null
@@ -0,0 +1,78 @@
+#ifndef THOMSON_H
+#define THOMSON_H
+
+#include "pirkeysetmetadata.h"
+
+class QObject;
+
+class ThomsonConverter1: public PIRKeysetMetaData
+{
+public:
+  ThomsonConverter1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class ThomsonTV1: public PIRKeysetMetaData
+{
+public:
+  ThomsonTV1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class ThomsonVCR1: public PIRKeysetMetaData
+{
+public:
+  ThomsonVCR1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class ThomsonVCR1a: public ThomsonVCR1
+{
+public:
+  ThomsonVCR1a(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class ThomsonDVD1: public PIRKeysetMetaData
+{
+public:
+  ThomsonDVD1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class ThomsonSat1: public PIRKeysetMetaData
+{
+public:
+  ThomsonSat1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class ThomsonAudio1: public PIRKeysetMetaData
+{
+public:
+  ThomsonAudio1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+#endif // THOMSON_H
index 85aabaa..50926c7 100644 (file)
@@ -162,7 +162,13 @@ SOURCES += main.cpp mainwindow.cpp \
     keysets/kaon.cpp \
     forms/pirrecordform.cpp \
     keysets/qnap.cpp \
-    keysets/compro.cpp
+    keysets/compro.cpp \
+    protocols/xmpprotocol.cpp \
+    keysets/dreambox.cpp \
+    keysets/magnum.cpp \
+    keysets/telenet.cpp \
+    keysets/thomson.cpp \
+    keysets/genius.cpp
 HEADERS += mainwindow.h \
     pirkeynames.h \
     pirmakenames.h \
@@ -300,7 +306,13 @@ HEADERS += mainwindow.h \
     pirdeviceinfo.h \
     forms/pirrecordform.h \
     keysets/qnap.h \
-    keysets/compro.h
+    keysets/compro.h \
+    protocols/xmpprotocol.h \
+    keysets/dreambox.h \
+    keysets/magnum.h \
+    keysets/telenet.h \
+    keysets/thomson.h \
+    keysets/genius.h
 FORMS += mainwindow.ui \
     pirdocumentationform.ui \
     piraboutform.ui \
index fa90698..441290e 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by Qt Creator 2.4.1, 2012-03-02T20:08:31. -->
+<!-- Written by Qt Creator 2.4.1, 2012-03-04T19:04:14. -->
 <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-1.1.0</value>
+      <value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">/Users/john/Develop/n900/pierogi-1.1.1</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="QDateTime">2012-01-25T13:42:55</value>
        <value type="QDateTime">2012-02-22T09:37:53</value>
        <value type="QDateTime">2012-01-17T12:19:28</value>
-       <value type="QDateTime">2012-03-02T20:06:33</value>
+       <value type="QDateTime">2012-03-02T20:08:41</value>
       </valuelist>
      </valuemap>
      <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">3</value>
index 611d78b..f7f541a 100644 (file)
@@ -22,6 +22,7 @@
 #include "keysets/digitalstream.h"
 #include "keysets/directv.h"
 #include "keysets/dish.h"
+#include "keysets/dreambox.h"
 #include "keysets/dse.h"
 #include "keysets/dynex.h"
 #include "keysets/ei.h"
@@ -30,6 +31,7 @@
 #include "keysets/epson.h"
 #include "keysets/fortec.h"
 #include "keysets/foxtel.h"
+#include "keysets/genius.h"
 #include "keysets/goldstar.h"
 #include "keysets/grundig.h"
 #include "keysets/haier.h"
@@ -48,6 +50,7 @@
 #include "keysets/lg.h"
 #include "keysets/logitech.h"
 #include "keysets/magnavox.h"
+#include "keysets/magnum.h"
 #include "keysets/mce.h"
 #include "keysets/mitsubishi.h"
 #include "keysets/motorola.h"
@@ -72,6 +75,8 @@
 #include "keysets/sony.h"
 #include "keysets/starsat.h"
 #include "keysets/technics.h"
+#include "keysets/telenet.h"
+#include "keysets/thomson.h"
 #include "keysets/tivo.h"
 #include "keysets/topfield.h"
 #include "keysets/toshiba.h"
@@ -209,6 +214,15 @@ PIRKeysetManager::PIRKeysetManager()
   setupKeyset(new DishReceiver1n(counter++));
   setupKeyset(new DishReceiver1o(counter++));
 
+  setupKeyset(new DreamboxSat1(counter++));
+  setupKeyset(new DreamboxSat1a(counter++));
+  setupKeyset(new DreamboxSat1b(counter++));
+  setupKeyset(new DreamboxSat1c(counter++));
+  setupKeyset(new DreamboxSat2(counter++));
+  setupKeyset(new DreamboxSat3(counter++));
+  setupKeyset(new DreamboxSat4(counter++));
+  setupKeyset(new DreamboxSat5(counter++));
+
   setupKeyset(new DSEDVD1(counter++));
   setupKeyset(new DSESat1(counter++));
 
@@ -230,6 +244,8 @@ PIRKeysetManager::PIRKeysetManager()
   setupKeyset(new FoxtelSTB1(counter++));
   setupKeyset(new FoxtelSTB2(counter++));
 
+  setupKeyset(new GeniusSpeakers1(counter++));
+
   setupKeyset(new GoldStarTV1(counter++));
   setupKeyset(new GoldStarTV2(counter++));
   setupKeyset(new GoldStarVCR1(counter++));
@@ -350,6 +366,8 @@ PIRKeysetManager::PIRKeysetManager()
   setupKeyset(new MagnavoxConverterBox1(counter++));
   setupKeyset(new MagnavoxTV1(counter++));
 
+  setupKeyset(new MagnumTV1(counter++));
+
   setupKeyset(new MCERemote1(counter++));
   setupKeyset(new MCERemote1a(counter++));
   setupKeyset(new MCERemote1b(counter++));
@@ -553,6 +571,16 @@ PIRKeysetManager::PIRKeysetManager()
   setupKeyset(new TechnicsAudio3a(counter++));
   setupKeyset(new TechnicsDVD1(counter++));
 
+  setupKeyset(new TelenetSTB1(counter++));
+
+  setupKeyset(new ThomsonConverter1(counter++));
+  setupKeyset(new ThomsonTV1(counter++));
+  setupKeyset(new ThomsonVCR1(counter++));
+  setupKeyset(new ThomsonVCR1a(counter++));
+  setupKeyset(new ThomsonDVD1(counter++));
+  setupKeyset(new ThomsonSat1(counter++));
+  setupKeyset(new ThomsonAudio1(counter++));
+
   setupKeyset(new Tivo1(counter++));
   setupKeyset(new Tivo1a(counter++));
   setupKeyset(new Tivo1b(counter++));
index b0e5bed..6db70bf 100644 (file)
@@ -243,6 +243,20 @@ void PIRKeysetMetaData::addDishKey(
 }
 
 
+void PIRKeysetMetaData::addXMPKey(
+  const char *name,
+  PIRKeyName key,
+  unsigned int firstCommand,
+  unsigned int secondCommand)
+{
+  if (key != Unmapped_Key)
+  {
+    keys[key] = name;
+    threadableProtocol->addXMPKey(key, firstCommand, secondCommand);
+  }
+}
+
+
 void PIRKeysetMetaData::setPreData(
   unsigned long data,
   unsigned int bits)
index b3bfb55..2426bed 100644 (file)
@@ -121,6 +121,12 @@ protected:
     unsigned int firstCommand,
     unsigned int secondCommand);
 
+  void addXMPKey(
+    const char *name,
+    PIRKeyName key,
+    unsigned int firstCommand,
+    unsigned int secondCommand);
+
   void setPreData(
     unsigned long data,
     unsigned int bits);
index 8c7cfa7..580fab0 100644 (file)
@@ -23,6 +23,7 @@ PIRMakeMgr::PIRMakeMgr()
   makes[DigitalStream_Make] = "Digital Stream";
   makes[Directv_Make] = "DirecTV";
   makes[Dish_Make] = "Dish";
+  makes[Dreambox_Make] = "Dream Multimedia";
   makes[DSE_Make] = "DSE (Dick Smith)";
   makes[Dynex_Make] = "Dynex";
   makes[Ei_Make] = "Ei";
@@ -31,6 +32,7 @@ PIRMakeMgr::PIRMakeMgr()
   makes[Epson_Make] = "Epson";
   makes[Fortec_Make] = "Fortec Star";
   makes[Foxtel_Make] = "Foxtel";
+  makes[Genius_Make] = "Genius";
   makes[GoldStar_Make] = "GoldStar";
   makes[Grundig_Make] = "Grundig";
   makes[Haier_Make] = "Haier";
@@ -49,6 +51,7 @@ PIRMakeMgr::PIRMakeMgr()
   makes[LG_Make] = "LG";
   makes[Logitech_Make] = "Logitech";
   makes[Magnavox_Make] = "Magnavox";
+  makes[Magnum_Make] = "Magnum";
   makes[Microsoft_Make] = "Microsoft";
   makes[Mitsubishi_Make] = "Mitsubishi";
   makes[Motorola_Make] = "Motorola";
@@ -73,6 +76,8 @@ PIRMakeMgr::PIRMakeMgr()
   makes[Sony_Make] = "Sony";
   makes[Starsat_Make] = "Starsat";
   makes[Technics_Make] = "Technics";
+  makes[Telenet_Make] = "Telenet";
+  makes[Thomson_Make] = "Thomson";
   makes[Tivo_Make] = "TiVo";
   makes[Topfield_Make] = "Topfield";
   makes[Toshiba_Make] = "Toshiba";
index 4083269..9da5fb2 100644 (file)
@@ -24,6 +24,7 @@ enum PIRMakeName{
   DigitalStream_Make,
   Directv_Make,
   Dish_Make,
+  Dreambox_Make,
   DSE_Make,
   Dynex_Make,
   Ei_Make,
@@ -32,6 +33,7 @@ enum PIRMakeName{
   Epson_Make,
   Fortec_Make,
   Foxtel_Make,
+  Genius_Make,
   GoldStar_Make,
   Grundig_Make,
   Haier_Make,
@@ -50,6 +52,7 @@ enum PIRMakeName{
   LG_Make,
   Logitech_Make,
   Magnavox_Make,
+  Magnum_Make,
   Microsoft_Make,
   Mitsubishi_Make,
   Motorola_Make,
@@ -74,6 +77,8 @@ enum PIRMakeName{
   Sony_Make,
   Starsat_Make,
   Technics_Make,
+  Telenet_Make,
+  Thomson_Make,
   Tivo_Make,
   Topfield_Make,
   Toshiba_Make,
index 3fd0731..7e6d794 100644 (file)
@@ -289,6 +289,29 @@ void PIRProtocol::addDishKey(
 }
 
 
+void PIRProtocol::addXMPKey(
+  PIRKeyName key,
+  unsigned int firstCommand,
+  unsigned int secondCommand)
+{
+  PIRKeyBits *pkb = 0;
+  KeycodeCollection::iterator i = keycodes.find(key);
+  if (i != keycodes.end())
+  {
+    pkb = &(i->second);
+    pkb->firstCode.clear();
+    pkb->secondCode.clear();
+  }
+  else
+  {
+    pkb = &(keycodes[key]);
+  }
+
+  appendToBitSeq(pkb->firstCode, firstCommand, 8);
+  appendToBitSeq(pkb->secondCode, secondCommand, 8);
+}
+
+
 void PIRProtocol::setCarrierFrequency(
   unsigned int freq)
 {
index 21a803d..e5b32c9 100644 (file)
@@ -101,6 +101,11 @@ public:
     unsigned int firstCommand,
     unsigned int secondCommand);
 
+  void addXMPKey(
+    PIRKeyName key,
+    unsigned int firstCommand,
+    unsigned int secondCommand);
+
   void setCarrierFrequency(
     unsigned int freq);
 
diff --git a/protocols/xmpprotocol.cpp b/protocols/xmpprotocol.cpp
new file mode 100644 (file)
index 0000000..096eb54
--- /dev/null
@@ -0,0 +1,414 @@
+#include "xmpprotocol.h"
+
+#include "pirrx51hardware.h"
+
+#include "pirexception.h"
+
+// Some global communications stuff:
+#include <QMutex>
+extern bool commandInFlight;
+extern QMutex commandIFMutex;
+
+// The XMP protocol is a real beast, packed full of checksums, toggle bits,
+// large command codes and fancy repeat mechanisms.
+// Each pulse/space pair represents four bits, as so:
+// A "zero" is encoded with a 210 usec pulse, 760 usec space.
+// Each value after that adds an additional 136 usec to the space, so
+// a "one" has a 1*136 + 760 = 896 usec space,
+// a "two" has a 2*136 + 760 = 1032 usec space,
+// ...
+// and a "fifteen" has a 15*136 + 760 = 2800 usec space.
+// There is no header pulse.
+// There is a 210 usec pulse, 13800 usec space in the middle...
+// Commands end with a trailing 210 usec pulse.
+// The first "frame" has a 4-bit "toggle" value of 0; repeat frames following
+// this one are identical, except for the "toggle" value changed to 8.
+// There is a gap of 80000 usec between each frame.
+// An optional "final" frame can also exist, with a toggle value of 9, and
+// separated from the previous frame by only 13800 usec.
+// The carrier frequency should be 38 kHz.
+
+XMPProtocol::XMPProtocol(
+  QObject *guiObject,
+  unsigned int index,
+  unsigned int sd1,
+  unsigned int sd2,
+  unsigned int oem,
+  unsigned int d,
+  bool hasFF)
+  : PIRProtocol(
+      guiObject, index,
+      80000, true),
+    subDeviceOne(sd1),
+    subDeviceTwo(sd2),
+    oemCode(oem),
+    deviceCode(d),
+    hasFinalFrame(hasFF)
+{
+}
+
+
+void XMPProtocol::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 (repeatCount)
+      {
+        commandDuration = generateRepeatCommand(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())
+        {
+          // Do we need to send out a final frame?
+          if (hasFinalFrame)
+          {
+            commandDuration = generateFinalCommand(i->second, rx51device);
+            rx51device.sendCommandToDevice();
+            sleepUntilRepeat(commandDuration);
+          }
+
+          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 XMPProtocol::generateStandardCommand(
+  const PIRKeyBits &pkb,
+  PIRRX51Hardware &rx51device)
+{
+  int duration = 0;
+
+  // XMP frames have the following structure:
+  // 1) The first 4 bits of the "sub-device" code
+  // 2) A four-bit checksum value
+  // 3) The second 4 bits of the "sub-device" code
+  // 4) The four-bit value 0xF
+  // 5) An eight-bit OEM code (normally 0x44)
+  // 6) An eight-bit device code
+  // 7) a 210 usec pulse, 13800 usec space divider
+  // 8) The first 4 bits of the "sub-device" code (again)
+  // 9) Another four-bit checksum value
+  // 10) The four-bit toggle value
+  // 11) The second 4 bits of the "sub-device" code (again)
+  // 12) A pair of 8-bit command codes (often one of them will be 0)
+  // All of this is sent in MSB order.
+  // The checksums are constructed by adding up all the half-bytes in
+  // their side of the frame to 15, taking the complement, and modding the
+  // result with 16.
+
+  duration += pushHalfByte(subDeviceOne, rx51device);
+  duration += pushHalfByte(calculateChecksumOne(), rx51device);
+  duration += pushHalfByte(subDeviceTwo, rx51device);
+  duration += pushHalfByte(0xF, rx51device);
+  duration += pushFullByte(oemCode, rx51device);
+  duration += pushFullByte(deviceCode, rx51device);
+
+  rx51device.addPair(210, 13800);
+  duration += 14010;
+
+  duration += pushHalfByte(subDeviceOne, rx51device);
+  duration += pushHalfByte(
+    calculateChecksumTwo(0x0, pkb.firstCode, pkb.secondCode),
+    rx51device);
+  duration += pushHalfByte(0x0, rx51device);
+  duration += pushHalfByte(subDeviceTwo, rx51device);
+  duration += pushBits(pkb.firstCode, rx51device);
+  duration += pushBits(pkb.secondCode, rx51device);
+
+  // Finally add the "trail":
+  rx51device.addSingle(210);
+  duration += 210;
+
+  return duration;
+}
+
+
+int XMPProtocol::generateRepeatCommand(
+  const PIRKeyBits &pkb,
+  PIRRX51Hardware &rx51device)
+{
+  int duration = 0;
+
+  // an XMP repeat frame is identical to the start frame, except that
+  // the "toggle" value is now 8.
+
+  duration += pushHalfByte(subDeviceOne, rx51device);
+  duration += pushHalfByte(calculateChecksumOne(), rx51device);
+  duration += pushHalfByte(subDeviceTwo, rx51device);
+  duration += pushHalfByte(0xF, rx51device);
+  duration += pushFullByte(oemCode, rx51device);
+  duration += pushFullByte(deviceCode, rx51device);
+
+  rx51device.addPair(210, 13800);
+  duration += 14010;
+
+  duration += pushHalfByte(subDeviceOne, rx51device);
+  duration += pushHalfByte(
+    calculateChecksumTwo(0x8, pkb.firstCode, pkb.secondCode),
+    rx51device);
+  duration += pushHalfByte(0x8, rx51device);
+  duration += pushHalfByte(subDeviceTwo, rx51device);
+  duration += pushBits(pkb.firstCode, rx51device);
+  duration += pushBits(pkb.secondCode, rx51device);
+
+  // Finally add the "trail":
+  rx51device.addSingle(210);
+  duration += 210;
+
+  return duration;
+}
+
+
+int XMPProtocol::generateFinalCommand(
+  const PIRKeyBits &pkb,
+  PIRRX51Hardware &rx51device)
+{
+  int duration = 0;
+
+  // an XMP final frame is basically a pair of repeat frames, but the
+  // gap between them is only 13800 usec, and the "toggle" value of the
+  // second frame is 9.
+
+  duration += pushHalfByte(subDeviceOne, rx51device);
+  duration += pushHalfByte(calculateChecksumOne(), rx51device);
+  duration += pushHalfByte(subDeviceTwo, rx51device);
+  duration += pushHalfByte(0xF, rx51device);
+  duration += pushFullByte(oemCode, rx51device);
+  duration += pushFullByte(deviceCode, rx51device);
+
+  rx51device.addPair(210, 13800);
+  duration += 14010;
+
+  duration += pushHalfByte(subDeviceOne, rx51device);
+  duration += pushHalfByte(
+    calculateChecksumTwo(0x8, pkb.firstCode, pkb.secondCode),
+    rx51device);
+  duration += pushHalfByte(0x8, rx51device);
+  duration += pushHalfByte(subDeviceTwo, rx51device);
+  duration += pushBits(pkb.firstCode, rx51device);
+  duration += pushBits(pkb.secondCode, rx51device);
+
+  rx51device.addPair(210, 13800);
+  duration += 14010;
+
+  duration += pushHalfByte(subDeviceOne, rx51device);
+  duration += pushHalfByte(calculateChecksumOne(), rx51device);
+  duration += pushHalfByte(subDeviceTwo, rx51device);
+  duration += pushHalfByte(0xF, rx51device);
+  duration += pushFullByte(oemCode, rx51device);
+  duration += pushFullByte(deviceCode, rx51device);
+
+  rx51device.addPair(210, 13800);
+  duration += 14010;
+
+  duration += pushHalfByte(subDeviceOne, rx51device);
+  duration += pushHalfByte(
+    calculateChecksumTwo(0x9, pkb.firstCode, pkb.secondCode),
+    rx51device);
+  duration += pushHalfByte(0x9, rx51device);
+  duration += pushHalfByte(subDeviceTwo, rx51device);
+  duration += pushBits(pkb.firstCode, rx51device);
+  duration += pushBits(pkb.secondCode, rx51device);
+
+  // Finally add the "trail":
+  rx51device.addSingle(210);
+  duration += 210;
+
+  return duration;
+}
+
+
+unsigned int XMPProtocol::calculateChecksumOne()
+{
+  // Start with the value 0xF:
+  unsigned int total = 0xF;
+
+  // Add the other half-bytes in the first part of the frame:
+  total += subDeviceOne;
+  total += subDeviceTwo;
+  total += 0xF;
+  total += oemCode >> 4;
+  total += oemCode & 0x0F;
+  total += deviceCode >> 4;
+  total += deviceCode & 0x0F;
+
+  // Next, invert:
+  total = -total;
+
+  // Finally, mod 0x10:
+  total = total % 0x10;
+
+  return total;
+}
+
+
+unsigned int XMPProtocol::calculateChecksumTwo(
+  unsigned int toggle,
+  const CommandSequence &firstCode,
+  const CommandSequence &secondCode)
+{
+  // Start with the value 0xF:
+  unsigned int total = 0xF;
+
+  // Add the other half-bytes in the second part of the frame:
+  total += subDeviceOne;
+  total += toggle;
+  total += subDeviceTwo;
+
+  unsigned int codeValue = 0;
+  CommandSequence::const_iterator i = firstCode.begin();
+
+  while (i != firstCode.end())
+  {
+    // Shift codeValue over and add the bit:
+    codeValue = codeValue << 1;
+    codeValue += *i;
+    ++i;
+  }
+
+  total += codeValue >> 4;
+  total += codeValue & 0xF;
+
+  codeValue = 0;
+  i = secondCode.begin();
+
+  while (i != secondCode.end())
+  {
+    codeValue = codeValue << 1;
+    codeValue += *i;
+    ++i;
+  }
+
+  total += codeValue >> 4;
+  total += codeValue & 0xF;
+
+  // Next, invert:
+  total = -total;
+
+  // Finally, mod 0x10:
+  total = total % 0x10;
+
+  return total;
+}
+
+
+int XMPProtocol::pushHalfByte(
+  unsigned int halfByte,
+  PIRRX51Hardware &rx51device)
+{
+  unsigned int space = 760 + (136 * halfByte);
+  rx51device.addPair(210, space);
+
+  return (210 + space);
+}
+
+
+int XMPProtocol::pushFullByte(
+  unsigned int fullByte,
+  PIRRX51Hardware &rx51device)
+{
+  unsigned int firstSpace = 760 + (136 * (fullByte >> 4));
+  unsigned int secondSpace = 760 + (136 * (fullByte & 0xF));
+
+  rx51device.addPair(210, firstSpace);
+  rx51device.addPair(210, secondSpace);
+
+  return (420 + firstSpace + secondSpace);
+}
+
+
+int XMPProtocol::pushBits(
+  const CommandSequence &bits,
+  PIRRX51Hardware &rx51device)
+{
+  unsigned int duration = 0;
+
+  // We can only sent 4-bit values in XMP, so need to collect bits up into
+  // bundles of 4:
+
+  unsigned int bitsValue = 0;
+  int count = 0;
+  CommandSequence::const_iterator i = bits.begin();
+
+  while (i != bits.end())
+  {
+    if (count < 4)
+    {
+      bitsValue = bitsValue << 1;
+      bitsValue += *i;
+      ++count;
+    }
+    else
+    {
+      rx51device.addPair(210, 760 + (136 * bitsValue));
+      duration += 970 + (136 * bitsValue);
+
+      count = 1;
+      bitsValue = *i;
+    }
+
+    ++i;
+  }
+
+  if (count == 4)
+  {
+    rx51device.addPair(210, 760 + (136 * bitsValue));
+    duration += 970 + (136 * bitsValue);
+  }
+
+  return duration;
+}
diff --git a/protocols/xmpprotocol.h b/protocols/xmpprotocol.h
new file mode 100644 (file)
index 0000000..d4dbe98
--- /dev/null
@@ -0,0 +1,69 @@
+#ifndef XMPPROTOCOL_H
+#define XMPPROTOCOL_H
+
+#include "pirprotocol.h"
+
+class PIRRX51Hardware;
+
+//
+// The XMP protocol is a large, fairly complex protocol, but seems to be
+// gaining popularity in a variety of modern devices.
+//
+
+class XMPProtocol: public PIRProtocol
+{
+public:
+  XMPProtocol(
+    QObject *guiObject,
+    unsigned int index,
+    unsigned int sd1,
+    unsigned int sd2,
+    unsigned int oem,
+    unsigned int d,
+    bool hasFF);
+
+public slots:
+  void startSendingCommand(
+    unsigned int threadableID,
+    PIRKeyName command);
+
+private:
+  int generateStandardCommand(
+    const PIRKeyBits &bits,
+    PIRRX51Hardware &device);
+
+  int generateRepeatCommand(
+    const PIRKeyBits &bits,
+    PIRRX51Hardware &device);
+
+  int generateFinalCommand(
+    const PIRKeyBits &bits,
+    PIRRX51Hardware &device);
+
+  unsigned int calculateChecksumOne();
+
+  unsigned int calculateChecksumTwo(
+    unsigned int toggle,
+    const CommandSequence &firstCode,
+    const CommandSequence &secondCode);
+
+  int pushHalfByte(
+    unsigned int halfByte,
+    PIRRX51Hardware &rx51device);
+
+  int pushFullByte(
+    unsigned int fullByte,
+    PIRRX51Hardware &rx51device);
+
+  int pushBits(
+    const CommandSequence &bits,
+    PIRRX51Hardware &rx51device);
+
+  unsigned int subDeviceOne;
+  unsigned int subDeviceTwo;
+  unsigned int oemCode;
+  unsigned int deviceCode;
+  bool hasFinalFrame;
+};
+
+#endif // XMPPROTOCOL_H
index 4d089f8..3207063 100644 (file)
@@ -1,3 +1,8 @@
+pierogi (1.1.2) unstable; urgency=low
+  * First pass at keysets for Dream Multimedia, Genius, Magnum, Telenet, and Thomson.
+
+ -- John Pietrzak <jpietrzak8@gmail.com>  Sun, 04 Mar 2012 10:57:07 -0500
+
 pierogi (1.1.1) unstable; urgency=low
   * The Record button returns to Pierogi via a new "Program/Record" panel
   * Several fixes for Select Keyset by Device window (thanks sixwheeledbeast!)
index 47784f0..395b0e0 100644 (file)
@@ -11,8 +11,8 @@ Architecture: armel
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: Universal Infrared (IR) Remote Control for N900
  Pierogi is a Universal Infrared Remote Control app for the Nokia N900.  It is independent from the LIRC server, and stores all configuration info internally.
-XB-Maemo-Upgrade-Description: Record button is back
- The "Record" button makes its triumphant return to Pierogi through a new "Program/Record" control panel.  Also several bug-fixes to the Select Keyset by Device window (thanks to sixwheeledbeast for pointing them out), and a first pass at keysets for Compro, Kaon, and QNAP
+XB-Maemo-Upgrade-Description: Keyset Update
+ This update contains a first pass at keysets for Dream Multimedia, Genius, Magnum, Telenet, and Thomson.  These keysets all need some testing...
 XSBC-Bugtracker: https://garage.maemo.org/tracker/?func=add&group_id=2286&atid=7641
 XB-Maemo-Display-Name: Pierogi
 XB-Maemo-Icon-26: iVBORw0KGgoAAAANSUhEUgAAADAAA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