Another "final" fix to the installer
authorJohn Pietrzak <john@pietrzak.org>
Thu, 9 Feb 2012 01:42:45 +0000 (20:42 -0500)
committerJohn Pietrzak <john@pietrzak.org>
Thu, 9 Feb 2012 01:42:45 +0000 (20:42 -0500)
Yes, the previous final fix didn't work either, but this one looks promising.
Cross your fingers.  Also, completely revamped the Panasonic protocol, we'll
see if it still works.  Also added Bose and some more Aiwa keysets.

24 files changed:
keysets/aiwa.cpp
keysets/aiwa.h
keysets/bose.cpp [new file with mode: 0644]
keysets/bose.h [new file with mode: 0644]
keysets/lg.cpp
keysets/panasonic.cpp
keysets/panasonic.h
pierogi.pro
pierogi.pro.user
pierogi.sudoers [deleted file]
pirkeysetmanager.cpp
pirkeysetmetadata.cpp
pirkeysetmetadata.h
pirmakenames.cpp
pirmakenames.h
protocols/boseprotocol.cpp [new file with mode: 0644]
protocols/boseprotocol.h [new file with mode: 0644]
protocols/kaseikyoprotocol.cpp [new file with mode: 0644]
protocols/kaseikyoprotocol.h [new file with mode: 0644]
protocols/pirprotocol.cpp
protocols/pirprotocol.h
qtc_packaging/debian_fremantle/changelog
qtc_packaging/debian_fremantle/control
qtc_packaging/debian_fremantle/postinst

index dafc468..d6ca886 100644 (file)
@@ -3,7 +3,6 @@
 #include "protocols/lircprotocol.h"
 #include "protocols/necprotocol.h"
 
-// Is this a vcr?
 AiwaVCR1::AiwaVCR1(
   QObject *guiObject,
   unsigned int index)
