Memory Management Improved
[pierogi] / keysets / panasonic.cpp
1 #include "panasonic.h"
2 #include "protocols/necprotocol.h"
3 #include "protocols/kaseikyoprotocol.h"
4
5
6 PanasonicCarAudio::PanasonicCarAudio(
7   unsigned int index)
8   : PIRKeysetMetaData(
9       "Car Audio Keyset",
10       Panasonic_Make,
11       index)
12 {
13 }
14
15
16 void PanasonicCarAudio::populateProtocol(
17   QObject *guiObject)
18 {
19   if (threadableProtocol)
20   {
21     // If the pointer is not null, the keyset must already be populated.
22     return;
23   }
24
25   threadableProtocol = new NECProtocol(guiObject, index, true, false);
26
27 //  setPreData(0x8156, 16);
28   setPreData(0x6A81, 16);
29
30   addKey("Power", Power_Key, 0x12, 8);
31   addKey("ATT", Unmapped_Key, 0x14, 8);
32   addKey("Vol_Down", VolumeDown_Key, 0x19, 8);
33   addKey("Mode", SoundMode_Key, 0x1A, 8);
34   addKey("PRG", Program_Key, 0x1C, 8);
35   addKey("Vol_Up", VolumeUp_Key, 0x1D, 8);
36   addKey("Tune/Track_Down", ChannelDown_Key, 0x1E, 8);
37   addKey("Tune/Track_Up", ChannelUp_Key, 0x1F, 8);
38 }
39
40
41 PanasonicSat1::PanasonicSat1(
42   unsigned int index)
43   : PIRKeysetMetaData(
44       "Satellite Keyset 1",
45       Panasonic_Make,
46       index)
47 {
48 }
49
50
51 void PanasonicSat1::populateProtocol(
52   QObject *guiObject)
53 {
54   if (threadableProtocol)
55   {
56     // If the pointer is not null, the keyset must already be populated.
57     return;
58   }
59
60   threadableProtocol = new KaseikyoProtocol(guiObject, index);
61
62 //  setPreData(0x40040140, 32);
63   setPreData(0x2002, 16);
64
65   addKaseikyoKey("PROG", Program_Key, 0x028, 0x8A);
66   addKaseikyoKey("1", One_Key, 0x028, 0xA0);
67   addKaseikyoKey("2", Two_Key, 0x028, 0xA1);
68   addKaseikyoKey("3", Three_Key, 0x028, 0xA2);
69   addKaseikyoKey("4", Four_Key, 0x028, 0xA3);
70   addKaseikyoKey("5", Five_Key, 0x028, 0xA4);
71   addKaseikyoKey("6", Six_Key, 0x028, 0xA5);
72   addKaseikyoKey("7", Seven_Key, 0x028, 0xA6);
73   addKaseikyoKey("8", Eight_Key, 0x028, 0xA7);
74   addKaseikyoKey("9", Nine_Key, 0x028, 0xA8);
75   addKaseikyoKey("0", Zero_Key, 0x028, 0xA9);
76   addKaseikyoKey("CH-", ChannelDown_Key, 0x028, 0xB6);
77   addKaseikyoKey("CH+", ChannelUp_Key, 0x028, 0xB7);
78   addKaseikyoKey("ALT_AUD", Audio_Key, 0x028, 0xB8);
79   addKaseikyoKey("INFO", Info_Key, 0x028, 0xB9);
80   addKaseikyoKey("TV/DSS", Input_Key, 0x028, 0xBC);
81   addKaseikyoKey("POWER", Power_Key, 0x028, 0xBD);
82   addKaseikyoKey("REC", Record_Key, 0x028, 0xC2);
83   addKaseikyoKey("ACTION", Select_Key, 0x028, 0xC3);
84   addKaseikyoKey("MENU", Menu_Key, 0x028, 0xC4);
85   addKaseikyoKey("GUIDE", Guide_Key, 0x028, 0xC5);
86   addKaseikyoKey("EXIT", Exit_Key, 0x028, 0xC6);
87   addKaseikyoKey("UP", Up_Key, 0x028, 0xCA);
88   addKaseikyoKey("DOWN", Down_Key, 0x028, 0xCB);
89   addKaseikyoKey("LEFT", Left_Key, 0x028, 0xCD);
90   addKaseikyoKey("RIGHT", Right_Key, 0x028, 0xCE);
91   addKaseikyoKey("FAV", Favorites_Key, 0x028, 0xD0);
92   addKaseikyoKey("R_TUNE", PrevChannel_Key, 0x028, 0xD1);
93   addKaseikyoKey("GUIDE", Guide_Key, 0x028, 0xD3);
94   addKaseikyoKey("LOGO_TUNE", Unmapped_Key, 0x028, 0xD5);
95   addKaseikyoKey("TXT", Teletext_Key, 0x028, 0xDE);
96   addKaseikyoKey("STTL", Unmapped_Key, 0x028, 0xDF);
97
98   addKaseikyoKey("RED", Red_Key, 0x028, 0xEC);
99   addKaseikyoKey("GREEN", Green_Key, 0x028, 0xED);
100   addKaseikyoKey("BLUE", Blue_Key, 0x028, 0xEE);
101   addKaseikyoKey("YELLOW", Yellow_Key, 0x028, 0xEF);
102 }
103
104
105 PanasonicSat1a::PanasonicSat1a(
106   unsigned int index)
107   : PanasonicSat1(index)
108 {
109   setKeysetName("Satellite Keyset 1a");
110 }
111
112
113 void PanasonicSat1a::populateProtocol(
114   QObject *guiObject)
115 {
116   if (threadableProtocol)
117   {
118     // If the pointer is not null, the keyset must already be populated.
119     return;
120   }
121
122   PanasonicSat1::populateProtocol(guiObject);
123
124   addKaseikyoKey("EXIT", Exit_Key, 0x028, 0xCF);
125   addKaseikyoKey("CH+", ChannelUp_Key, 0x028, 0xB2);
126   addKaseikyoKey("CH-", ChannelDown_Key, 0x028, 0xB3);
127 }
128
129
130 PanasonicTV1::PanasonicTV1(
131   unsigned int index)
132   : PIRKeysetMetaData(
133       "TV Keyset 1",
134       Panasonic_Make,
135       index)
136 {
137 }
138
139
140 void PanasonicTV1::populateProtocol(
141   QObject *guiObject)
142 {
143   if (threadableProtocol)
144   {
145     // If the pointer is not null, the keyset must already be populated.
146     return;
147   }
148
149   threadableProtocol = new KaseikyoProtocol(guiObject, index);
150
151 //  setPreData(0x400401, 24);
152   setPreData(0x2002, 16);
153
154   addKaseikyoKey("TV/AV", Input_Key, 0x008, 0x05);
155   addKaseikyoKey("PICTURE", PictureMode_Key, 0x008, 0x06);
156   addKaseikyoKey("SOUND", SoundMode_Key, 0x008, 0x07);
157   addKaseikyoKey("N", Unmapped_Key, 0x008, 0x0C);
158   addKaseikyoKey("S", Unmapped_Key, 0x008, 0x0E);
159   addKaseikyoKey("TIMER", Sleep_Key, 0x008, 0x0F); // "Sleep"
160   addKaseikyoKey("1", One_Key, 0x008, 0x10);
161   addKaseikyoKey("2", Two_Key, 0x008, 0x11);
162   addKaseikyoKey("3", Three_Key, 0x008, 0x12);
163   addKaseikyoKey("4", Four_Key, 0x008, 0x13);
164   addKaseikyoKey("5", Five_Key, 0x008, 0x14);
165   addKaseikyoKey("6", Six_Key, 0x008, 0x15);
166   addKaseikyoKey("7", Seven_Key, 0x008, 0x16);
167   addKaseikyoKey("8", Eight_Key, 0x008, 0x17);
168   addKaseikyoKey("9", Nine_Key, 0x008, 0x18);
169   addKaseikyoKey("0", Zero_Key, 0x008, 0x19);
170   addKaseikyoKey("VOLUME_UP", VolumeUp_Key, 0x008, 0x20);
171   addKaseikyoKey("VOLUME_DOWN", VolumeDown_Key, 0x008, 0x21);
172   addKaseikyoKey("Bass Up", BassUp_Key, 0x008, 0x22);
173   addKaseikyoKey("Bass Down", BassDown_Key, 0x008, 23);
174   addKaseikyoKey("Treble Up", TrebleUp_Key, 0x008, 0x24);
175   addKaseikyoKey("Treble Down", TrebleDown_Key, 0x008, 0x25);
176   addKaseikyoKey("Balance Left", BalanceLeft_Key, 0x008, 0x26);
177   addKaseikyoKey("Balance Right", BalanceRight_Key, 0x008, 0x27);
178   addKaseikyoKey("SURROUND", Surround_Key, 0x008, 0x31);
179   addKaseikyoKey("MUTE", Mute_Key, 0x008, 0x32);
180   addKaseikyoKey("SAP", Audio_Key, 0x008, 0x33); // "Stereo/Mono/Bilingual"
181   addKaseikyoKey("PROG_UP", ChannelUp_Key, 0x008, 0x34);
182   addKaseikyoKey("PROG_DOWN", ChannelDown_Key, 0x008, 0x35);
183   addKaseikyoKey("R-TUNE", Unmapped_Key, 0x008, 0x37);
184   addKaseikyoKey("RECALL", PrevChannel_Key, 0x008, 0x39);
185   addKaseikyoKey("C", Clear_Key, 0x008, 0x3A);
186   addKaseikyoKey("-/--", DoubleDigit_Key, 0x008, 0x3B); // Also Dash_Key?
187   addKaseikyoKey("POWER", Power_Key, 0x008, 0x3D);
188   addKaseikyoKey("On", PowerOn_Key, 0x008, 0x3E);
189   addKaseikyoKey("Off", PowerOff_Key, 0x008, 0x3F);
190   addKaseikyoKey("Color Up", ColorUp_Key, 0x008, 0x40);
191   addKaseikyoKey("Color Down", ColorDown_Key, 0x008, 0x41);
192   addKaseikyoKey("Contrast Up", ContrastUp_Key, 0x008, 0x42);
193   addKaseikyoKey("Contrast Down", ContrastDown_Key, 0x008, 0x43);
194   addKaseikyoKey("Brightness Up", BrightnessUp_Key, 0x008, 0x44);
195   addKaseikyoKey("Brightness Down", BrightnessDown_Key, 0x008, 0x45);
196   addKaseikyoKey("select", Select_Key, 0x008, 0x49); // "OK"
197   addKaseikyoKey("UP", Up_Key, 0x008, 0x4A);
198   addKaseikyoKey("DOWN", Down_Key, 0x008, 0x4B);
199   addKaseikyoKey("LEFT", Left_Key, 0x008, 0x4E);
200   addKaseikyoKey("RIGHT", Right_Key, 0x008, 0x4F);
201   addKaseikyoKey("P_MENU", Unmapped_Key, 0x008, 0x50);
202   addKaseikyoKey("S_MENU", Unmapped_Key, 0x008, 0x51);
203 //  addKaseikyoKey("ACTION", Enter_Key, 0x008, 0x52); // Might be wrong
204   addKaseikyoKey("setup", Menu_Key, 0x008, 0x52); // "ACTION"
205   addKaseikyoKey("pip swap", PIPSwap_Key, 0x008, 0x5E);
206   addKaseikyoKey("pip move", PIPMove_Key, 0x008, 0x67);
207   addKaseikyoKey("RED", Red_Key, 0x008, 0x70);
208   addKaseikyoKey("GREEN", Green_Key, 0x008, 0x71);
209   addKaseikyoKey("YELLOW", Yellow_Key, 0x008, 0x72);
210   addKaseikyoKey("BLUE", Blue_Key, 0x008, 0x73);
211   addKaseikyoKey("MOOD_LIGHT", Unmapped_Key, 0x008, 0xA1);
212   addKaseikyoKey("HELP", Unmapped_Key, 0x008, 0xAC);
213   addKaseikyoKey("GAME", Unmapped_Key, 0x008, 0xBB);
214   addKaseikyoKey("Exit", Unmapped_Key, 0x008, 0xD3);
215   addKaseikyoKey("Return", Unmapped_Key, 0x008, 0xD4); // "R"
216   addKaseikyoKey("STR", Unmapped_Key, 0x008,0xD5);
217   addKaseikyoKey("MULTIWINDOW", Unmapped_Key, 0x008, 0xE6); // "multi pip"
218   addKaseikyoKey("FM/TV", Unmapped_Key, 0x008, 0xEE);
219   addKaseikyoKey("System reset", Unmapped_Key, 0x008, 0xFF);
220
221   addKaseikyoKey("Mix", TeletextAndTV_Key, 0x018, 0x01);
222   addKaseikyoKey("TV/TEXT", Teletext_Key, 0x018, 0x03);
223   addKaseikyoKey("Display_Cancel", Unmapped_Key, 0x018, 0x04);
224   addKaseikyoKey("FP (Favorite Page)", Unmapped_Key, 0x018, 0x05);
225   addKaseikyoKey("INDEX", TeletextIndex_Key, 0x018, 0x08);
226   addKaseikyoKey("HOLD", TeletextHold_Key, 0x018, 0x09);
227   addKaseikyoKey("List Store", TeletextStore_Key, 0x018, 0x0A);
228   addKaseikyoKey("TIMETEXT", TeletextTime_Key, 0x018, 0x0B);
229   addKaseikyoKey("FTB (Full/Top/Bottom)", TeletextSize_Key, 0x018, 0x0C);
230   addKaseikyoKey("REVEAL", TeletextReveal_Key, 0x018, 0x1C);
231   addKaseikyoKey("List/F.Text", Unmapped_Key, 0x018, 0x1D);
232   addKaseikyoKey("Text Reset", Unmapped_Key, 0x018, 0x1E);
233
234   addKaseikyoKey("TV", Unmapped_Key, 0x028, 0x30);
235   addKaseikyoKey("PROG", Program_Key, 0x028, 0x8A);
236   addKaseikyoKey("MENU", Menu_Key, 0x028, 0xC4);
237   addKaseikyoKey("GUIDE", Guide_Key, 0x028, 0xC5);
238   addKaseikyoKey("EXIT", Exit_Key, 0x028, 0xC6);
239
240   addKaseikyoKey("ASPECT", AspectRatio_Key, 0x048, 0xDE);
241   addKaseikyoKey("picture position/size", PIPSize_Key, 0x048, 0xE5);
242
243   addKaseikyoKey("Guide", Unmapped_Key, 0x098, 0x87);
244   addKaseikyoKey("DIRECTREC", Record_Key, 0x098, 0x89);
245   addKaseikyoKey("Exit", Unmapped_Key, 0x098, 0x9A);
246   addKaseikyoKey("Option", Unmapped_Key, 0x098, 0xA7);
247   addKaseikyoKey("SDCard", Unmapped_Key, 0x098, 0xAB);
248   addKaseikyoKey("Favorite", Unmapped_Key, 0x098, 0xAE);
249   addKaseikyoKey("Link", Unmapped_Key, 0x098, 0xB1);
250   addKaseikyoKey("prog-", Unmapped_Key, 0x098, 0xD0);
251
252   // Some media keys, possibly a combo DVD-TV?
253 //  addKaseikyoKey("STOP", Stop_Key, 0x00B, 0x00);
254 //  addKaseikyoKey("PLAY", Play_Key, 0x00B, 0x0A);
255 //  addKaseikyoKey("FORWARD", FastForward_Key, 0x00B, 0x4A);
256 //  addKaseikyoKey("REWIND", Rewind_Key, 0x00B, 0x49);
257 }
258
259
260 PanasonicTV1a::PanasonicTV1a(
261   unsigned int index)
262   : PanasonicTV1(index)
263 {
264   setKeysetName("TV Keyset 1a");
265 }
266
267
268 void PanasonicTV1a::populateProtocol(
269   QObject *guiObject)
270 {
271   if (threadableProtocol)
272   {
273     // If the pointer is not null, the keyset must already be populated.
274     return;
275   }
276
277   PanasonicTV1::populateProtocol(guiObject);
278
279   // Overwrite some of the keys:
280   addKaseikyoKey("OK", Select_Key, 0x008, 0x49);
281   addKaseikyoKey("MENU", Menu_Key, 0x008, 0x06);
282 }
283
284
285 PanasonicTV1b::PanasonicTV1b(
286   unsigned int index)
287   : PanasonicTV1(index)
288 {
289   setKeysetName("TV Keyset 1b");
290
291   addControlledDevice(Panasonic_Make, "Viera TX-32LZD80", TV_Device);
292   addControlledDevice(Panasonic_Make, "Viera 42PZ700U", TV_Device);
293   addControlledDevice(Panasonic_Make, "Viera 42PZ8ES", TV_Device);
294   addControlledDevice(Panasonic_Make, "Quintrix TX-25MK1C", TV_Device);
295 }
296
297
298 void PanasonicTV1b::populateProtocol(
299   QObject *guiObject)
300 {
301   if (threadableProtocol)
302   {
303     // If the pointer is not null, the keyset must already be populated.
304     return;
305   }
306
307   PanasonicTV1::populateProtocol(guiObject);
308
309   addKaseikyoKey("Info", Info_Key, 0x008, 0x39); // "OSD"
310   addKaseikyoKey("OK", Select_Key, 0x008, 0x49);
311   addKaseikyoKey("Menu", Menu_Key, 0x008, 0x52);
312 //  addKaseikyoKey("Exit", Exit_Key, 0x008, 0xD3);
313
314   addKaseikyoKey("Guide", Guide_Key, 0x098, 0x87);
315   addKaseikyoKey("Exit", Exit_Key, 0x098, 0x9A);
316 }
317
318
319 PanasonicVCR1::PanasonicVCR1(
320   unsigned int index)
321   : PIRKeysetMetaData(
322       "VCR Keyset 1",
323       Panasonic_Make,
324       index)
325 {
326 }
327
328
329 void PanasonicVCR1::populateProtocol(
330   QObject *guiObject)
331 {
332   if (threadableProtocol)
333   {
334     // If the pointer is not null, the keyset must already be populated.
335     return;
336   }
337
338   threadableProtocol = new KaseikyoProtocol(guiObject, index);
339
340 //  setPreData(0x400409, 24);
341   setPreData(0x2002, 16);
342
343   addKaseikyoKey("STOP", Stop_Key, 0x009, 0x00);
344   addKaseikyoKey("REWIND", Rewind_Key, 0x009, 0x02);
345   addKaseikyoKey("FORWARD", FastForward_Key, 0x009, 0x03);
346   addKaseikyoKey("PAUSE", Pause_Key, 0x009, 0x06);
347   addKaseikyoKey("REC", Record_Key, 0x009, 0x08);
348   addKaseikyoKey("PLAY", Play_Key, 0x009, 0x0A);
349   addKaseikyoKey("STILL", StepForward_Key, 0x009, 0x0C);  // also "ADV"
350   addKaseikyoKey("SLOW", Slow_Key, 0x009, 0x0F);
351   addKaseikyoKey("1", One_Key, 0x009, 0x10);
352   addKaseikyoKey("2", Two_Key, 0x009, 0x11);
353   addKaseikyoKey("3", Three_Key, 0x009, 0x12);
354   addKaseikyoKey("4", Four_Key, 0x009, 0x13);
355   addKaseikyoKey("5", Five_Key, 0x009, 0x14);
356   addKaseikyoKey("6", Six_Key, 0x009, 0x15);
357   addKaseikyoKey("7", Seven_Key, 0x009, 0x16);
358   addKaseikyoKey("8", Eight_Key, 0x009, 0x17);
359   addKaseikyoKey("9", Nine_Key, 0x009, 0x18);
360   addKaseikyoKey("0", Zero_Key, 0x009, 0x19);
361   addKaseikyoKey("AUDIO", Audio_Key, 0x009, 0x33);
362   addKaseikyoKey("PROGRAMME^", ChannelUp_Key, 0x009, 0x34);
363   addKaseikyoKey("PROGRAMMEv", ChannelDown_Key, 0x009, 0x35);
364   addKaseikyoKey("TV-SAT", Input_Key, 0x009, 0x36);
365   addKaseikyoKey("INFO", Info_Key, 0x009, 0x39);
366   addKaseikyoKey("-/--", DoubleDigit_Key, 0x009, 0x3B);
367   addKaseikyoKey("POWER", Power_Key, 0x009, 0x3D);
368   addKaseikyoKey("INDEX", Unmapped_Key, 0x009, 0x40);
369   addKaseikyoKey("time_search", Unmapped_Key, 0x009, 0x44);
370   addKaseikyoKey("INDEXL", Unmapped_Key, 0x009, 0x49);
371   addKaseikyoKey("INDEXR", Unmapped_Key, 0x009, 0x4A);
372   addKaseikyoKey("mem_rep", Unmapped_Key, 0x009, 0x53);
373   addKaseikyoKey("COUNTER_RESET", Unmapped_Key, 0x009, 0x54);
374   addKaseikyoKey("TAPE_REMAIN", Unmapped_Key, 0x009, 0x55);
375   addKaseikyoKey("CLOCK/COUNTER", Clock_Key, 0x009, 0x56);
376   addKaseikyoKey("+", Unmapped_Key, 0x009, 0x8E);
377   addKaseikyoKey("-", Unmapped_Key, 0x009, 0x8F);
378   addKaseikyoKey("monitor", Unmapped_Key, 0x009, 0x91);
379   addKaseikyoKey("TRACKING_AUTO", AutoTracking_Key, 0x009, 0xB0);
380   addKaseikyoKey("TRACKING_PLUS", TrackingPlus_Key, 0x009, 0xB1);
381   addKaseikyoKey("TRACKING_MINUS", TrackingMinus_Key, 0x009, 0xB2);
382   addKaseikyoKey("TIMERREC", Timer_Key, 0x009, 0xB4);
383   addKaseikyoKey("AV", Unmapped_Key, 0x009, 0xC0);
384   addKaseikyoKey("DIRECT_TV_REC", Unmapped_Key, 0x009, 0xC2);
385   addKaseikyoKey("mesecam", Unmapped_Key, 0x009, 0xC9);
386   addKaseikyoKey("100", PlusOneHundred_Key, 0x009, 0xE5);
387   addKaseikyoKey("sap/hi-fi", Unmapped_Key, 0x009, 0xE6);
388   addKaseikyoKey("repeat", Repeat_Key, 0x009, 0xF0);
389   addKaseikyoKey("memory", Program_Key, 0x009, 0xF1);
390   addKaseikyoKey("sleep", Sleep_Key, 0x009, 0xF2);
391   addKaseikyoKey("rew2", Unmapped_Key, 0x009, 0xF3);
392   addKaseikyoKey("zerostop", Unmapped_Key, 0x009, 0xF5);
393   addKaseikyoKey("REPLAY", Replay_Key, 0x009, 0xF7);
394   addKaseikyoKey("cm-zero", Unmapped_Key, 0x009, 0xF8);
395
396   addKaseikyoKey("PROG/CHECK", Program_Key, 0x019, 0x01);
397   addKaseikyoKey("rotate", Unmapped_Key, 0x019, 0x02);
398   addKaseikyoKey("rotatedown", Unmapped_Key, 0x019, 0x03);
399   addKaseikyoKey("set", Unmapped_Key, 0x019, 0x04);
400   addKaseikyoKey("clear", Unmapped_Key, 0x019, 0x05);
401   addKaseikyoKey("VPS/PDC", Unmapped_Key, 0x019, 0x06);
402   addKaseikyoKey("OffTimer", Sleep_Key, 0x019, 0x08);
403   addKaseikyoKey("CANCEL", Clear_Key, 0x019, 0x09);
404   addKaseikyoKey("SPEED", VHSSpeed_Key, 0x019, 0x0A);
405   addKaseikyoKey("ADD/DELETE", Unmapped_Key, 0x019, 0x31);
406   addKaseikyoKey("RADIO_TUNE", Unmapped_Key, 0x019, 0x38);
407   addKaseikyoKey("MENU", Menu_Key, 0x019, 0x56);
408   addKaseikyoKey("OK", Select_Key, 0x019, 0x58);
409   addKaseikyoKey("SHOWVIEW", Unmapped_Key, 0x019, 0x5D);
410   addKaseikyoKey("DISPLAY", Unmapped_Key, 0x019, 0x5F);
411   addKaseikyoKey("EXIT", Exit_Key, 0x019, 0x66);
412   addKaseikyoKey("CHECK+", Unmapped_Key, 0x019, 0x90);
413   addKaseikyoKey("CHECK-", Unmapped_Key, 0x019, 0x91);
414   addKaseikyoKey("DATE+", Unmapped_Key, 0x019, 0x92);
415   addKaseikyoKey("DATE-", Unmapped_Key, 0x019, 0x93);
416   addKaseikyoKey("ON+", Unmapped_Key, 0x019, 0x94);
417   addKaseikyoKey("ON-", Unmapped_Key, 0x019, 0x95);
418   addKaseikyoKey("OFF+", Unmapped_Key, 0x019, 0x96);
419   addKaseikyoKey("OFF-", Unmapped_Key, 0x019, 0x97);
420   addKaseikyoKey("SEARCH", Unmapped_Key, 0x019, 0x9D);
421   addKaseikyoKey("TAPE", Unmapped_Key, 0x019, 0xE0);
422
423   addKaseikyoKey("STILL_ALBUM", Unmapped_Key, 0x059, 0x23);
424   addKaseikyoKey("PROG_PLAY", Unmapped_Key, 0x059, 0x3A);
425   addKaseikyoKey("I-Timer", Unmapped_Key, 0x059, 0x3F);
426   addKaseikyoKey("TV/TEXT", Unmapped_Key, 0x059, 0x57);
427   addKaseikyoKey("ExtLink", Unmapped_Key, 0x059, 0x5B);
428
429 // These are fishy:
430 //  addKaseikyoKey("RESET_STORE", Unmapped_Key, 0x019, 0x58);
431 }
432
433
434 PanasonicVCR1a::PanasonicVCR1a(
435   unsigned int index)
436   : PanasonicVCR1(index)
437 {
438   setKeysetName("VCR Keyset 1a");
439 }
440
441
442 void PanasonicVCR1a::populateProtocol(
443   QObject *guiObject)
444 {
445   if (threadableProtocol)
446   {
447     // If the pointer is not null, the keyset must already be populated.
448     return;
449   }
450
451   PanasonicVCR1::populateProtocol(guiObject);
452
453   addKaseikyoKey("OSD", Info_Key, 0x009, 0x57);
454   addKaseikyoKey("AV", Input_Key, 0x009, 0xC0);
455   addKaseikyoKey("DISPLAY", Info_Key, 0x019, 0x5F);
456 }
457
458
459 PanasonicVCR1b::PanasonicVCR1b(
460   unsigned int index)
461   : PanasonicVCR1(index)
462 {
463   setKeysetName("VCR Keyset 1b");
464 }
465
466
467 void PanasonicVCR1b::populateProtocol(
468   QObject *guiObject)
469 {
470   if (threadableProtocol)
471   {
472     // If the pointer is not null, the keyset must already be populated.
473     return;
474   }
475
476   PanasonicVCR1::populateProtocol(guiObject);
477
478   addKaseikyoKey("repeat", Repeat_Key, 0x009, 0xF9);
479   addKaseikyoKey("prog", Program_Key, 0x009, 0xFF);
480   addKaseikyoKey("clear", Clear_Key, 0x019, 0x0A);
481 }
482
483
484 PanasonicVCR1c::PanasonicVCR1c(
485   unsigned int index)
486   : PanasonicVCR1(index)
487 {
488   setKeysetName("VCR Keyset 1c");
489 }
490
491
492 void PanasonicVCR1c::populateProtocol(
493   QObject *guiObject)
494 {
495   if (threadableProtocol)
496   {
497     // If the pointer is not null, the keyset must already be populated.
498     return;
499   }
500
501   PanasonicVCR1::populateProtocol(guiObject);
502
503   addKaseikyoKey("rotate", Up_Key, 0x019, 0x02);
504   addKaseikyoKey("rotatedown", Down_Key, 0x019, 0x03);
505   addKaseikyoKey("set", Select_Key, 0x019, 0x04);
506   addKaseikyoKey("clear", Exit_Key, 0x019, 0x05);
507 }
508
509
510 PanasonicDVD1::PanasonicDVD1(
511   unsigned int index)
512   : PIRKeysetMetaData(
513       "DVD Keyset 1",
514       Panasonic_Make,
515       index)
516 {
517 }
518
519
520 void PanasonicDVD1::populateProtocol(
521   QObject *guiObject)
522 {
523   if (threadableProtocol)
524   {
525     // If the pointer is not null, the keyset must already be populated.
526     return;
527   }
528
529   threadableProtocol = new KaseikyoProtocol(guiObject, index);
530
531 //  setPreData(0x40040D00, 32);
532   setPreData(0x2002, 16);
533
534   addKaseikyoKey("STOP", Stop_Key, 0x00B, 0x00);
535   addKaseikyoKey("OPEN/CLOSE", Eject_Key, 0x00B, 0x01);
536 //  addKaseikyoKey("TV-SAT", Input_Key, 0x00B, 0x01);
537   addKaseikyoKey("REW", Rewind_Key, 0x00B, 0x04);
538   addKaseikyoKey("FF", FastForward_Key, 0x00B, 0x05);
539   addKaseikyoKey("PAUSE", Pause_Key, 0x00B, 0x06);
540   addKaseikyoKey("CH_DOWN", ChannelDown_Key, 0x00B, 0x07);
541   addKaseikyoKey("rec", Record_Key, 0x00B, 0x08);
542   addKaseikyoKey("PLAY", Play_Key, 0x00B, 0x0A);
543   addKaseikyoKey("CH_UP", ChannelUp_Key, 0x00B, 0x0F);
544   addKaseikyoKey("1", One_Key, 0x00B, 0x10);
545   addKaseikyoKey("2", Two_Key, 0x00B, 0x11);
546   addKaseikyoKey("3", Three_Key, 0x00B, 0x12);
547   addKaseikyoKey("4", Four_Key, 0x00B, 0x13);
548   addKaseikyoKey("5", Five_Key, 0x00B, 0x14);
549   addKaseikyoKey("6", Six_Key, 0x00B, 0x15);
550   addKaseikyoKey("7", Seven_Key, 0x00B, 0x16);
551   addKaseikyoKey("8", Eight_Key, 0x00B, 0x17);
552   addKaseikyoKey("9", Nine_Key, 0x00B, 0x18);
553   addKaseikyoKey("0", Zero_Key, 0x00B, 0x19);
554   addKaseikyoKey("extlink", Unmapped_Key, 0x00B, 0x23);
555   addKaseikyoKey("AUDIO", Audio_Key, 0x00B, 0x33);
556   addKaseikyoKey("POWER", Power_Key, 0x00B, 0x3D);
557   addKaseikyoKey("erase", Unmapped_Key, 0x00B, 0x44); // "DELETE"
558   addKaseikyoKey("POSITION_MEMORY", Unmapped_Key, 0x00B, 0x46);
559   addKaseikyoKey("A-B_REPEAT", RepeatAB_Key, 0x00B, 0x48);
560   addKaseikyoKey("PREV", Previous_Key, 0x00B, 0x49);
561   addKaseikyoKey("NEXT", Next_Key, 0x00B, 0x04A);
562   addKaseikyoKey("timeslip", Unmapped_Key, 0x00B, 0x4B);
563   addKaseikyoKey("manualskip", Unmapped_Key, 0x00B, 0x4C);
564   addKaseikyoKey("RANDOM", Random_Key, 0x00B, 0x4D);
565   addKaseikyoKey("recmode", Unmapped_Key, 0x00B, 0x51);
566   addKaseikyoKey("functions", Unmapped_Key, 0x00B, 0x57);
567   addKaseikyoKey("createchapter", Unmapped_Key, 0x00B, 0x58);
568   addKaseikyoKey("status", Unmapped_Key, 0x00B, 0x5F);
569   addKaseikyoKey("VOLUMEDOWN", VolumeDown_Key, 0x00B, 0x62);
570   addKaseikyoKey("VOLUMEUP", VolumeUp_Key, 0x00B, 0x63);
571   addKaseikyoKey("i", Unmapped_Key, 0x00B, 0x66);
572   addKaseikyoKey("timer", Timer_Key, 0x00B, 0x78);
573   addKaseikyoKey("progcheck", Unmapped_Key, 0x00B, 0x7C);
574   addKaseikyoKey("showview", Unmapped_Key, 0x00B, 0x7F);
575   addKaseikyoKey("MENU", Menu_Key, 0x00B, 0x80);
576   addKaseikyoKey("RETURN", Exit_Key, 0x00B, 0x81);
577   addKaseikyoKey("ACTION", Select_Key, 0x00B, 0x82);
578   addKaseikyoKey("CANCEL", Clear_Key, 0x00B, 0x83);
579   addKaseikyoKey("UP", Up_Key, 0x00B, 0x85);
580   addKaseikyoKey("DOWN", Down_Key, 0x00B, 0x86);
581   addKaseikyoKey("LEFT", Left_Key, 0x00B, 0x87);
582   addKaseikyoKey("RIGHT", Right_Key, 0x00B, 0x88);
583   addKaseikyoKey("+10", DoubleDigit_Key, 0x00B, 0x89);
584 //  addKaseikyoKey("inputselect", Input_Key, 0x00B, 0x89); // odd!
585   addKaseikyoKey("PROGRAM", Program_Key, 0x00B, 0x8A);
586   addKaseikyoKey("QUICK_REPLAY", Replay_Key, 0x00B, 0x8B);
587   addKaseikyoKey("REPEAT", Repeat_Key, 0x00B, 0x8C);
588   addKaseikyoKey("PLAY_MODE", Unmapped_Key, 0x00B, 0x8D);
589   addKaseikyoKey("ANGLE", Angle_Key, 0x00B, 0x90);
590   addKaseikyoKey("SUBTITLE", Captions_Key, 0x00B, 0x91);
591   addKaseikyoKey("INFO", Info_Key, 0x00B, 0x92);
592   addKaseikyoKey("SETUP", Unmapped_Key, 0x00B, 0x94);
593 //  addKaseikyoKey("R-TUNE", PrevChannel_Key, 0x00B, 0x9B);
594   addKaseikyoKey("TOP_MENU", DiscTitle_Key, 0x00B, 0x9B);
595   addKaseikyoKey("A.SRD", Unmapped_Key, 0x00B, 0x9E);
596   addKaseikyoKey("FL_SELECT", Unmapped_Key, 0x00B, 0xB6);
597   addKaseikyoKey("DISC", Unmapped_Key, 0x00B, 0xB7);
598   addKaseikyoKey("SEQUENTIAL", Unmapped_Key, 0x00B, 0xBF);
599   addKaseikyoKey("CINEMA", Unmapped_Key, 0x00B, 0xC0);
600   addKaseikyoKey("ZOOM", Zoom_Key, 0x00B, 0xC1);
601   addKaseikyoKey("frec", Unmapped_Key, 0x00B, 0xC7);
602   addKaseikyoKey("BASS", EnhancedBass_Key, 0x00B, 0xD4);
603   addKaseikyoKey("D.ENH", Unmapped_Key, 0x00B, 0xD5);
604   addKaseikyoKey("ONETOUCH_MEMORY", Unmapped_Key, 0x00B, 0xD6);
605   addKaseikyoKey("GROUP", Unmapped_Key, 0x00B, 0xE0);
606   addKaseikyoKey("SLEEP", Sleep_Key, 0x00B, 0xEB);
607 }
608
609
610 PanasonicDVD1a::PanasonicDVD1a(
611   unsigned int index)
612   : PanasonicDVD1(index)
613 {
614   setKeysetName("DVD Keyset 1a");
615 }
616
617
618 void PanasonicDVD1a::populateProtocol(
619   QObject *guiObject)
620 {
621   if (threadableProtocol)
622   {
623     // If the pointer is not null, the keyset must already be populated.
624     return;
625   }
626
627   PanasonicDVD1::populateProtocol(guiObject);
628
629   addKaseikyoKey("channel2up", ChannelUp_Key, 0x00B, 0x34);
630   addKaseikyoKey("channel2down", ChannelDown_Key, 0x00B, 0x35);
631   addKaseikyoKey("INPUT_SELECT", Input_Key, 0x00B, 0x50);
632 }
633
634
635 PanasonicAudio1::PanasonicAudio1(
636   unsigned int index)
637   : PIRKeysetMetaData(
638       "Audio Keyset 1",
639       Panasonic_Make,
640       index)
641 {
642   addControlledDevice(Panasonic_Make, "RX-DS25", Audio_Device);
643   addControlledDevice(Panasonic_Make, "RX-e300", Audio_Device);
644 }
645
646
647 void PanasonicAudio1::populateProtocol(
648   QObject *guiObject)
649 {
650   if (threadableProtocol)
651   {
652     // If the pointer is not null, the keyset must already be populated.
653     return;
654   }
655
656   threadableProtocol = new KaseikyoProtocol(guiObject, index);
657
658 //  setPreData(0x40040543, 32);
659   setPreData(0x2002, 16);
660
661   addKaseikyoKey("INTRO", Unmapped_Key, 0xC2A, 0x46); // odd
662
663   addKaseikyoKey("stop-clear", Stop_Key, 0xC2A, 0x80);
664   addKaseikyoKey("repeat", Repeat_Key, 0xC2A, 0x81);
665   addKaseikyoKey("random", Random_Key, 0xC2A, 0x82);
666   addKaseikyoKey("eject", Eject_Key, 0xC2A, 0x8E);
667   addKaseikyoKey("prev", Rewind_Key, 0xC2A, 0x84); // "CD_<<"
668   addKaseikyoKey("next", FastForward_Key, 0xC2A, 0x85); // "CD_>>"
669   addKaseikyoKey("CD_PAUSE", Pause_Key, 0xC2A, 0x86);
670   addKaseikyoKey("play-pause", Play_Key, 0xC2A, 0x87);
671   addKaseikyoKey("program", Program_Key, 0xC2A, 0x8B); // "MEMORY"
672   addKaseikyoKey("cancel", Clear_Key, 0xC2A, 0x8D);
673   addKaseikyoKey("display", Info_Key, 0xC2A, 0x8F);
674
675   addKaseikyoKey("1", One_Key, 0xC2A, 0x90);
676   addKaseikyoKey("2", Two_Key, 0xC2A, 0x91);
677   addKaseikyoKey("3", Three_Key, 0xC2A, 0x92);
678   addKaseikyoKey("4", Four_Key, 0xC2A, 0x93);
679   addKaseikyoKey("5", Five_Key, 0xC2A, 0x94);
680   addKaseikyoKey("6", Six_Key, 0xC2A, 0x95);
681   addKaseikyoKey("7", Seven_Key, 0xC2A, 0x96);
682   addKaseikyoKey("8", Eight_Key, 0xC2A, 0x97);
683   addKaseikyoKey("9", Nine_Key, 0xC2A, 0x98);
684   addKaseikyoKey("10/0", Zero_Key, 0xC2A, 0x99);
685   addKaseikyoKey("+10", DoubleDigit_Key, 0xC2A, 0x9F);
686
687   addKaseikyoKey("tape_stop", Unmapped_Key, 0xC2A, 0xA0);
688   addKaseikyoKey("rew", Unmapped_Key, 0xC2A, 0xA2); // "TAPE_<<"
689   addKaseikyoKey("ff", Unmapped_Key, 0xC2A, 0xA3); // "TAPE_>>"
690   addKaseikyoKey("tape_record", Record_Key, 0xC2A, 0xA4);
691   addKaseikyoKey("TAPE_PLAY_REWIND", Unmapped_Key, 0xC2A, 0xA5);
692   addKaseikyoKey("tape_play", Unmapped_Key, 0xC2A, 0xA6); // "TAPE_PLAY_FORWARD"
693   addKaseikyoKey("tape", TapeInput_Key, 0xC2A, 0xAC);
694   addKaseikyoKey("TAPE_DECK", Unmapped_Key, 0xC2A, 0xAD);
695   addKaseikyoKey("rev_mode", Unmapped_Key, 0xC2A, 0xAE); // "TAPE_REV_MODE"
696   addKaseikyoKey("counter_reset", Reset_Key, 0xC2A, 0xAF);
697
698   addKaseikyoKey("vol+", VolumeUp_Key, 0xC2A, 0xB0);
699   addKaseikyoKey("vol-", VolumeDown_Key, 0xC2A, 0xB1);
700   addKaseikyoKey("cd", CDInput_Key, 0xC2A, 0xB6);
701   addKaseikyoKey("tuner-band", TunerBand_Key, 0xC2A, 0xB8);
702   addKaseikyoKey("sleep", Sleep_Key, 0xC2A, 0xBC);
703   addKaseikyoKey("power", Power_Key, 0xC2A, 0xBF);
704
705   addKaseikyoKey("TRACK>>", Unmapped_Key, 0xC2A, 0xD0);
706   addKaseikyoKey("TRACK<<", Unmapped_Key, 0xC2A, 0xD1);
707   addKaseikyoKey("xbs", Unmapped_Key, 0xC2A, 0xD6);
708   addKaseikyoKey("preset_eq", Unmapped_Key, 0xC2A, 0xD9);
709   addKaseikyoKey("virtualizer", Unmapped_Key, 0xC2A, 0xDA); // "S.VIRT"
710
711   addKaseikyoKey("fm-mode", FMMode_Key, 0xC2A, 0xE4); // "st-mono"
712   addKaseikyoKey("TUNER_PRESET_TUNE_UP", NextPreset_Key, 0xC2A, 0xE7);
713   addKaseikyoKey("TUNER_PRESET_TUNE_UP", Next_Key, 0xC2A, 0xE7);
714   addKaseikyoKey("TUNER_PRESET_TUNE_DOWN", PrevPreset_Key, 0xC2A, 0xE8);
715   addKaseikyoKey("TUNER_PRESET_TUNE_DOWN", Previous_Key, 0xC2A, 0xE8);
716   addKaseikyoKey("tuning+", ChannelUp_Key, 0xC2A, 0xE9);
717   addKaseikyoKey("tuning-", ChannelDown_Key, 0xC2A, 0xEA);
718   addKaseikyoKey("AUTOSCAN", Scan_Key, 0xC2A, 0xEC);
719   addKaseikyoKey("bp", Unmapped_Key, 0xC2A, 0xEF); // "TUNER_BP", beat-proof?
720
721   addKaseikyoKey("panelopen", Unmapped_Key, 0xC2A, 0xF4);  // "TOP_PANEL_OPEN"
722   addKaseikyoKey("panelclose", Unmapped_Key, 0xC2A, 0xF5); // "TOP_PANEL_CLOSE"
723 }
724
725
726 PanasonicAC1::PanasonicAC1(
727   unsigned int index)
728   : PIRKeysetMetaData(
729       "Air Conditioner 1",
730       Panasonic_Make,
731       index)
732 {
733 }
734
735
736 void PanasonicAC1::populateProtocol(
737   QObject *guiObject)
738 {
739   if (threadableProtocol)
740   {
741     // If the pointer is not null, the keyset must already be populated.
742     return;
743   }
744
745   threadableProtocol = new NECProtocol(guiObject, index, true, true);
746
747   setPreData(0x6681, 16);
748
749   addKey("Operation", Power_Key, 0x81, 8);
750   addKey("Air Swing", Yellow_Key, 0x83, 8);
751   addKey("Temp Up", Red_Key, 0x85, 8);
752   addKey("Temp Down", Blue_Key, 0x8A, 8);
753   addKey("Economy", Green_Key, 0x8D, 8);
754   addKey("Timer", Sleep_Key, 0x90, 8);
755   addKey("Fan Speed", SoundMode_Key, 0x99, 8);
756   addKey("Mode", PictureMode_Key, 0x9B, 8);
757 }