Search for Power Button Panel
[pierogi] / keysets / samsung.cpp
index 1b9c9a7..56fb273 100644 (file)
@@ -4,7 +4,6 @@
 #include "protocols/rc5protocol.h"
 
 SamsungTV1::SamsungTV1(
-  QObject *guiObject,
   unsigned int index)
   : PIRKeysetMetaData(
       "TV Keyset 1",
@@ -15,6 +14,18 @@ SamsungTV1::SamsungTV1(
   addControlledDevice(Samsung_Make, "SyncMaster 225MW", TV_Device);
   addControlledDevice(Samsung_Make, "LN32C530F1FXZA", TV_Device);
   addControlledDevice(Samsung_Make, "UE46B6000VPXZG", TV_Device); // ?
+  addControlledDevice(Samsung_Make, "LE22B470C9M", TV_Device);
+}
+
+
+void SamsungTV1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
 
   threadableProtocol = new SamsungProtocol(guiObject, index);
 
@@ -102,11 +113,23 @@ SamsungTV1::SamsungTV1(
 
 
 SamsungTV1a::SamsungTV1a(
-  QObject *guiObject,
   unsigned int index)
-  : SamsungTV1(guiObject, index)
+  : SamsungTV1(index)
 {
   setKeysetName("TV Keyset 1a");
+}
+
+
+void SamsungTV1a::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
+  SamsungTV1::populateProtocol(guiObject);
 
   addKey("turbo", Unmapped_Key, 0x13, 8);
   addKey("s.menu", SoundMode_Key, 0x14, 8);
@@ -116,13 +139,25 @@ SamsungTV1a::SamsungTV1a(
 
 
 SamsungTV1b::SamsungTV1b(
-  QObject *guiObject,
   unsigned int index)
-  : SamsungTV1(guiObject, index)
+  : SamsungTV1(index)
 {
   setKeysetName("TV Keyset 1b");
 
   addControlledDevice(Samsung_Make, "LE46M51B (R)", TV_Device); // ?
+}
+
+
+void SamsungTV1b::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
+  SamsungTV1::populateProtocol(guiObject);
 
   addKey("Red", Red_Key, 0x21, 8);
   addKey("Exit", Exit_Key, 0x2C, 8);
@@ -130,11 +165,23 @@ SamsungTV1b::SamsungTV1b(
 
 
 SamsungTV1c::SamsungTV1c(
-  QObject *guiObject,
   unsigned int index)
-  : SamsungTV1(guiObject, index)
+  : SamsungTV1(index)
 {
   setKeysetName("TV Keyset 1c");
+}
+
+
+void SamsungTV1c::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
+  SamsungTV1::populateProtocol(guiObject);
 
   // Some remotes apparently use channel and volume keys for navigation:
   addKey("right", Right_Key, 0x07, 8);
@@ -146,22 +193,46 @@ SamsungTV1c::SamsungTV1c(
 
 
 SamsungTV1d::SamsungTV1d(
-  QObject *guiObject,
   unsigned int index)
-  : SamsungTV1(guiObject, index)
+  : SamsungTV1(index)
 {
   setKeysetName("TV Keyset 1d");
+}
+
+
+void SamsungTV1d::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
+  SamsungTV1::populateProtocol(guiObject);
 
   addKey("turbo", Unmapped_Key, 0x64, 8);
 }
 
 
 SamsungTV1e::SamsungTV1e(
-  QObject *guiObject,
   unsigned int index)
-  : SamsungTV1(guiObject, index)
+  : SamsungTV1(index)
 {
   setKeysetName("TV Keyset 1e");
+}
+
+
+void SamsungTV1e::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
+  SamsungTV1::populateProtocol(guiObject);
 
   addKey("p.mode", PictureMode_Key, 0x16, 8);
 }
@@ -169,11 +240,23 @@ SamsungTV1e::SamsungTV1e(
 
 // This one overrides the color keys:
 SamsungTV1f::SamsungTV1f(
-  QObject *guiObject,
   unsigned int index)
-  : SamsungTV1(guiObject, index)
+  : SamsungTV1(index)
 {
   setKeysetName("TV Keyset 1f");
+}
+
+
+void SamsungTV1f::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
+  SamsungTV1::populateProtocol(guiObject);
 
   addKey("p-mode", PictureMode_Key, 0x6C, 8);
   addKey("s-mode", SoundMode_Key, 0x14, 8);
@@ -184,13 +267,24 @@ SamsungTV1f::SamsungTV1f(
 
 // Not sure that this even is a Samsung TV...
 SamsungTV2::SamsungTV2(
-  QObject *guiObject,
   unsigned int index)
   : PIRKeysetMetaData(
       "TV Keyset 2",
       Samsung_Make,
       index)
 {
+}
+
+
+void SamsungTV2::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
   threadableProtocol = new RC5Protocol(guiObject, index);
 
   addKey("1", One_Key, 0x1001, 13);
@@ -233,11 +327,23 @@ SamsungTV2::SamsungTV2(
 
 
 SamsungTV2a::SamsungTV2a(
-  QObject *guiObject,
   unsigned int index)
-  : SamsungTV2(guiObject, index)
+  : SamsungTV2(index)
 {
   setKeysetName("TV Keyset 2a");
+}
+
+
+void SamsungTV2a::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
+  SamsungTV2::populateProtocol(guiObject);
 
   addKey("volume+", VolumeUp_Key, 0x1010, 13);
   addKey("volume-", VolumeDown_Key, 0x1011, 13);
@@ -247,13 +353,24 @@ SamsungTV2a::SamsungTV2a(
 
 
 SamsungVCR1::SamsungVCR1(
-  QObject *guiObject,
   unsigned int index)
   : PIRKeysetMetaData(
       "VCR(DVD) Keyset 1",
       Samsung_Make,
       index)
 {
+}
+
+
+void SamsungVCR1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
   threadableProtocol = new SamsungProtocol(guiObject, index);
 
 //  setPreData(0xA0A0, 16);
@@ -292,12 +409,12 @@ SamsungVCR1::SamsungVCR1(
   addKey("Eject", Eject_Key, 0x20, 8);
   addKey("auto_track", AutoTracking_Key, 0x21, 8); // "A.TRK"
   addKey("Captions", Captions_Key, 0x22, 8);
-  addKey("BAND", TunerBand_Key, 0x23, 8);
+  addKey("BAND", TunerInput_Key, 0x23, 8);
   addKey("input", Unmapped_Key, 0x24, 8);
   addKey("shift", Unmapped_Key, 0x25, 8);
   addKey("100+", PlusOneHundred_Key, 0x26, 8);
   addKey("Down", Down_Key, 0x29, 8); // "erase"
-  addKey("mark/search", Unmapped_Key, 0x2B, 8); // "index"
+  addKey("mark/search", IndexSearch_Key, 0x2B, 8); // "index"
   addKey("trk_up", TrackingPlus_Key, 0x2C, 8); // "FINE_UP"
   addKey("trk_down", TrackingMinus_Key, 0x2D, 8); // "FINE_DOWN"
   addKey("dub", Unmapped_Key, 0x2E, 8);
@@ -308,7 +425,7 @@ SamsungVCR1::SamsungVCR1(
   addKey("SYSTEM", Unmapped_Key, 0x32, 8);
   addKey("CLK_COUNT", Unmapped_Key, 0x33, 8); // "clk/cnt"
   addKey("PRESET", Unmapped_Key, 0x35, 8);
-  addKey("VPS", Unmapped_Key, 0x38, 8);
+  addKey("VPS", RecordPDC_Key, 0x38, 8);
   addKey("progressive/speed", VHSSpeed_Key, 0x3A, 8); // "SP-LP"
   addKey("Q_PRO", Unmapped_Key, 0x3D, 8);
 
@@ -322,11 +439,23 @@ SamsungVCR1::SamsungVCR1(
 
 
 SamsungVCR1a::SamsungVCR1a(
-  QObject *guiObject,
   unsigned int index)
-  : SamsungVCR1(guiObject, index)
+  : SamsungVCR1(index)
 {
   setKeysetName("VCR(DVD) Keyset 1a");
+}
+
+
+void SamsungVCR1a::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
+  SamsungVCR1::populateProtocol(guiObject);
 
   addKey("right", Right_Key, 0x13, 8);
   addKey("left", Left_Key, 0x17, 8);
@@ -347,11 +476,23 @@ SamsungVCR1a::SamsungVCR1a(
 
 
 SamsungVCR1b::SamsungVCR1b(
-  QObject *guiObject,
   unsigned int index)
-  : SamsungVCR1(guiObject, index)
+  : SamsungVCR1(index)
 {
   setKeysetName("VCR(DVD) Keyset 1b");
+}
+
+
+void SamsungVCR1b::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
+  SamsungVCR1::populateProtocol(guiObject);
 
   addKey("audio", Audio_Key, 0x22, 8); // "output"
   addKey("+", Unmapped_Key, 0x26, 8);
@@ -368,13 +509,25 @@ SamsungVCR1b::SamsungVCR1b(
 
 
 SamsungVCR1c::SamsungVCR1c(
-  QObject *guiObject,
   unsigned int index)
-  : SamsungVCR1a(guiObject, index)
+  : SamsungVCR1a(index)
 {
+  setKeysetName("VCR(DVD) Keyset 1c");
+
   addControlledDevice(Samsung_Make, "DVD-V1000", DVD_Device);
+}
 
-  setKeysetName("VCR(DVD) Keyset 1c");
+
+void SamsungVCR1c::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
+  SamsungVCR1a::populateProtocol(guiObject);
 
   addKey("right", Right_Key, 0x00, 8);
   addKey("up", Up_Key, 0x1E, 8);
@@ -391,15 +544,27 @@ SamsungVCR1c::SamsungVCR1c(
 
 
 SamsungVCR1d::SamsungVCR1d(
-  QObject *guiObject,
   unsigned int index)
-  : SamsungVCR1(guiObject, index)
+  : SamsungVCR1(index)
 {
   // Combo VCR/TV:
   addControlledDevice(Samsung_Make, "CXD1342", TV_Device);
   addControlledDevice(Samsung_Make, "CXD1342", VCR_Device);
 
   setKeysetName("VCR/TV Combo Keyset 1d");
+}
+
+
+void SamsungVCR1d::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
+  SamsungVCR1::populateProtocol(guiObject);
 
   addKey("VOL+", VolumeUp_Key, 0x07, 8);
   addKey("VOL-", VolumeDown_Key, 0x0B, 8);
@@ -413,11 +578,23 @@ SamsungVCR1d::SamsungVCR1d(
 
 
 SamsungVCR1e::SamsungVCR1e(
-  QObject *guiObject,
   unsigned int index)
-  : SamsungVCR1(guiObject, index)
+  : SamsungVCR1(index)
 {
   setKeysetName("VCR(DVD) Keyset 1e");
+}
+
+
+void SamsungVCR1e::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
+  SamsungVCR1::populateProtocol(guiObject);
 
   addKey("DIGEST", Unmapped_Key, 0x00, 8);
   addKey("RIGHT", Right_Key, 0x13, 8);
@@ -445,13 +622,24 @@ SamsungVCR1e::SamsungVCR1e(
 
 
 SamsungDVD1::SamsungDVD1(
-  QObject *guiObject,
   unsigned int index)
   : PIRKeysetMetaData(
       "DVD Keyset 1",
       Samsung_Make,
       index)
 {
+}
+
+
+void SamsungDVD1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
   LIRCProtocol *lp = new LIRCProtocol(
     guiObject,
     index,
@@ -525,22 +713,46 @@ SamsungDVD1::SamsungDVD1(
 
 
 SamsungDVD1a::SamsungDVD1a(
-  QObject *guiObject,
   unsigned int index)
-  : SamsungDVD1(guiObject, index)
+  : SamsungDVD1(index)
 {
   setKeysetName("DVD Keyset 1a");
+}
+
+
+void SamsungDVD1a::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
+  SamsungDVD1::populateProtocol(guiObject);
 
   addKey("hdmi_sel", Unmapped_Key, 0x15EA, 16);
 }
 
 
 SamsungDVD1b::SamsungDVD1b(
-  QObject *guiObject,
   unsigned int index)
-  : SamsungDVD1(guiObject, index)
+  : SamsungDVD1(index)
 {
   setKeysetName("DVD Keyset 1b");
+}
+
+
+void SamsungDVD1b::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
+  SamsungDVD1::populateProtocol(guiObject);
 
   addKey("Zoom", Zoom_Key, 0x55AA, 16);
   addKey("i.replay", Replay_Key, 0xB54A, 16);
@@ -549,7 +761,6 @@ SamsungDVD1b::SamsungDVD1b(
 
 
 SamsungDVD2::SamsungDVD2(
-  QObject *guiObject,
   unsigned int index)
   : PIRKeysetMetaData(
       "DVD Keyset 2",
@@ -557,6 +768,17 @@ SamsungDVD2::SamsungDVD2(
       index)
 {
   addControlledDevice(Samsung_Make, "HT-P1200", DVD_Device);
+}
+
+
+void SamsungDVD2::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
 
   threadableProtocol= new SamsungProtocol(guiObject, index);
 
@@ -621,13 +843,24 @@ SamsungDVD2::SamsungDVD2(
 
 
 SamsungAC1::SamsungAC1(
-  QObject *guiObject,
   unsigned int index)
   : PIRKeysetMetaData(
-      "Air Conditioner Keyset 1",
+      "Air Conditioner 1",
       Samsung_Make,
       index)
 {
+}
+
+
+void SamsungAC1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
   LIRCProtocol *lp = new LIRCProtocol(
     guiObject,
     index,
@@ -646,14 +879,147 @@ SamsungAC1::SamsungAC1(
 
   addKey("TIMER", Timer_Key, 0xA4, 8);
   addKey("SLEEP", Sleep_Key, 0xE4, 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("TEMP+", TempUp_Key, 0x4C, 8);
+  addKey("TEMP-", TempDown_Key, 0x8C, 8);
+  addKey("FAN", Fan_Key, 0x9C, 8);
+  addKey("COOL", Cool_Key, 0x3C, 8);
+  addKey("HEAT", Heat_Key, 0x5C, 8);
+  addKey("FAN_HIGH", FanFaster_Key, 0xEC, 8);
+  addKey("FAN_MED", Unmapped_Key, 0x6C, 8);
+  addKey("FAN_LOW", FanSlower_Key, 0xAC, 8);
+  addKey("SWING", Oscillate_Key, 0x94, 8);
   addKey("POWER", Power_Key, 0xFC, 8);
 }
+
+
+/*
+SamsungAC2::SamsungAC2(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "AC Keyset 2",
+      Samsung_Make,
+      index)
+{
+}
+
+
+void SamsungAC2::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new ACProtocol(guiObject, index);
+
+  addKey("Power Off", PowerOff_Subkey, 0x0, 4);
+  addKey("Power On", PowerOn_Subkey, 0xC, 4);
+
+  addKey("Cool Mode - Normal", CoolModeNormal_Subkey, 0x0, 3);
+  addKey("Cool Mode - Turbo", CoolModeTurbo_Subkey, 0x3, 3);
+  addKey("Cool Mode - Far", CoolModeFar_Subkey, 0x6, 3);
+
+  addKey("Deflector L/R Off", DeflectorLROff_Subkey, 0x1, 1);
+  addKey("Deflector L/R On", DeflectorLROn_Subkey, 0x0, 1);
+  addKey("Deflector U/D Off", DeflectorUDOff_Subkey, 0x1, 1);
+  addKey("Deflector U/D On", DeflectorUDOn_Subkey, 0x0, 1);
+
+  // Sixteen temperature settings; make this a straight-up variable?
+  // It may be that only 18-30 are supported.
+//  addKey("Temperature 16", Temp16_Subkey, 0x0, 8);
+//  addKey("Temperature 17", Temp16_Subkey, 0x1, 8);
+  addKey("Temperature 18", Temp16_Subkey, 0x2, 8);
+  addKey("Temperature 19", Temp16_Subkey, 0x3, 8);
+  addKey("Temperature 20", Temp16_Subkey, 0x4, 8);
+  addKey("Temperature 21", Temp16_Subkey, 0x5, 8);
+  addKey("Temperature 22", Temp16_Subkey, 0x6, 8);
+  addKey("Temperature 23", Temp16_Subkey, 0x7, 8);
+  addKey("Temperature 24", Temp16_Subkey, 0x8, 8);
+  addKey("Temperature 25", Temp16_Subkey, 0x9, 8);
+  addKey("Temperature 26", Temp16_Subkey, 0xA, 8);
+  addKey("Temperature 27", Temp16_Subkey, 0xB, 8);
+  addKey("Temperature 28", Temp16_Subkey, 0xC, 8);
+  addKey("Temperature 29", Temp16_Subkey, 0xD, 8);
+  addKey("Temperature 30", Temp16_Subkey, 0xE, 8);
+//  addKey("Temperature 31", Temp31_Subkey, 0xF, 8);
+
+  addKey("Fan - Auto", FanSpeedAuto_Subkey, 0x0, 3);
+  addKey("Fan - Low", FanSpeedLow_Subkey, 0x2, 3);
+  addKey("Fan - Medium", FanSpeedMed_Subkey, 0x4, 3);
+  addKey("Fan - High", FanSpeedHigh_Subkey, 0x6, 3);
+
+  addKey("Mode - auto", ModeAuto_Subkey, 0x0, 4);
+  addKey("Mode - cool", ModeCool_Subkey, 0x1, 4);
+  addKey("Mode - DeHumidify", ModeDehumidify_Subkey, 0x2, 4);
+  addKey("Mode - fan", ModeFan_Subkey, 0x03, 4);
+}
+*/
+
+
+SamsungDVBT1::SamsungDVBT1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "DVB-T Receiver Keyset 1",
+      Samsung_Make,
+      index)
+{
+  addControlledDevice(Samsung_Make, "SMT-1000T", TV_Device);
+  addControlledDevice(Samsung_Make, "SMT-1100T", TV_Device);
+}
+
+
+void SamsungDVBT1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // If the pointer is not null, the keyset must already be populated.
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, true, true);
+
+  setPreData(0x4040, 16);
+
+  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("power", Power_Key, 0x0A, 8);
+  addKey("up", Up_Key, 0x0B, 8);
+  addKey("mute", Mute_Key, 0x0C, 8);
+  addKey("ok", Select_Key, 0x0D, 8);
+  addKey("down", Down_Key, 0x0E, 8);
+  addKey("tv/stb", Input_Key, 0x0F, 8);
+
+  addKey("left", Left_Key, 0x10, 8);
+  addKey("right", Right_Key, 0x11, 8);
+  addKey("clock", Unmapped_Key, 0x12, 8);
+  addKey("vol+", VolumeUp_Key, 0x15, 8);
+  addKey("red", Red_Key, 0x16, 8);
+  addKey("green", Green_Key, 0x17, 8);
+  addKey("yellow", Yellow_Key, 0x18, 8);
+  addKey("blue", Blue_Key, 0x19, 8);
+  addKey("epg", Guide_Key, 0x1A, 8);
+  addKey("vol-", VolumeDown_Key, 0x1C, 8);
+  addKey("radio", TunerInput_Key, 0x1D, 8);
+  addKey("chan-", ChannelDown_Key, 0x1E, 8);
+  addKey("chan+", ChannelUp_Key, 0x1F, 8);
+
+  addKey("fav", Favorites_Key, 0x27, 8);
+
+  addKey("menu", Menu_Key, 0x40, 8);
+  addKey("exit", Exit_Key, 0x41, 8);
+  addKey("i", Info_Key, 0x42, 8);
+  addKey("rcl", PrevChannel_Key, 0x43, 8);
+  addKey("txt", Teletext_Key, 0x45, 8); // might be wrong
+  addKey("a-z", Unmapped_Key, 0x46, 8);
+}