@@ -12,24 +11,87 @@ AiwaVCR1::AiwaVCR1(
       Aiwa_Make,
       index)
 {
-  addControlledDevice(Aiwa_Make, "HV-CX100KER", VCR_Device); // maybe not vcr
+  addControlledDevice(Aiwa_Make, "HV-CX100KER", VCR_Device);
 
   threadableProtocol = new AiwaProtocol(guiObject, index);
 
   setPreData(0x007F, 13);
 
   addKey("POWER", Power_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("CH", Unmapped_Key, 0x0C, 8);
+  addKey("TV/VCR", Unmapped_Key, 0x0D, 8);
+  addKey("INPUT", Input_Key, 0x0E, 8);
   addKey("SLOW", Slow_Key, 0x0F, 8);
+
+  addKey("COUNTDISPLAY", Info_Key, 0x10, 8);
   addKey("FORWARD", FastForward_Key, 0x11, 8);
   addKey("REWIND", Rewind_Key, 0x12, 8);
+  addKey("Audio_MONI", Unmapped_Key, 0x13, 8);
+  addKey("REC", Record_Key, 0x14, 8);
   addKey("PLAY", Play_Key, 0x15, 8);
   addKey("PAUSE", Pause_Key, 0x17, 8);
+  addKey("Index_SkipForward", Next_Key, 0x18, 8);
+  addKey("Index_SkipBack", Previous_Key, 0x19, 8);
+//  addKey("ONETOUCH", Unmapped_Key, 0x19, 8); // need sub-keyset for this
   addKey("STOP", Stop_Key, 0x1A, 8);
-  addKey("+", Unmapped_Key, 0x46, 8);
-  addKey("-", Unmapped_Key, 0x47, 8);
+  addKey("TIMER/PRG", Timer_Key, 0x1C, 8);
+  addKey("T-REC", Unmapped_Key, 0x1E, 8);
+  addKey("CLEAR", Clear_Key, 0x1F, 8); // "CANCEL"
+
+  addKey("CHAN_UP", ChannelUp_Key, 0x40, 8);
+  addKey("CHAN_DOWN", ChannelDown_Key, 0x41, 8);
+  addKey("Audio_DUB", Unmapped_Key, 0x42, 8);
+  addKey("SAT", Unmapped_Key, 0x44, 8);
+  addKey("Zero_Return", Unmapped_Key, 0x45, 8);
+  addKey("TRACK+", TrackingPlus_Key, 0x46, 8);
+  addKey("TRACK-", TrackingMinus_Key, 0x47, 8);
+  addKey("EJECT", Eject_Key, 0x48, 8);
+  addKey("AD-Skip", Advance_Key, 0x49, 8);
+  addKey("SUPER_CLEAR", Unmapped_Key, 0x4B, 8);
+  addKey("RESET", Reset_Key, 0x4C, 8); // "Counter_Reset"
+  addKey("INDEXSRCH", Unmapped_Key, 0x4D, 8);
+  addKey("SP/LP", VHSSpeed_Key, 0x50, 8);
+  addKey("MEMORY", Memory_Key, 0x51, 8);
   addKey("AUTO", Unmapped_Key, 0x53, 8);
+  addKey("CLOCK", Clock_Key, 0x56, 8);
+  addKey("A-TR", AutoTracking_Key, 0x5C, 8);
+  addKey("Tape_Remain", Unmapped_Key, 0x5E, 8);
   addKey("REPEAT", Repeat_Key, 0x5F, 8);
+
+  addKey("Fwd(Jog)", StepForward_Key, 0x65, 8);
+  addKey("Rev(Jog)", StepBack_Key, 0x74, 8);
+
+  addKey("MENU", Menu_Key, 0x81, 8);
+  addKey("VPS/PDC", Unmapped_Key, 0x82, 8);
+//  addKey("NEXT", Next_Key, 0x83, 8);
+  addKey("MENURIGHT", Right_Key, 0x83, 8);
+  addKey("MENULEFT", Left_Key, 0x84, 8);
+  addKey("OTPB", Unmapped_Key, 0x89, 8);
+  addKey("MENUUP", Up_Key, 0x8D, 8);
+  addKey("MENUDOWN", Down_Key, 0x8E, 8);
+
+  addKey("Showview_DeLuxe", Unmapped_Key, 0x98, 8);
+  addKey("Add_T", Unmapped_Key, 0x99, 8);
+  addKey("D/WLY", Unmapped_Key, 0x9A, 8);
+  addKey("Set_Ch.No", Unmapped_Key, 0x9D, 8);
+  addKey("Set_Auto", Unmapped_Key, 0x9E, 8);
+  addKey("OK", Select_Key, 0x9F, 8);
+
   addKey("GUIDE", Guide_Key, 0xB0, 8);
+  addKey("Audio_MIX", Unmapped_Key, 0xB5, 8);
+  addKey("TheatreMode_BBE", Unmapped_Key, 0xB9, 8);
+  addKey("TheatreMode_Q.Surround", Unmapped_Key, 0xBA,8);
+  addKey("TheatreMode_Midnight", Unmapped_Key, 0xBB, 8);
 }
 
 
@@ -88,6 +150,63 @@ AiwaVCR2::AiwaVCR2(
 }
 
 
+AiwaVCR3::AiwaVCR3(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "VCR Keyset 3",
+      Aiwa_Make,
+      index)
+{
+  threadableProtocol = new NECProtocol(guiObject, index, true, false);
+
+  setPreData(0x7B80, 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("ch+", ChannelUp_Key, 0x0A, 8);
+  addKey("ch-", ChannelDown_Key, 0x0B, 8);
+  addKey("t-rec", Unmapped_Key, 0x0D, 8);
+  addKey("audio", Audio_Key, 0x0E, 8);
+  addKey("-/--", DoubleDigit_Key, 0x0F, 8);
+  addKey("tv/vcr", Input_Key, 0x12, 8);
+  addKey("power", Power_Key, 0x13, 8);
+  addKey("index", Unmapped_Key, 0x14, 8);
+  addKey("rec", Record_Key, 0x15, 8);
+  addKey("play", Play_Key, 0x16, 8);
+  addKey("stop", Stop_Key, 0x17, 8);
+  addKey("ff", FastForward_Key, 0x18, 8);
+  addKey("rew", Rewind_Key, 0x19, 8);
+  addKey("pause", Pause_Key, 0x1A, 8);
+  addKey("otpb", Unmapped_Key, 0x1B, 8);
+  addKey("vidplus", Unmapped_Key, 0x1D, 8);
+  addKey("speed", VHSSpeed_Key, 0x1E, 8);
+  addKey("slow", Slow_Key, 0x1F, 8);
+  addKey("up", Up_Key, 0x41, 8);
+  addKey("down", Down_Key, 0x42, 8);
+  addKey("select", Select_Key, 0x45, 8);
+  addKey("left", Left_Key, 0x49, 8);
+  addKey("cancel", Clear_Key, 0x4A, 8);
+  addKey("zero", Unmapped_Key, 0x4B, 8);
+  addKey("reset", Reset_Key, 0x4C, 8);
+  addKey("right", Right_Key, 0x4D, 8);
+  addKey("eject", Eject_Key, 0x4E, 8);
+  addKey("menu", Menu_Key, 0x50, 8);
+  addKey("counter", Unmapped_Key, 0x51, 8);
+  addKey("tracking", AutoTracking_Key, 0x52, 8);
+  addKey("ad-skip", Advance_Key, 0x5C, 8);
+  addKey("call", Call_Key, 0x5F, 8);
+}
+
+
 AiwaAudio1::AiwaAudio1(
   QObject *guiObject,
   unsigned int index)
@@ -97,23 +216,35 @@ AiwaAudio1::AiwaAudio1(
       index)
 {
   addControlledDevice(Aiwa_Make, "LCX-100", Audio_Device);
+  addControlledDevice(Aiwa_Make, "RC-TD3", Audio_Device);
 
   threadableProtocol = new AiwaProtocol(guiObject, index);
 
   setPreData(0x0070, 13);
 
   addKey("power", Power_Key, 0x00, 8);
+  addKey("tape", TapeInput_Key, 0x0C, 8);
+  addKey("tuner", TunerInput_Key, 0x0D, 8);
+  addKey("cd", CDInput_Key, 0x0E, 8);
+
   addKey("volume_up", VolumeUp_Key, 0x11, 8);
   addKey("volume_down", VolumeDown_Key, 0x12, 8);
   addKey("tuner_band", TunerBand_Key, 0x13, 8);
-  addKey("geq", Unmapped_Key, 0x1F, 8); // graphic equalizer?
+  addKey("tape_play", Unmapped_Key, 0x14, 8);
+  addKey("tape_stop", Unmapped_Key, 0x15, 8);
+  addKey("tape_next", Unmapped_Key, 0x16, 8);
+  addKey("tape_prev", Unmapped_Key, 0x17, 8);
+  addKey("tape_rec", Unmapped_Key, 0x18, 8);
+  addKey("tape_pause", Unmapped_Key, 0x19, 8);
+  addKey("geq", Unmapped_Key, 0x1F, 8); // "mode", "CD_MODE"
 
   addKey("sleep", Sleep_Key, 0x40, 8);
-  addKey("tuner_mode", FMMode_Key, 0x4E, 8);
+  addKey("tuner_mode", FMMode_Key, 0x4E, 8); // "FM_MODE"
   addKey("REPEAT", Repeat_Key, 0x51, 8);
   addKey("set", Memory_Key, 0x52, 8); // "MEMORY"
   addKey("CANCEL", Clear_Key, 0x53, 8);
   addKey("timer", Timer_Key, 0x5A, 8);
+  addKey("aux", AuxInput_Key, 0x5D, 8); // "DAT_AUX"
 
   addKey("DISPLAY", Info_Key, 0x80, 8);
   addKey("random", Random_Key, 0x8F, 8);
@@ -133,11 +264,15 @@ AiwaAudio1::AiwaAudio1(
   addKey("play", Up_Key, 0xC4, 8); // "ENTER", "UP"
   addKey("stop", Stop_Key, 0xC5, 8); // "DOWN"
   addKey("stop", Down_Key, 0xC5, 8); // "DOWN"
-  addKey("forward", FastForward_Key, 0xC6, 8); // "RIGHT"
-  addKey("forward", Right_Key, 0xC6, 8); // "RIGHT"
-  addKey("back", Rewind_Key, 0xC7, 8); // "LEFT"
-  addKey("back", Left_Key, 0xC7, 8); // "LEFT"
+  addKey("forward", FastForward_Key, 0xC6, 8); // "RIGHT", "next"
+  addKey("forward", Right_Key, 0xC6, 8); // "RIGHT", "next"
+  addKey("SKIP-SEARCH-TUNING-RIGHT", ChannelUp_Key, 0xC6, 8);
+  addKey("back", Rewind_Key, 0xC7, 8); // "LEFT", "prev"
+  addKey("back", Left_Key, 0xC7, 8); // "LEFT", "prev"
+  addKey("SKIP-SEARCH-TUNING-LEFT", ChannelDown_Key, 0xC7, 8);
   addKey("PAUSE", Pause_Key, 0xC9, 8);
+  addKey("dimmer", Unmapped_Key, 0xCD, 8);
+  addKey("tray", Eject_Key, 0xCF, 8);
 }
 
 
@@ -150,6 +285,7 @@ AiwaAudio1a::AiwaAudio1a(
   setKeysetName("Audio Keyset 1a");
 
   addControlledDevice(Aiwa_Make, "XR-M201", Audio_Device);
+  addControlledDevice(Aiwa_Make, "CA-DW635", Audio_Device);
 
   addKey("1", One_Key, 0x01, 8);
   addKey("2", Two_Key, 0x02, 8);
@@ -179,6 +315,15 @@ AiwaAudio2::AiwaAudio2(
   addControlledDevice(Aiwa_Make, "NSX-532", Audio_Device);
   addControlledDevice(Aiwa_Make, "NSX-AV320", Audio_Device);
   addControlledDevice(Aiwa_Make, "XR-M35", Audio_Device);
+  addControlledDevice(Aiwa_Make, "LCX50", Audio_Device);
+  addControlledDevice(Aiwa_Make, "NSX-V929", Audio_Device);
+  addControlledDevice(Aiwa_Make, "NSX-V30", Audio_Device);
+  addControlledDevice(Aiwa_Make, "NSX-V25", Audio_Device);
+  addControlledDevice(Aiwa_Make, "NSX-320", Audio_Device);
+  addControlledDevice(Aiwa_Make, "NSX-330", Audio_Device);
+  addControlledDevice(Aiwa_Make, "NSX-500", Audio_Device);
+  addControlledDevice(Aiwa_Make, "NSX-540", Audio_Device);
+  addControlledDevice(Aiwa_Make, "NSX-DR5", Audio_Device);
 
   threadableProtocol = new AiwaProtocol(guiObject, index);
 
@@ -201,34 +346,92 @@ AiwaAudio2::AiwaAudio2(
 
   addKey("shift9", Unmapped_Key, 0x11, 8); // "clock"
   addKey("shift0", FMMode_Key, 0x12, 8); // "mono tuner"
-  addKey("EJECT", Eject_Key, 0x13, 8);
+  addKey("EJECT", Eject_Key, 0x13, 8); // "OPEN"
+  addKey("KARAOKE_ENTER", Unmapped_Key, 0x14, 8);
   addKey("shift3", Random_Key, 0x15, 8); // "random/repeat"
   addKey("REPEAT", Repeat_Key, 0x16, 8);
   addKey("shift1", Unmapped_Key, 0x17, 8); // "edit/check"
   addKey("shift2", Program_Key, 0x19, 8); // "prgm"
-  addKey("TAPE", TapeInput_Key, 0x1B, 8);
+  addKey("TAPE", TapeInput_Key, 0x1B, 8); // "Deck"
   addKey("shiftplus10", TunerBand_Key, 0x1C, 8); // "band"
-  addKey("VIDEO", Unmapped_Key, 0x1D, 8);
+  addKey("VIDEO", AuxInput_Key, 0x1D, 8); // "aux"
   addKey("function", Unmapped_Key, 0x1E, 8);
   addKey("CD", CDInput_Key, 0x1F, 8);
 
-  addKey("play", Play_Key, 0x40, 8);
-  addKey("stop", Stop_Key, 0x41, 8);
-  addKey("next", FastForward_Key, 0x42, 8); // "FF"
-  addKey("prev", Rewind_Key, 0x43, 8); // "REW"
-  addKey("pause", Pause_Key, 0x44, 8);
+  addKey("play", Play_Key, 0x40, 8); // "direction"
+  addKey("stop", Stop_Key, 0x41, 8); // "clear"
+  addKey("stop", Clear_Key, 0x41, 8); // "clear"
+  addKey("next", FastForward_Key, 0x42, 8); // "FF", "up"
+  addKey("next", Up_Key, 0x42, 8); // "FF", "up"
+  addKey("prev", Rewind_Key, 0x43, 8); // "REW", "down"
+  addKey("prev", Down_Key, 0x43, 8); // "REW", "down"
+  addKey("pause", Pause_Key, 0x44, 8); // "SET"
   addKey("record", Record_Key, 0x45, 8);
+  addKey("Rec_Mute", RecordMute_Key, 0x46, 8);
   addKey("shift6", EnhancedBass_Key, 0x47, 8); // "t-bass"
+  addKey("bbe", Unmapped_Key, 0x48, 8);
   addKey("shift4", Unmapped_Key, 0x49, 8); // "geq" "eq" equalizer?
+  addKey("DSP", Surround_Key, 0x4A, 8); // "qsurround"
+  addKey("Mute", Mute_Key, 0x4C, 8);
   addKey("volup", VolumeUp_Key, 0x4D, 8);
   addKey("voldown", VolumeDown_Key, 0x4E, 8);
 
-  addKey("shift5", Unmapped_Key, 0x50, 8);
+  addKey("vocal_fader", Unmapped_Key, 0x50, 8); // "KARAOKE"
   addKey("cd1", Unmapped_Key, 0x51, 8); // "DDP_1"
   addKey("cd2", Unmapped_Key, 0x52, 8); // "DDP_2"
   addKey("cd3", Unmapped_Key, 0x53, 8); // "DDP_3"
+  addKey("DISCSKIP", NextDisc_Key, 0x56, 8);
+  addKey("Treble", Unmapped_Key, 0x57, 8);
   addKey("MANUAL", Unmapped_Key, 0x58, 8);
+  addKey("phrase_repeat", RepeatAB_Key, 0x5A, 8);
   addKey("DOLBY", NoiseReduction_Key, 0x6A, 8);
+  addKey("md", MDInput_Key, 0x70, 8);
+  addKey("Enter", Enter_Key, 0x73, 8);
+}
+
+
+AiwaAudio2a::AiwaAudio2a(
+  QObject *guiObject,
+  unsigned int index)
+  : AiwaAudio2(guiObject, index)
+{
+  setKeysetName("Audio Keyset 2a");
+
+  addKey("Rec", Record_Key, 0x5F, 8);
+  addKey("ChUp", ChannelUp_Key, 0x86, 8);
+  addKey("ChDown", ChannelDown_Key, 0x85, 8);
+}
+
+
+AiwaAudio2b::AiwaAudio2b(
+  QObject *guiObject,
+  unsigned int index)
+  : AiwaAudio2(guiObject, index)
+{
+  setKeysetName("Audio Keyset 2b");
+
+  addKey("UP", Up_Key, 0x40, 8);
+  addKey("DOWN", Down_Key, 0x41, 8);
+  addKey("RIGHT", Right_Key, 0x42, 8);
+  addKey("LEFT", Left_Key, 0x43, 8);
+}
+
+
+AiwaAudio2c::AiwaAudio2c(
+  QObject *guiObject,
+  unsigned int index)
+  : AiwaAudio2(guiObject, index)
+{
+  setKeysetName("Audio Keyset 2c");
+
+  addControlledDevice(Aiwa_Make, "XR-MD201", Audio_Device);
+
+  addKey("display", Info_Key, 0x14, 8);
+  addKey("rec", Record_Key, 0x71, 8);
+  addKey("drec", Unmapped_Key, 0x72, 8);
+  addKey("md_mark", Unmapped_Key, 0x73, 8);
+  addKey("mode", Mode_Key, 0x76, 8);
+  addKey("tit_inp", Unmapped_Key, 0x77, 8);
 }
 
 
@@ -370,6 +573,69 @@ AiwaAudio5::AiwaAudio5(
 }
 
 
+AiwaAudio6::AiwaAudio6(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Audio Keyset 6",
+      Aiwa_Make,
+      index)
+{
+  addControlledDevice(Aiwa_Make, "CX-770", Audio_Device);
+  addControlledDevice(Aiwa_Make, "Series 70", Audio_Device);
+
+  threadableProtocol = new AiwaProtocol(guiObject, index);
+
+  setPreData(0x0048, 13);
+
+  addKey("fm", Unmapped_Key, 0x00, 8);
+  addKey("am", Unmapped_Key, 0x01, 8); // "MW"
+  addKey("LW", Unmapped_Key, 0x02, 8);
+  addKey("t_up", ChannelUp_Key, 0x03, 8);
+  addKey("power", Power_Key, 0x04, 8);
+  addKey("t_down", ChannelDown_Key, 0x05, 8);
+  addKey("v_up", VolumeUp_Key, 0x07, 8);
+  addKey("v_down", VolumeDown_Key, 0x08, 8);
+  addKey("muting", Mute_Key, 0x09, 8);
+  addKey("cdp_program", Program_Key, 0x0A, 8);
+  addKey("cdp_play", Play_Key, 0x0B, 8);
+  addKey("cdp_memory", Memory_Key, 0x0C, 8);
+  addKey("cdp_stop", Stop_Key, 0x0D, 8);
+  addKey("cdp_fskip", FastForward_Key, 0x0E, 8);
+  addKey("cdp_bskip", Rewind_Key, 0x0F, 8);
+  addKey("VcrAux", AuxInput_Key, 0x10, 8);
+  addKey("phono", PhonoInput_Key, 0x11, 8);
+  addKey("tape", TapeInput_Key, 0x12, 8);
+}
+
+
+AiwaCarStereo1::AiwaCarStereo1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Car Stereo Keyset 1",
+      Aiwa_Make,
+      index)
+{
+  threadableProtocol = new NECProtocol(guiObject, index, true, true);
+
+  setPreData(0x1386, 16);
+
+  addKey("off", Power_Key, 0x00, 8);
+  addKey("vol+", VolumeUp_Key, 0x0F, 8);
+  addKey("vol-", VolumeDown_Key, 0x10, 8);
+  addKey("disc_tune+", ChannelUp_Key, 0x11, 8);
+  addKey("disc_tune-", ChannelDown_Key, 0x12, 8);
+  addKey("radio_band", TunerBand_Key, 0x13, 8);
+  addKey("tape", TapeInput_Key, 0x14, 8);
+  addKey("ff_next", FastForward_Key, 0x16, 8);
+  addKey("rew_prev", Rewind_Key, 0x17, 8);
+  addKey("playpause", Play_Key, 0x1B, 8);
+  addKey("playpause", Pause_Key, 0x1B, 8);
+  addKey("preset_scan", Scan_Key, 0x1F, 8);
+}
+
+
 AiwaDVD1::AiwaDVD1(
   QObject *guiObject,
   unsigned int index)
index 2648b62..0e6562a 100644 (file)
@@ -21,6 +21,14 @@ public:
     unsigned int index);
 };
 
+class AiwaVCR3: public PIRKeysetMetaData
+{
+public:
+  AiwaVCR3(
+    QObject *guiObject,
+    unsigned int index);
+};
+
 class AiwaAudio1: public PIRKeysetMetaData
 {
 public:
@@ -45,6 +53,30 @@ public:
     unsigned int index);
 };
 
+class AiwaAudio2a: public AiwaAudio2
+{
+public:
+  AiwaAudio2a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class AiwaAudio2b: public AiwaAudio2
+{
+public:
+  AiwaAudio2b(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class AiwaAudio2c: public AiwaAudio2
+{
+public:
+  AiwaAudio2c(
+    QObject *guiObject,
+    unsigned int index);
+};
+
 class AiwaAudio3: public PIRKeysetMetaData
 {
 public:
@@ -69,6 +101,22 @@ public:
     unsigned int index);
 };
 
+class AiwaAudio6: public PIRKeysetMetaData
+{
+public:
+  AiwaAudio6(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class AiwaCarStereo1: public PIRKeysetMetaData
+{
+public:
+  AiwaCarStereo1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
 class AiwaDVD1: public PIRKeysetMetaData
 {
 public:
diff --git a/keysets/bose.cpp b/keysets/bose.cpp
new file mode 100644 (file)
index 0000000..dc07781
--- /dev/null
@@ -0,0 +1,114 @@
+#include "bose.h"
+#include "protocols/boseprotocol.h"
+#include "protocols/necprotocol.h"
+
+BoseRadio1::BoseRadio1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Wave Radio Keyset 1",
+      Bose_Make,
+      index)
+{
+  threadableProtocol = new BoseProtocol(guiObject, index);
+
+  addKey("Mute", Mute_Key, 0x01, 8);
+  addKey("Volume_Down", VolumeDown_Key, 0x02, 8);
+  addKey("Volume_Up", VolumeUp_Key, 0x03, 8);
+  addKey("FM_AM", TunerBand_Key, 0x06, 8);
+  addKey("1", One_Key, 0x07, 8);
+  addKey("2", Two_Key, 0x08, 8);
+  addKey("3", Three_Key, 0x09, 8);
+  addKey("4", Four_Key, 0x0A, 8);
+  addKey("5", Five_Key, 0x0B, 8);
+  addKey("6", Six_Key, 0x0C, 8);
+  addKey("AUX", AuxInput_Key, 0x0F, 8);
+
+  addKey("Seek_Track_Backward", Previous_Key, 0x18, 8);
+  addKey("Seek_Track_Forward", Next_Key, 0x19, 8);
+  addKey("Stop_Eject", Stop_Key, 0x1A, 8);
+  addKey("Stop_Eject", Eject_Key, 0x1A, 8);
+  addKey("Play_Pause", Play_Key, 0x1B, 8);
+  addKey("Play_Pause", Pause_Key, 0x1B, 8);
+  addKey("Play_Mode", Mode_Key, 0x21, 8);
+  addKey("Alarm_On_Off", Unmapped_Key, 0x22, 8);
+  addKey("Alarm_Time", Timer_Key, 0x23, 8);
+  addKey("Time_Plus", Unmapped_Key, 0x24, 8);
+
+  addKey("On_Off", Power_Key, 0x4C, 8);
+  addKey("CD", CDInput_Key, 0x53, 8);
+  addKey("Sleep", Sleep_Key, 0x54, 8);
+  addKey("Tune_MP3_Down", ChannelDown_Key, 0x57, 8);
+  addKey("Tune_MP3_Up", ChannelUp_Key, 0x58, 8);
+
+  addKey("Alarm_Wake_To", Unmapped_Key, 0x70, 8);
+  addKey("Time_Minus", Unmapped_Key, 0x9E, 8);
+}
+
+
+BoseRadio2::BoseRadio2(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Wave Radio Keyset 2",
+      Bose_Make,
+      index)
+{
+  threadableProtocol = new BoseProtocol(guiObject, index);
+
+  addKey("on/off", Power_Key, 0x00, 8);
+  addKey("4", Four_Key, 0x08, 8);
+  addKey("am", Unmapped_Key, 0x10, 8);
+  addKey("6", Six_Key, 0x20, 8);
+  addKey("trackprev", Previous_Key, 0x30, 8);
+  addKey("volup", VolumeUp_Key, 0x40,8);
+  addKey("cdstop", Stop_Key, 0x50, 8);
+  addKey("fm", Unmapped_Key, 0x60, 8);
+  addKey("2", Two_Key, 0x70, 8);
+  addKey("mute", Mute_Key, 0x80, 8);
+  addKey("5", Five_Key, 0x88, 8);
+  addKey("cdplaypause", Play_Key, 0x90, 8);
+  addKey("cdplaypause", Pause_Key, 0x90, 8);
+  addKey("sleep", Sleep_Key, 0xA0, 8);
+  addKey("1", One_Key, 0xB0, 8);
+  addKey("voldown", VolumeDown_Key, 0xC0, 8);
+  addKey("tracknext", Next_Key, 0xD0, 8);
+  addKey("aux", AuxInput_Key, 0xE0, 8);
+  addKey("3", Three_Key, 0xF0, 8);
+}
+
+
+BoseRadio3::BoseRadio3(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Wave Radio Keyset 3",
+      Bose_Make,
+      index)
+{
+  threadableProtocol = new NECProtocol(guiObject, index, false, false);
+
+  setPreData(0xBA, 8);
+
+  addKey("MUTE", Mute_Key, 0x01, 8);
+  addKey("VOL-", VolumeDown_Key, 0x02, 8);
+  addKey("VOL+", VolumeUp_Key, 0x03, 8);
+  addKey("STATION", Unmapped_Key, 0x04, 8);
+  addKey("AM/FM", TunerBand_Key, 0x05, 8);
+  addKey("1", One_Key, 0x07, 8);
+  addKey("2", Two_Key, 0x08, 8);
+  addKey("3", Three_Key, 0x09, 8);
+  addKey("4", Four_Key, 0x0A, 8);
+  addKey("5", Five_Key, 0x0B, 8);
+  addKey("6", Six_Key, 0x0C, 8);
+  addKey("AUX", AuxInput_Key, 0x0F, 8);
+
+  addKey("TUNE+", ChannelUp_Key, 0x10, 8); // "Tune/Time+"
+  addKey("TUNE-", ChannelDown_Key, 0x11, 8); // "Tune/Time-"
+  addKey("ALARM/TIME", Timer_Key, 0x12, 8);
+  addKey("ALARM/WAKEUPTO", Unmapped_Key, 0x13, 8);
+
+  addKey("SLEEP", Sleep_Key, 0x1E, 8);
+
+  addKey("POWER", Power_Key, 0x4C, 8); // also "enter"?
+}
diff --git a/keysets/bose.h b/keysets/bose.h
new file mode 100644 (file)
index 0000000..5abb13f
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef BOSE_H
+#define BOSE_H
+
+#include "pirkeysetmetadata.h"
+
+class QObject;
+
+class BoseRadio1: public PIRKeysetMetaData
+{
+public:
+  BoseRadio1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class BoseRadio2: public PIRKeysetMetaData
+{
+public:
+  BoseRadio2(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class BoseRadio3: public PIRKeysetMetaData
+{
+public:
+  BoseRadio3(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+#endif // BOSE_H
index fcf0c56..7ed8964 100644 (file)
@@ -23,11 +23,12 @@ LGTV1::LGTV1(
   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("sap", Audio_Key, 0x0A, 8); // "I/II", "tv/av"
   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("TvVideo", Unmapped_Key, 0x0F, 8);
   addKey("0", Zero_Key, 0x10, 8);
   addKey("1", One_Key, 0x11, 8);
   addKey("2", Two_Key, 0x12, 8);
@@ -38,47 +39,77 @@ LGTV1::LGTV1(
   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("qview", PrevChannel_Key, 0x1A, 8); // "review", "ChannelPrev"
   addKey("fav", Favorites_Key, 0x1E, 8);
   addKey("text", Teletext_Key, 0x20, 8);
-  addKey("topt", Unmapped_Key, 0x21, 8);
-  addKey("topt/rev", Rewind_Key, 0x21, 8);
+  addKey("topt", Unmapped_Key, 0x21, 8); // "topt/rev", "t.opt"
   addKey("MIX", TeletextAndTV_Key, 0x24, 8);
   addKey("TIME", TeletextTime_Key, 0x26, 8);
   addKey("INDEX", TeletextIndex_Key, 0x27, 8);
   addKey("return/exit", Exit_Key, 0x28, 8);
+  addKey("reveal", TeletextReveal_Key, 0x2A, 8);
   addKey("avmode", Unmapped_Key, 0x30, 8); // "UPDATE"
-  addKey("subtitle", Captions_Key, 0x39, 8); // "cc"
-  addKey("subtitle/ffw", FastForward_Key, 0x39, 8);
+  addKey("subtitle", Captions_Key, 0x39, 8); // "cc", "subtitle/ffw"
   addKey("up", Up_Key, 0x40, 8);
   addKey("down", Down_Key, 0x41, 8);
-  addKey("menu", Menu_Key, 0x43, 8);
+  addKey("menu", Menu_Key, 0x43, 8); // "setup menu", "Home"
   addKey("ok", Select_Key, 0x44, 8);
   addKey("qmenu", Unmapped_Key, 0x45, 8);
-  addKey("video", Unmapped_Key, 0x4D, 8); // "apc", "PSM"
+  addKey("-", Dash_Key, 0x4C, 8);
+  addKey("video", PictureMode_Key, 0x4D, 8); // "apc", "PSM", "picture mode"
   addKey("TV/PC", PCInput_Key, 0x50, 8);
-  addKey("sound", Unmapped_Key, 0x52, 8); // "SSM"
+  addKey("AV-2", Unmapped_Key, 0x51, 8);
+  addKey("sound", SoundMode_Key, 0x52, 8); // "SSM", "Select Sound Mode"
   addKey("list", Unmapped_Key, 0x53, 8);
   addKey("auto", Unmapped_Key, 0x54, 8);
   addKey("memory/erase", Memory_Key, 0x55, 8);
+  addKey("av1", CompositeInput_Key, 0x5A, 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("red", Red_Key, 0x72, 8);
   addKey("ratio", AspectRatio_Key, 0x79, 8);
   addKey("xstudio", Unmapped_Key, 0x7C, 8);
   addKey("simplink", Unmapped_Key, 0x7E, 8);
+  addKey("Ratio16:9", Unmapped_Key, 0x88, 8);
+  addKey("Ratio4:3", Unmapped_Key, 0x89, 8);
+  addKey("app/x", Unmapped_Key, 0x90, 8);
+  addKey("ad", Unmapped_Key, 0x91, 8);
   addKey("energy", Unmapped_Key, 0x95, 8); // "EYEASTERISK"
-  addKey("comp-rgb-dvi", Unmapped_Key, 0x98, 8);
+  addKey("comp-rgb-dvi", ComponentInput_Key, 0x98, 8);
+  addKey("InputAv1", Unmapped_Key, 0xA5, 8);
   addKey("info", Info_Key, 0xAA, 8);
   addKey("guide", Guide_Key, 0xAB, 8);
+  addKey("RatioZoom", Zoom_Key, 0xAF, 8);
   addKey("rec", Record_Key, 0xBD, 8);
-  addKey("tv/radio", Unmapped_Key, 0xF0, 8);
+  addKey("InputComponent1", Unmapped_Key, 0xBF, 8);
+  addKey("PowerOn", PowerOn_Key, 0xC4, 8);
+  addKey("PowerOff", PowerOff_Key, 0xC5, 8);
+  addKey("hdmi", HDMIInput_Key, 0xC6, 8);
+  addKey("InputHDMI2", HDMI2Input_Key, 0xCC, 8);
+//  addKey("InputHDMI1", HDMIInput_Key, 0xCE, 8);
+  addKey("InputAv2", Unmapped_Key, 0xD0, 8);
+  addKey("InputComponent2", Unmapped_Key, 0xD2, 8);
+  addKey("InputRgb-Pc", PCInput_Key, 0xD5, 8);
+  addKey("aerial", AntennaInput_Key, 0xD6, 8);
+  addKey("InputTv", Unmapped_Key, 0xD9, 8);
+  addKey("InputHDMI4", Unmapped_Key, 0xDA, 8);
+  addKey("InputHDMI3", Unmapped_Key, 0xE9, 8);
+  addKey("Auto Demo Mode", Unmapped_Key, 0xED, 8);
+  addKey("tv/radio", TunerInput_Key, 0xF0, 8);
+
+  // Factory controls:
+  addKey("Picture Test Mode", Unmapped_Key, 0xF9, 8);
+  addKey("InStop(FactoryReset)", Unmapped_Key, 0xFA, 8);
+  addKey("InStart", Unmapped_Key, 0xFB, 8);
+  addKey("Password Protected Function", Unmapped_Key, 0xFC, 8);
+  addKey("PowerOnly", Unmapped_Key, 0xFE, 8);
+  addKey("EZadjust", Unmapped_Key, 0xFF, 8);
 }
 
 
@@ -128,12 +159,25 @@ LGTV1c::LGTV1c(
 {
   setKeysetName("TV Keyset 1c");
 
-  addKey("backward", Rewind_Key, 0x80, 8);
+  addControlledDevice(LG_Make, "60px950", TV_Device);
+  addControlledDevice(LG_Make, "60pg60", TV_Device);
+  addControlledDevice(LG_Make, "55lw9500", TV_Device);
+
+//  addKey("Mark", Unmapped_Key, 0x1E, 8); // This is probably an error
+//  addKey("3DOption", Unmapped_Key, 0x45, 8); // also probably error
+//  addKey("List", Unmapped_Key, 0x4C, 8); // also odd
+  addKey("info", Info_Key, 0x55, 8);
+  addKey("Premium", Unmapped_Key, 0x56, 8);
+  addKey("WIDGETS", Unmapped_Key, 0x58, 8);
+  addKey("exit", Exit_Key, 0x5B, 8); // "Return"
   addKey("forward", FastForward_Key, 0x8E, 8);
-  addKey("stop", Stop_Key, 0xB1, 8);
+  addKey("backward", Rewind_Key, 0x8F, 8);
+  addKey("netcast", Unmapped_Key, 0xA9, 8);
   addKey("play", Play_Key, 0xB0, 8);
-  addKey("pause", Pause_Key, 0xBA, 8);
+  addKey("stop", Stop_Key, 0xB1, 8);
+  addKey("pause", Pause_Key, 0xBA, 8); // "Freeze"
   addKey("rec", Record_Key, 0xBD, 8);
+  addKey("3D", Unmapped_Key, 0xDC, 8);
 }
 
 
index a80661a..d77f9bc 100644 (file)
@@ -1,39 +1,6 @@
 #include "panasonic.h"
-#include "protocols/lircprotocol.h"
 #include "protocols/necprotocol.h"
-
-PanasonicAmp::PanasonicAmp(
-  QObject *guiObject,
-  unsigned int index)
-  : PIRKeysetMetaData(
-      "Amp Keyset",
-      Panasonic_Make,
-      index)
-{
-  LIRCProtocol *lp = new LIRCProtocol(
-    guiObject,
-    index,
-    400, 400,
-    400, 1200,
-    76000, false);
-
-  threadableProtocol = lp;
-
-  lp->setHeaderPair(4000, 1600);
-  lp->setTrailerPulse(400);
-
-//  lp->setMinimumRepetitions(4);
-
-  lp->setCarrierFrequency(36000);
-
-  setPreData(0x80080A86, 32);
-
-  addKey("POWER", Power_Key, 0xFDBB, 16);
-  addKey("VOL+", VolumeUp_Key, 0x0D4B, 16);
-  addKey("VOL-", VolumeDown_Key, 0x4DCB, 16);
-  addKey("SLEEP", Sleep_Key, 0x3D7B, 16);
-  addKey("DISPLAY", Info_Key, 0xF17B, 16);
-}
+#include "protocols/kaseikyoprotocol.h"
 
 
 PanasonicCarAudio::PanasonicCarAudio(
@@ -68,59 +35,48 @@ PanasonicSat1::PanasonicSat1(
       Panasonic_Make,
       index)
 {
-  LIRCProtocol *lp = new LIRCProtocol(
-    guiObject,
-    index,
-    500, 400,
-    500, 1212,
-    74500, false);
-
-  threadableProtocol = lp;
-
-  lp->setHeaderPair(3565, 1700);
-  lp->setTrailerPulse(500);
-
-  setPreData(0x40040140, 32);
-
-  addKey("POWER", Power_Key, 0xBDFC, 16);
-  addKey("CH+", ChannelUp_Key, 0xEDAC, 16);
-//  addKey("CH+", ChannelUp_Key, 0x2D6C, 16);
-  addKey("CH-", ChannelDown_Key, 0x6D2C, 16);
-//  addKey("CH-", ChannelDown_Key, 0xADEC, 16);
-  addKey("R_TUNE", PrevChannel_Key, 0x8BCA, 16);
-  addKey("GUIDE", Guide_Key, 0xA3E2, 16);
-  addKey("MENU", Menu_Key, 0x2362, 16);
-  addKey("EXIT", Exit_Key, 0x6322, 16);
-  addKey("LEFT", Left_Key, 0xB3F2, 16);
-  addKey("RIGHT", Right_Key, 0x7332, 16);
-  addKey("UP", Up_Key, 0x5312, 16);
-  addKey("DOWN", Down_Key, 0xD392, 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);
-  addKey("3", Three_Key, 0x4504, 16);
-  addKey("4", Four_Key, 0xC584, 16);
-  addKey("5", Five_Key, 0x2564, 16);
-  addKey("6", Six_Key, 0xA5E4, 16);
-  addKey("7", Seven_Key, 0x6524, 16);
-  addKey("8", Eight_Key, 0xE5A4, 16);
-  addKey("9", Nine_Key, 0x1554, 16);
-  addKey("0", Zero_Key, 0x95D4, 16);
-  addKey("LOGO_TUNE", Unmapped_Key, 0xABEA, 16);
-  addKey("ALT_AUD", Audio_Key, 0x1D5C, 16);
-  addKey("TV/DSS", Input_Key, 0x3D7C, 16);
-  addKey("REC", Record_Key, 0x4302, 16);
-  addKey("ACTION", Select_Key, 0xC382, 16);
-  addKey("PROG", Program_Key, 0x5110, 16);
-  addKey("TXT", Teletext_Key, 0x7B3A, 16);
-  addKey("STTL", Unmapped_Key, 0xFBBA, 16);
-  addKey("GUIDE", Guide_Key, 0xCB8A, 16);
-//  addKey("EXIT", Unmapped_Key, 0xF3B2, 16);
-  addKey("RED", Red_Key, 0x3776, 16);
-  addKey("GREEN", Green_Key, 0xB7F6, 16);
-  addKey("YELLOW", Yellow_Key, 0xF7B6, 16);
-  addKey("BLUE", Blue_Key, 0x7736, 16);
+  threadableProtocol = new KaseikyoProtocol(guiObject, index);
+
+//  setPreData(0x40040140, 32);
+  setPreData(0x2002, 16);
+
+  addKaseikyoKey("PROG", Program_Key, 0x028, 0x8A);
+  addKaseikyoKey("1", One_Key, 0x028, 0xA0);
+  addKaseikyoKey("2", Two_Key, 0x028, 0xA1);
+  addKaseikyoKey("3", Three_Key, 0x028, 0xA2);
+  addKaseikyoKey("4", Four_Key, 0x028, 0xA3);
+  addKaseikyoKey("5", Five_Key, 0x028, 0xA4);
+  addKaseikyoKey("6", Six_Key, 0x028, 0xA5);
+  addKaseikyoKey("7", Seven_Key, 0x028, 0xA6);
+  addKaseikyoKey("8", Eight_Key, 0x028, 0xA7);
+  addKaseikyoKey("9", Nine_Key, 0x028, 0xA8);
+  addKaseikyoKey("0", Zero_Key, 0x028, 0xA9);
+  addKaseikyoKey("CH-", ChannelDown_Key, 0x028, 0xB6);
+  addKaseikyoKey("CH+", ChannelUp_Key, 0x028, 0xB7);
+  addKaseikyoKey("ALT_AUD", Audio_Key, 0x028, 0xB8);
+  addKaseikyoKey("INFO", Info_Key, 0x028, 0xB9);
+  addKaseikyoKey("TV/DSS", Input_Key, 0x028, 0xBC);
+  addKaseikyoKey("POWER", Power_Key, 0x028, 0xBD);
+  addKaseikyoKey("REC", Record_Key, 0x028, 0xC2);
+  addKaseikyoKey("ACTION", Select_Key, 0x028, 0xC3);
+  addKaseikyoKey("MENU", Menu_Key, 0x028, 0xC4);
+  addKaseikyoKey("GUIDE", Guide_Key, 0x028, 0xC5);
+  addKaseikyoKey("EXIT", Exit_Key, 0x028, 0xC6);
+  addKaseikyoKey("UP", Up_Key, 0x028, 0xCA);
+  addKaseikyoKey("DOWN", Down_Key, 0x028, 0xCB);
+  addKaseikyoKey("LEFT", Left_Key, 0x028, 0xCD);
+  addKaseikyoKey("RIGHT", Right_Key, 0x028, 0xCE);
+  addKaseikyoKey("FAV", Favorites_Key, 0x028, 0xD0);
+  addKaseikyoKey("R_TUNE", PrevChannel_Key, 0x028, 0xD1);
+  addKaseikyoKey("GUIDE", Guide_Key, 0x028, 0xD3);
+  addKaseikyoKey("LOGO_TUNE", Unmapped_Key, 0x028, 0xD5);
+  addKaseikyoKey("TXT", Teletext_Key, 0x028, 0xDE);
+  addKaseikyoKey("STTL", Unmapped_Key, 0x028, 0xDF);
+
+  addKaseikyoKey("RED", Red_Key, 0x028, 0xEC);
+  addKaseikyoKey("GREEN", Green_Key, 0x028, 0xED);
+  addKaseikyoKey("BLUE", Blue_Key, 0x028, 0xEE);
+  addKaseikyoKey("YELLOW", Yellow_Key, 0x028, 0xEF);
 }
 
 
@@ -130,9 +86,10 @@ PanasonicSat1a::PanasonicSat1a(
   : PanasonicSat1(guiObject, index)
 {
   setKeysetName("Satellite Keyset 1a");
-  addKey("EXIT", Exit_Key, 0xF3B2, 16);
-  addKey("CH+", ChannelUp_Key, 0x4D0C, 16);
-  addKey("CH-", ChannelDown_Key, 0xCD8C, 16);
+
+  addKaseikyoKey("EXIT", Exit_Key, 0x028, 0xCF);
+  addKaseikyoKey("CH+", ChannelUp_Key, 0x028, 0xB2);
+  addKaseikyoKey("CH-", ChannelDown_Key, 0x028, 0xB3);
 }
 
 
@@ -144,95 +101,114 @@ PanasonicTV1::PanasonicTV1(
       Panasonic_Make,
       index)
 {
-  LIRCProtocol *lp = new LIRCProtocol(
-    guiObject,
-    index,
-    500, 400,
-    500, 1250,
-    75000, false);
-
-  threadableProtocol = lp;
-
-  lp->setHeaderPair(3500, 1700);
-  lp->setTrailerPulse(500);
-
-//  lp->setMinRepeat(1);
-
-  setPreData(0x400401, 24);
-
-  addKey("POWER", Power_Key, 0x00BCBD, 24);
-  addKey("MUTE", Mute_Key, 0x004C4D, 24);
-  addKey("PICTURE", PictureMode_Key, 0x006061, 24);
-  addKey("SOUND", SoundMode_Key, 0x00E0E1, 24);
-  addKey("ACTION", Enter_Key, 0x004A4B, 24);
-  addKey("ACTION", Select_Key, 0x004A4B, 24);
-  addKey("UP", Up_Key, 0x005253, 24);
-  addKey("DOWN", Down_Key, 0x00D2D3, 24);
-  addKey("RIGHT", Right_Key, 0x00F2F3, 24);
-  addKey("LEFT", Left_Key, 0x007273, 24);
-  addKey("PROG_UP", ChannelUp_Key, 0x002C2D, 24);
-  addKey("PROG_DOWN", ChannelDown_Key, 0x00ACAD, 24);
-  addKey("VOLUME_UP", VolumeUp_Key, 0x000405, 24);
-  addKey("VOLUME_DOWN", VolumeDown_Key, 0x008485, 24);
-  addKey("RECALL", PrevChannel_Key, 0x009C9D, 24);
-  addKey("TV/AV", Input_Key, 0x00A0A1, 24);
-  addKey("RED", Red_Key, 0x000E0F, 24);
-  addKey("GREEN", Green_Key, 0x008E8F, 24);
-  addKey("YELLOW", Yellow_Key, 0x004E4F, 24);
-  addKey("BLUE", Blue_Key, 0x00CECF, 24);
-  addKey("1", One_Key, 0x000809, 24);
-  addKey("2", Two_Key, 0x008889, 24);
-  addKey("3", Three_Key, 0x004849, 24);
-  addKey("4", Four_Key, 0x00C8C9, 24);
-  addKey("5", Five_Key, 0x002829, 24);
-  addKey("6", Six_Key, 0x00A8A9, 24);
-  addKey("7", Seven_Key, 0x006869, 24);
-  addKey("8", Eight_Key, 0x00E8E9, 24);
-  addKey("9", Nine_Key, 0x001819, 24);
-  addKey("0", Zero_Key, 0x009899, 24);
-  addKey("C", Clear_Key, 0x005C5D, 24);
-  addKey("-/--", DoubleDigit_Key, 0x00DCDD, 24); // Might also be Dash_Key
-  addKey("SURROUND", Surround_Key, 0x008C8D, 24);
-  addKey("MULTIWINDOW", Unmapped_Key, 0x006766, 24);
-  addKey("N", Unmapped_Key, 0x003031, 24);
-  addKey("STR", Unmapped_Key, 0x00ABAA, 24);
-  addKey("TIMER", Timer_Key, 0x00F0F1, 24);
-  addKey("HELP", Unmapped_Key, 0x003534, 24);
-  addKey("R-TUNE", PrevChannel_Key, 0x00ECED, 24);
-  addKey("GAME", Unmapped_Key, 0x00DDDC, 24);
-  addKey("S", Unmapped_Key, 0x007071, 24);
-  addKey("S_MENU", Unmapped_Key, 0x008A8B, 24);
-  addKey("P_MENU", Unmapped_Key, 0x000A0B, 24);
-  addKey("SAP", Unmapped_Key, 0x00CCCD, 24);
-  addKey("FM/TV", Unmapped_Key, 0x007776, 24);
-  addKey("Exit", Unmapped_Key, 0x00CBCA, 24);
-  addKey("Return", Unmapped_Key, 0x002B2A, 24);
-  addKey("MOOD_LIGHT", Unmapped_Key, 0x008584, 24);
-
-  addKey("ASPECT", AspectRatio_Key, 0x207B5A, 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", Teletext_Key, 0x80C041, 24);
-  addKey("FP", Unmapped_Key, 0x80A021, 24);
-  addKey("INDEX", Unmapped_Key, 0x801091, 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);
-
-  addKey("DIRECTREC", Record_Key, 0x909100, 24);
-  addKey("Link", Unmapped_Key, 0x908D1C, 24);
-  addKey("Option", Unmapped_Key, 0x90E574, 24);
-  addKey("SDCard", Unmapped_Key, 0x90D544, 24);
-  addKey("Guide", Unmapped_Key, 0x90E170, 24);
-  addKey("prog-", Unmapped_Key, 0x900B9A, 24);
+  threadableProtocol = new KaseikyoProtocol(guiObject, index);
+
+//  setPreData(0x400401, 24);
+  setPreData(0x2002, 16);
+
+  addKaseikyoKey("TV/AV", Input_Key, 0x008, 0x05);
+  addKaseikyoKey("PICTURE", PictureMode_Key, 0x008, 0x06);
+  addKaseikyoKey("SOUND", SoundMode_Key, 0x008, 0x07);
+  addKaseikyoKey("N", Unmapped_Key, 0x008, 0x0C);
+  addKaseikyoKey("S", Unmapped_Key, 0x008, 0x0E);
+  addKaseikyoKey("TIMER", Sleep_Key, 0x008, 0x0F); // "Sleep"
+  addKaseikyoKey("1", One_Key, 0x008, 0x10);
+  addKaseikyoKey("2", Two_Key, 0x008, 0x11);
+  addKaseikyoKey("3", Three_Key, 0x008, 0x12);
+  addKaseikyoKey("4", Four_Key, 0x008, 0x13);
+  addKaseikyoKey("5", Five_Key, 0x008, 0x14);
+  addKaseikyoKey("6", Six_Key, 0x008, 0x15);
+  addKaseikyoKey("7", Seven_Key, 0x008, 0x16);
+  addKaseikyoKey("8", Eight_Key, 0x008, 0x17);
+  addKaseikyoKey("9", Nine_Key, 0x008, 0x18);
+  addKaseikyoKey("0", Zero_Key, 0x008, 0x19);
+  addKaseikyoKey("VOLUME_UP", VolumeUp_Key, 0x008, 0x20);
+  addKaseikyoKey("VOLUME_DOWN", VolumeDown_Key, 0x008, 0x21);
+  addKaseikyoKey("Bass Up", BassUp_Key, 0x008, 0x22);
+  addKaseikyoKey("Bass Down", BassDown_Key, 0x008, 23);
+  addKaseikyoKey("Treble Up", TrebleUp_Key, 0x008, 0x24);
+  addKaseikyoKey("Treble Down", TrebleDown_Key, 0x008, 0x25);
+  addKaseikyoKey("Balance Left", BalanceLeft_Key, 0x008, 0x26);
+  addKaseikyoKey("Balance Right", BalanceRight_Key, 0x008, 0x27);
+  addKaseikyoKey("SURROUND", Surround_Key, 0x008, 0x31);
+  addKaseikyoKey("MUTE", Mute_Key, 0x008, 0x32);
+  addKaseikyoKey("SAP", Audio_Key, 0x008, 0x33); // "Stereo/Mono/Bilingual"
+  addKaseikyoKey("PROG_UP", ChannelUp_Key, 0x008, 0x34);
+  addKaseikyoKey("PROG_DOWN", ChannelDown_Key, 0x008, 0x35);
+  addKaseikyoKey("R-TUNE", Unmapped_Key, 0x008, 0x37);
+  addKaseikyoKey("RECALL", PrevChannel_Key, 0x008, 0x39);
+  addKaseikyoKey("C", Clear_Key, 0x008, 0x3A);
+  addKaseikyoKey("-/--", DoubleDigit_Key, 0x008, 0x3B); // Also Dash_Key?
+  addKaseikyoKey("POWER", Power_Key, 0x008, 0x3D);
+  addKaseikyoKey("On", PowerOn_Key, 0x008, 0x3E);
+  addKaseikyoKey("Off", PowerOff_Key, 0x008, 0x3F);
+  addKaseikyoKey("Color Up", ColorUp_Key, 0x008, 0x40);
+  addKaseikyoKey("Color Down", ColorDown_Key, 0x008, 0x41);
+  addKaseikyoKey("Contrast Up", ContrastUp_Key, 0x008, 0x42);
+  addKaseikyoKey("Contrast Down", ContrastDown_Key, 0x008, 0x43);
+  addKaseikyoKey("Brightness Up", BrightnessUp_Key, 0x008, 0x44);
+  addKaseikyoKey("Brightness Down", BrightnessDown_Key, 0x008, 0x45);
+  addKaseikyoKey("select", Select_Key, 0x008, 0x49); // "OK"
+  addKaseikyoKey("UP", Up_Key, 0x008, 0x4A);
+  addKaseikyoKey("DOWN", Down_Key, 0x008, 0x4B);
+  addKaseikyoKey("LEFT", Left_Key, 0x008, 0x4E);
+  addKaseikyoKey("RIGHT", Right_Key, 0x008, 0x4F);
+  addKaseikyoKey("P_MENU", Unmapped_Key, 0x008, 0x50);
+  addKaseikyoKey("S_MENU", Unmapped_Key, 0x008, 0x51);
+//  addKaseikyoKey("ACTION", Enter_Key, 0x008, 0x52); // Might be wrong
+  addKaseikyoKey("setup", Menu_Key, 0x008, 0x52); // "ACTION"
+  addKaseikyoKey("pip swap", PIPSwap_Key, 0x008, 0x5E);
+  addKaseikyoKey("pip move", PIPMove_Key, 0x008, 0x67);
+  addKaseikyoKey("RED", Red_Key, 0x008, 0x70);
+  addKaseikyoKey("GREEN", Green_Key, 0x008, 0x71);
+  addKaseikyoKey("YELLOW", Yellow_Key, 0x008, 0x72);
+  addKaseikyoKey("BLUE", Blue_Key, 0x008, 0x73);
+  addKaseikyoKey("MOOD_LIGHT", Unmapped_Key, 0x008, 0xA1);
+  addKaseikyoKey("HELP", Unmapped_Key, 0x008, 0xAC);
+  addKaseikyoKey("GAME", Unmapped_Key, 0x008, 0xBB);
+  addKaseikyoKey("Exit", Unmapped_Key, 0x008, 0xD3);
+  addKaseikyoKey("Return", Unmapped_Key, 0x008, 0xD4); // "R"
+  addKaseikyoKey("STR", Unmapped_Key, 0x008,0xD5);
+  addKaseikyoKey("MULTIWINDOW", Unmapped_Key, 0x008, 0xE6); // "multi pip"
+  addKaseikyoKey("FM/TV", Unmapped_Key, 0x008, 0xEE);
+  addKaseikyoKey("System reset", Unmapped_Key, 0x008, 0xFF);
+
+  addKaseikyoKey("Mix", TeletextAndTV_Key, 0x018, 0x01);
+  addKaseikyoKey("TV/TEXT", Teletext_Key, 0x018, 0x03);
+  addKaseikyoKey("Display_Cancel", Unmapped_Key, 0x018, 0x04);
+  addKaseikyoKey("FP (Favorite Page)", Unmapped_Key, 0x018, 0x05);
+  addKaseikyoKey("INDEX", TeletextIndex_Key, 0x018, 0x08);
+  addKaseikyoKey("HOLD", TeletextHold_Key, 0x018, 0x09);
+  addKaseikyoKey("List Store", TeletextStore_Key, 0x018, 0x0A);
+  addKaseikyoKey("TIMETEXT", TeletextTime_Key, 0x018, 0x0B);
+  addKaseikyoKey("FTB (Full/Top/Bottom)", TeletextSize_Key, 0x018, 0x0C);
+  addKaseikyoKey("REVEAL", TeletextReveal_Key, 0x018, 0x1C);
+  addKaseikyoKey("List/F.Text", Unmapped_Key, 0x018, 0x1D);
+  addKaseikyoKey("Text Reset", Unmapped_Key, 0x018, 0x1E);
+
+  addKaseikyoKey("TV", Unmapped_Key, 0x028, 0x30);
+  addKaseikyoKey("PROG", Program_Key, 0x028, 0x8A);
+  addKaseikyoKey("MENU", Menu_Key, 0x028, 0xC4);
+  addKaseikyoKey("GUIDE", Guide_Key, 0x028, 0xC5);
+  addKaseikyoKey("EXIT", Exit_Key, 0x028, 0xC6);
+
+  addKaseikyoKey("ASPECT", AspectRatio_Key, 0x048, 0xDE);
+  addKaseikyoKey("picture position/size", PIPSize_Key, 0x048, 0xE5);
+
+  addKaseikyoKey("Guide", Unmapped_Key, 0x098, 0x87);
+  addKaseikyoKey("DIRECTREC", Record_Key, 0x098, 0x89);
+  addKaseikyoKey("Exit", Unmapped_Key, 0x098, 0x9A);
+  addKaseikyoKey("Option", Unmapped_Key, 0x098, 0xA7);
+  addKaseikyoKey("SDCard", Unmapped_Key, 0x098, 0xAB);
+  addKaseikyoKey("Favorite", Unmapped_Key, 0x098, 0xAE);
+  addKaseikyoKey("Link", Unmapped_Key, 0x098, 0xB1);
+  addKaseikyoKey("prog-", Unmapped_Key, 0x098, 0xD0);
+
+  // Some media keys, possibly a combo DVD-TV?
+//  addKaseikyoKey("STOP", Stop_Key, 0x00B, 0x00);
+//  addKaseikyoKey("PLAY", Play_Key, 0x00B, 0x0A);
+//  addKaseikyoKey("FORWARD", FastForward_Key, 0x00B, 0x4A);
+//  addKaseikyoKey("REWIND", Rewind_Key, 0x00B, 0x49);
 }
 
 
@@ -243,8 +219,8 @@ PanasonicTV1a::PanasonicTV1a(
 {
   setKeysetName("TV Keyset 1a");
   // Overwrite some of the keys:
-  addKey("OK", Select_Key, 0x009293, 24);
-  addKey("MENU", Menu_Key, 0x006061, 24);
+  addKaseikyoKey("OK", Select_Key, 0x008, 0x49);
+  addKaseikyoKey("MENU", Menu_Key, 0x008, 0x06);
 }
 
 
@@ -258,12 +234,13 @@ PanasonicTV1b::PanasonicTV1b(
   addControlledDevice(Panasonic_Make, "Viera TX-32LZD80", TV_Device);
   addControlledDevice(Panasonic_Make, "Viera 42PZ700U", TV_Device);
 
-  addKey("Menu", Menu_Key, 0x004A4B, 24);
-  addKey("OK", Select_Key, 0x009293, 24);
-  addKey("Guide", Guide_Key, 0x90E170, 24);
-//  addKey("Exit", Exit_Key, 0x00CBCA, 24);
-  addKey("Info", Info_Key, 0x009C9D, 24);
-  addKey("Exit", Exit_Key, 0x9059C8, 24);
+  addKaseikyoKey("Info", Info_Key, 0x008, 0x39); // "OSD"
+  addKaseikyoKey("OK", Select_Key, 0x008, 0x49);
+  addKaseikyoKey("Menu", Menu_Key, 0x008, 0x52);
+//  addKaseikyoKey("Exit", Exit_Key, 0x008, 0xD3);
+
+  addKaseikyoKey("Guide", Guide_Key, 0x098, 0x87);
+  addKaseikyoKey("Exit", Exit_Key, 0x098, 0x9A);
 }
 
 
@@ -275,108 +252,99 @@ PanasonicVCR1::PanasonicVCR1(
       Panasonic_Make,
       index)
 {
-  LIRCProtocol *lp = new LIRCProtocol(
-    guiObject,
-    index,
-    550, 330,
-    550, 1200,
-    75000, false);
-
-  threadableProtocol = lp;
-
-  lp->setHeaderPair(3600, 1650);
-  lp->setTrailerPulse(550);
-
-  setPreData(0x400409, 24);
-
-  addKey("POWER", Power_Key, 0x00BCB5, 24);
-  addKey("PROGRAMME^", ChannelUp_Key, 0x002C25, 24);
-  addKey("PROGRAMMEv", ChannelDown_Key, 0x00ACA5, 24);
-  addKey("REC", Record_Key, 0x001019, 24);
-  addKey("PAUSE", Pause_Key, 0x006069, 24);
-  addKey("PLAY", Play_Key, 0x005059, 24);
-  addKey("STOP", Stop_Key, 0x000009, 24);
-  addKey("FORWARD", FastForward_Key, 0x00C0C9, 24);
-  addKey("REWIND", Rewind_Key, 0x004049, 24);
-  addKey("INFO", Info_Key, 0x009C95, 24);
-  addKey("1", One_Key, 0x000801, 24);
-  addKey("2", Two_Key, 0x008881, 24);
-  addKey("3", Three_Key, 0x004841, 24);
-  addKey("4", Four_Key, 0x00C8C1, 24);
-  addKey("5", Five_Key, 0x002821, 24);
-  addKey("6", Six_Key, 0x00A8A1, 24);
-  addKey("7", Seven_Key, 0x006861, 24);
-  addKey("8", Eight_Key, 0x00E8E1, 24);
-  addKey("9", Nine_Key, 0x001811, 24);
-  addKey("0", Zero_Key, 0x009891, 24);
-  addKey("100", PlusOneHundred_Key, 0x00A7AE, 24);
-  addKey("TV-SAT", Input_Key, 0x006C65, 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);
-  addKey("AV", Unmapped_Key, 0x00030A, 24);
-  addKey("-/--", DoubleDigit_Key, 0x00DCD5, 24);
-  addKey("REPLAY", Replay_Key, 0x00EFE6, 24);
-  addKey("DIRECT_TV_REC", Unmapped_Key, 0x00434A, 24);
-  addKey("TIMERREC", Timer_Key, 0x002D24, 24);
-  addKey("COUNTER_RESET", Unmapped_Key, 0x002A23, 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", 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", Clock_Key, 0x006A63, 24);
-  addKey("TAPE_REMAIN", Unmapped_Key, 0x00AAA3, 24);
-  addKey("mesecam", Unmapped_Key, 0x00939A, 24);
-  addKey("zerostop", Unmapped_Key, 0x00AFA6, 24);
-  addKey("sap/hi-fi", Unmapped_Key, 0x00676E, 24);
-
-  addKey("DISPLAY", Unmapped_Key, 0x80FA73, 24);
-  addKey("SEARCH", Unmapped_Key, 0x80B930, 24);
-  addKey("SPEED", VHSSpeed_Key, 0x8050D9, 24);
-  addKey("SHOWVIEW", Unmapped_Key, 0x80BA33, 24);
-  addKey("MENU", Menu_Key, 0x806AE3, 24);
-  addKey("OK", Select_Key, 0x801A93, 24);
-  addKey("EXIT", Exit_Key, 0x8066EF, 24);
-  addKey("CHECK+", Unmapped_Key, 0x800980, 24);
-  addKey("CHECK-", Unmapped_Key, 0x808900, 24);
-  addKey("DATE+", Unmapped_Key, 0x8049C0, 24);
-  addKey("DATE-", Unmapped_Key, 0x80C940, 24);
-  addKey("ON+", Unmapped_Key, 0x8029A0, 24);
-  addKey("ON-", Unmapped_Key, 0x80A920, 24);
-  addKey("OFF+", Unmapped_Key, 0x8069E0, 24);
-  addKey("OFF-", Unmapped_Key, 0x80E960, 24);
-  addKey("PROG/CHECK", Program_Key, 0x808009, 24);
-  addKey("CANCEL", Clear_Key, 0x809019, 24);
-  addKey("TAPE", Unmapped_Key, 0x80078E, 24);
-  addKey("ADD/DELETE", Unmapped_Key, 0x808C05, 24);
-  addKey("RADIO_TUNE", Unmapped_Key, 0x801C95, 24);
-  addKey("VPS/PDC", Unmapped_Key, 0x8060E9, 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);
-  addKey("clear", Unmapped_Key, 0x80A029, 24);
-
-  addKey("TV/TEXT", Unmapped_Key, 0xA0EA43, 24);
-  addKey("STILL_ALBUM", Unmapped_Key, 0xA0C46D, 24);
-  addKey("ExtLink", Unmapped_Key, 0xA0DA73, 24);
-  addKey("I-Timer", Unmapped_Key, 0xA0FC55, 24);
-  addKey("PROG_PLAY", Unmapped_Key, 0xA05CF5, 24);
+  threadableProtocol = new KaseikyoProtocol(guiObject, index);
+
+//  setPreData(0x400409, 24);
+  setPreData(0x2002, 16);
+
+  addKaseikyoKey("STOP", Stop_Key, 0x009, 0x00);
+  addKaseikyoKey("REWIND", Rewind_Key, 0x009, 0x02);
+  addKaseikyoKey("FORWARD", FastForward_Key, 0x009, 0x03);
+  addKaseikyoKey("PAUSE", Pause_Key, 0x009, 0x06);
+  addKaseikyoKey("REC", Record_Key, 0x009, 0x08);
+  addKaseikyoKey("PLAY", Play_Key, 0x009, 0x0A);
+  addKaseikyoKey("STILL", StepForward_Key, 0x009, 0x0C);  // also "ADV"
+  addKaseikyoKey("SLOW", Slow_Key, 0x009, 0x0F);
+  addKaseikyoKey("1", One_Key, 0x009, 0x10);
+  addKaseikyoKey("2", Two_Key, 0x009, 0x11);
+  addKaseikyoKey("3", Three_Key, 0x009, 0x12);
+  addKaseikyoKey("4", Four_Key, 0x009, 0x13);
+  addKaseikyoKey("5", Five_Key, 0x009, 0x14);
+  addKaseikyoKey("6", Six_Key, 0x009, 0x15);
+  addKaseikyoKey("7", Seven_Key, 0x009, 0x16);
+  addKaseikyoKey("8", Eight_Key, 0x009, 0x17);
+  addKaseikyoKey("9", Nine_Key, 0x009, 0x18);
+  addKaseikyoKey("0", Zero_Key, 0x009, 0x19);
+  addKaseikyoKey("AUDIO", Audio_Key, 0x009, 0x33);
+  addKaseikyoKey("PROGRAMME^", ChannelUp_Key, 0x009, 0x34);
+  addKaseikyoKey("PROGRAMMEv", ChannelDown_Key, 0x009, 0x35);
+  addKaseikyoKey("TV-SAT", Input_Key, 0x009, 0x36);
+  addKaseikyoKey("INFO", Info_Key, 0x009, 0x39);
+  addKaseikyoKey("-/--", DoubleDigit_Key, 0x009, 0x3B);
+  addKaseikyoKey("POWER", Power_Key, 0x009, 0x3D);
+  addKaseikyoKey("INDEX", Unmapped_Key, 0x009, 0x40);
+  addKaseikyoKey("time_search", Unmapped_Key, 0x009, 0x44);
+  addKaseikyoKey("INDEXL", Unmapped_Key, 0x009, 0x49);
+  addKaseikyoKey("INDEXR", Unmapped_Key, 0x009, 0x4A);
+  addKaseikyoKey("mem_rep", Unmapped_Key, 0x009, 0x53);
+  addKaseikyoKey("COUNTER_RESET", Unmapped_Key, 0x009, 0x54);
+  addKaseikyoKey("TAPE_REMAIN", Unmapped_Key, 0x009, 0x55);
+  addKaseikyoKey("CLOCK/COUNTER", Clock_Key, 0x009, 0x56);
+  addKaseikyoKey("+", Unmapped_Key, 0x009, 0x8E);
+  addKaseikyoKey("-", Unmapped_Key, 0x009, 0x8F);
+  addKaseikyoKey("monitor", Unmapped_Key, 0x009, 0x91);
+  addKaseikyoKey("TRACKING_AUTO", AutoTracking_Key, 0x009, 0xB0);
+  addKaseikyoKey("TRACKING_PLUS", TrackingPlus_Key, 0x009, 0xB1);
+  addKaseikyoKey("TRACKING_MINUS", TrackingMinus_Key, 0x009, 0xB2);
+  addKaseikyoKey("TIMERREC", Timer_Key, 0x009, 0xB4);
+  addKaseikyoKey("AV", Unmapped_Key, 0x009, 0xC0);
+  addKaseikyoKey("DIRECT_TV_REC", Unmapped_Key, 0x009, 0xC2);
+  addKaseikyoKey("mesecam", Unmapped_Key, 0x009, 0xC9);
+  addKaseikyoKey("100", PlusOneHundred_Key, 0x009, 0xE5);
+  addKaseikyoKey("sap/hi-fi", Unmapped_Key, 0x009, 0xE6);
+  addKaseikyoKey("repeat", Repeat_Key, 0x009, 0xF0);
+  addKaseikyoKey("memory", Program_Key, 0x009, 0xF1);
+  addKaseikyoKey("sleep", Sleep_Key, 0x009, 0xF2);
+  addKaseikyoKey("rew2", Unmapped_Key, 0x009, 0xF3);
+  addKaseikyoKey("zerostop", Unmapped_Key, 0x009, 0xF5);
+  addKaseikyoKey("REPLAY", Replay_Key, 0x009, 0xF7);
+  addKaseikyoKey("cm-zero", Unmapped_Key, 0x009, 0xF8);
+
+  addKaseikyoKey("PROG/CHECK", Program_Key, 0x019, 0x01);
+  addKaseikyoKey("rotate", Unmapped_Key, 0x019, 0x02);
+  addKaseikyoKey("rotatedown", Unmapped_Key, 0x019, 0x03);
+  addKaseikyoKey("set", Unmapped_Key, 0x019, 0x04);
+  addKaseikyoKey("clear", Unmapped_Key, 0x019, 0x05);
+  addKaseikyoKey("VPS/PDC", Unmapped_Key, 0x019, 0x06);
+  addKaseikyoKey("OffTimer", Sleep_Key, 0x019, 0x08);
+  addKaseikyoKey("CANCEL", Clear_Key, 0x019, 0x09);
+  addKaseikyoKey("SPEED", VHSSpeed_Key, 0x019, 0x0A);
+  addKaseikyoKey("ADD/DELETE", Unmapped_Key, 0x019, 0x31);
+  addKaseikyoKey("RADIO_TUNE", Unmapped_Key, 0x019, 0x38);
+  addKaseikyoKey("MENU", Menu_Key, 0x019, 0x56);
+  addKaseikyoKey("OK", Select_Key, 0x019, 0x58);
+  addKaseikyoKey("SHOWVIEW", Unmapped_Key, 0x019, 0x5D);
+  addKaseikyoKey("DISPLAY", Unmapped_Key, 0x019, 0x5F);
+  addKaseikyoKey("EXIT", Exit_Key, 0x019, 0x66);
+  addKaseikyoKey("CHECK+", Unmapped_Key, 0x019, 0x90);
+  addKaseikyoKey("CHECK-", Unmapped_Key, 0x019, 0x91);
+  addKaseikyoKey("DATE+", Unmapped_Key, 0x019, 0x92);
+  addKaseikyoKey("DATE-", Unmapped_Key, 0x019, 0x93);
+  addKaseikyoKey("ON+", Unmapped_Key, 0x019, 0x94);
+  addKaseikyoKey("ON-", Unmapped_Key, 0x019, 0x95);
+  addKaseikyoKey("OFF+", Unmapped_Key, 0x019, 0x96);
+  addKaseikyoKey("OFF-", Unmapped_Key, 0x019, 0x97);
+  addKaseikyoKey("SEARCH", Unmapped_Key, 0x019, 0x9D);
+  addKaseikyoKey("TAPE", Unmapped_Key, 0x019, 0xE0);
+
+  addKaseikyoKey("STILL_ALBUM", Unmapped_Key, 0x059, 0x23);
+  addKaseikyoKey("PROG_PLAY", Unmapped_Key, 0x059, 0x3A);
+  addKaseikyoKey("I-Timer", Unmapped_Key, 0x059, 0x3F);
+  addKaseikyoKey("TV/TEXT", Unmapped_Key, 0x059, 0x57);
+  addKaseikyoKey("ExtLink", Unmapped_Key, 0x059, 0x5B);
 
 // These are fishy:
-//  addKey("RESET_STORE", Unmapped_Key, 0x801A93, 24);
+//  addKaseikyoKey("RESET_STORE", Unmapped_Key, 0x019, 0x58);
 }
 
 
@@ -387,9 +355,9 @@ PanasonicVCR1a::PanasonicVCR1a(
 {
   setKeysetName("VCR Keyset 1a");
 
-  addKey("DISPLAY", Info_Key, 0x80FA73, 24);
-  addKey("AV", Input_Key, 0x00030A, 24);
-  addKey("OSD", Info_Key, 0x00EAE3, 24);
+  addKaseikyoKey("OSD", Info_Key, 0x009, 0x57);
+  addKaseikyoKey("AV", Input_Key, 0x009, 0xC0);
+  addKaseikyoKey("DISPLAY", Info_Key, 0x019, 0x5F);
 }
 
 
@@ -400,9 +368,9 @@ PanasonicVCR1b::PanasonicVCR1b(
 {
   setKeysetName("VCR Keyset 1b");
 
-  addKey("clear", Clear_Key, 0x8050D9, 24);
-  addKey("prog", Program_Key, 0x00FFF6, 24);
-  addKey("repeat", Repeat_Key, 0x009F96, 24);
+  addKaseikyoKey("repeat", Repeat_Key, 0x009, 0xF9);
+  addKaseikyoKey("prog", Program_Key, 0x009, 0xFF);
+  addKaseikyoKey("clear", Clear_Key, 0x019, 0x0A);
 }
 
 
@@ -413,10 +381,10 @@ PanasonicVCR1c::PanasonicVCR1c(
 {
   setKeysetName("VCR Keyset 1c");
 
-  addKey("rotate", Up_Key, 0x8040C9, 24);
-  addKey("rotatedown", Down_Key, 0x80C049, 24);
-  addKey("set", Select_Key, 0x8020A9, 24);
-  addKey("clear", Exit_Key, 0x80A029, 24);
+  addKaseikyoKey("rotate", Up_Key, 0x019, 0x02);
+  addKaseikyoKey("rotatedown", Down_Key, 0x019, 0x03);
+  addKaseikyoKey("set", Select_Key, 0x019, 0x04);
+  addKaseikyoKey("clear", Exit_Key, 0x019, 0x05);
 }
 
 
@@ -428,97 +396,84 @@ PanasonicDVD1::PanasonicDVD1(
       Panasonic_Make,
       index)
 {
-  LIRCProtocol *lp = new LIRCProtocol(
-    guiObject,
-    index,
-    500, 400,
-    500, 1200,
-    75000, false);
-
-  threadableProtocol = lp;
-
-  lp->setHeaderPair(3500, 1650);
-  lp->setTrailerPulse(500);
-
-  setPreData(0x40040D00, 32);
-
-  addKey("POWER", Power_Key, 0xBCB1, 16);
-  addKey("PLAY", Play_Key, 0x505D, 16);
-  addKey("REW", Rewind_Key, 0x202D, 16);
-  addKey("FF", FastForward_Key, 0xA0AD, 16);
-  addKey("STOP", Stop_Key, 0x000D, 16);
-  addKey("PAUSE", Pause_Key, 0x606D, 16);
-  addKey("PREV", Previous_Key, 0x929F, 16);
-  addKey("NEXT", Next_Key, 0x525F, 16);
-  addKey("UP", Up_Key, 0xA1AC, 16);
-  addKey("LEFT", Left_Key, 0xE1EC, 16);
-  addKey("RIGHT", Right_Key, 0x111C, 16);
-  addKey("DOWN", Down_Key, 0x616C, 16);
-  addKey("ACTION", Select_Key, 0x414C, 16);
-  addKey("RETURN", Exit_Key, 0x818C, 16);
-  addKey("MENU", Menu_Key, 0x010C, 16);
-  addKey("INFO", Info_Key, 0x4944, 16);
-  addKey("1", One_Key, 0x0805, 16);
-  addKey("2", Two_Key, 0x8885, 16);
-  addKey("3", Three_Key, 0x4845, 16);
-  addKey("4", Four_Key, 0xC8C5, 16);
-  addKey("5", Five_Key, 0x2825, 16);
-  addKey("6", Six_Key, 0xA8A5, 16);
-  addKey("7", Seven_Key, 0x6865, 16);
-  addKey("8", Eight_Key, 0xE8E5, 16);
-  addKey("9", Nine_Key, 0x1815, 16);
-  addKey("0", Zero_Key, 0x9895, 16);
-  addKey("CANCEL", Clear_Key, 0xC1CC, 16);
-  addKey("+10", DoubleDigit_Key, 0x919C, 16);
-  addKey("inputselect", Input_Key, 0x919C, 16);
-//  addKey("R-TUNE", PrevChannel_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", 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", 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", EnhancedBass_Key, 0x2B26, 16);
-  addKey("CINEMA", Unmapped_Key, 0x030E, 16);
-  addKey("D.ENH", Unmapped_Key, 0xABA6, 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);
-  addKey("PLAY_MODE", Unmapped_Key, 0xB1BC, 16);
-  addKey("SETUP", Unmapped_Key, 0x2924, 16);
-  addKey("CINEMA", Unmapped_Key, 0x030E, 16);
-  addKey("VOLUMEUP", VolumeUp_Key, 0xC6CB, 16);
-  addKey("VOLUMEDOWN", VolumeDown_Key, 0x262B, 16);
-  addKey("showview", Unmapped_Key, 0xFEF3, 16);
-  addKey("manualskip", Unmapped_Key, 0x323F, 16);
-  addKey("functions", Unmapped_Key, 0xEAE7, 16);
-  addKey("progcheck", Unmapped_Key, 0x3E33, 16);
-  addKey("status", Unmapped_Key, 0xFAF7, 16);
-  addKey("timeslip", Unmapped_Key, 0xD2DF, 16);
-  addKey("rec", Record_Key, 0x101D, 16);
-  addKey("recmode", Unmapped_Key, 0x8A87, 16);
-  addKey("extlink", Unmapped_Key, 0xC4C9, 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);
-  addKey("DISC", Unmapped_Key, 0xEDE0, 16);
-  addKey("SEQUENTIAL", Unmapped_Key, 0xFDF0, 16);
-  addKey("FL_SELECT", Unmapped_Key, 0x6D60, 16);
-  addKey("i", Unmapped_Key, 0x666B, 16);
-//  addKey("EXIT", Unmapped_Key, 0x808A07, 24);
-//  addKey("RED", Unmapped_Key, 0x80820F, 24);
-//  addKey("GREEN", Unmapped_Key, 0x8042CF, 24);
+  threadableProtocol = new KaseikyoProtocol(guiObject, index);
+
+//  setPreData(0x40040D00, 32);
+  setPreData(0x2002, 16);
+
+  addKaseikyoKey("STOP", Stop_Key, 0x00B, 0x00);
+  addKaseikyoKey("OPEN/CLOSE", Eject_Key, 0x00B, 0x01);
+//  addKaseikyoKey("TV-SAT", Input_Key, 0x00B, 0x01);
+  addKaseikyoKey("REW", Rewind_Key, 0x00B, 0x04);
+  addKaseikyoKey("FF", FastForward_Key, 0x00B, 0x05);
+  addKaseikyoKey("PAUSE", Pause_Key, 0x00B, 0x06);
+  addKaseikyoKey("CH_DOWN", ChannelDown_Key, 0x00B, 0x07);
+  addKaseikyoKey("rec", Record_Key, 0x00B, 0x08);
+  addKaseikyoKey("PLAY", Play_Key, 0x00B, 0x0A);
+  addKaseikyoKey("CH_UP", ChannelUp_Key, 0x00B, 0x0F);
+  addKaseikyoKey("1", One_Key, 0x00B, 0x10);
+  addKaseikyoKey("2", Two_Key, 0x00B, 0x11);
+  addKaseikyoKey("3", Three_Key, 0x00B, 0x12);
+  addKaseikyoKey("4", Four_Key, 0x00B, 0x13);
+  addKaseikyoKey("5", Five_Key, 0x00B, 0x14);
+  addKaseikyoKey("6", Six_Key, 0x00B, 0x15);
+  addKaseikyoKey("7", Seven_Key, 0x00B, 0x16);
+  addKaseikyoKey("8", Eight_Key, 0x00B, 0x17);
+  addKaseikyoKey("9", Nine_Key, 0x00B, 0x18);
+  addKaseikyoKey("0", Zero_Key, 0x00B, 0x19);
+  addKaseikyoKey("extlink", Unmapped_Key, 0x00B, 0x23);
+  addKaseikyoKey("AUDIO", Audio_Key, 0x00B, 0x33);
+  addKaseikyoKey("POWER", Power_Key, 0x00B, 0x3D);
+  addKaseikyoKey("erase", Unmapped_Key, 0x00B, 0x44); // "DELETE"
+  addKaseikyoKey("POSITION_MEMORY", Unmapped_Key, 0x00B, 0x46);
+  addKaseikyoKey("A-B_REPEAT", RepeatAB_Key, 0x00B, 0x48);
+  addKaseikyoKey("PREV", Previous_Key, 0x00B, 0x49);
+  addKaseikyoKey("NEXT", Next_Key, 0x00B, 0x04A);
+  addKaseikyoKey("timeslip", Unmapped_Key, 0x00B, 0x4B);
+  addKaseikyoKey("manualskip", Unmapped_Key, 0x00B, 0x4C);
+  addKaseikyoKey("RANDOM", Random_Key, 0x00B, 0x4D);
+  addKaseikyoKey("recmode", Unmapped_Key, 0x00B, 0x51);
+  addKaseikyoKey("functions", Unmapped_Key, 0x00B, 0x57);
+  addKaseikyoKey("createchapter", Unmapped_Key, 0x00B, 0x58);
+  addKaseikyoKey("status", Unmapped_Key, 0x00B, 0x5F);
+  addKaseikyoKey("VOLUMEDOWN", VolumeDown_Key, 0x00B, 0x62);
+  addKaseikyoKey("VOLUMEUP", VolumeUp_Key, 0x00B, 0x63);
+  addKaseikyoKey("i", Unmapped_Key, 0x00B, 0x66);
+  addKaseikyoKey("timer", Timer_Key, 0x00B, 0x78);
+  addKaseikyoKey("progcheck", Unmapped_Key, 0x00B, 0x7C);
+  addKaseikyoKey("showview", Unmapped_Key, 0x00B, 0x7F);
+  addKaseikyoKey("MENU", Menu_Key, 0x00B, 0x80);
+  addKaseikyoKey("RETURN", Exit_Key, 0x00B, 0x81);
+  addKaseikyoKey("ACTION", Select_Key, 0x00B, 0x82);
+  addKaseikyoKey("CANCEL", Clear_Key, 0x00B, 0x83);
+  addKaseikyoKey("UP", Up_Key, 0x00B, 0x85);
+  addKaseikyoKey("DOWN", Down_Key, 0x00B, 0x86);
+  addKaseikyoKey("LEFT", Left_Key, 0x00B, 0x87);
+  addKaseikyoKey("RIGHT", Right_Key, 0x00B, 0x88);
+  addKaseikyoKey("+10", DoubleDigit_Key, 0x00B, 0x89);
+//  addKaseikyoKey("inputselect", Input_Key, 0x00B, 0x89); // odd!
+  addKaseikyoKey("PROGRAM", Program_Key, 0x00B, 0x8A);
+  addKaseikyoKey("QUICK_REPLAY", Replay_Key, 0x00B, 0x8B);
+  addKaseikyoKey("REPEAT", Repeat_Key, 0x00B, 0x8C);
+  addKaseikyoKey("PLAY_MODE", Unmapped_Key, 0x00B, 0x8D);
+  addKaseikyoKey("ANGLE", Angle_Key, 0x00B, 0x90);
+  addKaseikyoKey("SUBTITLE", Captions_Key, 0x00B, 0x91);
+  addKaseikyoKey("INFO", Info_Key, 0x00B, 0x92);
+  addKaseikyoKey("SETUP", Unmapped_Key, 0x00B, 0x94);
+//  addKaseikyoKey("R-TUNE", PrevChannel_Key, 0x00B, 0x9B);
+  addKaseikyoKey("TOP_MENU", DiscTitle_Key, 0x00B, 0x9B);
+  addKaseikyoKey("A.SRD", Unmapped_Key, 0x00B, 0x9E);
+  addKaseikyoKey("FL_SELECT", Unmapped_Key, 0x00B, 0xB6);
+  addKaseikyoKey("DISC", Unmapped_Key, 0x00B, 0xB7);
+  addKaseikyoKey("SEQUENTIAL", Unmapped_Key, 0x00B, 0xBF);
+  addKaseikyoKey("CINEMA", Unmapped_Key, 0x00B, 0xC0);
+  addKaseikyoKey("ZOOM", Zoom_Key, 0x00B, 0xC1);
+  addKaseikyoKey("frec", Unmapped_Key, 0x00B, 0xC7);
+  addKaseikyoKey("BASS", EnhancedBass_Key, 0x00B, 0xD4);
+  addKaseikyoKey("D.ENH", Unmapped_Key, 0x00B, 0xD5);
+  addKaseikyoKey("ONETOUCH_MEMORY", Unmapped_Key, 0x00B, 0xD6);
+  addKaseikyoKey("GROUP", Unmapped_Key, 0x00B, 0xE0);
+  addKaseikyoKey("SLEEP", Sleep_Key, 0x00B, 0xEB);
 }
 
 
@@ -529,10 +484,9 @@ PanasonicDVD1a::PanasonicDVD1a(
 {
   setKeysetName("DVD Keyset 1a");
 
-  addKey("channel2up", ChannelUp_Key, 0x2C21, 16);
-  addKey("channel2down", ChannelDown_Key, 0xACA1, 16);
-  addKey("DELETE", Clear_Key, 0x222F, 16);
-  addKey("INPUT_SELECT", Input_Key, 0x0A07, 16);
+  addKaseikyoKey("channel2up", ChannelUp_Key, 0x00B, 0x34);
+  addKaseikyoKey("channel2down", ChannelDown_Key, 0x00B, 0x35);
+  addKaseikyoKey("INPUT_SELECT", Input_Key, 0x00B, 0x50);
 }
 
 
@@ -547,92 +501,72 @@ PanasonicAudio1::PanasonicAudio1(
   addControlledDevice(Panasonic_Make, "RX-DS25", Audio_Device);
   addControlledDevice(Panasonic_Make, "RX-e300", Audio_Device);
 
-  LIRCProtocol *lp = new LIRCProtocol(
-    guiObject,
-    index,
-    400, 400,
-    400, 1200,
-    76000, false);
-
-  threadableProtocol = lp;
-
-  lp->setHeaderPair(4000, 1600);
-  lp->setTrailerPulse(400);
-
-//  lp->setMinimumRepetitions(1);
-
-  setPreData(0x40040543, 32);
-
-  addKey("power", Power_Key, 0xFDBB, 16);
-  addKey("tape", TapeInput_Key, 0x3573, 16);
-  addKey("1", One_Key, 0x094F, 16);
-  addKey("2", Two_Key, 0x89CF, 16);
-  addKey("3", Three_Key, 0x490F, 16);
-  addKey("4", Four_Key, 0xC98F, 16);
-  addKey("5", Five_Key, 0x296F, 16);
-  addKey("6", Six_Key, 0xA9EF, 16);
-  addKey("7", Seven_Key, 0x692F, 16);
-  addKey("8", Eight_Key, 0xE9AF, 16);
-  addKey("9", Nine_Key, 0x195F, 16);
-  addKey("+10", DoubleDigit_Key, 0xF9BF, 16);
-  addKey("10/0", Zero_Key, 0x99DF, 16);
-  addKey("cancel", Clear_Key, 0xB1F7, 16);
-  addKey("program", Program_Key, 0xD197, 16); // "MEMORY"
-  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", FMMode_Key, 0x2761, 16); // "st-mono"
-  addKey("cd", CDInput_Key, 0x6D2B, 16);
-  addKey("prev", Previous_Key, 0x2167, 16);
-  addKey("next", Next_Key, 0xA1E7, 16);
-  addKey("stop-clear", Stop_Key, 0x0147, 16);
-  addKey("play-pause", Play_Key, 0xE1A7, 16);
-  addKey("play-pause", Pause_Key, 0xE1A7, 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);
-  addKey("sleep", Sleep_Key, 0x3D7B, 16);
-  addKey("display", Info_Key, 0xF1B7, 16);
-  addKey("preset_eq", Unmapped_Key, 0x9BDD, 16);
-  addKey("bp", Unmapped_Key, 0xF7B1, 16); // "TUNER_BP"
-  addKey("tape_record", Record_Key, 0x2563, 16);
-  addKey("counter_reset", Reset_Key, 0xF5B3, 16);
-  addKey("rev_mode", Unmapped_Key, 0x7533, 16); // "TAPE_REV_MODE"
-  addKey("rew", Rewind_Key, 0x4503, 16);
-  addKey("ff", FastForward_Key, 0xC583, 16);
-  addKey("tape_play", Unmapped_Key, 0x6523, 16);
-  addKey("tape_stop", Unmapped_Key, 0x0543, 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);
-  addKey("panelclose", Unmapped_Key, 0xAFE9, 16); // "TOP_PANEL_CLOSE"
-  addKey("panelopen", Unmapped_Key, 0x2F69, 16);  // "TOP_PANEL_OPEN"
-  addKey("virtualizer", Unmapped_Key, 0x5B1D, 16); // "S.VIRT"
-  addKey("AUTOSCAN", Unmapped_Key, 0x3771, 16);
-  addKey("TRACK<<", Unmapped_Key, 0x8BCD, 16);
-  addKey("TRACK>>", Unmapped_Key, 0x0B4D, 16);
-  addKey("INTRO", Unmapped_Key, 0x6224, 16);
+  threadableProtocol = new KaseikyoProtocol(guiObject, index);
+
+//  setPreData(0x40040543, 32);
+  setPreData(0x2002, 16);
+
+  addKaseikyoKey("INTRO", Unmapped_Key, 0xC2A, 0x46); // odd
+
+  addKaseikyoKey("stop-clear", Stop_Key, 0xC2A, 0x80);
+  addKaseikyoKey("repeat", Repeat_Key, 0xC2A, 0x81);
+  addKaseikyoKey("random", Random_Key, 0xC2A, 0x82);
+  addKaseikyoKey("eject", Eject_Key, 0xC2A, 0x8E);
+  addKaseikyoKey("prev", Rewind_Key, 0xC2A, 0x84); // "CD_<<"
+  addKaseikyoKey("next", FastForward_Key, 0xC2A, 0x85); // "CD_>>"
+  addKaseikyoKey("CD_PAUSE", Pause_Key, 0xC2A, 0x86);
+  addKaseikyoKey("play-pause", Play_Key, 0xC2A, 0x87);
+  addKaseikyoKey("program", Program_Key, 0xC2A, 0x8B); // "MEMORY"
+  addKaseikyoKey("cancel", Clear_Key, 0xC2A, 0x8D);
+  addKaseikyoKey("display", Info_Key, 0xC2A, 0x8F);
+
+  addKaseikyoKey("1", One_Key, 0xC2A, 0x90);
+  addKaseikyoKey("2", Two_Key, 0xC2A, 0x91);
+  addKaseikyoKey("3", Three_Key, 0xC2A, 0x92);
+  addKaseikyoKey("4", Four_Key, 0xC2A, 0x93);
+  addKaseikyoKey("5", Five_Key, 0xC2A, 0x94);
+  addKaseikyoKey("6", Six_Key, 0xC2A, 0x95);
+  addKaseikyoKey("7", Seven_Key, 0xC2A, 0x96);
+  addKaseikyoKey("8", Eight_Key, 0xC2A, 0x97);
+  addKaseikyoKey("9", Nine_Key, 0xC2A, 0x98);
+  addKaseikyoKey("10/0", Zero_Key, 0xC2A, 0x99);
+  addKaseikyoKey("+10", DoubleDigit_Key, 0xC2A, 0x9F);
+
+  addKaseikyoKey("tape_stop", Unmapped_Key, 0xC2A, 0xA0);
+  addKaseikyoKey("rew", Unmapped_Key, 0xC2A, 0xA2); // "TAPE_<<"
+  addKaseikyoKey("ff", Unmapped_Key, 0xC2A, 0xA3); // "TAPE_>>"
+  addKaseikyoKey("tape_record", Record_Key, 0xC2A, 0xA4);
+  addKaseikyoKey("TAPE_PLAY_REWIND", Unmapped_Key, 0xC2A, 0xA5);
+  addKaseikyoKey("tape_play", Unmapped_Key, 0xC2A, 0xA6); // "TAPE_PLAY_FORWARD"
+  addKaseikyoKey("tape", TapeInput_Key, 0xC2A, 0xAC);
+  addKaseikyoKey("TAPE_DECK", Unmapped_Key, 0xC2A, 0xAD);
+  addKaseikyoKey("rev_mode", Unmapped_Key, 0xC2A, 0xAE); // "TAPE_REV_MODE"
+  addKaseikyoKey("counter_reset", Reset_Key, 0xC2A, 0xAF);
+
+  addKaseikyoKey("vol+", VolumeUp_Key, 0xC2A, 0xB0);
+  addKaseikyoKey("vol-", VolumeDown_Key, 0xC2A, 0xB1);
+  addKaseikyoKey("cd", CDInput_Key, 0xC2A, 0xB6);
+  addKaseikyoKey("tuner-band", TunerBand_Key, 0xC2A, 0xB8);
+  addKaseikyoKey("sleep", Sleep_Key, 0xC2A, 0xBC);
+  addKaseikyoKey("power", Power_Key, 0xC2A, 0xBF);
+
+  addKaseikyoKey("TRACK>>", Unmapped_Key, 0xC2A, 0xD0);
+  addKaseikyoKey("TRACK<<", Unmapped_Key, 0xC2A, 0xD1);
+  addKaseikyoKey("xbs", Unmapped_Key, 0xC2A, 0xD6);
+  addKaseikyoKey("preset_eq", Unmapped_Key, 0xC2A, 0xD9);
+  addKaseikyoKey("virtualizer", Unmapped_Key, 0xC2A, 0xDA); // "S.VIRT"
+
+  addKaseikyoKey("fm-mode", FMMode_Key, 0xC2A, 0xE4); // "st-mono"
+  addKaseikyoKey("TUNER_PRESET_TUNE_UP", NextPreset_Key, 0xC2A, 0xE7);
+  addKaseikyoKey("TUNER_PRESET_TUNE_UP", Next_Key, 0xC2A, 0xE7);
+  addKaseikyoKey("TUNER_PRESET_TUNE_DOWN", PrevPreset_Key, 0xC2A, 0xE8);
+  addKaseikyoKey("TUNER_PRESET_TUNE_DOWN", Previous_Key, 0xC2A, 0xE8);
+  addKaseikyoKey("tuning+", ChannelUp_Key, 0xC2A, 0xE9);
+  addKaseikyoKey("tuning-", ChannelDown_Key, 0xC2A, 0xEA);
+  addKaseikyoKey("AUTOSCAN", Scan_Key, 0xC2A, 0xEC);
+  addKaseikyoKey("bp", Unmapped_Key, 0xC2A, 0xEF); // "TUNER_BP", beat-proof?
+
+  addKaseikyoKey("panelopen", Unmapped_Key, 0xC2A, 0xF4);  // "TOP_PANEL_OPEN"
+  addKaseikyoKey("panelclose", Unmapped_Key, 0xC2A, 0xF5); // "TOP_PANEL_CLOSE"
 }
 
-
-PanasonicAudio1a::PanasonicAudio1a(
-  QObject *guiObject,
-  unsigned int index)
-  : PanasonicAudio1(guiObject, index)
-{
-  setKeysetName("Audio Keyset 1a");
-
-  addControlledDevice(Panasonic_Make, "RX-DT55", Audio_Device);
-  addControlledDevice(Panasonic_Make, "RX-DT505", Audio_Device);
-
-  addKey("CD_PAUSE", Pause_Key, 0x6127, 16);
-  addKey("CD_<<", Rewind_Key, 0x2167, 16);
-  addKey("CD_>>", FastForward_Key, 0xA1E7, 16);
-  addKey("TAPE_<<", Unmapped_Key, 0x4503, 16);
-  addKey("TAPE_>>", Unmapped_Key, 0xC583, 16);
-  addKey("eject", Eject_Key, 0x7137, 16);
-}
index 09d220c..5fe45ee 100644 (file)
@@ -5,14 +5,6 @@
 
 class QObject;
 
-class PanasonicAmp: public PIRKeysetMetaData
-{
-public:
-  PanasonicAmp(
-    QObject *guiObject,
-    unsigned int index);
-};
-
 class PanasonicCarAudio: public PIRKeysetMetaData
 {
 public:
index 8fe9513..18ae9ff 100644 (file)
@@ -3,11 +3,9 @@
 # file1.source = myfile
 # dir1.source = mydir
 #DEPLOYMENTFOLDERS = # file1 dir1
-sudoers_stuff.source = pierogi.sudoers
-sudoers_stuff.target = ../../etc/sudoers.d
 loadModule.source = loadRX51Module unloadRX51Module
 loadModule.target = bin
-DEPLOYMENTFOLDERS = loadModule sudoers_stuff
+DEPLOYMENTFOLDERS = loadModule
 
 #symbian:TARGET.UID3 = 0xE0C0A793
 
@@ -82,7 +80,10 @@ SOURCES += main.cpp mainwindow.cpp \
     protocols/rcaprotocol.cpp \
     keysets/acer.cpp \
     keysets/aiwa.cpp \
-    protocols/aiwaprotocol.cpp
+    protocols/aiwaprotocol.cpp \
+    protocols/kaseikyoprotocol.cpp \
+    keysets/bose.cpp \
+    protocols/boseprotocol.cpp
 HEADERS += mainwindow.h \
     pirkeynames.h \
     pirmakenames.h \
@@ -139,7 +140,10 @@ HEADERS += mainwindow.h \
     protocols/rcaprotocol.h \
     keysets/acer.h \
     keysets/aiwa.h \
-    protocols/aiwaprotocol.h
+    protocols/aiwaprotocol.h \
+    protocols/kaseikyoprotocol.h \
+    protocols/boseprotocol.h \
+    keysets/bose.h
 FORMS += mainwindow.ui \
     pirdocumentationform.ui \
     piraboutform.ui \
@@ -195,7 +199,6 @@ OTHER_FILES += \
     qtc_packaging/debian_fremantle/control \
     qtc_packaging/debian_fremantle/compat \
     qtc_packaging/debian_fremantle/changelog \
-    pierogi.sudoers \
     qtc_packaging/debian_fremantle/postinst \
     www/index.html \
     www/KeypadTab.png \
index db8bc27..c6ba144 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by Qt Creator 2.4.1, 2012-02-06T10:12:27. -->
+<!-- Written by Qt Creator 2.4.1, 2012-02-08T17:10:54. -->
 <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.5.1</value>
+      <value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">/Users/john/Develop/n900/pierogi-0.5.2</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_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_5_2_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>
        <value type="QString">/Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_5_1_armel.deb</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">192.168.0.15</value>
        <value type="QString">localhost</value>
        <value type="QString">192.168.0.15</value>
        <value type="QString">192.168.0.15</value>
        <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-02-03T10:04:34</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-02-08T11:55:19</value>
        <value type="QDateTime">2012-01-01T15:35:35</value>
        <value type="QDateTime">2012-01-25T13:42:55</value>
-       <value type="QDateTime">2012-02-06T09:42:34</value>
+       <value type="QDateTime">2012-02-06T17:22:16</value>
       </valuelist>
      </valuemap>
      <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">3</value>
diff --git a/pierogi.sudoers b/pierogi.sudoers
deleted file mode 100644 (file)
index c980496..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-user ALL = NOPASSWD: /opt/pierogi/bin/loadRX51Module
-user ALL = NOPASSWD: /opt/pierogi/bin/unloadRX51Module
index 44292b1..a57a398 100644 (file)
@@ -7,6 +7,7 @@
 #include "keysets/acer.h"
 #include "keysets/aiwa.h"
 #include "keysets/apple.h"
+#include "keysets/bose.h"
 #include "keysets/denon.h"
 #include "keysets/ei.h"
 #include "keysets/elgato.h"
@@ -60,16 +61,26 @@ PIRKeysetManager::PIRKeysetManager(
 
   populateKeyset(new AiwaVCR1(guiObject, counter++));
   populateKeyset(new AiwaVCR2(guiObject, counter++));
+  populateKeyset(new AiwaVCR3(guiObject, counter++));
   populateKeyset(new AiwaAudio1(guiObject, counter++));
   populateKeyset(new AiwaAudio1a(guiObject, counter++));
   populateKeyset(new AiwaAudio2(guiObject, counter++));
+  populateKeyset(new AiwaAudio2a(guiObject, counter++));
+  populateKeyset(new AiwaAudio2b(guiObject, counter++));
+  populateKeyset(new AiwaAudio2c(guiObject, counter++));
   populateKeyset(new AiwaAudio3(guiObject, counter++));
   populateKeyset(new AiwaAudio4(guiObject, counter++));
   populateKeyset(new AiwaAudio5(guiObject, counter++));
+  populateKeyset(new AiwaAudio6(guiObject, counter++));
+  populateKeyset(new AiwaCarStereo1(guiObject, counter++));
   populateKeyset(new AiwaDVD1(guiObject, counter++));
 
   populateKeyset(new AppleWhiteRemote(guiObject, counter++));
 
+  populateKeyset(new BoseRadio1(guiObject, counter++));
+  populateKeyset(new BoseRadio2(guiObject, counter++));
+  populateKeyset(new BoseRadio3(guiObject, counter++));
+
   populateKeyset(new DenonDVD1(guiObject, counter++));
   populateKeyset(new DenonDVD2(guiObject, counter++));
   populateKeyset(new DenonDVD3(guiObject, counter++));
@@ -166,7 +177,6 @@ PIRKeysetManager::PIRKeysetManager(
 
   populateKeyset(new NokiaGenericVCR(guiObject, counter++));
 
-  populateKeyset(new PanasonicAmp(guiObject, counter++));
   populateKeyset(new PanasonicCarAudio(guiObject, counter++));
   populateKeyset(new PanasonicSat1(guiObject, counter++));
   populateKeyset(new PanasonicSat1a(guiObject, counter++));
@@ -180,7 +190,6 @@ PIRKeysetManager::PIRKeysetManager(
   populateKeyset(new PanasonicDVD1(guiObject, counter++));
   populateKeyset(new PanasonicDVD1a(guiObject, counter++));
   populateKeyset(new PanasonicAudio1(guiObject, counter++));
-  populateKeyset(new PanasonicAudio1a(guiObject, counter++));
 
   populateKeyset(new PhilipsTV1(guiObject, counter++));
   populateKeyset(new PhilipsTV1a(guiObject, counter++));
index 1c755a2..ee1acf4 100644 (file)
@@ -192,6 +192,20 @@ void PIRKeysetMetaData::addRCAKey(
 */
 
 
+void PIRKeysetMetaData::addKaseikyoKey(
+  const char *name,
+  PIRKeyName key,
+  unsigned int addressData,
+  unsigned int commandData)
+{
+  if (key != Unmapped_Key)
+  {
+    keys[key] = name;
+    threadableProtocol->addKaseikyoKey(key, addressData, commandData);
+  }
+}
+
+
 void PIRKeysetMetaData::setPreData(
   unsigned long data,
   unsigned int bits)
index 42e34c2..2267899 100644 (file)
@@ -121,6 +121,12 @@ protected:
     unsigned int commandData);
 */
 
+  void addKaseikyoKey(
+    const char *name,
+    PIRKeyName key,
+    unsigned int addressData,
+    unsigned int commandData);
+
   void setPreData(
     unsigned long data,
     unsigned int bits);
index bb0b423..cacbecb 100644 (file)
@@ -8,6 +8,7 @@ PIRMakeMgr::PIRMakeMgr()
   makes[Acer_Make] = "Acer";
   makes[Aiwa_Make] = "Aiwa";
   makes[Apple_Make] = "Apple";
+  makes[Bose_Make] = "Bose";
   makes[Denon_Make] = "Denon";
   makes[Ei_Make] = "Ei";
   makes[Elgato_Make] = "Elgato";
index fa6a9ca..cde6630 100644 (file)
@@ -9,6 +9,7 @@ enum PIRMakeName{
   Acer_Make,
   Aiwa_Make,
   Apple_Make,
+  Bose_Make,
   Denon_Make,
   Ei_Make,
   Elgato_Make,
diff --git a/protocols/boseprotocol.cpp b/protocols/boseprotocol.cpp
new file mode 100644 (file)
index 0000000..63e1658
--- /dev/null
@@ -0,0 +1,119 @@
+#include "boseprotocol.h"
+
+#include "pirrx51hardware.h"
+
+#include "pirexception.h"
+
+// Some global communications stuff:
+#include <QMutex>
+extern bool commandInFlight;
+extern QMutex commandIFMutex;
+
+// Here's what I've been able to scrounge up on the Bose protocol:
+// A "zero" is encoded with a 500 usec pulse, 500 usec space.
+// A "one" is encoded with a 500 usec pulse, and 3*500 (1500) usec space.
+// The header is a 1000 usec pulse, 1500 usec space.
+// Commands end with a trailing 500 usec pulse.
+// When repeating, the entire command is resent.
+// A gap of 50000 usec is placed between repeated commands.
+
+BoseProtocol::BoseProtocol(
+  QObject *guiObject,
+  unsigned int index)
+  : SpaceProtocol(
+      guiObject, index,
+      500, 500,
+      500, 1500,
+      1000, 1500,
+      500,
+      50000, false)
+{
+}
+
+
+void BoseProtocol::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)
+      {
+        // 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 BoseProtocol::generateStandardCommand(
+  const PIRKeyBits &pkb,
+  PIRRX51Hardware &rx51device)
+{
+  int duration = 0;
+
+  // First, the "header" pulse:
+  rx51device.addPair(headerPulse, headerSpace);
+  duration += (headerPulse + headerSpace);
+
+  // The Bose protocol uses 1/2 of the NEC protocol; it has the command
+  // portion, but no device address portion.  So, we only need to reverse
+  // the command, then invert and reverse the command:
+  duration += pushReverseBits(pkb.firstCode, rx51device);
+  duration += pushInvertedReverseBits(pkb.firstCode, rx51device);
+
+  // Finally add the "trail":
+  rx51device.addSingle(trailerPulse);
+  duration += trailerPulse;
+
+  return duration;
+}
+
diff --git a/protocols/boseprotocol.h b/protocols/boseprotocol.h
new file mode 100644 (file)
index 0000000..dffe11e
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef BOSEPROTOCOL_H
+#define BOSEPROTOCOL_H
+
+#include "spaceprotocol.h"
+
+class PIRRX51Hardware;
+
+//
+// Bose appears to be using a simplified version of the NEC protocol; it
+// has a smaller header, and completely omits the device address portion
+// of the protocol (so, only the command portion is sent).
+//
+
+class BoseProtocol: public SpaceProtocol
+{
+public:
+  BoseProtocol(
+    QObject *guiObject,
+    unsigned int index);
+
+public slots:
+  void startSendingCommand(
+    unsigned int threadableID,
+    PIRKeyName command);
+
+private:
+  int generateStandardCommand(
+    const PIRKeyBits &bits,
+    PIRRX51Hardware &device);
+};
+
+#endif // BOSEPROTOCOL_H
diff --git a/protocols/kaseikyoprotocol.cpp b/protocols/kaseikyoprotocol.cpp
new file mode 100644 (file)
index 0000000..44169aa
--- /dev/null
@@ -0,0 +1,275 @@
+#include "kaseikyoprotocol.h"
+
+#include "pirrx51hardware.h"
+
+#include "pirexception.h"
+
+// Some global communications stuff:
+#include <QMutex>
+extern bool commandInFlight;
+extern QMutex commandIFMutex;
+
+// Getting good data on the Kaseikyo protocol(s) is difficult.  The following
+// is my current understanding:
+// A "zero" is encoded with a 432 usec pulse, 432 usec space.
+// A "one" is encoded with a 432 usec pulse, and 3*432 (1296) usec space.
+// The header has a 3456 usec pulse, and a 1728 usec space.
+// Commands end with a trailing 432 usec pulse.
+// When repeating, the entire pulse train is re-sent.
+// There is a 74736 usec gap between repeated commands.
+// The carrier frequency is 37 kHz.
+
+KaseikyoProtocol::KaseikyoProtocol(
+  QObject *guiObject,
+  unsigned int index)
+  : SpaceProtocol(
+      guiObject, index,
+      432, 432,
+      432, 1296,
+      3456, 1728,
+      432,
+      74736, false)
+{
+  setCarrierFrequency(37000);
+}
+
+
+void KaseikyoProtocol::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)
+      {
+        // 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 KaseikyoProtocol::generateStandardCommand(
+  const PIRKeyBits &pkb,
+  PIRRX51Hardware &rx51device)
+{
+  int duration = 0;
+
+  // First, the header pulse:
+  rx51device.addPair(headerPulse, headerSpace);
+  duration += (headerPulse + headerSpace);
+
+  // While I don't yet fully understand the contents of the protocol, the
+  // data is obviously split into a first half (supposedly containing
+  // manufacturer ID codes) and a second half (containing address and command
+  // data).  The first half is 16 bits long plus a 4 bit checksum, and the
+  // second half is 24 bits long plus a 4 bit checksum.  Of that second half,
+  // the first 12 bits are probably the device, and the last 12 bits are split
+  // into 8 bits of command followed by 4 bits that turn out to be the last
+  // four bits of the command xored with the middle 4 bits of the device.
+  // (At least for Panasonic.)  Very strange.
+  // For now, I'm going with this game plan:
+  // -- The "preData" will contain the 16 bits of manufacturer data as a
+  // single value.
+  // -- The "firstCode" will contain the 12 address bits.
+  // -- The "secondCode" will contain the 8 command bits.
+  // -- I'll generate the three checksums below.
+
+  CommandSequence checksum;
+
+  // The "manufacturer codes":
+  duration += pushReverseBits(preData, rx51device);
+
+  generateChecksum(preData, checksum);
+  duration += pushReverseBits(checksum, rx51device);
+
+  // The command portion:
+  // First, the address and command:
+  duration += pushReverseBits(pkb.firstCode, rx51device);
+  duration += pushReverseBits(pkb.secondCode, rx51device);
+
+  // Next, the odd little checksum:
+  CommandSequence littleChecksum;
+  generateLittleChecksum(pkb.firstCode, pkb.secondCode, littleChecksum);
+  duration += pushReverseBits(littleChecksum, rx51device);
+  
+  // Finally, the last checksum:
+  checksum.clear();
+  generateChecksum(pkb.firstCode, checksum);
+  generateChecksum(pkb.secondCode, checksum);
+  generateChecksum(littleChecksum, checksum);
+  duration += pushReverseBits(checksum, rx51device);
+
+  // Add the trailer pulse:
+  rx51device.addSingle(trailerPulse);
+  duration += trailerPulse;
+
+  return duration;
+}
+
+
+void KaseikyoProtocol::generateChecksum(
+  const CommandSequence &bits,
+  CommandSequence &checksum)
+{
+  bool bit1;
+  bool bit2;
+  bool bit3;
+  bool bit4;
+
+  CommandSequence::const_iterator i = bits.begin();
+
+  // Set up the first four bits:
+  if (i == bits.end()) return; // this shouldn't happen, throw an error?
+  bit1 = *i;
+  ++i;
+
+  if (i == bits.end()) return;
+  bit2 = *i;
+  ++i;
+
+  if (i == bits.end()) return;
+  bit3 = *i;
+  ++i;
+
+  if (i == bits.end()) return;
+  bit4 = *i;
+  ++i;
+
+  while (i != bits.end())
+  {
+    bit1 = bit1 ^ *i;
+    ++i;  
+
+    if (i != bits.end())
+    {
+      bit2 = bit2 ^ *i;
+      ++i;
+
+      if (i != bits.end())
+      {
+        bit3 = bit3 ^ *i;
+        ++i;
+
+        if (i != bits.end())
+        {
+          bit4 = bit4 ^ *i;
+          ++i;
+        }
+      }
+    }
+  }
+
+  // Now, either insert these bits into the checksum, or xor them with the
+  // bits already in the checksum.
+  if (checksum.empty())
+  {
+    checksum.push_back(bit1);
+    checksum.push_back(bit2);
+    checksum.push_back(bit3);
+    checksum.push_back(bit4);
+  }
+  else
+  {
+    CommandSequence::iterator j = checksum.begin();
+    if (j != checksum.end())
+    {
+      *j = *j ^ bit1;
+      ++j;
+    }
+
+    if (j != checksum.end())
+    {
+      *j = *j ^ bit2;
+      ++j;
+    }
+
+    if (j != checksum.end())
+    {
+      *j = *j ^ bit3;
+      ++j;
+    }
+
+    if (j != checksum.end())
+    {
+      *j = *j ^ bit4;
+    }
+  }
+}
+
+
+void KaseikyoProtocol::generateLittleChecksum(
+  const CommandSequence &firstBits,
+  const CommandSequence &secondBits,
+  CommandSequence &littleChecksum)
+{
+  CommandSequence::const_iterator i = firstBits.begin();
+  CommandSequence::const_iterator j = secondBits.begin();
+
+  // Advance both iterators by 4 bits:
+  int index = 0;
+  while ((index < 4) && (i != firstBits.end()) && (j != secondBits.end()))
+  {
+    ++i;
+    ++j;
+    ++index;
+  }
+
+  // Xor the next four bits and store them:
+  index = 0;
+  while ((index < 4) && (i != firstBits.end()) && (j != secondBits.end()))
+  {
+    littleChecksum.push_back(*i ^ *j);
+    ++i;
+    ++j;
+    ++index;
+  }
+}
diff --git a/protocols/kaseikyoprotocol.h b/protocols/kaseikyoprotocol.h
new file mode 100644 (file)
index 0000000..9574298
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef KASEIKYOPROTOCOL_H
+#define KASEIKYOPROTOCOL_H
+
+#include "spaceprotocol.h"
+
+class PIRRX51Hardware;
+
+//
+// The Kaseikyo protocol is a more complex protocol than NEC or RC5 (although
+// not nearly reaching the level of RC6).  I don't have enough information on
+// it yet to understand all of its workings.
+//
+
+class KaseikyoProtocol: public SpaceProtocol
+{
+public:
+  KaseikyoProtocol(
+    QObject *guiObject,
+    unsigned int index);
+
+public slots:
+  void startSendingCommand(
+    unsigned int threadableID,
+    PIRKeyName command);
+
+private:
+  int generateStandardCommand(
+    const PIRKeyBits &bits,
+    PIRRX51Hardware &device);
+
+  void generateChecksum(
+    const CommandSequence &bits,
+    CommandSequence &checksum);
+
+  void generateLittleChecksum(
+    const CommandSequence &firstBits,
+    const CommandSequence &secondBits,
+    CommandSequence &littleChecksum);
+};
+
+#endif // KASEIKYOPROTOCOL_H
index 6f23bfe..f1de67c 100644 (file)
@@ -243,6 +243,29 @@ void PIRProtocol::addRCAKey(
 */
 
 
+void PIRProtocol::addKaseikyoKey(
+  PIRKeyName key,
+  unsigned int addressData,
+  unsigned int commandData)
+{
+  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, addressData, 12);
+  appendToBitSeq(pkb->secondCode, commandData, 8);
+}
+
+
 void PIRProtocol::setCarrierFrequency(
   unsigned int freq)
 {
index b16ea2a..3839af9 100644 (file)
@@ -91,6 +91,11 @@ public:
     unsigned int commandData);
 */
 
+  void addKaseikyoKey(
+    PIRKeyName key,
+    unsigned int addressData,
+    unsigned int commandData);
+
   void setCarrierFrequency(
     unsigned int freq);
 
index 0b146f1..c51b7de 100644 (file)
@@ -1,3 +1,10 @@
+pierogi (0.5.2) unstable; urgency=low
+  * Finally, got a fix for the uninstall problem!
+  * Some general internal cleanup.
+  * Keysets for Acer, Aiwa.
+
+ -- John Pietrzak <jpietrzak8@gmail.com>  Mon, 06 Feb 2012 17:29:07 -0500
+
 pierogi (0.5.1) unstable; urgency=low
   * Updated UI with new window, moved tabs around.  Revamped back-end keyset system, added Pioneer, lots of changes.  Also, yet another attempt at pierogi.sudoers.
 
index e6d9022..15ce426 100644 (file)
@@ -11,5 +11,8 @@ Architecture: armel
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: Universal Infrared 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-Display-Name: pierogi
+XB-Maemo-Upgrade-Description: Continuing to work on installer
+ New method for creating pierogi.sudoers file should finally allow uninstaller to cleanly remove it.  Also, completely revamped Panasonic keysets (possibly breaking them), and added Bose and more Aiwa keysets.
+XSBC-Bugtracker: https://garage.maemo.org/tracker/?func=add&group_id=2286&atid=7641
+XB-Maemo-Display-Name: Pierogi
 XB-Maemo-Icon-26: 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
index d9d5f8f..d2fda90 100755 (executable)
@@ -1,5 +1,12 @@
 #!/bin/sh
 
+# just in case, clean up any existing pierogi.sudoers file:
+rm /etc/sudoers.d/pierogi.sudoers
+
+# now, create the file:
+echo "user ALL = NOPASSWD: /opt/pierogi/bin/loadRX51Module
+user ALL = NOPASSWD: /opt/pierogi/bin/unloadRX51Module" > /etc/sudoers.d/pierogi.sudoers
+
 update-sudoers
 
 exit 0